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

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

- File List
- File Members

SoMultiTextureImageElement.h
1 #ifndef COIN_SOMULTITEXTUREIMAGEELEMENT_H
2 #define COIN_SOMULTITEXTUREIMAGEELEMENT_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/SbColor.h>
32
33 class SoState;
34 class SoMultiTextureImageElementP;
35
36 class COIN_DLL_API SoMultiTextureImageElement : public SoElement {
37 typedef SoElement inherited;
38
39 SO_ELEMENT_HEADER(SoMultiTextureImageElement);
40 public:
41 static void initClass(void);
42 protected:
43 virtual ~SoMultiTextureImageElement();
44
45 public:
46
47 virtual void init(SoState * state);
48 static void setDefault(SoState * const state, SoNode * const node, const int unit);
49
50 static void set(SoState * const state, SoNode * const node,
51 const int unit,
52 const SbVec2s & size, const int numComponents,
53 const unsigned char * bytes,
54 const SoTextureImageElement::Wrap wrapS,
55 const SoTextureImageElement::Wrap wrapT,
56 const SoTextureImageElement::Model model, const SbColor & blendColor);
57 static void set(SoState * const state, SoNode * const node,
58 const int unit,
59 const SbVec3s & size, const int numComponents,
60 const unsigned char * bytes,
61 const SoTextureImageElement::Wrap wrapS,
62 const SoTextureImageElement::Wrap wrapT,
63 const SoTextureImageElement::Wrap wrapR,
64 const SoTextureImageElement::Model model, const SbColor & blendColor);
65
66 static const unsigned char *get(SoState * const state,
67 const int unit,
68 SbVec2s & size,
69 int & numComponents,
70 SoTextureImageElement::Wrap & wrapS,
71 SoTextureImageElement::Wrap & wrapT,
72 SoTextureImageElement::Model & model,
73 SbColor & blendColor);
74 static const unsigned char *get(SoState * const state,
75 const int unit,
76 SbVec3s & size,
77 int & numComponents,
78 SoTextureImageElement::Wrap & wrapS,
79 SoTextureImageElement::Wrap & wrapT,
80 SoTextureImageElement::Wrap & wrapR,
81 SoTextureImageElement::Model & model,
82 SbColor & blendColor);
83
84 static const unsigned char *getImage(SoState * const state,
85 const int unit,
86 SbVec2s & size,
87 int & numComponents);
88 static const unsigned char *getImage(SoState * const state,
89 const int unit,
90 SbVec3s &size,
91 int &numComponents);
92
93 static const SbColor & getBlendColor(SoState * const state, const int unit);
94 static SoTextureImageElement::Model getModel(SoState * const state, const int unit);
95 static SoTextureImageElement::Wrap getWrapS(SoState * const state, const int unit);
96 static SoTextureImageElement::Wrap getWrapT(SoState * const state, const int unit);
97 static SoTextureImageElement::Wrap getWrapR(SoState * const state, const int unit);
98
99 static SbBool containsTransparency(SoState * const state);
100
101 static const unsigned char * getDefault(SbVec2s & size, int & numComponents);
102 static const unsigned char * getDefault(SbVec3s & size, int & numComponents);
103
104 virtual void push(SoState * state);
105 virtual SbBool matches(const SoElement * elem) const;
106 SoElement * copyMatchInfo(void) const;
107
108 virtual void setElt(const int unit,
109 const uint32_t nodeid,
110 const SbVec2s & size, const int numComponents,
111 const unsigned char * bytes,
112 const SoTextureImageElement::Wrap wrapS,
113 const SoTextureImageElement::Wrap wrapT,
114 const SoTextureImageElement::Model model,
115 const SbColor & blendColor);
116 virtual void setElt(const int unit,
117 const uint32_t nodeid,
118 const SbVec3s & size, const int numComponents,
119 const unsigned char * bytes,
120 const SoTextureImageElement::Wrap wrapS,
121 const SoTextureImageElement::Wrap wrapT,
122 const SoTextureImageElement::Wrap wrapR,
123 const SoTextureImageElement::Model model,
124 const SbColor & blendColor);
125
126 virtual SbBool hasTransparency(const int unit) const;
127
128 class UnitData {
129 public:
130 uint32_t nodeid;
131 SbVec3s size;
132 int numComponents;
133 const unsigned char * bytes;
134 SoTextureImageElement::Wrap wrapS, wrapT, wrapR;
135 SoTextureImageElement::Model model;
136 SbColor blendColor;
137 };
138
139 protected:
140 const UnitData & getUnitData(const int unit) const;
141
142 private:
143 void setDefaultValues(const int unit);
144 SoMultiTextureImageElementP * pimpl;
145 };
146
147 #endif // !COIN_SOMULTITEXTUREIMAGEELEMENT_H

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