.TH "SoToVRML2Action" 3 "Tue Jun 23 2026 23:48:38" "Version 4.0.10" "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 \fR#include \fP .PP Inherits \fBSoToVRMLAction\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const" .br .ti -1c .RI "\fBSoToVRML2Action\fP (void)" .br .ti -1c .RI "virtual \fB~SoToVRML2Action\fP (void)" .br .ti -1c .RI "virtual void \fBapply\fP (\fBSoNode\fP *node)" .br .ti -1c .RI "virtual void \fBapply\fP (\fBSoPath\fP *path)" .br .ti -1c .RI "virtual void \fBapply\fP (const \fBSoPathList\fP &pathlist, SbBool obeysrules=FALSE)" .br .ti -1c .RI "class \fBSoVRMLGroup\fP * \fBgetVRML2SceneGraph\fP (void) const" .br .ti -1c .RI "void \fBreuseAppearanceNodes\fP (SbBool appearance)" .br .ti -1c .RI "SbBool \fBdoReuseAppearanceNodes\fP (void) const" .br .ti -1c .RI "void \fBreusePropertyNodes\fP (SbBool property)" .br .ti -1c .RI "SbBool \fBdoReusePropertyNodes\fP (void) const" .br .ti -1c .RI "void \fBreuseGeometryNodes\fP (SbBool geometry)" .br .ti -1c .RI "SbBool \fBdoReuseGeometryNodes\fP (void) const" .br .in -1c Public Member Functions inherited from \fBSoToVRMLAction\fP .in +1c .ti -1c .RI "\fBSoToVRMLAction\fP (void)" .br .ti -1c .RI "virtual \fB~SoToVRMLAction\fP (void)" .br .ti -1c .RI "\fBSoNode\fP * \fBgetVRMLSceneGraph\fP (void) const" .br .ti -1c .RI "void \fBexpandSoFile\fP (SbBool flag)" .br .ti -1c .RI "SbBool \fBareSoFileExpanded\fP (void) const" .br .ti -1c .RI "void \fBsetUrlName\fP (const \fBSbString\fP name)" .br .ti -1c .RI "\fBSbString\fP \fBgetUrlName\fP (void) const" .br .ti -1c .RI "void \fBwriteTexCoords\fP (SbBool flag)" .br .ti -1c .RI "SbBool \fBareTexCoordWritten\fP (void) const" .br .ti -1c .RI "void \fBexpandTexture2Node\fP (SbBool flag)" .br .ti -1c .RI "SbBool \fBareTexture2NodeExpanded\fP (void) const" .br .ti -1c .RI "void \fBkeepUnknownNodes\fP (SbBool flag)" .br .ti -1c .RI "SbBool \fBareUnknownNodeKept\fP (void) const" .br .ti -1c .RI "void \fBconvertInlineNodes\fP (SbBool flag)" .br .ti -1c .RI "SbBool \fBdoConvertInlineNodes\fP (void) const" .br .ti -1c .RI "void \fBconditionalConversion\fP (SbBool flag)" .br .ti -1c .RI "SbBool \fBdoConditionalConversion\fP (void) const" .br .ti -1c .RI "void \fBsetVerbosity\fP (SbBool flag)" .br .ti -1c .RI "SbBool \fBisVerbose\fP (void) const" .br .in -1c Public Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "virtual \fB~SoAction\fP (void)" .br .ti -1c .RI "virtual SbBool \fBisOfType\fP (\fBSoType\fP type) const" .br .ti -1c .RI "void \fBapply\fP (\fBSoAction\fP *beingApplied)" .br .ti -1c .RI "virtual void \fBinvalidateState\fP (void)" .br .ti -1c .RI "\fBAppliedCode\fP \fBgetWhatAppliedTo\fP (void) const" .br .ti -1c .RI "\fBSoNode\fP * \fBgetNodeAppliedTo\fP (void) const" .br .ti -1c .RI "\fBSoPath\fP * \fBgetPathAppliedTo\fP (void) const" .br .ti -1c .RI "const \fBSoPathList\fP * \fBgetPathListAppliedTo\fP (void) const" .br .ti -1c .RI "const \fBSoPathList\fP * \fBgetOriginalPathListAppliedTo\fP (void) const" .br .ti -1c .RI "SbBool \fBisLastPathListAppliedTo\fP (void) const" .br .ti -1c .RI "\fBPathCode\fP \fBgetPathCode\fP (int &numindices, const int *&indices)" .br .ti -1c .RI "void \fBtraverse\fP (\fBSoNode\fP *const node)" .br .ti -1c .RI "SbBool \fBhasTerminated\fP (void) const" .br .ti -1c .RI "const \fBSoPath\fP * \fBgetCurPath\fP (void)" .br .ti -1c .RI "\fBSoState\fP * \fBgetState\fP (void) const" .br .ti -1c .RI "\fBPathCode\fP \fBgetCurPathCode\fP (void) const" .br .ti -1c .RI "virtual \fBSoNode\fP * \fBgetCurPathTail\fP (void)" .br .ti -1c .RI "void \fBusePathCode\fP (int &numindices, const int *&indices)" .br .ti -1c .RI "void \fBpushCurPath\fP (const int childindex, \fBSoNode\fP *node=NULL)" .br .ti -1c .RI "void \fBpopCurPath\fP (const \fBPathCode\fP prevpathcode)" .br .ti -1c .RI "void \fBpushCurPath\fP (void)" .br .ti -1c .RI "void \fBpopPushCurPath\fP (const int childindex, \fBSoNode\fP *node=NULL)" .br .ti -1c .RI "void \fBpopCurPath\fP (void)" .br .ti -1c .RI "void \fBswitchToPathTraversal\fP (\fBSoPath\fP *path)" .br .ti -1c .RI "void \fBswitchToNodeTraversal\fP (\fBSoNode\fP *node)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBaddMethod\fP (const \fBSoType\fP type, SoActionMethod method)" .br .ti -1c .RI "static void \fBenableElement\fP (const \fBSoType\fP type, const int stackindex)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c Static Public Member Functions inherited from \fBSoToVRMLAction\fP .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBaddMethod\fP (const \fBSoType\fP type, SoActionMethod method)" .br .ti -1c .RI "static void \fBenableElement\fP (const \fBSoType\fP type, const int stackindex)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c Static Public Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "static void \fBinitClass\fP (void)" .br .ti -1c .RI "static void \fBinitClasses\fP (void)" .br .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBnullAction\fP (\fBSoAction\fP *action, \fBSoNode\fP *node)" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual const \fBSoEnabledElementsList\fP & \fBgetEnabledElements\fP (void) const" .br .ti -1c .RI "virtual void \fBbeginTraversal\fP (\fBSoNode\fP *node)" .br .in -1c Protected Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "\fBSoAction\fP (void)" .br .ti -1c .RI "virtual void \fBendTraversal\fP (\fBSoNode\fP *node)" .br .ti -1c .RI "void \fBsetTerminated\fP (const SbBool flag)" .br .ti -1c .RI "virtual SbBool \fBshouldCompactPathList\fP (void) const" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static \fBSoEnabledElementsList\fP * \fBgetClassEnabledElements\fP (void)" .br .ti -1c .RI "static \fBSoActionMethodList\fP * \fBgetClassActionMethods\fP (void)" .br .in -1c Static Protected Member Functions inherited from \fBSoToVRMLAction\fP .in +1c .ti -1c .RI "static \fBSoEnabledElementsList\fP * \fBgetClassEnabledElements\fP (void)" .br .ti -1c .RI "static \fBSoActionMethodList\fP * \fBgetClassActionMethods\fP (void)" .br .in -1c Static Protected Member Functions inherited from \fBSoAction\fP .in +1c .ti -1c .RI "static \fBSoEnabledElementsList\fP * \fBgetClassEnabledElements\fP (void)" .br .ti -1c .RI "static \fBSoActionMethodList\fP * \fBgetClassActionMethods\fP (void)" .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 \fRNULL\fP\&. .PP \fBSee also\fP .RS 4 \fBSoToVRMLAction\fP .RE .PP \fBSince\fP .RS 4 Coin 2\&.0 .PP TGS Inventor 2\&.5 .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoToVRML2Action::SoToVRML2Action (void )" Constructor\&. .SS "SoToVRML2Action::~SoToVRML2Action (void )\fR [virtual]\fP" The destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoToVRML2Action::getTypeId (void ) const\fR [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\&. .PP Reimplemented from \fBSoToVRMLAction\fP\&. .SS "\fBSoType\fP SoToVRML2Action::getClassTypeId (void )\fR [static]\fP" This static method returns the \fBSoType\fP object associated with objects of this class\&. .SS "void SoToVRML2Action::addMethod (const \fBSoType\fP type, SoActionMethod method)\fR [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 "void SoToVRML2Action::enableElement (const \fBSoType\fP type, const int stackindex)\fR [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 "const \fBSoEnabledElementsList\fP & SoToVRML2Action::getEnabledElements (void ) const\fR [protected]\fP, \fR [virtual]\fP" Returns list of enabled elements\&. .PP Reimplemented from \fBSoToVRMLAction\fP\&. .SS "\fBSoEnabledElementsList\fP * SoToVRML2Action::getClassEnabledElements (void )\fR [static]\fP, \fR [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 v2\&.1 API\&. .br .SS "\fBSoActionMethodList\fP * SoToVRML2Action::getClassActionMethods (void )\fR [static]\fP, \fR [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 v2\&.1 API\&. .br .SS "void SoToVRML2Action::initClass (void )\fR [static]\fP" Initializes the runtime type system for this class, and sets up the enabled elements and action method list\&. .SS "void SoToVRML2Action::apply (\fBSoNode\fP * root)\fR [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 "void SoToVRML2Action::apply (\fBSoPath\fP * path)\fR [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 "void SoToVRML2Action::apply (const \fBSoPathList\fP & pathlist, SbBool obeysrules = \fRFALSE\fP)\fR [virtual]\fP" Applies action to the graphs defined by \fIpathlist\fP\&. If \fIobeysrules\fP is set to \fRTRUE\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 (void ) const" Return a pointer to the root node of the generated scene graph of only VRML2 / VRML97 nodes\&. .PP Will return \fRNULL\fP if VRML97 support was not compiled into the library\&. .SS "void 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 (void ) 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 "void SoToVRML2Action::reusePropertyNodes (SbBool property)" Set the flag deciding if property nodes should be reused if possible\&. The default is FALSE\&. .SS "SbBool SoToVRML2Action::doReusePropertyNodes (void ) const" Get the flag deciding if property nodes should be reused if possible\&. The default is FALSE\&. .SS "void 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 (void ) 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 "void SoToVRML2Action::beginTraversal (\fBSoNode\fP * node)\fR [protected]\fP, \fR [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\&.