Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
SoTextureCombineElement.h
1#ifndef COIN_SOTEXTURECOMBINEELEMENT_H
2#define COIN_SOTEXTURECOMBINEELEMENT_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/SoReplacedElement.h>
37#include <Inventor/SbVec2s.h>
38#include <Inventor/SbVec3s.h>
39#include <Inventor/SbColor4f.h>
40
41class SoState;
42class SoTextureCombineElementP;
43
44class COIN_DLL_API SoTextureCombineElement : public SoElement {
45 typedef SoElement inherited;
46
47 SO_ELEMENT_HEADER(SoTextureCombineElement);
48public:
49 static void initClass(void);
50protected:
52
53public:
54
55 enum Source {
56 PRIMARY_COLOR = 0x8577,
57 TEXTURE = 0x1702,
58 CONSTANT = 0x8576,
59 PREVIOUS = 0x8578
60 };
61 enum Operand {
62 SRC_COLOR = 0x0300,
63 ONE_MINUS_SRC_COLOR = 0x0301,
64 SRC_ALPHA = 0x0302,
65 ONE_MINUS_SRC_ALPHA = 0x0303
66 };
67 enum Operation {
68 REPLACE = 0x1E01,
69 MODULATE = 0x2100,
70 ADD = 0x0104,
71 ADD_SIGNED = 0x8574,
72 SUBTRACT = 0x84E7,
73 INTERPOLATE = 0x8575,
74 DOT3_RGB = 0x86AE,
75 DOT3_RGBA = 0x86AF
76 };
77
78 virtual void init(SoState * state);
79
80 static void set(SoState * const state, SoNode * const node,
81 const int unit,
82 const Operation rgboperation,
83 const Operation alphaoperation,
84 const Source * rgbsource,
85 const Source * alphasource,
86 const Operand * rgboperand,
87 const Operand * alphaoperand,
88 const SbColor4f & constantcolor,
89 const float rgbscale,
90 const float alphascale);
91
92 static SbBool isDefault(SoState * const state,
93 const int unit);
94
95 static void get(SoState * const state,
96 const int unit,
97 Operation & rgboperation,
98 Operation & alphaoperation,
99 Source * rgbsource,
100 Source * alphasource,
101 Operand * rgboperand,
102 Operand * alphaoperand,
103 SbColor4f & constantcolor,
104 float & rgbscale,
105 float & alphascale);
106
107 virtual void push(SoState * state);
108 virtual SbBool matches(const SoElement * elem) const;
109 SoElement * copyMatchInfo(void) const;
110
111 virtual void setElt(const int unit,
112 const SbUniqueId nodeid,
113 const Operation rgboperation,
114 const Operation alphaoperation,
115 const Source * rgbsource,
116 const Source * alphasource,
117 const Operand * rgboperand,
118 const Operand * alphaoperand,
119 const SbColor4f & constantcolor,
120 const float rgbscale,
121 const float alphascale);
122
123 static void apply(SoState * state, const int unit);
124
125 class UnitData {
126 public:
127 UnitData();
128 UnitData(const UnitData & org);
129
130 SbUniqueId nodeid;
131 Source rgbsource[3];
132 Source alphasource[3];
133 Operand rgboperand[3];
134 Operand alphaoperand[3];
135 Operation rgboperation;
136 Operation alphaoperation;
137 SbColor4f constantcolor;
138 float rgbscale;
139 float alphascale;
140 };
141
142protected:
143 const UnitData & getUnitData(const int unit) const;
144
145private:
146 SoTextureCombineElementP * pimpl;
147};
148
149#endif // !COIN_SOTEXTURECOMBINEELEMENT_H
The SbColor4f class contains the red, green, blue and alpha components which make up a color value.
Definition SbColor4f.h:42
SoElement is the abstract base class for all elements.
Definition SoElement.h:43
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
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:56
The SoState class manages the Coin scene graph traversal state data.
Definition SoState.h:44
Definition SoTextureCombineElement.h:125
The SoTextureCombineElement class is yet to be documented.
Definition SoTextureCombineElement.h:44