/*
 * $Id: geometrynode.h 4270 2016-11-06 11:02:47Z antonin.misek-skoda-auto.cz $
 *
 * Description  : One line description of file.
 * Author       : Vaclav Kyba <mail/Jabber: vaseo1@gmail.com>  <ICQ: 98576293>
 *
 * Purpose      :
 *     Long description of what the file is for.
 */


#ifndef __GEOMETRYNODE__H__
#define __GEOMETRYNODE__H__

#include <wx/wx.h>

#include "smartptr.h"
#include "scenenode.h"
#include "material.h"
#include "geometry.h"
//#include "moddefs.h"

namespace VRUT
{
	///\c SceneNode with geometry
	class GeometryNode : public SceneNode
	{
	protected:
		///Geometry ID (\c Scene ownership)
		GEOMETRY_ID geometryID;
		///Material ID (\c Scene ownership)
		MATERIAL_ID materialID;

	public:
		static const SCENENODE_TYPE ClassType = GEOMETRY;

		///Class constructor, \c GEOMETRY type by default
		GeometryNode(const wxString & _name) : SceneNode(_name, ClassType),
			geometryID(GEOMETRY_ID_NONE), materialID(MATERIAL_ID_NONE)
		{
		}

		///Copy constructor
		GeometryNode(const GeometryNode & g) : SceneNode(g),
			geometryID(g.geometryID), materialID(g.materialID)
		{
		}

		///Class destructor
		virtual ~GeometryNode()
		{
		}

		///Get node's geometry ID
		GEOMETRY_ID GetGeometryID() const
		{
			return geometryID;
		}

		///Get node's material ID
		MATERIAL_ID GetMaterialID() const
		{
			return materialID;
		}

		///Get string with node's properties - \c SceneNode overload
		virtual wxString ToString() const
		{
			return SceneNode::ToString()+wxString::Format(wxT("\nGeometry ID: %lu\nMaterial ID: %lu\n"), (unsigned long)geometryID, (unsigned long)materialID);
		}

		///Get copy of instance - \c SceneNode overload
		virtual SceneNode * Clone() const
		{
			return new GeometryNode(*this);
		}

		friend class Scene;
	};
}

#endif
