Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoSimplifier.h
Go to the documentation of this file.
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 (Apr 1998)
22**=======================================================================*/
23
24
25#ifndef _SO_SIMPLIFIER_
26#define _SO_SIMPLIFIER_
27
28
29#include <Inventor/SbLinear.h>
31
32
52
53public:
57 SoSimplifier () : shapeType (TRIANGLES), numTriangles (0), isShapeOpen (FALSE),
58 hasNormal (FALSE), hasColor (FALSE), color (0), hasData (FALSE),
59 numData (0), data (NULL), verbosity (FALSE) {};
63 virtual ~SoSimplifier();
64
74
79 virtual void beginShape(ShapeType);
83 virtual void endShape();
84
88 virtual void setVertex (const SbVec3f&);
89
93 void setNormal (const SbVec3f&);
97 void setData (int numData, const float*);
101 void setColor (const unsigned long&);
102
108 virtual SoNode* simplify (float ) = 0 ;
109
113 virtual void clear();
114
119 virtual int getNumTriangles() { return numTriangles; };
120
124 virtual void setVerbosity(SbBool v) { verbosity = v;}
128 SbBool getVerbosity() const { return verbosity;}
129
130private:
131
132 ShapeType shapeType;
133 int numTriangles;
134 SbBool isShapeOpen;
135
136 // current normal, color and data (texture coordinates,...)
137 SbBool hasNormal;
138 SbVec3f normal;
139 SbBool hasColor;
140 unsigned long color;
141 SbBool hasData;
142 int numData;
143 float *data;
144 SbBool verbosity;
145
146};
147
148#endif // _SO_SIMPLIFIER_
149
150
151
152
153
154
155
156
#define FALSE
Possible value of SbBool.
Definition SbBase.h:75
3D vector class.
Definition SbVec.h:932
Abstract base class for all database nodes.
Definition SoNode.h:145
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
virtual SoNode * simplify(float)=0
Performs the simplification on the shapes and returns a simplified node.
void setData(int numData, const float *)
Method to set optional vertex data (data).
virtual void endShape()
Ends a shape started by beginShape().
void setNormal(const SbVec3f &)
Method to set optional vertex data (normal).
SbBool getVerbosity() const
Gets whether to print messages while simplifying.
ShapeType
ShapeType.
@ TRIANGLES
TRIANGLES.
@ TRIANGLE_FAN
TRIANGLE_FAN.
@ TRIANGLE_STRIP
TRIANGLE_STRIP.
virtual void setVerbosity(SbBool v)
Sets whether to print messages while simplifying.
virtual int getNumTriangles()
Returns the number of triangles actually stored in the object.
virtual void beginShape(ShapeType)
Starts a new shape, ShapeType defines which triangle organization to use.
virtual ~SoSimplifier()
Destructor.
virtual void setVertex(const SbVec3f &)
Specifies a new vertex location.
virtual void clear()
Removes all shapes and reset.
void setColor(const unsigned long &)
Method to set optional vertex data (color).
SoSimplifier()
Constructor.
int SbBool
Boolean type.
Definition SbBase.h:87