H3D API  2.4.1
NurbsTextureCoordinate.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __NURBSTEXTURECOORDINATE_H__
30 #define __NURBSTEXTURECOORDINATE_H__
31 
33 #include <H3D/MFVec2f.h>
34 #include <H3D/MFFloat.h>
35 #include <H3D/SFInt32.h>
36 #include <H3D/MFDouble.h>
37 #include "GL/glew.h"
38 
39 namespace H3D {
40 
67  // according to the X3D standard NurbsTextureCoordinate should inherit
68  // from X3DNode so we cheat here to make it easier in
69  // NurbsTextureCoordinate.
70  class H3DAPI_API NurbsTextureCoordinate :
72  public:
73 
75  void renderTexForNurbs( GLUnurbsObj *nurbs_object );
76 
79  if(u_knots != NULL )
80  delete [] u_knots;
81  if(v_knots != NULL )
82  delete [] v_knots;
83  if(withWeights != NULL )
84  delete [] withWeights;}
85 
87  NurbsTextureCoordinate( Inst< SFNode > _metadata = 0,
88  Inst< MFVec2f > _controlPoint = 0,
89  Inst< MFFloat > _weight = 0,
90  Inst< SFInt32 > _uDimension = 0,
91  Inst< SFInt32 > _vDimension = 0,
92  Inst< MFDouble > _uKnot = 0,
93  Inst< MFDouble > _vKnot = 0,
94  Inst< SFInt32 > _uOrder = 0,
95  Inst< SFInt32 > _vOrder = 0 );
96 
100  virtual string defaultXMLContainerField() {
101  return "texCoord";
102  }
103 
115  H3DUniquePtr< MFVec2f > controlPoint;
116 
129  H3DUniquePtr< MFFloat > weight;
130 
137  H3DUniquePtr< SFInt32 > uDimension;
138 
145  H3DUniquePtr< SFInt32 > vDimension;
146 
152  H3DUniquePtr< MFDouble > uKnot;
153 
159  H3DUniquePtr< MFDouble > vKnot;
160 
167  H3DUniquePtr< SFInt32 > uOrder;
168 
175  H3DUniquePtr< SFInt32 > vOrder;
176 
179 
180  protected:
181  // Used for temporary storage.
182  GLfloat * withWeights;
183  GLfloat * u_knots;
184  GLfloat * v_knots;
185  };
186 }
187 
188 #endif
Contains the MFDouble field class.
Contains the MFFloat field class.
Contains the MFVec2f field class.
Contains the SFInt32 field class.
Header file for X3DGeometricPropertyNode, X3D scene-graph node.
The NurbsTextureCoordinate node is a NURBS surface existing in the parametric domain of its surface h...
Definition: NurbsTextureCoordinate.h:71
H3DUniquePtr< MFVec2f > controlPoint
controlPoint defines a set of control points of dimension uDimension x vDimension.
Definition: NurbsTextureCoordinate.h:115
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: NurbsTextureCoordinate.h:178
H3DUniquePtr< SFInt32 > uDimension
Defines the number of control points in the u dimension.
Definition: NurbsTextureCoordinate.h:137
H3DUniquePtr< SFInt32 > vOrder
Defines the order of the surface in the v dimension.
Definition: NurbsTextureCoordinate.h:175
virtual string defaultXMLContainerField()
Returns the default xml containerField attribute value.
Definition: NurbsTextureCoordinate.h:100
H3DUniquePtr< MFDouble > uKnot
Defines the knot values of the surface in the u dimension.
Definition: NurbsTextureCoordinate.h:152
H3DUniquePtr< SFInt32 > uOrder
Defines the order of the surface in the u dimension.
Definition: NurbsTextureCoordinate.h:167
H3DUniquePtr< MFFloat > weight
A weight value that shall be greater than zero is assigned to each controlPoint.
Definition: NurbsTextureCoordinate.h:129
~NurbsTextureCoordinate()
Destructor.
Definition: NurbsTextureCoordinate.h:78
H3DUniquePtr< MFDouble > vKnot
Defines the knot values of the surface in the v dimension.
Definition: NurbsTextureCoordinate.h:159
H3DUniquePtr< SFInt32 > vDimension
Defines the number of control points in the v dimension.
Definition: NurbsTextureCoordinate.h:145
This is the base node type for all geometric property node types defined in X3D.
Definition: X3DGeometricPropertyNode.h:43
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194