Coin: SoShapeStyleElement.h Source File

| Coin3D is Free Software, published under the BSD 3-clause license. | https://coin3d.github.io https://www.kongsberg.com/en/kogt/

SoShapeStyleElement.h
1#ifndef COIN_SOSHAPESTYLEELEMENT_H
2#define COIN_SOSHAPESTYLEELEMENT_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
38 class COIN_DLL_API SoShapeStyleElement : public SoElement {
39 typedef SoElement inherited;
40
41 SO_ELEMENT_HEADER(SoShapeStyleElement);
42public:
43 static void initClass(void);
44protected:
45 virtual ~SoShapeStyleElement();
46
47public:
48
49 // flags used for optimized testing of features
50 enum Flags {
51 LIGHTING = 0x00000100,
52 TEXENABLED = 0x00000200,
53 TEXFUNC = 0x00000400,
54 BBOXCMPLX = 0x00000800,
55 INVISIBLE = 0x00001000,
56 ABORTCB = 0x00002000,
57 OVERRIDE = 0x00004000,
58 TEX3ENABLED = 0x00008000,
59 BIGIMAGE = 0x00010000,
60 BUMPMAP = 0x00020000,
61 VERTEXARRAY = 0x00040000,
62 TRANSP_TEXTURE = 0x00080000,
63 TRANSP_MATERIAL = 0x00100000,
64 TRANSP_SORTED_TRIANGLES = 0x00200000,
65 SHADOWMAP = 0x00400000,
66 SHADOWS = 0x00800000
67 };
68
69 virtual void init(SoState * state);
70
71 virtual void push(SoState * state);
72 virtual void pop(SoState * state, const SoElement * prevTopElement);
73
74 virtual SbBool matches(const SoElement * element) const;
75 virtual SoElement * copyMatchInfo(void) const;
76
77 static const SoShapeStyleElement * get(SoState * const state);
78
79 unsigned int getFlags(void) const;
80 SbBool mightNotRender(void) const;
81 SbBool needNormals(void) const;
82 SbBool needTexCoords(void) const;
83 int getRenderCaseMask(void) const;
84
85 static void setDrawStyle(SoState * const state, const int32_t value);
86 static void setComplexityType(SoState * const state,
87 const int32_t value);
88 static void setTransparencyType(SoState * const state,
89 const int32_t value);
90 static void setTextureEnabled(SoState * const state, const SbBool value);
91 static void setTexture3Enabled(SoState * const state, const SbBool value);
92 static void setTextureFunction(SoState * const state,
93 const SbBool value);
94 static void setLightModel(SoState * const state, const int32_t value);
95 static void setOverrides(SoState * const state, const SbBool value);
96
97 static SbBool isScreenDoor(SoState * const state);
98 static int getTransparencyType(SoState * const state);
99 SbBool isTextureFunction(void) const;
100
101 static void setBumpmapEnabled(SoState * state, const SbBool value);
102 static void setBigImageEnabled(SoState * state, const SbBool value);
103 static void setVertexArrayRendering(SoState * state, const SbBool value);
104
105 static void setTransparentMaterial(SoState * state, const SbBool value);
106 static void setTransparentTexture(SoState * state, const SbBool value);
107
108 static void setShadowMapRendering(SoState * state, const SbBool value);
109 static void setShadowsRendering(SoState * state, const SbBool value);
110
111private:
112
113 static SoShapeStyleElement * getElement(SoState * const state);
114 static const SoShapeStyleElement * getConstElement(SoState * const state);
115
116 unsigned int flags;
117};
118
119#endif // !COIN_SOSHAPESTYLEELEMENT_H
SoElement::getElement
static SoElement * getElement(SoState *const state, const int stackIndex)
Definition SoElement.h:110
SoElement::SoElement
SoElement(void)
Definition SoElement.cpp:534
SoElement::getConstElement
static const SoElement * getConstElement(SoState *const state, const int stackIndex)
Definition SoElement.h:123
SoElement::pop
virtual void pop(SoState *state, const SoElement *prevTopElement)
Definition SoElement.cpp:585
SoElement::matches
virtual SbBool matches(const SoElement *element) const =0
Definition SoElement.cpp:609
SoElement::initClass
static void initClass(void)
Definition SoElement.cpp:507
SoElement::copyMatchInfo
virtual SoElement * copyMatchInfo(void) const =0
SoElement::init
virtual void init(SoState *state)
Definition SoElement.cpp:553
SoElement::push
virtual void push(SoState *state)
Definition SoElement.cpp:570
SoShapeStyleElement::setDrawStyle
static void setDrawStyle(SoState *const state, const int32_t value)
FIXME: write doc.
Definition SoShapeStyleElement.cpp:150
SoShapeStyleElement::setTextureFunction
static void setTextureFunction(SoState *const state, const SbBool value)
FIXME: write doc.
Definition SoShapeStyleElement.cpp:236
SoShapeStyleElement::setTransparentMaterial
static void setTransparentMaterial(SoState *state, const SbBool value)
Definition SoShapeStyleElement.cpp:431
SoShapeStyleElement::setTransparencyType
static void setTransparencyType(SoState *const state, const int32_t value)
FIXME: write doc.
Definition SoShapeStyleElement.cpp:180
SoShapeStyleElement::setTransparentTexture
static void setTransparentTexture(SoState *state, const SbBool value)
Definition SoShapeStyleElement.cpp:448
SoShapeStyleElement::setShadowsRendering
static void setShadowsRendering(SoState *state, const SbBool value)
Definition SoShapeStyleElement.cpp:482
SoShapeStyleElement::setTextureEnabled
static void setTextureEnabled(SoState *const state, const SbBool value)
FIXME: write doc.
Definition SoShapeStyleElement.cpp:201
SoShapeStyleElement::needNormals
SbBool needNormals(void) const
Definition SoShapeStyleElement.cpp:317
SoShapeStyleElement::get
static const SoShapeStyleElement * get(SoState *const state)
FIXME: write doc.
Definition SoShapeStyleElement.cpp:139
SoShapeStyleElement::isTextureFunction
SbBool isTextureFunction(void) const
Definition SoShapeStyleElement.cpp:346
SoShapeStyleElement::isScreenDoor
static SbBool isScreenDoor(SoState *const state)
FIXME: write doc.
Definition SoShapeStyleElement.cpp:281
SoShapeStyleElement::setComplexityType
static void setComplexityType(SoState *const state, const int32_t value)
FIXME: write doc.
Definition SoShapeStyleElement.cpp:165
SoShapeStyleElement::mightNotRender
SbBool mightNotRender(void) const
Definition SoShapeStyleElement.cpp:306
SoShapeStyleElement::setTexture3Enabled
static void setTexture3Enabled(SoState *const state, const SbBool value)
Definition SoShapeStyleElement.cpp:221
SoShapeStyleElement::setBumpmapEnabled
static void setBumpmapEnabled(SoState *state, const SbBool value)
Definition SoShapeStyleElement.cpp:380
SoShapeStyleElement::getFlags
unsigned int getFlags(void) const
Definition SoShapeStyleElement.cpp:499
SoShapeStyleElement::getTransparencyType
static int getTransparencyType(SoState *const state)
Definition SoShapeStyleElement.cpp:295
SoShapeStyleElement::setVertexArrayRendering
static void setVertexArrayRendering(SoState *state, const SbBool value)
Definition SoShapeStyleElement.cpp:414
SoShapeStyleElement::setOverrides
static void setOverrides(SoState *const state, const SbBool value)
FIXME: write doc.
Definition SoShapeStyleElement.cpp:266
SoShapeStyleElement::setLightModel
static void setLightModel(SoState *const state, const int32_t value)
FIXME: write doc.
Definition SoShapeStyleElement.cpp:251
SoShapeStyleElement::setShadowMapRendering
static void setShadowMapRendering(SoState *state, const SbBool value)
Definition SoShapeStyleElement.cpp:465
SoShapeStyleElement::getRenderCaseMask
int getRenderCaseMask(void) const
Definition SoShapeStyleElement.cpp:336
SoShapeStyleElement::needTexCoords
SbBool needTexCoords(void) const
Definition SoShapeStyleElement.cpp:327
SoShapeStyleElement::setBigImageEnabled
static void setBigImageEnabled(SoState *state, const SbBool value)
Definition SoShapeStyleElement.cpp:397