.TH "SoProtoInstance" 3 "Sat Oct 12 2013" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoProtoInstance \- .PP The \fBSoProtoInstance\fP class handles PROTO instances\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoNode\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const " .br .RI "\fIReturns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. \fP" .ti -1c .RI "\fBSoProtoInstance\fP (\fBSoProto\fP *proto, const \fBSoFieldData\fP *deffielddata)" .br .ti -1c .RI "void \fBsetRootNode\fP (\fBSoNode\fP *root)" .br .ti -1c .RI "\fBSoNode\fP * \fBgetRootNode\fP (void)" .br .ti -1c .RI "\fBSoProto\fP * \fBgetProtoDefinition\fP (void) const " .br .ti -1c .RI "\fBSbName\fP \fBgetProtoName\fP (void) const " .br .ti -1c .RI "virtual void \fBwrite\fP (\fBSoWriteAction\fP *action)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .RI "\fIThis static method returns the \fBSoType\fP object associated with objects of this class\&. \fP" .ti -1c .RI "static void \fBinitClass\fP (void)" .br .RI "\fISets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system\&. \fP" .ti -1c .RI "static \fBSoProtoInstance\fP * \fBfindProtoInstance\fP (const \fBSoNode\fP *rootnode)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual const \fBSoFieldData\fP * \fBgetFieldData\fP (void) const " .br .ti -1c .RI "virtual \fB~SoProtoInstance\fP ()" .br .ti -1c .RI "virtual SbBool \fBreadInstance\fP (\fBSoInput\fP *in, unsigned short flags)" .br .ti -1c .RI "virtual const char * \fBgetFileFormatName\fP (void) const " .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBSoProtoInstance\fP class handles PROTO instances\&. \fBSee Also:\fP .RS 4 \fBSoProto\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoProtoInstance::SoProtoInstance (\fBSoProto\fP *proto, const \fBSoFieldData\fP *deffielddata)" Constructor\&. .SS "SoProtoInstance::~SoProtoInstance ()\fC [protected]\fP, \fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoProtoInstance::getTypeId (void) const\fC [virtual]\fP" .PP Returns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. Usage example: .PP .PP .nf void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } } .fi .PP .PP For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in \fIall\fP subclasses\&. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance \fBInventor/nodes/SoSubNode\&.h\fP (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine\&.h (for engine classes) and so on\&. .PP For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups\&. .PP Implements \fBSoBase\fP\&. .SS "const \fBSoFieldData\fP * SoProtoInstance::getFieldData (void) const\fC [protected]\fP, \fC [virtual]\fP" Returns a pointer to the class-wide field data storage object for this instance\&. If no fields are present, returns \fCNULL\fP\&. .PP Reimplemented from \fBSoFieldContainer\fP\&. .SS "\fBSoProtoInstance\fP * SoProtoInstance::findProtoInstance (const \fBSoNode\fP *rootnode)\fC [static]\fP" Given root node \fIrootnode\fP, return the PROTO instance, or NULL if \fIrootnode\fP is not a PROTO instance root node\&. .SS "void SoProtoInstance::setRootNode (\fBSoNode\fP *root)" Sets the root node for this instance\&. .SS "\fBSoNode\fP * SoProtoInstance::getRootNode (void)" Returns the instance root node\&. .SS "\fBSoProto\fP * SoProtoInstance::getProtoDefinition (void) const" Returns the PROTO definition for this instance\&. .SS "\fBSbName\fP SoProtoInstance::getProtoName (void) const" Returns the PROTO defintion name\&. .SS "void SoProtoInstance::write (\fBSoWriteAction\fP *action)\fC [virtual]\fP" Action method for \fBSoWriteAction\fP\&. .PP Writes out a node object, and any connected nodes, engines etc, if necessary\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "SbBool SoProtoInstance::readInstance (\fBSoInput\fP *in, unsigned shortflags)\fC [protected]\fP, \fC [virtual]\fP" This method is mainly intended for internal use during file import operations\&. .PP It reads a definition of an instance from the input stream \fIin\fP\&. The input stream state points to the start of a serialized / persistant representation of an instance of this class type\&. .PP \fCTRUE\fP or \fCFALSE\fP is returned, depending on if the instantiation and configuration of the new object of this class type went ok or not\&. The import process should be robust and handle corrupted input streams by returning \fCFALSE\fP\&. .PP \fIflags\fP is used internally during binary import when reading user extension nodes, group nodes or engines\&. .PP Reimplemented from \fBSoNode\fP\&. .SS "const char * SoProtoInstance::getFileFormatName (void) const\fC [protected]\fP, \fC [virtual]\fP" Returns the class name this object should be written under\&. Default string returned is the name of the class from the type system\&. .PP User extensions nodes and engines override this method to return the name of the extension (instead of 'UnknownNode' or 'UnknownEngine')\&. .PP Reimplemented from \fBSoBase\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.