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

SoMultiTextureCoordinateElement.h
1 #ifndef COIN_SOMULTITEXTURECOORDINATEELEMENT_H
2 #define COIN_SOMULTITEXTURECOORDINATEELEMENT_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/SoTextureCoordinateElement.h>
28 #include <Inventor/elements/SoSubElement.h>
29 #include <Inventor/SbVec2f.h>
30 #include <Inventor/SbVec3f.h>
31 #include <Inventor/SbVec4f.h>
32 
33 class SoMultiTextureCoordinateElementP;
34 
35 class COIN_DLL_API SoMultiTextureCoordinateElement : public SoElement {
36  typedef SoElement inherited;
37 
38  SO_ELEMENT_HEADER(SoMultiTextureCoordinateElement);
39 public:
40  static void initClass(void);
41 protected:
42  virtual ~SoMultiTextureCoordinateElement();
43 
44 public:
45 
46  virtual void init(SoState * state);
47 
48  static void setDefault(SoState * const state, SoNode * const node, const int unit);
49  static void setFunction(SoState * const state, SoNode * const node,
50  const int unit,
51  SoTextureCoordinateFunctionCB * const func,
52  void * const userdata);
53 
54  static void set2(SoState * const state, SoNode * const node,
55  const int unit,
56  const int32_t numCoords, const SbVec2f * const coords);
57  static void set3(SoState * const state, SoNode * const node,
58  const int unit,
59  const int32_t numCoords, const SbVec3f * const coords);
60  static void set4(SoState * const state, SoNode * const node,
61  const int unit,
62  const int32_t numCoords, const SbVec4f * const coords);
63 
64  static SoTextureCoordinateElement::CoordType getType(SoState * const state, const int unit);
65  virtual SoTextureCoordinateElement::CoordType getType(const int unit) const;
66 
67  static const SoMultiTextureCoordinateElement * getInstance(SoState * const state);
68 
69  const SbVec4f & get(const int unit,
70  const SbVec3f & point,
71  const SbVec3f & normal) const;
72 
73  int32_t getNum(const int unit) const;
74  SbBool is2D(const int unit) const;
75  int32_t getDimension(const int unit) const;
76 
77  const SbVec2f & get2(const int unit, const int index) const;
78  const SbVec3f & get3(const int unit, const int index) const;
79  const SbVec4f & get4(const int unit, const int index) const;
80 
81  const SbVec2f * getArrayPtr2(const int unit) const;
82  const SbVec3f * getArrayPtr3(const int unit) const;
83  const SbVec4f * getArrayPtr4(const int unit) const;
84 
85  class UnitData {
86  public:
87  uint32_t nodeid;
89  SoTextureCoordinateFunctionCB * funcCB;
90  void * funcCBData;
91  int32_t numCoords;
92  const SbVec2f * coords2;
93  const SbVec3f * coords3;
94  const SbVec4f * coords4;
95  int coordsDimension;
96  };
97 
98  virtual void push(SoState * state);
99  virtual SbBool matches(const SoElement * elem) const;
100  SoElement * copyMatchInfo(void) const;
101 
102 protected:
103  UnitData & getUnitData(const int unit);
104  const UnitData & getUnitData(const int unit) const;
105  SbVec2f convert2;
106  SbVec3f convert3;
107  SbVec4f convert4;
108 
109 private:
110  SoMultiTextureCoordinateElementP * pimpl;
111 };
112 
113 #endif // !COIN_SOMULTITEXTURECOORDINATEELEMENT_H
The SbVec2f class is a 2 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec2f.h:39
The SbVec4f class is a 4 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec4f.h:40
static void initClass(void)
Definition: SoElement.cpp:507
virtual SbBool matches(const SoElement *element) const =0
Definition: SoElement.cpp:609
virtual void push(SoState *state)
Definition: SoElement.cpp:570
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 is the abstract base class for all elements.
Definition: SoElement.h:34
The SoState class manages the Coin scenegraph traversal state data.The SoState class is used by actio...
Definition: SoState.h:35
virtual void init(SoState *state)
Definition: SoElement.cpp:553
The SbVec3f class is a 3 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec3f.h:40
virtual SoElement * copyMatchInfo(void) const =0
CoordType
Definition: SoTextureCoordinateElement.h:52

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

Generated on Wed Feb 7 2018 for Coin by Doxygen 1.8.14.