#include "EPSG/Entity.h"

/* EPSG Includes */
#include "EPSG/Shape.h"
#include "EPSG/Material.h"
#include "EPSG/Appearance.h"

EPSG::Entity::Entity()
{
	_appearance = NULL;
	_shape = NULL;
}

void EPSG::Entity::render()
{
	if( _shape == NULL )
		return;

	if( _appearance == NULL )
		_appearance = new EPSG::Material();

	_appearance->load();
	_shape->draw();
	_appearance->unload();
}

void EPSG::Entity::setAppearance( EPSG::Appearance* a )
{
	_appearance = a;
}

void EPSG::Entity::setShape( EPSG::Shape* s )
{
	_shape = s;
}

EPSG::Appearance* EPSG::Entity::getAppearance()
{
	return _appearance;
}

EPSG::Shape* EPSG::Entity::getShape()
{
	return _shape;
}