Proto Class Reference

#include <Proto.h>

Inheritance diagram for Proto:

ProtoAudioClip ProtoBox ProtoCollision ProtoColor ProtoCone ProtoCoordinate ProtoCylinder ProtoCylinderSensor ProtoDefBody ProtoDefBodyTex ProtoDirectionalLight ProtoElevationGrid ProtoExtrusion ProtoFog ProtoFontStyle ProtoGroup ProtoHumanoid ProtoImageTexture ProtoIndexedFaceSet ProtoIndexedLineSet ProtoInline ProtoInterpolator ProtoJoint ProtoLOD ProtoMaterial ProtoMaterialProperties ProtoMovieTexture ProtoNavigationInfo ProtoNormal ProtoNormalInterpolator ProtoOrientationInterpolator ProtoParticleBounce ProtoParticleColorD ProtoParticleSizeD ProtoParticleSource ProtoParticleVelocityD ProtoPixelTexture ProtoPlaneSensor ProtoPointLight ProtoPointSet ProtoProximitySensor ProtoScript ProtoSegment ProtoShape ProtoSite ProtoSound ProtoSphere ProtoSphereSensor ProtoSpotLight ProtoSwitch ProtoText ProtoTextureCoordinate ProtoTextureTransform ProtoTimeSensor ProtoTouchSensor ProtoTransform ProtoViewpoint ProtoVisibilitySensor ProtoWorldInfo ProtoWrkAnimation List of all members.

Public Member Functions

 Proto (Scene *scene, const std::string &name)
virtual ~Proto ()
virtual Nodecreate (Scene *scene)
NodegetPrimaryNode ()
EventIngetEventIn (int index) const
EventOutgetEventOut (int index) const
FieldgetField (int index) const
ExposedFieldgetExposedField (int index) const
int getNumFields () const
int getNumEventIns () const
int getNumEventOuts () const
int lookupEventIn (const std::string &name) const
int lookupEventOut (const std::string &name) const
int lookupField (const std::string &name) const
int lookupExposedField (const std::string &name) const
const std::string & getName () const
void write (FILE *f, int indent) const
void addElement (Element *element)
void addExposedField (ExposedField *exposedField)
void define (Node *primaryNode, NodeList *nodes)

Protected Member Functions

void addField (int fieldType, const std::string &name, FieldValue *defaultValue=NULL, float min=-FLT_MAX, float max=FLT_MAX)
void addField (int fieldType, const std::string &name, FieldValue *defaultValue, int nodeType)
void addField (int fieldType, const std::string &name, FieldValue *defaultValue, int flags, const char **strings)
void addEventIn (int fieldType, const std::string &name)
void addEventOut (int fieldType, const std::string &name)
void addExposedField (int fieldType, const std::string &name, FieldValue *defaultValue, float min=-FLT_MAX, float max=FLT_MAX)
void addExposedField (int fieldType, const std::string &name, FieldValue *defaultValue, int nodeType)
void addExposedField (int fieldType, const std::string &name, FieldValue *defaultValue, int flags, const char **strings)
int lookupSimpleEventIn (const std::string &name) const
int lookupSimpleEventOut (const std::string &name) const

Protected Attributes

Scene_scene
std::string _name
Array< EventIn * > _eventIns
Array< EventOut * > _eventOuts
Array< Field * > _fields
Array< ExposedField * > _exposedFields
NodeList_nodes
Node_primaryNode

Detailed Description

Initialises the Proto node as every node is considered to be a Proto node with a ProtoNode part (VRML Proto definition) and a Node part (VRML ProtoBody).


Constructor & Destructor Documentation

Proto::Proto ( Scene scene,
const std::string &  name 
)

Proto default constructor.

Parameters:
*scene the current Scene.
&name the name of the Proto.

Proto::~Proto (  )  [virtual]


Member Function Documentation

Node * Proto::create ( Scene scene  )  [virtual]

Creates a Node (VRML ProtoBody). As the Proto(VRML Proto definition) is initialised in this class.

Returns:
a ProtoNode(scene,this) object which inherits from Node. e.g. the ProtoGroup::create will return a NodeGroup, the ProtoLOD::create() a NodeLOD etc.

Reimplemented in ProtoInterpolator, ProtoAudioClip, ProtoBox, ProtoCollision, ProtoColor, ProtoColorInterpolator, ProtoCone, ProtoCoordinate, ProtoCoordinateInterpolator, ProtoCylinder, ProtoCylinderSensor, ProtoDefBody, ProtoDefBodyTex, ProtoDirectionalLight, ProtoElevationGrid, ProtoExtrusion, ProtoFog, ProtoFontStyle, ProtoGroup, ProtoHumanoid, ProtoImageTexture, ProtoIndexedFaceSet, ProtoIndexedLineSet, ProtoInline, ProtoJoint, ProtoLOD, ProtoMaterial, ProtoMaterialProperties, ProtoMovieTexture, ProtoNavigationInfo, ProtoNormal, ProtoNormalInterpolator, ProtoOrientationInterpolator, ProtoParticleBounce, ProtoParticleColorD, ProtoParticleSizeD, ProtoParticleSource, ProtoParticleVelocityD, ProtoPixelTexture, ProtoPlaneSensor, ProtoPointLight, ProtoPointSet, ProtoPositionInterpolator, ProtoProximitySensor, ProtoScalarInterpolator, ProtoScript, ProtoSegment, ProtoShape, ProtoSite, ProtoSound, ProtoSphere, ProtoSphereSensor, ProtoSpotLight, ProtoSwitch, ProtoText, ProtoTextureCoordinate, ProtoTextureTransform, ProtoTimeSensor, ProtoTouchSensor, ProtoTransform, ProtoViewpoint, ProtoVisibilitySensor, ProtoWorldInfo, and ProtoWrkAnimation.

