.TH "SoToVRML2Action" 3 "Tue Dec 26 2023 17:59:22" "Version 4.0.2" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoToVRML2Action \- The \fBSoToVRML2Action\fP class builds a new scene graph, using only VRML97/VRML2 nodes\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoToVRMLAction\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBvirtual\fP \fBSoType\fP \fBgetTypeId\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBSoToVRML2Action\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvirtual\fP \fB~SoToVRML2Action\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBapply\fP (\fBSoNode\fP *node)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBapply\fP (\fBSoPath\fP *path)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBapply\fP (\fBconst\fP \fBSoPathList\fP &\fBpathlist\fP, SbBool \fBobeysrules\fP=FALSE)" .br .ti -1c .RI "\fBclass\fP \fBSoVRMLGroup\fP * \fBgetVRML2SceneGraph\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBreuseAppearanceNodes\fP (SbBool appearance)" .br .ti -1c .RI "SbBool \fBdoReuseAppearanceNodes\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBreusePropertyNodes\fP (SbBool \fBproperty\fP)" .br .ti -1c .RI "SbBool \fBdoReusePropertyNodes\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBreuseGeometryNodes\fP (SbBool geometry)" .br .ti -1c .RI "SbBool \fBdoReuseGeometryNodes\fP (\fBvoid\fP) \fBconst\fP" .br .in -1c Public Member Functions inherited from \fBSoToVRMLAction\fP .in +1c .ti -1c .RI "\fBSoToVRMLAction\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvirtual\fP \fB~SoToVRMLAction\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBSoNode\fP * \fBgetVRMLSceneGraph\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBexpandSoFile\fP (SbBool \fBflag\fP)" .br .ti -1c .RI "SbBool \fBareSoFileExpanded\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetUrlName\fP (\fBconst\fP \fBSbString\fP name)" .br .ti -1c .RI "\fBSbString\fP \fBgetUrlName\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBwriteTexCoords\fP (SbBool \fBflag\fP)" .br .ti -1c .RI "SbBool \fBareTexCoordWritten\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBexpandTexture2Node\fP (SbBool \fBflag\fP)" .br .ti -1c .RI "SbBool \fBareTexture2NodeExpanded\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBkeepUnknownNodes\fP (SbBool \fBflag\fP)" .br .ti -1c .RI "SbBool \fBareUnknownNodeKept\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBconvertInlineNodes\fP (SbBool \fBflag\fP)" .br .ti -1c .RI "SbBool \fBdoConvertInlineNodes\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBconditionalConversion\fP (SbBool \fBflag\fP)" .br .ti -1c .RI "SbBool \fBdoConditionalConversion\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBsetVerbosity\fP (SbBool \fBflag\fP)" .br .ti -1c .RI "SbBool \fBisVerbose\fP (\fBvoid\fP) \fBconst\fP" .br .in -1c Public Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "\fBvirtual\fP \fB~SoAction\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBisOfType\fP (\fBSoType\fP type) \fBconst\fP" .br .ti -1c .RI "\fBvoid\fP \fBapply\fP (\fBSoAction\fP *\fBbeingApplied\fP)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBinvalidateState\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBAppliedCode\fP \fBgetWhatAppliedTo\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBSoNode\fP * \fBgetNodeAppliedTo\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBSoPath\fP * \fBgetPathAppliedTo\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBconst\fP \fBSoPathList\fP * \fBgetPathListAppliedTo\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBconst\fP \fBSoPathList\fP * \fBgetOriginalPathListAppliedTo\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "SbBool \fBisLastPathListAppliedTo\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBPathCode\fP \fBgetPathCode\fP (int &\fBnumindices\fP, \fBconst\fP int *&indices)" .br .ti -1c .RI "\fBvoid\fP \fBtraverse\fP (\fBSoNode\fP *\fBconst\fP node)" .br .ti -1c .RI "SbBool \fBhasTerminated\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBconst\fP \fBSoPath\fP * \fBgetCurPath\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBSoState\fP * \fBgetState\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBPathCode\fP \fBgetCurPathCode\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBSoNode\fP * \fBgetCurPathTail\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBusePathCode\fP (int &\fBnumindices\fP, \fBconst\fP int *&indices)" .br .ti -1c .RI "\fBvoid\fP \fBpushCurPath\fP (\fBconst\fP int \fBchildindex\fP, \fBSoNode\fP *node=\fBNULL\fP)" .br .ti -1c .RI "\fBvoid\fP \fBpopCurPath\fP (\fBconst\fP \fBPathCode\fP \fBprevpathcode\fP)" .br .ti -1c .RI "\fBvoid\fP \fBpushCurPath\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBpopPushCurPath\fP (\fBconst\fP int \fBchildindex\fP, \fBSoNode\fP *node=\fBNULL\fP)" .br .ti -1c .RI "\fBvoid\fP \fBpopCurPath\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvoid\fP \fBswitchToPathTraversal\fP (\fBSoPath\fP *path)" .br .ti -1c .RI "\fBvoid\fP \fBswitchToNodeTraversal\fP (\fBSoNode\fP *node)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "\fBstatic\fP \fBSoType\fP \fBgetClassTypeId\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBaddMethod\fP (\fBconst\fP \fBSoType\fP type, SoActionMethod method)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBenableElement\fP (\fBconst\fP \fBSoType\fP type, \fBconst\fP int \fBstackindex\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClass\fP (\fBvoid\fP)" .br .in -1c Static Public Member Functions inherited from \fBSoToVRMLAction\fP .in +1c .ti -1c .RI "\fBstatic\fP \fBSoType\fP \fBgetClassTypeId\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBaddMethod\fP (\fBconst\fP \fBSoType\fP type, SoActionMethod method)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBenableElement\fP (\fBconst\fP \fBSoType\fP type, \fBconst\fP int \fBstackindex\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClass\fP (\fBvoid\fP)" .br .in -1c Static Public Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClass\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBinitClasses\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBSoType\fP \fBgetClassTypeId\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBvoid\fP \fBnullAction\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "\fBvirtual\fP \fBconst\fP \fBSoEnabledElementsList\fP & \fBgetEnabledElements\fP (\fBvoid\fP) \fBconst\fP" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBbeginTraversal\fP (\fBSoNode\fP *node)" .br .in -1c Protected Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "\fBSoAction\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBvirtual\fP \fBvoid\fP \fBendTraversal\fP (\fBSoNode\fP *node)" .br .ti -1c .RI "\fBvoid\fP \fBsetTerminated\fP (\fBconst\fP SbBool \fBflag\fP)" .br .ti -1c .RI "\fBvirtual\fP SbBool \fBshouldCompactPathList\fP (\fBvoid\fP) \fBconst\fP" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "\fBstatic\fP \fBSoEnabledElementsList\fP * \fBgetClassEnabledElements\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBSoActionMethodList\fP * \fBgetClassActionMethods\fP (\fBvoid\fP)" .br .in -1c Static Protected Member Functions inherited from \fBSoToVRMLAction\fP .in +1c .ti -1c .RI "\fBstatic\fP \fBSoEnabledElementsList\fP * \fBgetClassEnabledElements\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBSoActionMethodList\fP * \fBgetClassActionMethods\fP (\fBvoid\fP)" .br .in -1c Static Protected Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "\fBstatic\fP \fBSoEnabledElementsList\fP * \fBgetClassEnabledElements\fP (\fBvoid\fP)" .br .ti -1c .RI "\fBstatic\fP \fBSoActionMethodList\fP * \fBgetClassActionMethods\fP (\fBvoid\fP)" .br .in -1c .SS "Additional Inherited Members" Public Types inherited from \fBSoAction\fP .in +1c .ti -1c .RI "enum \fBAppliedCode\fP { \fBNODE\fP = 0, \fBPATH\fP = 1, \fBPATH_LIST\fP = 2 }" .br .ti -1c .RI "enum \fBPathCode\fP { \fBNO_PATH\fP = 0, \fBIN_PATH\fP = 1, \fBBELOW_PATH\fP = 2, \fBOFF_PATH\fP = 3 }" .br .in -1c Protected Attributes inherited from \fBSoAction\fP .in +1c .ti -1c .RI "\fBSoState\fP * \fBstate\fP" .br .ti -1c .RI "\fBSoActionMethodList\fP * \fBtraversalMethods\fP" .br .in -1c .SH "Detailed Description" .PP The \fBSoToVRML2Action\fP class builds a new scene graph, using only VRML97/VRML2 nodes\&. This action is used for converting a scene graph of VRML1/Coin nodes to a new scene graph using only VRML97/VRML2 nodes\&. .PP Due to the basic differences between VRML1/Coin and VRML2 (the latter does not really have a traversal state) the new scene graph will typically be somewhat larger\&. To minimize this effect the action tries to reuse nodes when possible\&. .PP VRML1 nodes will be converted to their equivalent VRML2 nodes, while Coin nodes with no VRML2 equivalent are converted to IndexedFaceSet\&. If the DrawStyle is POINTS, all geometry will be built using PointSet; if it is LINES IndexedLineSet is used\&. .PP Here's a basic usage example of this action, in the form of a complete, standalone program: .PP .PP .nf #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { SoDB::init(); SoInteraction::init(); SoInput in; in\&.openFile(argv[1]); printf("Reading\&.\&.\&.\\n"); SoSeparator *root = SoDB::readAll(&in); if (root) { root\->ref(); SbString hdr = in\&.getHeader(); in\&.closeFile(); printf("Converting\&.\&.\&.\\n"); SoToVRML2Action tovrml2; tovrml2\&.apply(root); SoVRMLGroup *newroot = tovrml2\&.getVRML2SceneGraph(); newroot\->ref(); root\->unref(); printf("Writing\&.\&.\&.\\n"); SoOutput out; out\&.openFile("out\&.wrl"); out\&.setHeaderString("#VRML V2\&.0 utf8"); SoWriteAction wra(&out); wra\&.apply(newroot); out\&.closeFile(); newroot\->unref(); } return 0; } .fi .PP .PP Note: if VRML97 support is not present in the Coin library, this action does nothing and getVRML2SceneGraph always returns \fCNULL\fP\&. .PP \fBSee also\fP .RS 4 \fBSoToVRMLAction\fP .RE .PP \fBSince\fP .RS 4 Coin \fB2\&.0\fP .PP TGS Inventor \fB2\&.5\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoToVRML2Action::SoToVRML2Action (\fBvoid\fP)" Constructor\&. .SS "SoToVRML2Action::~SoToVRML2Action (\fBvoid\fP)\fC [virtual]\fP" The destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoToVRML2Action::getTypeId (\fBvoid\fP) const\fC [virtual]\fP" Returns the type identification of an object derived from a class inheriting \fBSoAction\fP\&. This is used for runtime type checking and 'downward' casting\&. .br .PP Reimplemented from \fBSoToVRMLAction\fP\&. .SS "\fBSoType\fP SoToVRML2Action::getClassTypeId (\fBvoid\fP)\fC [static]\fP" This static method returns the \fBSoType\fP object associated with objects of this class\&. .br .SS "\fBvoid\fP SoToVRML2Action::addMethod (\fBconst\fP \fBSoType\fP type, SoActionMethod method)\fC [static]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .br .br .SS "\fBvoid\fP SoToVRML2Action::enableElement (\fBconst\fP \fBSoType\fP type, \fBconst\fP int stackindex)\fC [static]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .br .br .SS "\fBconst\fP \fBSoEnabledElementsList\fP & SoToVRML2Action::getEnabledElements (\fBvoid\fP) const\fC [protected]\fP, \fC [virtual]\fP" Returns list of enabled elements\&. .br .PP Reimplemented from \fBSoToVRMLAction\fP\&. .SS "\fBSoEnabledElementsList\fP * SoToVRML2Action::getClassEnabledElements (\fBvoid\fP)\fC [static]\fP, \fC [protected]\fP" Returns list of enabled elements for this class\&. The enabledElements and methods variables are protected in the original OIV API\&. This is not such a good idea, since exposed static class member variables is a major grievance with regard to Win32 DLLs\&. This function is an extension for Coin, and it is not available in the original SGI Open Inventor \fBv2\&.1\fP API\&. .br .br .SS "\fBSoActionMethodList\fP * SoToVRML2Action::getClassActionMethods (\fBvoid\fP)\fC [static]\fP, \fC [protected]\fP" Returns list of action methods for this class\&. The enabledElements and methods variables are protected in the original OIV API\&. This is not such a good idea, since exposed static class member variables is a major grievance with regard to Win32 DLLs\&. This function is an extension for Coin, and it is not available in the original SGI Open Inventor \fBv2\&.1\fP API\&. .br .br .SS "\fBvoid\fP SoToVRML2Action::initClass (\fBvoid\fP)\fC [static]\fP" Initializes the runtime type system for this class, and sets up the enabled elements and action method list\&. .SS "\fBvoid\fP SoToVRML2Action::apply (\fBSoNode\fP * root)\fC [virtual]\fP" Applies the action to the scene graph rooted at \fIroot\fP\&. .PP Note that you should \fInot\fP apply an action to a node with a zero reference count\&. The behavior in that case is undefined\&. .PP Reimplemented from \fBSoToVRMLAction\fP\&. .SS "\fBvoid\fP SoToVRML2Action::apply (\fBSoPath\fP * path)\fC [virtual]\fP" Applies the action to the parts of the graph defined by \fIpath\fP\&. .PP Note that an \fBSoPath\fP will also contain all nodes that may influence e\&.g\&. geometry nodes in the path\&. So for instance applying an \fBSoGLRenderAction\fP on an \fBSoPath\fP will render that path as expected in the view, where geometry will get its materials, textures, and other appearance settings correctly\&. .PP If the \fIpath\fP ends in an \fBSoGroup\fP node, the action will also traverse the tail node's children\&. .PP Reimplemented from \fBSoToVRMLAction\fP\&. .SS "\fBvoid\fP SoToVRML2Action::apply (\fBconst\fP \fBSoPathList\fP & pathlist, SbBool obeysrules = \fCFALSE\fP)\fC [virtual]\fP" Applies action to the graphs defined by \fIpathlist\fP\&. If \fIobeysrules\fP is set to \fCTRUE\fP, \fIpathlist\fP must obey the following four conditions (which is the case for path lists returned from search actions for non-group nodes and path lists returned from picking actions): .PP All paths must start at the same head node\&. All paths must be sorted in traversal order\&. The paths must be unique\&. No path can continue through the end point of another path\&. .PP \fBSee also\fP .RS 4 \fBSoAction::apply(SoPath * path)\fP .RE .PP .PP Reimplemented from \fBSoToVRMLAction\fP\&. .SS "\fBSoVRMLGroup\fP * SoToVRML2Action::getVRML2SceneGraph (\fBvoid\fP) const" Return a pointer to the root node of the generated scene graph of only VRML2 / VRML97 nodes\&. .PP Will return \fCNULL\fP if VRML97 support was not compiled into the library\&. .SS "\fBvoid\fP SoToVRML2Action::reuseAppearanceNodes (SbBool appearance)" Set the flag deciding if appearance nodes should be reused if possible\&. The default is FALSE\&. .PP Please note that support for reusing Appearance nodes is not implemented yet\&. .SS "SbBool SoToVRML2Action::doReuseAppearanceNodes (\fBvoid\fP) const" Get the flag deciding if appearance nodes should be reused if possible\&. The default is FALSE\&. .PP Please note that support for reusing Appearance nodes is not implemented yet, so this method will always return FALSE\&. .SS "\fBvoid\fP SoToVRML2Action::reusePropertyNodes (SbBool property)" Set the flag deciding if property nodes should be reused if possible\&. The default is FALSE\&. .SS "SbBool SoToVRML2Action::doReusePropertyNodes (\fBvoid\fP) const" Get the flag deciding if property nodes should be reused if possible\&. The default is FALSE\&. .SS "\fBvoid\fP SoToVRML2Action::reuseGeometryNodes (SbBool geometry)" Set the flag deciding if geometry nodes should be reused if possible\&. The default is FALSE\&. .PP Please note that support for reusing Geometry nodes is not implemented yet\&. .SS "SbBool SoToVRML2Action::doReuseGeometryNodes (\fBvoid\fP) const" Get the flag deciding if geometry nodes should be reused if possible\&. The default is FALSE\&. .PP Please note that support for reusing Geometry nodes is not implemented yet, so this function will always return FALSE\&. .SS "\fBvoid\fP SoToVRML2Action::beginTraversal (\fBSoNode\fP * node)\fC [protected]\fP, \fC [virtual]\fP" This virtual method is called from \fBSoAction::apply()\fP, and is the entry point for the actual scene graph traversal\&. .PP It can be overridden to initialize the action at traversal start, for specific initializations in the action subclasses inheriting \fBSoAction\fP\&. .PP Default method just calls \fBtraverse()\fP, which any overridden implementation of the method must do too (or call \fBSoAction::beginTraversal()\fP) to trigger the scene graph traversal\&. .PP Reimplemented from \fBSoToVRMLAction\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.