http://www.sim.no/
http://www.coin3d.org/
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
include
Inventor
elements
SoTextureImageElement.h
1
#ifndef COIN_SOTEXTUREIMAGEELEMENT_H
2
#define COIN_SOTEXTUREIMAGEELEMENT_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/SbVec2s.h>
29
#include <Inventor/SbVec3s.h>
30
#include <Inventor/SbColor.h>
31
32
class
SoState
;
33
34
class
COIN_DLL_API
SoTextureImageElement
:
public
SoReplacedElement
{
35
typedef
SoReplacedElement
inherited
;
36
37
SO_ELEMENT_HEADER(
SoTextureImageElement
);
38
public
:
39
static
void
initClass
(
void
);
40
protected
:
41
virtual
~
SoTextureImageElement
();
42
43
public
:
44
enum
Model
{
45
// These should match GL_BLEND, GL_MODULATE and GL_DECAL for SGI
46
// Inventor compatibility (these are also used by SoTexture2 and
47
// SoTexture3).
48
BLEND = 0x0be2,
49
MODULATE = 0x2100,
50
DECAL = 0x2101,
51
REPLACE = 0x1E01
// must match GL_REPLACE
52
};
53
54
enum
Wrap
{
55
// These should match GL_CLAMP and GL_REPEAT for SGI Inventor
56
// compatibility (these are also used by SoTexture2 and
57
// SoTexture3).
58
CLAMP = 0x2900,
59
REPEAT = 0x2901,
60
CLAMP_TO_BORDER = 0x812D
61
};
62
63
virtual
void
init
(
SoState
* state);
64
65
static
void
setDefault(
SoState
*
const
state,
SoNode
*
const
node);
66
67
static
void
set
(
SoState
*
const
state,
SoNode
*
const
node,
68
const
SbVec2s
& size,
const
int
numComponents,
69
const
unsigned
char
* bytes,
70
const
int
wrapS,
const
int
wrapT,
71
const
int
model,
const
SbColor
& blendColor);
72
static
void
set
(
SoState
*
const
state,
SoNode
*
const
node,
73
const
SbVec3s
& size,
const
int
numComponents,
74
const
unsigned
char
* bytes,
75
const
int
wrapS,
const
int
wrapT,
const
int
wrapR,
76
const
int
model,
const
SbColor
& blendColor);
77
78
static
void
set
(
SoState
*
const
state,
SoNode
*
const
node,
79
const
SbVec2s
& size,
const
int
numComponents,
80
const
unsigned
char
* bytes,
81
const
Wrap wrapS,
const
Wrap wrapT,
82
const
Model model,
const
SbColor
& blendColor);
83
static
void
set
(
SoState
*
const
state,
SoNode
*
const
node,
84
const
SbVec3s
& size,
const
int
numComponents,
85
const
unsigned
char
* bytes,
86
const
Wrap wrapS,
const
Wrap wrapT,
const
Wrap wrapR,
87
const
Model model,
const
SbColor
& blendColor);
88
89
static
const
unsigned
char
*
get
(
SoState
*
const
state,
90
SbVec2s
& size,
91
int
& numComponents,
92
Wrap & wrapS,
93
Wrap & wrapT,
94
Model & model,
95
SbColor
& blendColor);
96
static
const
unsigned
char
*
get
(
SoState
*
const
state,
97
SbVec3s
& size,
98
int
& numComponents,
99
Wrap & wrapS,
100
Wrap & wrapT,
101
Wrap & wrapR,
102
Model & model,
103
SbColor
& blendColor);
104
105
static
const
unsigned
char
*
get
(
SoState
*
const
state,
106
SbVec2s
& size,
107
int
& numComponents,
108
int
& wrapS,
109
int
& wrapT,
110
int
& model,
111
SbColor
& blendColor);
112
static
const
unsigned
char
*
get
(
SoState
*
const
state,
113
SbVec3s
& size,
114
int
& numComponents,
115
int
& wrapS,
116
int
& wrapT,
117
int
& wrapR,
118
int
& model,
119
SbColor
& blendColor);
120
121
static
const
SbColor
&getBlendColor(
SoState
*
const
state);
122
static
const
unsigned
char
*getImage(
SoState
*
const
state,
123
SbVec2s
&size,
124
int
&numComponents);
125
static
const
unsigned
char
*getImage(
SoState
*
const
state,
126
SbVec3s
&size,
127
int
&numComponents);
128
static
Model getModel(
SoState
*
const
state);
129
static
Wrap getWrapS(
SoState
*
const
state);
130
static
Wrap getWrapT(
SoState
*
const
state);
131
static
Wrap getWrapR(
SoState
*
const
state);
132
133
static
SbBool containsTransparency(
SoState
*
const
state);
134
135
static
const
unsigned
char
*getDefault(
SbVec2s
& size,
int
& numComponents);
136
static
const
unsigned
char
*getDefault(
SbVec3s
& size,
int
& numComponents);
137
138
protected
:
139
virtual
void
setElt(
const
SbVec2s
& size,
const
int
numComponents,
140
const
unsigned
char
* bytes,
141
const
Wrap wrapS,
const
Wrap wrapT,
142
const
Model model,
const
SbColor
& blendColor);
143
virtual
void
setElt(
const
SbVec3s
& size,
const
int
numComponents,
144
const
unsigned
char
* bytes,
145
const
Wrap wrapS,
const
Wrap wrapT,
const
Wrap wrapR,
146
const
Model model,
const
SbColor
& blendColor);
147
148
virtual
SbBool hasTransparency(
void
)
const
;
149
150
SbVec3s
size
;
151
int
numComponents
;
152
const
unsigned
char
*
bytes
;
153
Wrap
wrapS,
wrapT
, wrapR;
154
Model
model
;
155
SbColor
blendColor
;
156
157
private
:
158
void
setDefaultValues(
void
);
159
160
};
161
162
#endif // !COIN_SOTEXTUREIMAGEELEMENT_H
Copyright © 1998-2010 by
Kongsberg Oil & Gas Technologies
. All rights reserved.
Generated for Coin by
Doxygen
1.8.1.