Instance of an externprototype. More...
#include <Inventor/VRMLnodes/SoVRMLEXTERNPROTOInstance.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
void | setupInstance () |
SoType | getEXTERNPROTOType () |
SoVRMLEXTERNPROTOInstance () | |
SoVRMLEXTERNPROTOInstance (SoVRMLEXTERNPROTODef *protoDef) | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
An externprototype 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 externprototype.
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 .
SoVRMLEXTERNPROTOInstance::SoVRMLEXTERNPROTOInstance | ( | ) |
SoVRMLEXTERNPROTOInstance::SoVRMLEXTERNPROTOInstance | ( | SoVRMLEXTERNPROTODef * | protoDef | ) |
Creates an instance of the externprototype defined by the definition externprotoDef.
static SoType SoVRMLEXTERNPROTOInstance::getClassTypeId | ( | ) | [static] |
Returns type identifier for this class.
Reimplemented from SoVRMLNode.
SoType SoVRMLEXTERNPROTOInstance::getEXTERNPROTOType | ( | ) | [inline] |
Returns the type of the externprototype being instanced.
A type of an externprototype determines where it can be instanced. The first node found in the PROTO defined in the externproto definition defines the type of the externprototype.
virtual SoType SoVRMLEXTERNPROTOInstance::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoVRMLNode.
void SoVRMLEXTERNPROTOInstance::setupInstance | ( | ) |
Finishes setting up an instance of an externprototype.
The steps required to create an instance of an externprototype are:
1. Read in the externprototype. You can read it in from a file or a buffer using the readAllVRML method of SoDB.
2. Find the externprototype definition from the externprototype's name using the static method findEXTERNPROTO in SoBase.
SoVRMLEXTERNPROTODef *goldProtoDef = (SoVRMLEXTERNPROTODef *) SoBase::findEXTERNPROTO(SbName("newGold"));
3. Create an instance of the prototype.
SoVRMLEXTERNPROTOInstance *goldInst = new SoVRMLEXTERNPROTOInstance(goldProtoDef);
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.
goldInst->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.