/*
 *	osgART/Tracker/ARToolKit/SimpleMarker
 *	osgART: AR ToolKit for OpenSceneGraph
 *
 *	Copyright (c) 2005-2007 ARToolworks, Inc. All rights reserved.
 *	
 *	Rev		Date		Who		Changes
 *  1.0   	2006-12-08  ---     Version 1.0 release.
 *
 */
/*
 * This file is part of osgART - AR Toolkit for OpenSceneGraph
 *
 * Copyright (c) 2005-2007 ARToolworks, Inc. All rights reserved.
 *
 * (See the AUTHORS file in the root of this distribution.)
 *
 *
 * OSGART is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * OSGART is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with OSGART; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 *
 */


#ifndef OSGART_SIMPLEMARKER
#define OSGART_SIMPLEMARKER 1

// STL include
#include <string>
#include <vector>

// local include
#include "osgART/Export"
#include "osgART/Marker"

// AR ToolKit include
//#include <AR/ar.h>
#include <ARToolKitPlus/Tracker.h>

namespace osgART {

	/**
	* \class SimpleMarker.
	* \brief A marker consisting of a single pattern.
	*/
	class SimpleMarker : public Marker
	{
	public:	
		
        virtual bool isSameKindAs(const osg::Object* obj) const {
            return dynamic_cast<const SimpleMarker*>(obj) != 0L;
        }
        virtual const char* className() const { return "SimpleMarker"; }
        
    
		/** 
		 * \brief default constructor.
		 *
		 */
		SimpleMarker(ARToolKitPlus::Tracker *tracker);
		
	    
		bool initialise(int id, double width, double center[2]);

		virtual void setActive(bool a);

		void update(ARToolKitPlus::ARMarkerInfo* markerInfo);
		
		int getPatternID();
		double getPatternWidth();
		ARFloat* getPatternCenter();

		
		MarkerType getType() const;
	
	    
	protected:
	
		/**
		 * \brief destructor.
		 */
		virtual ~SimpleMarker();	    

                ARToolKitPlus::Tracker *m_tracker;
	 
	    int             patt_id;
		ARFloat          patt_width;
		ARFloat          patt_center[2];
		ARFloat          patt_trans[3][4];
		
		double			m_confidence;
		
		friend class ARToolKitPlusTracker;
		
	};
};

#endif
