Instance of a prototype. More...
#include <Inventor/VRMLnodes/SoVRMLPROTOInstance.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
void | setupInstance () |
SoVRMLPROTOInstance () | |
SoVRMLPROTOInstance (SoVRMLPROTODef *protoDef) | |
SoType | getPROTOType () |
Static Public Member Functions | |
static SoType | getClassTypeId () |
A prototype definition read from a file or a buffer does not define an actual node instance. This class is used to create the instance of a previously defined prototype.
NOTE: This class does not exist in Open Inventor 10.0 and later.This section may reference portions of the VRML97 specification that are not present in this help file. The complete VRML97 spec is available at http://www.web3d.org .
SoVRMLPROTOInstance::SoVRMLPROTOInstance | ( | ) |
SoVRMLPROTOInstance::SoVRMLPROTOInstance | ( | SoVRMLPROTODef * | protoDef | ) |
Creates an instance of the prototype defined by the definition protoDef.
static SoType SoVRMLPROTOInstance::getClassTypeId | ( | ) | [static] |
Returns type identifier for this class.
Reimplemented from SoVRMLNode.
SoType SoVRMLPROTOInstance::getPROTOType | ( | ) | [inline] |
Returns the type of the prototype being instanced.
A type of a prototype determines where it can be instanced. The first node found in a prototype definition defines the type of the prototype.
virtual SoType SoVRMLPROTOInstance::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoVRMLNode.
void SoVRMLPROTOInstance::setupInstance | ( | ) |
Finishes setting up an instance of a prototype.
The steps required to create an instance of a prototype are:
1. Read in the prototype. You can read it in from a file or a buffer using the readAllVRML method of SoDB.
2. Find the prototype definition from the prototype's name using the static method findPROTO in SoBase.
SoVRMLPROTODef *spinProtoDef = (SoVRMLPROTODef *) SoBase::findPROTO(SbName("SpinGroup"));
3. Create an instance of the prototype.
SoVRMLPROTOInstance *spinInst = new SoVRMLPROTOInstance(spinProtoDef);
This will partially set up the instance and create the fields.
4. Set the values of the fields.
5. Finish the setup of the instance.
spinInst->setupInstance();
The order of the calls is important. If the value of the field is to be changed from the default, it must be changed before setupInstance() is called.