SoTextureCombineElement.h Source File

| http://www.sim.no/ http://www.coin3d.org/

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

SoTextureCombineElement.h
1 #ifndef COIN_SOTEXTURECOMBINEELEMENT_H
2 #define COIN_SOTEXTURECOMBINEELEMENT_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 #include <Inventor/elements/SoReplacedElement.h>
28 #include <Inventor/elements/SoTextureImageElement.h>
29 #include <Inventor/SbVec2s.h>
30 #include <Inventor/SbVec3s.h>
31 #include <Inventor/SbColor4f.h>
32
33 class SoState;
34 class SoTextureCombineElementP;
35
36 class COIN_DLL_API SoTextureCombineElement : public SoElement {
37 typedef SoElement inherited;
38
39 SO_ELEMENT_HEADER(SoTextureCombineElement);
40 public:
41 static void initClass(void);
42 protected:
43 virtual ~SoTextureCombineElement();
44
45 public:
46
47 enum Source {
48 PRIMARY_COLOR = 0x8577,
49 TEXTURE = 0x1702,
50 CONSTANT = 0x8576,
51 PREVIOUS = 0x8578
52 };
53 enum Operand {
54 SRC_COLOR = 0x0300,
55 ONE_MINUS_SRC_COLOR = 0x0301,
56 SRC_ALPHA = 0x0302,
57 ONE_MINUS_SRC_ALPHA = 0x0303
58 };
59 enum Operation {
60 REPLACE = 0x1E01,
61 MODULATE = 0x2100,
62 ADD = 0x0104,
63 ADD_SIGNED = 0x8574,
64 SUBTRACT = 0x84E7,
65 INTERPOLATE = 0x8575,
66 DOT3_RGB = 0x86AE,
67 DOT3_RGBA = 0x86AF
68 };
69
70 virtual void init(SoState * state);
71
72 static void set(SoState * const state, SoNode * const node,
73 const int unit,
74 const Operation rgboperation,
75 const Operation alphaoperation,
76 const Source * rgbsource,
77 const Source * alphasource,
78 const Operand * rgboperand,
79 const Operand * alphaoperand,
80 const SbColor4f & constantcolor,
81 const float rgbscale,
82 const float alphascale);
83
84 static SbBool isDefault(SoState * const state,
85 const int unit);
86
87 static void get(SoState * const state,
88 const int unit,
89 Operation & rgboperation,
90 Operation & alphaoperation,
91 Source * rgbsource,
92 Source * alphasource,
93 Operand * rgboperand,
94 Operand * alphaoperand,
95 SbColor4f & constantcolor,
96 float & rgbscale,
97 float & alphascale);
98
99 virtual void push(SoState * state);
100 virtual SbBool matches(const SoElement * elem) const;
101 SoElement * copyMatchInfo(void) const;
102
103 virtual void setElt(const int unit,
104 const uint32_t nodeid,
105 const Operation rgboperation,
106 const Operation alphaoperation,
107 const Source * rgbsource,
108 const Source * alphasource,
109 const Operand * rgboperand,
110 const Operand * alphaoperand,
111 const SbColor4f & constantcolor,
112 const float rgbscale,
113 const float alphascale);
114
115 static void apply(SoState * state, const int unit);
116
117 class UnitData {
118 public:
119 uint32_t nodeid;
120 Source rgbsource[3];
121 Source alphasource[3];
122 Operand rgboperand[3];
123 Operand alphaoperand[3];
124 Operation rgboperation;
125 Operation alphaoperation;
126 SbColor4f constantcolor;
127 float rgbscale;
128 float alphascale;
129 };
130
131 protected:
132 const UnitData & getUnitData(const int unit) const;
133
134 private:
135 void setDefaultValues(const int unit);
136 SoTextureCombineElementP * pimpl;
137 };
138
139 #endif // !COIN_SOTEXTURECOMBINEELEMENT_H
SoElement::initClass
static void initClass(void)
Definition: SoElement.cpp:507
SbColor4f
The SbColor4f class contains the red, green, blue and alpha components which make up a color value...
Definition: SbColor4f.h:33
SoElement::matches
virtual SbBool matches(const SoElement *element) const =0
Definition: SoElement.cpp:609
SoTextureCombineElement
The SoTextureCombineElement class is yet to be documented.FIXME: write doc.
Definition: SoTextureCombineElement.h:36
SoElement::push
virtual void push(SoState *state)
Definition: SoElement.cpp:570
SoNode
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
SoElement
SoElement is the abstract base class for all elements.
Definition: SoElement.h:34
SoState
The SoState class manages the Coin scenegraph traversal state data.The SoState class is used by actio...
Definition: SoState.h:35
SoElement::init
virtual void init(SoState *state)
Definition: SoElement.cpp:553
SoElement::copyMatchInfo
virtual SoElement * copyMatchInfo(void) const =0

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.