Node* Proto::getPrimaryNode (  )  [inline]

EventIn* Proto::getEventIn ( int  index  )  const [inline]

Parameters:
index the index in the Array containing EventIn*

EventOut* Proto::getEventOut ( int  index  )  const [inline]

Parameters:
index the index in the Array containing EventOut*

Field* Proto::getField ( int  index  )  const [inline]

Returns the default specified Field

Parameters:
index the index in the Array containing Field*

ExposedField* Proto::getExposedField ( int  index  )  const [inline]

Parameters:
index the index in the Array containing Field*

int Proto::getNumFields (  )  const [inline]

Returns:
the size of the Fields Array

int Proto::getNumEventIns (  )  const [inline]

Returns:
the size of the EventIns Array

int Proto::getNumEventOuts (  )  const [inline]

Returns:
the size of the EventOuts Array

int Proto::lookupEventIn ( const std::string &  name  )  const

In case lookupSimpleEventIn fails, looks for an exposedField. Then looks up the corresponding eventIn.

Parameters:
name the name of the EventIn to find it's index
Returns:
the index of the found EventIn in the EventIn Array.

int Proto::lookupEventOut ( const std::string &  name  )  const

In case lookupSimpleEventOut fails, looks for an exposedField. Then looks up the corresponding eventOut.

Parameters:
name the name of the EventOut to find it's index
Returns:
the index of the found EventOut in the EventOut Array.

int Proto::lookupField ( const std::string &  name  )  const

Looks if a Field is contained in the Field Array.

Parameters:
name the name of the Field to find it's index
Returns:
the index of the found Field in the Field Array OR returns INVALID_INDEX.

int Proto::lookupExposedField ( const std::string &  name  )  const

Looks if a ExposedField is contained in the ExposedField Array.

Parameters:
name the name of the ExposedField to find it's index
Returns:
the index of the found ExposedField in the ExposedField Array OR returns INVALID_INDEX.

const std::string& Proto::getName (  )  const [inline]

Gets the name of this Proto.

void Proto::write ( FILE *  f,
int  indent 
) const

Outputs the contents of the Proto to a File

void Proto::addElement ( Element element  ) 

Adds the parsed VRML element to the appropriate Array. Appends to _fields,_eventIns, _eventOuts and calls addExposedField(ExposedField *).

void Proto::addExposedField ( ExposedField exposedField  ) 

Adds an exposedField to the corresponding Array. This is a special case as an exposed fiels is both an eventIn and eventOut. So after adding it to the _exposedFields Array, it adds a hiiden Field in _fields,a hidden EventIn and a hidden EventOut.

void Proto::define ( Node primaryNode,
NodeList nodes 
)

Defines the primary node and the children nodes of the Proto.

void Proto::addField ( int  fieldType,
const std::string &  name,
FieldValue defaultValue = NULL,
float  min = -FLT_MAX,
float  max = FLT_MAX 
) [protected]

Adds the specified field(name) and its value in the Field Array. Field has min,max values

void Proto::addField ( int  fieldType,
const std::string &  name,
FieldValue defaultValue,
int  nodeType 
) [protected]

Adds the specified field(name) and its value in the Field Array. Field is a Node

void Proto::addField ( int  fieldType,
const std::string &  name,
FieldValue defaultValue,
int  flags,
const char **  strings 
) [protected]

Adds the specified field(name) and its value in the Field Array. Field is std::string(s)

void Proto::addEventIn ( int  fieldType,
const std::string &  name 
) [protected]

Adds the the specified(name) eventIn in the EventIn Array.

void Proto::addEventOut ( int  fieldType,
const std::string &  name 
) [protected]

Adds the the specified(name) eventOut in the EventIn Array.

void Proto::addExposedField ( int  fieldType,
const std::string &  name,
FieldValue defaultValue,
float  min = -FLT_MAX,
float  max = FLT_MAX 
) [protected]

void Proto::addExposedField ( int  fieldType,
const std::string &  name,
FieldValue defaultValue,
int  nodeType 
) [protected]

void Proto::addExposedField ( int  fieldType,
const std::string &  name,
FieldValue defaultValue,
int  flags,
const char **  strings 
) [protected]

int Proto::lookupSimpleEventIn ( const std::string &  name  )  const [protected]

Parameters:
name the name of the EventIn to find its index in the EventIn Array.
Returns:
the index of the eventIn in the Array or INVALID_INDEX

int Proto::lookupSimpleEventOut ( const std::string &  name  )  const [protected]

Parameters:
name the name of the EventOut to find its index in the EventOut Array.
Returns:
the index of the eventOut in the Array or INVALID_INDEX


Member Data Documentation

Scene* Proto::_scene [protected]

handle to the current Scene.

std::string Proto::_name [protected]

the name of the Proto

Array<EventIn *> Proto::_eventIns [protected]

An Array(Vector) of EventIn object ptrs

Array<EventOut *> Proto::_eventOuts [protected]

An Array(Vector) of EventOut object ptrs

Array<Field *> Proto::_fields [protected]

An Array(Vector) of Field object ptrs

Array<ExposedField *> Proto::_exposedFields [protected]

An Array(Vector) of ExposedField object ptrs

NodeList* Proto::_nodes [protected]

An Array of Nodes

Node* Proto::_primaryNode [protected]


Generated on Thu Jan 18 10:06:20 2007 for vhdPLUS by  doxygen 1.5.1-p1