Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoReorganizeAction.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Pascal DOUX (May 1998)
22**=======================================================================*/
23
24
25#ifndef _SO_REORGANIZE_ACTION_
26#define _SO_REORGANIZE_ACTION_
27
28
29//------------------------------------------------------------------------------
30// Includes
31
32#include <Inventor/actions/SoAction.h>
33#include <Inventor/actions/SoSubAction.h>
34#include <Inventor/actions/SoCallbackAction.h>
35#include <Inventor/actions/SoSimplifyAction.h>
36#include <Inventor/nodes/SoMaterial.h>
37#include <Inventor/fields/SoMFFloat.h>
38
39#include <Inventor/SoType.h>
40
41class SoSimplifier;
42
68{
69 SO_ACTION_HEADER(SoReorganizeAction);
70
71public:
72
76 SoReorganizeAction (SoSimplifier *_simplifier = NULL) ;
77
82
86 SoSeparator *getSimplifiedSceneGraph() const { return simplifiedRoot; }
91 void generateNormals(SbBool g) { generateNormal = g;}
95 SbBool areNormalGenerated() const { return generateNormal ;}
100 void generateTriangleStrips(SbBool g) { generateTriangleStrip = g;}
105 SbBool areTriangleStripGenerated() const { return generateTriangleStrip ;}
111 void generateTexCoords(SbBool g) { generateTexCoord = g;}
116 SbBool areTexCoordsGenerated() const { return generateTexCoord ;}
122 void generateVPNodes(SbBool g) { generateVPNode = g;}
127 SbBool areVPNodesGenerated() const { return generateVPNode ;}
132 void matchIndexArrays(SbBool g) { matchIndexArray = g;}
136 SbBool areIndexArraysMatched() const { return matchIndexArray ;}
137
141 SoSimplifier *getSimplifier() const { return simplifier ;}
142
147 SoNONUNICODE static void startReport(const char* msg);
148
152 static void startReport(const SbString& msg);
153
157 static void finishReport();
158
160 virtual void apply(SoNode *node);
161
163 virtual void apply(SoPath *path);
164
166 virtual void apply(const SoPathList &path_list, SbBool obeys_rules=FALSE);
167
168private:
169 virtual void beginTraversal(SoNode *) { beginTraversal();}
170 virtual void endTraversal (SoNode *) { endTraversal() ;}
171
172 private:
173 static void initClass();
174 static void exitClass();
175
176private:
177
178 virtual void beginTraversal();
179 virtual void endTraversal ();
180
181 // new scene graph
182 SoSeparator *simplifiedRoot;
183
184 // generate per-vertex normals
185 SbBool generateNormal;
186
187 // generate Triangle Strips
188 // only used if a not using a simplifier. Otherwise ignored.
189 // FALSE by default
190 SbBool generateTriangleStrip;
191
192 // generate Texture Coordinates
193 SbBool generateTexCoord;
194
195 // generate Vertex Property Nodes
196 SbBool generateVPNode;
197
198 // match Index Arrays
199 SbBool matchIndexArray;
200
201 void simplifySingleLevel();
202 void simplifyMultiLevelsWithInline();
203 void simplifyMultiLevels();
204 void simplify();
205
206};
207
208
209#endif // _SO_REORGANIZE_ACTION_
210
211
212
213
214
215
216
217
218
Class for smart character strings.
Definition SbString.h:202
Abstract base class for all database nodes.
Definition SoNode.h:145
Path that points to a list of hierarchical nodes.
Definition SoPath.h:187
Maintains a list of pointers to paths.
Definition SoPathList.h:81
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Reorganizes the ...
SoSimplifier * getSimplifier() const
Returns the simplifier being used, may be NULL.
~SoReorganizeAction()
Destructor.
void generateTexCoords(SbBool g)
Sets whether texture coordinates should be generated during reorganization.
void generateTriangleStrips(SbBool g)
Sets whether triangle strips should be generated.
void matchIndexArrays(SbBool g)
Sets whether to try to match index arrays during reorganization.
void generateNormals(SbBool g)
Sets whether normals should be generated during reorganization.
SoSeparator * getSimplifiedSceneGraph() const
Returns result of reorganization as new scene graph.
virtual void apply(const SoPathList &path_list, SbBool obeys_rules=FALSE)
Initiates an action on the graph defined by a list of paths.
SbBool areVPNodesGenerated() const
Gets whether vertex property nodes should be generated during reorganization.
virtual void apply(SoPath *path)
Initiates an action on the graph defined by a path.
SoReorganizeAction(SoSimplifier *_simplifier=NULL)
Constructor.
void generateVPNodes(SbBool g)
Sets whether vertex property nodes should be generated during reorganization.
static SoNONUNICODE void startReport(const char *msg)
Starts a report.
SbBool areNormalGenerated() const
Gets whether normals should be generated during reorganization.
SbBool areIndexArraysMatched() const
Gets whether to try to match index arrays during reorganization.
static void startReport(const SbString &msg)
Starts a report.
SbBool areTexCoordsGenerated() const
Gets whether texture coordinates should be generated during reorganization.
SbBool areTriangleStripGenerated() const
Gets whether triangle strips should be generated; if false, IndexedFaceSets are generated.
virtual void apply(SoNode *node)
Initiates an action on the graph defined by a node.
static void finishReport()
Ends a report.
Group node that saves and restores traversal state.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
int SbBool
Boolean type.
Definition SbBase.h:87