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

SoTextureCoordinateElement.h
1#ifndef COIN_SOTEXTURECOORDINATEELEMENT_H
2#define COIN_SOTEXTURECOORDINATEELEMENT_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/SbVec2f.h>
29#include <Inventor/SbVec3f.h>
30#include <Inventor/SbVec4f.h>
31
32/*
33 * TODO
34 * - conversion between 2D and 4D (like Open Inventor)
35 */
36
37typedef const SbVec4f & SoTextureCoordinateFunctionCB(void * userdata,
38 const SbVec3f & point,
39 const SbVec3f & normal);
40
41class COIN_DLL_API SoTextureCoordinateElement : public SoReplacedElement {
43
44 SO_ELEMENT_HEADER(SoTextureCoordinateElement);
45public:
46 static void initClass(void);
47protected:
49
50public:
51
52 enum CoordType {
53 NONE = 0,
54 TEXGEN = 0,
55 EXPLICIT = 1,
56 FUNCTION = 2,
57 DEFAULT = 3
58 };
59
60 virtual void init(SoState * state);
61
62 static void setDefault(SoState * const state, SoNode * const node);
63 static void setFunction(SoState * const state, SoNode * const node,
64 SoTextureCoordinateFunctionCB * const func,
65 void * const userdata);
66
67 static void set2(SoState * const state, SoNode * const node,
68 const int32_t numCoords, const SbVec2f * const coords);
69 static void set3(SoState * const state, SoNode * const node,
70 const int32_t numCoords, const SbVec3f * const coords);
71 static void set4(SoState * const state, SoNode * const node,
72 const int32_t numCoords, const SbVec4f * const coords);
73
74 static CoordType getType(SoState * const state);
75 virtual CoordType getType(void) const;
76
77 static const SoTextureCoordinateElement *getInstance(SoState * const state);
78
79 const SbVec4f &get(const SbVec3f & point,
80 const SbVec3f & normal) const;
81 int32_t getNum(void) const;
82 SbBool is2D(void) const;
83 int32_t getDimension(void) const;
84
85 const SbVec2f &get2(const int index) const;
86 const SbVec3f &get3(const int index) const;
87 const SbVec4f &get4(const int index) const;
88
89 const SbVec2f *getArrayPtr2(void) const;
90 const SbVec3f *getArrayPtr3(void) const;
91 const SbVec4f *getArrayPtr4(void) const;
92
93protected:
95 SoTextureCoordinateFunctionCB *funcCB;
97 int32_t numCoords;
105};
106
107#endif // !COIN_SOTEXTURECOORDINATEELEMENT_H
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition SbVec2f.h:39
The SbVec3f class is a 3 dimensional vector with floating point coordinates.
Definition SbVec3f.h:40
The SbVec4f class is a 4 dimensional vector with floating point coordinates.
Definition SbVec4f.h:40
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:47
The SoReplacedElement class is an abstract element superclass.
Definition SoReplacedElement.h:30
virtual void init(SoState *state)
Definition SoReplacedElement.cpp:79
The SoState class manages the Coin scenegraph traversal state data.
Definition SoState.h:35
The SoTextureCoordinateElement class is yet to be documented.
Definition SoTextureCoordinateElement.h:41
const SbVec4f * coords4
Definition SoTextureCoordinateElement.h:100
CoordType whatKind
Definition SoTextureCoordinateElement.h:94
const SbVec2f * coords2
Definition SoTextureCoordinateElement.h:98
CoordType
Definition SoTextureCoordinateElement.h:52
SbBool coordsDimension
Definition SoTextureCoordinateElement.h:101
const SbVec3f * coords3
Definition SoTextureCoordinateElement.h:99
void * funcCBData
Definition SoTextureCoordinateElement.h:96
SbVec2f convert2
Definition SoTextureCoordinateElement.h:102
SbVec4f convert4
Definition SoTextureCoordinateElement.h:104
int32_t numCoords
Definition SoTextureCoordinateElement.h:97
SoTextureCoordinateFunctionCB * funcCB
Definition SoTextureCoordinateElement.h:95
SbVec3f convert3
Definition SoTextureCoordinateElement.h:103

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

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