/*
 *	osgART/ShadowRenderer
 *	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_SHADOWRENDERER
#define OSGART_SHADOWRENDERER

// graphics include
#include <osg/Node>
#include <osg/Group>
#include <osg/MatrixTransform>
#include <osg/Geometry>
#include <osg/Projection>


// local include
#include "osgART/Export"
#include "osgART/GenericVideoObject"
#include "osgART/GenericVideo"

namespace osgART {

	/**
	* \class ShadowRenderer.
	* Implement the depth shadow rendering based on depth shadow with GLSL shaders support.
	* This class just defined Virtual to Virtual shadow
	*/
	class OSGART_EXPORT ShadowRenderer : public osg::Group
	{
	public:        
		/** 
		 * \brief default constructor.
		 * \param model defined the model
		 * \param lightTransform defined the light position 
		 * \param markerId is the marker id 	
		 */
		ShadowRenderer(osg::Node*,osg::MatrixTransform*,int markerId = 0);
		
		ShadowRenderer(const ShadowRenderer& video);
	    
		/**
		 * \brief destructor.
		 */
		virtual ~ShadowRenderer();

		/**
		 * Initialize
		 */    
		virtual void init();
		
		virtual void setShadowResolution(int width, int height) {m_shadowWidth=width;m_shadowHeight=height;};

	protected:
		osg::Node* m_shadowedScene;

	private:

		osg::MatrixTransform* m_lightTransform;
		int m_markerId;

		int m_shadowWidth;
		int m_shadowHeight;
	
	};
};
#endif
