Coin Logo http://www.sim.no/
http://www.coin3d.org/

SoShaderParameter.h
1#ifndef COIN_SOSHADERPARAMETER_H
2#define COIN_SOSHADERPARAMETER_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/nodes/SoNode.h>
28#include <Inventor/nodes/SoSubNode.h>
29#include <Inventor/fields/SoSFString.h>
30#include <Inventor/fields/SoSFFloat.h>
31#include <Inventor/fields/SoSFInt32.h>
32#include <Inventor/fields/SoSFVec2f.h>
33#include <Inventor/fields/SoSFVec3f.h>
34#include <Inventor/fields/SoSFVec4f.h>
35#include <Inventor/fields/SoMFFloat.h>
36#include <Inventor/fields/SoMFInt32.h>
37#include <Inventor/fields/SoMFVec2f.h>
38#include <Inventor/fields/SoMFVec3f.h>
39#include <Inventor/fields/SoMFVec4f.h>
40#include <Inventor/fields/SoSFMatrix.h>
41#include <Inventor/fields/SoMFMatrix.h>
42#include <Inventor/fields/SoSFNode.h>
43#include <Inventor/fields/SoSFEnum.h>
44#include <Inventor/fields/SoSFImage.h>
45
46#include <Inventor/fields/SoSFVec2i32.h>
47#include <Inventor/fields/SoSFVec3i32.h>
48#include <Inventor/fields/SoSFVec4i32.h>
49#include <Inventor/fields/SoMFVec2i32.h>
50#include <Inventor/fields/SoMFVec3i32.h>
51#include <Inventor/fields/SoMFVec4i32.h>
52
53class SoGLShaderParameter;
54class SoGLShaderObject;
55
56// *************************************************************************
57
58// FIXME: split to one header file for each class? 20050120 mortene.
59
60/* **************************************************************************
61 * *** SoShaderParameter ***
62 * **************************************************************************/
63
64class COIN_DLL_API SoShaderParameter : public SoNode {
65 typedef SoNode inherited;
67
68public:
69 SoSFString name;
70 SoSFInt32 identifier;
71
72 SoINTERNAL public:
73 static void initClass();
74
75protected:
77 virtual ~SoShaderParameter();
78};
79
80/* **************************************************************************
81 * *** SoUniformShaderParameter ***
82 * **************************************************************************/
83class SoUniformShaderParameterP;
84
85class COIN_DLL_API SoUniformShaderParameter : public SoShaderParameter {
86 typedef SoShaderParameter inherited;
87 SO_NODE_ABSTRACT_HEADER(SoUniformShaderParameter);
88
89 SoINTERNAL public:
90 static void initClass(void);
91 virtual void updateParameter(SoGLShaderObject *shaderObject) = 0;
92
93protected:
94 SoUniformShaderParameter();
95 virtual ~SoUniformShaderParameter();
96
97 SoGLShaderParameter * getGLShaderParameter(const uint32_t cachecontext);
98 void ensureParameter(SoGLShaderObject * shader);
99
100private:
101 SoUniformShaderParameterP * pimpl;
102};
103
104/* **************************************************************************
105 * *** SoShaderParameter1f ***
106 * **************************************************************************/
107
108class COIN_DLL_API SoShaderParameter1f : public SoUniformShaderParameter {
109 typedef SoUniformShaderParameter inherited;
110 SO_NODE_HEADER(SoShaderParameter1f);
111
112public:
113 SoSFFloat value;
114 SoShaderParameter1f();
115
116 SoINTERNAL public:
117 static void initClass();
118 virtual void updateParameter(SoGLShaderObject *shaderObject);
119
120protected:
121 virtual ~SoShaderParameter1f();
122};
123
124/* **************************************************************************
125 * *** SoShaderParameter1i ***
126 * **************************************************************************/
127
128class COIN_DLL_API SoShaderParameter1i : public SoUniformShaderParameter {
129 typedef SoUniformShaderParameter inherited;
130 SO_NODE_HEADER(SoShaderParameter1i);
131
132public:
133 SoSFInt32 value;
134 SoShaderParameter1i();
135
136 SoINTERNAL public:
137 static void initClass();
138 virtual void updateParameter(SoGLShaderObject *shaderObject);
139
140protected:
141 virtual ~SoShaderParameter1i();
142};
143
144/* **************************************************************************
145 * *** SoShaderParameter2f ***
146 * **************************************************************************/
147
148class COIN_DLL_API SoShaderParameter2f : public SoUniformShaderParameter {
149 typedef SoUniformShaderParameter inherited;
150 SO_NODE_HEADER(SoShaderParameter2f);
151
152public:
153 SoSFVec2f value;
154 SoShaderParameter2f();
155
156 SoINTERNAL public:
157 static void initClass();
158 virtual void updateParameter(SoGLShaderObject *shaderObject);
159
160protected:
161 virtual ~SoShaderParameter2f();
162};
163
164/* **************************************************************************
165 * *** SoShaderParameter2i ***
166 * **************************************************************************/
167
168class COIN_DLL_API SoShaderParameter2i : public SoUniformShaderParameter {
169 typedef SoUniformShaderParameter inherited;
170 SO_NODE_HEADER(SoShaderParameter2i);
171
172public:
173 SoSFVec2i32 value;
174 SoShaderParameter2i();
175
176 SoINTERNAL public:
177 static void initClass();
178 virtual void updateParameter(SoGLShaderObject *shaderObject);
179
180protected:
181 virtual ~SoShaderParameter2i();
182};
183
184/* **************************************************************************
185 * *** SoShaderParameter3f ***
186 * **************************************************************************/
187
188class COIN_DLL_API SoShaderParameter3f : public SoUniformShaderParameter {
189 typedef SoUniformShaderParameter inherited;
190 SO_NODE_HEADER(SoShaderParameter3f);
191
192public:
193 SoSFVec3f value;
194
195 SoShaderParameter3f();
196
197 SoINTERNAL public:
198 static void initClass();
199 virtual void updateParameter(SoGLShaderObject *shaderObject);
200
201protected:
202 virtual ~SoShaderParameter3f();
203};
204
205/* **************************************************************************
206 * *** SoShaderParameter3i ***
207 * **************************************************************************/
208
209class COIN_DLL_API SoShaderParameter3i : public SoUniformShaderParameter {
210 typedef SoUniformShaderParameter inherited;
211 SO_NODE_HEADER(SoShaderParameter3i);
212
213public:
214 SoSFVec3i32 value;
215
216 SoShaderParameter3i();
217
218 SoINTERNAL public:
219 static void initClass();
220 virtual void updateParameter(SoGLShaderObject *shaderObject);
221
222protected:
223 virtual ~SoShaderParameter3i();
224};
225
226/* **************************************************************************
227 * *** SoShaderParameter4f ***
228 * **************************************************************************/
229
230class COIN_DLL_API SoShaderParameter4f : public SoUniformShaderParameter {
231 typedef SoUniformShaderParameter inherited;
232 SO_NODE_HEADER(SoShaderParameter4f);
233
234public:
235 SoSFVec4f value;
236
237 SoShaderParameter4f();
238
239 SoINTERNAL public:
240 static void initClass();
241 virtual void updateParameter(SoGLShaderObject *shaderObject);
242
243protected:
244 virtual ~SoShaderParameter4f();
245};
246
247/* **************************************************************************
248 * *** SoShaderParameter4i ***
249 * **************************************************************************/
250
251class COIN_DLL_API SoShaderParameter4i : public SoUniformShaderParameter {
252 typedef SoUniformShaderParameter inherited;
253 SO_NODE_HEADER(SoShaderParameter4i);
254
255public:
256 SoSFVec4i32 value;
257
258 SoShaderParameter4i();
259
260 SoINTERNAL public:
261 static void initClass();
262 virtual void updateParameter(SoGLShaderObject *shaderObject);
263
264protected:
265 virtual ~SoShaderParameter4i();
266};
267
268/* **************************************************************************
269 * *** SoShaderParameterArray1f ***
270 * **************************************************************************/
271
272class COIN_DLL_API SoShaderParameterArray1f : public SoUniformShaderParameter {
273 typedef SoUniformShaderParameter inherited;
274 SO_NODE_HEADER(SoShaderParameterArray1f);
275
276public:
277 SoMFFloat value;
278
279 SoShaderParameterArray1f();
280
281 SoINTERNAL public:
282 static void initClass();
283 virtual void updateParameter(SoGLShaderObject *shaderObject);
284
285protected:
286 virtual ~SoShaderParameterArray1f();
287};
288
289/* **************************************************************************
290 * *** SoShaderParameterArray1i ***
291 * **************************************************************************/
292
293class COIN_DLL_API SoShaderParameterArray1i : public SoUniformShaderParameter {
294 typedef SoUniformShaderParameter inherited;
295 SO_NODE_HEADER(SoShaderParameterArray1i);
296
297public:
298 SoMFInt32 value;
299
300 SoShaderParameterArray1i();
301
302 SoINTERNAL public:
303 static void initClass();
304 virtual void updateParameter(SoGLShaderObject *shaderObject);
305
306protected:
307 virtual ~SoShaderParameterArray1i();
308};
309
310/* **************************************************************************
311 * *** SoShaderParameterArray2f ***
312 * **************************************************************************/
313
314class COIN_DLL_API SoShaderParameterArray2f : public SoUniformShaderParameter {
315 typedef SoUniformShaderParameter inherited;
316 SO_NODE_HEADER(SoShaderParameterArray2f);
317
318public:
319 SoMFVec2f value;
320
321 SoShaderParameterArray2f();
322
323 SoINTERNAL public:
324 static void initClass();
325 virtual void updateParameter(SoGLShaderObject *shaderObject);
326
327protected:
328 virtual ~SoShaderParameterArray2f();
329};
330
331/* **************************************************************************
332 * *** SoShaderParameterArray2i ***
333 * **************************************************************************/
334class COIN_DLL_API SoShaderParameterArray2i : public SoUniformShaderParameter {
335 typedef SoUniformShaderParameter inherited;
336 SO_NODE_HEADER(SoShaderParameterArray2i);
337
338public:
339 SoMFVec2i32 value;
340
341 SoShaderParameterArray2i();
342
343 SoINTERNAL public:
344 static void initClass();
345 virtual void updateParameter(SoGLShaderObject *shaderObject);
346
347protected:
348 virtual ~SoShaderParameterArray2i();
349};
350
351/* **************************************************************************
352 * *** SoShaderParameterArray3f ***
353 * **************************************************************************/
354
355class COIN_DLL_API SoShaderParameterArray3f : public SoUniformShaderParameter {
356 typedef SoUniformShaderParameter inherited;
357 SO_NODE_HEADER(SoShaderParameterArray3f);
358
359public:
360 SoMFVec3f value;
361
362 SoShaderParameterArray3f();
363
364 SoINTERNAL public:
365 static void initClass();
366 virtual void updateParameter(SoGLShaderObject *shaderObject);
367
368protected:
369 virtual ~SoShaderParameterArray3f();
370};
371
372/* **************************************************************************
373 * *** SoShaderParameterArray3i ***
374 * **************************************************************************/
375
376class COIN_DLL_API SoShaderParameterArray3i : public SoUniformShaderParameter {
377 typedef SoUniformShaderParameter inherited;
378 SO_NODE_HEADER(SoShaderParameterArray3i);
379
380public:
381 SoMFVec3i32 value;
382
383 SoShaderParameterArray3i();
384
385 SoINTERNAL public:
386 static void initClass();
387 virtual void updateParameter(SoGLShaderObject *shaderObject);
388
389protected:
390 virtual ~SoShaderParameterArray3i();
391};
392
393/* **************************************************************************
394 * *** SoShaderParameterArray4f ***
395 * **************************************************************************/
396
397class COIN_DLL_API SoShaderParameterArray4f : public SoUniformShaderParameter {
398 typedef SoUniformShaderParameter inherited;
399 SO_NODE_HEADER(SoShaderParameterArray4f);
400
401public:
402 SoMFVec4f value;
403
404 SoShaderParameterArray4f();
405
406 SoINTERNAL public:
407 static void initClass();
408 virtual void updateParameter(SoGLShaderObject *shaderObject);
409
410protected:
411 virtual ~SoShaderParameterArray4f();
412
413};
414
415/* **************************************************************************
416 * *** SoShaderParameterArray4i ***
417 * **************************************************************************/
418
419class COIN_DLL_API SoShaderParameterArray4i : public SoUniformShaderParameter {
420 typedef SoUniformShaderParameter inherited;
421 SO_NODE_HEADER(SoShaderParameterArray4i);
422
423public:
424 SoMFVec4i32 value;
425
426 SoShaderParameterArray4i();
427
428 SoINTERNAL public:
429 static void initClass();
430 virtual void updateParameter(SoGLShaderObject *shaderObject);
431
432protected:
433 virtual ~SoShaderParameterArray4i();
434};
435
436/* **************************************************************************
437 * *** SoShaderParameterMatrix ***
438 * **************************************************************************/
439
440class COIN_DLL_API SoShaderParameterMatrix : public SoUniformShaderParameter {
441 typedef SoUniformShaderParameter inherited;
442 SO_NODE_HEADER(SoShaderParameterMatrix);
443
444public:
445 SoSFMatrix value;
446
447 SoShaderParameterMatrix();
448
449 SoINTERNAL public:
450 static void initClass();
451 virtual void updateParameter(SoGLShaderObject *shaderObject);
452
453protected:
454 virtual ~SoShaderParameterMatrix();
455};
456
457/* **************************************************************************
458 * *** SoShaderParameterMatrixArray ***
459 * **************************************************************************/
460
461class COIN_DLL_API SoShaderParameterMatrixArray : public SoUniformShaderParameter {
462 typedef SoUniformShaderParameter inherited;
463 SO_NODE_HEADER(SoShaderParameterMatrixArray);
464
465public:
466 SoMFMatrix value;
467
468 SoShaderParameterMatrixArray();
469
470 SoINTERNAL public:
471 static void initClass();
472 virtual void updateParameter(SoGLShaderObject *shaderObject);
473
474protected:
475 virtual ~SoShaderParameterMatrixArray();
476};
477
478/* **************************************************************************
479 * *** SoShaderStateMatrixParameter ***
480 * **************************************************************************/
481
482class COIN_DLL_API SoShaderStateMatrixParameter : public SoUniformShaderParameter {
483 typedef SoUniformShaderParameter inherited;
484 SO_NODE_HEADER(SoShaderStateMatrixParameter);
485
486public:
487
488 enum MatrixType {
489 MODELVIEW,
490 PROJECTION,
491 TEXTURE,
492 MODELVIEW_PROJECTION
493 };
494
495 enum MatrixTransform{
496 IDENTITY,
497 TRANSPOSE,
498 INVERSE,
499 INVERSE_TRANSPOSE
500 };
501
502 SoSFEnum matrixType;
503 SoSFEnum matrixTransform;
504
505 SoShaderStateMatrixParameter();
506 virtual ~SoShaderStateMatrixParameter();
507
508 static void initClass(void);
509 virtual void updateParameter(SoGLShaderObject *shaderObject);
510};
511
512#endif /* ! COIN_SOSHADERPARAMETER_H */
The SoMFFloat class is a container for floating point values.
Definition SoMFFloat.h:30
The SoMFInt32 class is a container for 32-bit integer values.
Definition SoMFInt32.h:30
The SoMFMatrix class is a container for SbMatrix values.
Definition SoMFMatrix.h:31
The SoMFVec2f class is a container for SbVec2f vectors.
Definition SoMFVec2f.h:31
The SoMFVec2i32 class is a container for SbVec2i32 vectors.
Definition SoMFVec2i32.h:31
The SoMFVec3f class is a container for SbVec3f vectors.
Definition SoMFVec3f.h:31
The SoMFVec3i32 class is a container for SbVec3i32 vectors.
Definition SoMFVec3i32.h:31
The SoMFVec4f class is a container for SbVec4f vectors.
Definition SoMFVec4f.h:31
The SoMFVec4i32 class is a container for SbVec4i32 vectors.
Definition SoMFVec4i32.h:31
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:47
The SoSFEnum class is a container for an enum value.
Definition SoSFEnum.h:31
The SoSFFloat class is a container for a floating point value.
Definition SoSFFloat.h:30
The SoSFInt32 class is a container for a 32-bit integer value.
Definition SoSFInt32.h:30
The SoSFMatrix class is a container for an SbMatrix.
Definition SoSFMatrix.h:31
The SoSFString class is a container for an SbString.
Definition SoSFString.h:31
The SoSFVec2f class is a container for an SbVec2f vector.
Definition SoSFVec2f.h:31
The SoSFVec2i32 class is a container for an SbVec2i32 vector.
Definition SoSFVec2i32.h:31
The SoSFVec3f class is a container for an SbVec3f vector.
Definition SoSFVec3f.h:31
The SoSFVec3i32 class is a container for an SbVec3i32 vector.
Definition SoSFVec3i32.h:31
The SoSFVec4f class is a container for an SbVec4f vector.
Definition SoSFVec4f.h:31
The SoSFVec4i32 class is a container for an SbVec4i32 vector.
Definition SoSFVec4i32.h:31
Definition SoShaderParameter.h:64
#define SO_NODE_ABSTRACT_HEADER(classname)
Definition macros.dox:54
#define SO_NODE_HEADER(classname)
Definition macros.dox:43

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

Generated on Wed Jul 17 2024 for Coin by Doxygen 1.12.0.