00001 /*======================================================================= 00002 * Copyright 1991-1996, Silicon Graphics, Inc. 00003 * ALL RIGHTS RESERVED 00004 * 00005 * UNPUBLISHED -- Rights reserved under the copyright laws of the United 00006 * States. Use of a copyright notice is precautionary only and does not 00007 * imply publication or disclosure. 00008 * 00009 * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND: 00010 * Use, duplication or disclosure by the Government is subject to restrictions 00011 * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights 00012 * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or 00013 * in similar or successor clauses in the FAR, or the DOD or NASA FAR 00014 * Supplement. Contractor/manufacturer is Silicon Graphics, Inc., 00015 * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311. 00016 * 00017 * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY 00018 * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION, 00019 * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY 00020 * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON 00021 * GRAPHICS, INC. 00022 **=======================================================================*/ 00023 /*======================================================================= 00024 ** Author : SGI (MMM YYYY) 00025 **=======================================================================*/ 00026 /*======================================================================= 00027 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00028 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00029 *** *** 00030 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00031 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00032 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00033 *** *** 00034 *** RESTRICTED RIGHTS LEGEND *** 00035 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00036 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00037 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00038 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00039 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00040 *** *** 00041 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, *** 00042 *** BORDEAUX, FRANCE *** 00043 *** ALL RIGHTS RESERVED *** 00044 **=======================================================================*/ 00045 /*======================================================================= 00046 ** Modified by : Pascal DOUX (May 1998) 00047 **=======================================================================*/ 00048 00049 00050 #ifndef _SO_TOVRML_ACTION_ 00051 #define _SO_TOVRML_ACTION_ 00052 00053 00054 //------------------------------------------------------------------------------ 00055 // Includes 00056 00057 #include <Inventor/actions/SoAction.h> 00058 #include <Inventor/actions/SoSubAction.h> 00059 #include <Inventor/actions/SoCallbackAction.h> 00060 #include <Inventor/nodes/SoMaterial.h> 00061 #include <Inventor/fields/SoMFFloat.h> 00062 00063 #include <Inventor/SoType.h> 00064 00065 00066 #if defined(OIV_IGNORE_VRML_DEPRECATED) 00067 #include <SoDeprecationRules.h> 00068 #pragma push_macro("SoDEPRECATED_CLASS") 00069 #pragma push_macro("SoDEPRECATED_TYPEDEF") 00070 #undef SoDEPRECATED_CLASS 00071 #undef SoDEPRECATED_TYPEDEF 00072 #define SoDEPRECATED_CLASS(x,y) 00073 #define SoDEPRECATED_TYPEDEF(x,y) 00074 #endif 00075 00076 class SoConvertGuts; 00077 class SoDEPRECATED SoToVRMLAction : public SoAction 00102 { 00103 SO_ACTION_HEADER(SoToVRMLAction); 00104 00105 public: 00106 00110 SoToVRMLAction () ; 00111 00115 ~SoToVRMLAction(); 00116 00118 virtual void apply(SoNode *node); 00120 virtual void apply(SoPath *path); 00122 virtual void apply(const SoPathList &path_list, SbBool obeys_rules = FALSE); 00123 00129 SoNode *getVRMLSceneGraph() const { return m_newRoot; } 00130 00134 void expandSoFile(SbBool e) { m_expandSoFile = e;} 00138 SbBool areSoFileExpanded() const { return m_expandSoFile;} 00139 00143 void setUrlName(const SbString name) { m_urlName = name;} 00147 SbString getUrlName() const { return m_urlName;} 00148 00152 void writeTexCoords(SbBool w) { m_writeTexCoords = w;} 00156 SbBool areTexCoordWritten() const { return m_writeTexCoords;} 00157 00162 void expandTexture2Node(SbBool e) { m_expandTexture2Node = e;} 00167 SbBool areTexture2NodeExpanded() const { return m_expandTexture2Node;} 00168 00172 void keepUnknownNodes(SbBool k) { m_keepUnknownNodes = k;} 00176 SbBool areUnknownNodeKept() const { return m_keepUnknownNodes;} 00177 00182 void convertInlineNodes(SbBool inlineNode) { m_inline = inlineNode;} 00186 SbBool doConvertInlineNodes() const { return m_inline; } 00187 00193 void conditionalConversion(SbBool conditional) { m_conditional = conditional;} 00197 SbBool doConditionalConversion() const { return m_conditional; } 00198 00199 private: 00205 void setVerbosity(SbBool v) { m_verbosity = v;} 00209 SbBool isVerbose() const { return m_verbosity;} 00210 00211 private: 00212 static void initClass(); 00213 static void exitClass(); 00214 00215 private: 00216 00217 SbBool m_inline, m_conditional; 00218 virtual SoConvertGuts* getNewConvertGuts() const; 00219 const SoConvertGuts* getConvertGuts() const { return m_convertGuts; } 00220 virtual void beginTraversal(SoNode *) { beginTraversal();} 00221 virtual void endTraversal (SoNode *) { endTraversal() ;} 00222 00223 private: 00224 00225 virtual void beginTraversal(); 00226 virtual void endTraversal (); 00227 00228 // new scene graph 00229 SoNode *m_newRoot; 00230 00231 // if TRUE each SoFile LOD is expanded instead of being converted 00232 // to Inline nodes: (default FALSE) 00233 SbBool m_expandSoFile; 00234 00235 // base name of each inlined and SoFile sub-files (default "") 00236 SbString m_urlName; 00237 00238 // if TRUE forces Texture Coordinates to write for all Nurbs Surfaces : (default FALSE) 00239 SbBool m_writeTexCoords; 00240 00241 // if TRUE Expand Texture2 nodes 00242 SbBool m_expandTexture2Node; 00243 00244 // if TRUE keeps unknown nodes instead of removing them 00245 SbBool m_keepUnknownNodes; 00246 00247 // verbosity: is TRUE prints a lot of informations during processing 00248 SbBool m_verbosity; 00249 00250 SoConvertGuts *m_convertGuts; 00251 00252 void removeViewNothingCameras(SoNode *root); 00253 void convertLevelOfDetailToLOD(SoNode *root); 00254 00255 }; 00256 00257 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 #if defined(OIV_IGNORE_VRML_DEPRECATED) 00269 #pragma pop_macro("SoDEPRECATED_TYPEDEF") 00270 #pragma pop_macro("SoDEPRECATED_CLASS") 00271 #endif 00272 00273 #endif // _SO_TOVRML_ACTION_ 00274