H3D API
2.4.1
|
The ProtoDeclaration class contains information about a PROTO node from the X3D standard. More...
#include <H3D/ProtoDeclaration.h>
Classes | |
class | FieldDeclaration |
Class that contains information about a field that is part of the prototype declaration. More... | |
Public Member Functions | |
ProtoDeclaration (const string &_name, const string &_body="", const vector< string > &_body_extra=vector< string >(), X3D::PrototypeVector *_existing_protos=NULL) | |
Constructor. More... | |
const string & | getProtoBody () |
Get the string with the internal scenegraph of the prototype. | |
void | setProtoBody (const string &_body) |
Set the string with the internal scenegraph of the prototype. | |
void | addProtoBodyExtra (const string &_body) |
Add one part of proto body that is not the main proto body(i.e. More... | |
const vector< string > & | getProtoBodyExtra () |
Get the proto body extras. | |
const string & | getName () |
Get the name of the prototype. | |
void | setName (const string &_name) |
Get the name of the prototype. | |
string | addFieldDeclaration (const string &_name, const X3DTypes::X3DType &type, const Field::AccessType &access_type, const string &value="") |
Add a field to the prototype. More... | |
FieldDeclaration * | getFieldDeclaration (const string &_name) |
Get the field declaration of the given name. More... | |
void | setFieldDeclarationsExternal (bool is_external) |
Call this to set the external property for all contained field declarations. More... | |
X3DPrototypeInstance * | newProtoInstance () |
Create a new X3DPrototypeInstance instance using the ProtoDeclaration. | |
The ProtoDeclaration class contains information about a PROTO node from the X3D standard.
It contains everything that is needed to now about the prototype and allows you to create new instances of the prototype with the newProtoInstance function.
Examples:
ProtoDeclaration::ProtoDeclaration | ( | const string & | _name, |
const string & | _body = "" , |
||
const vector< string > & | _body_extra = vector<string>() , |
||
X3D::PrototypeVector * | _existing_protos = NULL |
||
) |
Constructor.
_name | The name of the prototype. |
_body | String with the internal scenegraph of the prototype. |
_body_extra | Contains extra proto bodies that are not part of the main proto body. |
_existing_protos | Contains all the ProtoDeclarations that exists when this ProtoDeclaration is created. |
|
inline |
Add a field to the prototype.
_name | The name of the field. |
type | The type of the field. |
access_type | The access_type of the field. |
value | The value of the field. |
|
inline |
Add one part of proto body that is not the main proto body(i.e.
not the first )
|
inline |
Get the field declaration of the given name.
Returns true if such a field declaration exists, false otherwise
|
inline |
Call this to set the external property for all contained field declarations.
The external property should be set if this proto was created in an ExternalProto and the property is used to know how default values should be set.