Entity Class Reference

Wrapper around TriangleSet performing its (de)serialization. More...

#include <Entity.h>

Inheritance diagram for Entity:

Inheritance graph
[legend]
Collaboration diagram for Entity:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Entity ()
virtual ~Entity ()
 Entity (const Entity &)
 Deep copy.
Entityoperator= (const Entity &)
 Deep copy.
void setTransformMatrix (TransformMatrix *matrix)
 Set transofrmation matrix.
virtual void deserialize (XMLNode *from)
 Entity deserialization from XMLNode.
void divide (float size)
 Perform patch division.
PatchSequenceEnumeratorcreatePatchSequenceEnumerator ()
 Create enumerator for entity's patches.
TriangleSetExtcomputeVertexColors ()
 Compute per-vertex colors using simple interpolation.
XMLNode serialize ()
 Entity serialization to XMLNode.
void setName (XMLNode *from, const char *implicit="entity")
 All entities in input file can have explicit name. And this method set it.
void setName (std::string name)
 Set entity name.
std::string & getName ()
 Get name of entity.

Static Public Member Functions

static Entitycreate (XMLNode *from)
 Create a instantiate of special entity class.
static bool colorFromXMLNode (XMLNode *from, XMLCSTR attName, Color &to, int wlevel=2)
 Read color value from attribute of XMLNode and create its object representation.
static void setColors (XMLNode *from, Color &em, Color &refl, Color &rad)
 Read three colors from XMLnode from specified attributs and ctore its valeus.

Protected Member Functions

void addTriangle (Triangle *triangle)
 Add triangle to entity using tranformation matrix.

Detailed Description

Wrapper around TriangleSet performing its (de)serialization.

Definition at line 26 of file Entity.h.


Constructor & Destructor Documentation

Entity::Entity (  ) 

virtual Entity::~Entity (  )  [virtual]

Entity::Entity ( const Entity  ) 

Deep copy.


Member Function Documentation

Entity& Entity::operator= ( const Entity  ) 

Deep copy.

static Entity* Entity::create ( XMLNode *  from  )  [static]

Create a instantiate of special entity class.

Parameters:
from XMLNode containing entity declaration.
Returns:
entity created from XMLNode

void Entity::setTransformMatrix ( TransformMatrix matrix  ) 

Set transofrmation matrix.

Attention:
Calling this method after deserialize has no effect.
Parameters:
matrix Transformation matrix to set. There is no need to keep it in memory after call of this method.

virtual void Entity::deserialize ( XMLNode *  from  )  [virtual]

Entity deserialization from XMLNode.

Attention:
this method is unimlemented in this class
Parameters:
from XMLNode which contains entity declaration

Reimplemented in BarrelEntity, CuboidEntity, GlobeEntity, TeapotEntity, and TriangleEntity.

void Entity::divide ( float  size  ) 

Perform patch division.

Parameters:
size Size of the largest acceptable patch.

PatchSequenceEnumerator* Entity::createPatchSequenceEnumerator (  ) 

Create enumerator for entity's patches.

Returns:
Return instance of PatchSequenceEnumerator allocated on the heap.

TriangleSetExt* Entity::computeVertexColors (  ) 

Compute per-vertex colors using simple interpolation.

Returns:
Return instance of TriangleSetExt allocated on the heap.

XMLNode Entity::serialize (  ) 

Entity serialization to XMLNode.

Returns:
XMLNode wich is representation of entity.

void Entity::setName ( XMLNode *  from,
const char *  implicit = "entity" 
)

All entities in input file can have explicit name. And this method set it.

Parameters:
from XMLNode wich contains entity declaration.
implicit name when in xml doesn't exist

void Entity::setName ( std::string  name  )  [inline]

Set entity name.

Parameters:
name of entity

Definition at line 99 of file Entity.h.

std::string& Entity::getName (  )  [inline]

Get name of entity.

Returns:
Name of entity

Definition at line 105 of file Entity.h.

static bool Entity::colorFromXMLNode ( XMLNode *  from,
XMLCSTR  attName,
Color to,
int  wlevel = 2 
) [static]

Read color value from attribute of XMLNode and create its object representation.

Parameters:
from XMLnode with attribute contains color value
attName name of attribute with color
to reference of object to store value
wlevel is warnings level
Returns:
treu if color is succesfuly read and stored

static void Entity::setColors ( XMLNode *  from,
Color em,
Color refl,
Color rad 
) [static]

Read three colors from XMLnode from specified attributs and ctore its valeus.

Parameters:
from XMLNode containing entity declaration.
em Emmision color value
refl Reflectiovity color value
rad Radiosity color value

void Entity::addTriangle ( Triangle triangle  )  [protected]

Add triangle to entity using tranformation matrix.

Parameters:
triangle Triangle to add.


The documentation for this class was generated from the following file:
Generated on Thu Dec 6 19:33:12 2007 for Radiosity Renderer and Visualizer by  doxygen 1.5.2