Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
SoShapeHintsElement.h
1#ifndef COIN_SOSHAPEHINTSELEMENT_H
2#define COIN_SOSHAPEHINTSELEMENT_H
3
4/**************************************************************************\
5 * Copyright (c) Kongsberg Oil & Gas Technologies AS
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
10 * met:
11 *
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * Neither the name of the copyright holder nor the names of its
20 * contributors may be used to endorse or promote products derived from
21 * this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34\**************************************************************************/
35
36#include <Inventor/elements/SoSubElement.h>
37
38class COIN_DLL_API SoShapeHintsElement : public SoElement {
39 typedef SoElement inherited;
40
41 SO_ELEMENT_HEADER(SoShapeHintsElement);
42public:
43 static void initClass(void);
44protected:
45 virtual ~SoShapeHintsElement();
46
47public:
48 enum VertexOrdering {
49 UNKNOWN_ORDERING,
50 CLOCKWISE,
51 COUNTERCLOCKWISE,
52 ORDERING_AS_IS
53 };
54
55 enum ShapeType {
56 UNKNOWN_SHAPE_TYPE,
57 SOLID,
58 SHAPE_TYPE_AS_IS
59 };
60
61 enum FaceType {
62 UNKNOWN_FACE_TYPE,
63 CONVEX,
64 FACE_TYPE_AS_IS
65 };
66
67 virtual void init(SoState * state);
68 virtual void push(SoState * state);
69 virtual void pop(SoState * state, const SoElement * prevtopelement);
70
71 virtual SbBool matches(const SoElement * element) const;
72 virtual SoElement *copyMatchInfo(void) const;
73
74 static void set(SoState * const state, SoNode * const node,
75 const VertexOrdering vertexOrdering,
76 const ShapeType shapeType, const FaceType faceType);
77 static void set(SoState * const state,
78 const VertexOrdering vertexOrdering,
79 const ShapeType shapeType, const FaceType faceType);
80 static void get(SoState * const state, VertexOrdering & vertexOrdering,
81 ShapeType & shapeType, FaceType & faceType);
82
83 static VertexOrdering getVertexOrdering(SoState * const state);
84 static ShapeType getShapeType(SoState * const state);
85 static FaceType getFaceType(SoState * const state);
86
87 static VertexOrdering getDefaultVertexOrdering();
88 static ShapeType getDefaultShapeType();
89 static FaceType getDefaultFaceType();
90
91 virtual void print(FILE * file) const;
92
93protected:
94 void updateLazyElement(SoState * state);
95 virtual void setElt(VertexOrdering vertexOrdering,
96 ShapeType shapeType, FaceType faceType);
97
98 VertexOrdering vertexOrdering;
99 ShapeType shapeType;
100 FaceType faceType;
101
102};
103
104#endif // !COIN_SOSHAPEHINTSELEMENT_H
SoElement is the abstract base class for all elements.
Definition SoElement.h:43
virtual void pop(SoState *state, const SoElement *prevTopElement)
Definition SoElement.cpp:585
virtual SoElement * copyMatchInfo(void) const =0
virtual SbBool matches(const SoElement *element) const =0
Definition SoElement.cpp:609
static void initClass(void)
Definition SoElement.cpp:507
virtual void init(SoState *state)
Definition SoElement.cpp:553
virtual void push(SoState *state)
Definition SoElement.cpp:570
virtual void print(FILE *file=stdout) const
Definition SoElement.cpp:595
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:56
The SoShapeHintsElement class is yet to be documented.
Definition SoShapeHintsElement.h:38
The SoState class manages the Coin scene graph traversal state data.
Definition SoState.h:44