00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #ifndef _SO_SHAPE_HINTS_ELEMENT
00051 #define _SO_SHAPE_HINTS_ELEMENT
00052
00053 #include <Inventor/elements/SoReplacedElement.h>
00054
00069 SoEXTENDER_Documented class SoShapeHintsElement : public SoElement {
00070
00071 SO_ELEMENT_HEADER(SoShapeHintsElement);
00072
00073 public:
00077 enum VertexOrdering {
00081 UNKNOWN_ORDERING,
00085 CLOCKWISE,
00089 COUNTERCLOCKWISE,
00093 ORDERING_AS_IS
00094 };
00098 enum ShapeType {
00102 UNKNOWN_SHAPE_TYPE,
00106 SOLID,
00110 SHAPE_TYPE_AS_IS };
00111
00115 enum FaceType {
00119 UNKNOWN_FACE_TYPE,
00123 CONVEX,
00127 FACE_TYPE_AS_IS
00128 };
00129
00133 enum WindingType {
00137 NO_WINDING_TYPE,
00138 ODD_TYPE,
00139 NON_ZERO_TYPE,
00140 POSITIVE_TYPE,
00141 NEGATIVE_TYPE,
00142 ABS_GEQ_TWO_TYPE
00143 };
00144
00149 static void set(SoState *state, VertexOrdering vertexOrdering,
00150 ShapeType shapeType, FaceType faceType);
00151
00156 static void set(SoState *state, WindingType windingType);
00157
00161 static void set(SoState *state, SbBool useVBO) ;
00162
00163 #ifndef IV_STRICT
00164
00167 static void set(SoState *state, SoNode *,
00168 VertexOrdering vertexOrdering,
00169 ShapeType shapeType, FaceType faceType)
00170 { set(state, vertexOrdering, shapeType, faceType); }
00171
00175 static void set(SoState *state, SoNode *,WindingType windingType)
00176 { set(state,windingType); }
00177
00181 static void set(SoState *state, SoNode *, SbBool useVBO)
00182 { set(state,useVBO); }
00183 #endif
00184
00188 static void get(SoState *state,
00189 VertexOrdering &vertexOrdering,
00190 ShapeType &shapeType, FaceType &faceType);
00191
00195 static void get(SoState *state, WindingType &windingType );
00196
00200 static SbBool isVBOUsed(SoState *state) ;
00201
00205 static VertexOrdering getDefaultVertexOrdering();
00209 static ShapeType getDefaultShapeType();
00213 static FaceType getDefaultFaceType();
00217 static WindingType getDefaultWindingType();
00221 static SbBool getDefaultVBOUsage() ;
00222
00227 virtual void push(SoState *state);
00228
00232 virtual void print(FILE *fp) const;
00233
00234 private:
00235
00237 virtual void init(SoState *state);
00238
00242 virtual SbBool matches(const SoElement* elt) const;
00243
00247 virtual SoElement* copyMatchInfo() const;
00248
00249 private:
00250
00251 static void initClass();
00252 static void exitClass();
00253
00254 static bool isTwoSidedLighting(SoState *state);
00255
00256 private:
00257
00258 virtual void setElt(SoState *state, VertexOrdering vertexOrdering,
00259 ShapeType shapeType, FaceType faceType);
00260
00261 virtual void setElt(SoState *state, WindingType windingType);
00262
00263 VertexOrdering vertexOrdering;
00264 ShapeType shapeType;
00265 FaceType faceType;
00266 WindingType windingType;
00267 SbBool useVBO ;
00268
00269 virtual ~SoShapeHintsElement();
00270 };
00271
00272 #endif
00273
00274