H3D API  2.4.1
NurbsCurve.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 __NURBSCURVE_H__
30 #define __NURBSCURVE_H__
31 
34 #include <H3D/SFInt32.h>
35 #include <H3D/MFDouble.h>
36 #include <H3D/SFBool.h>
37 #include <H3D/X3DCoordinateNode.h>
38 #include <H3D/X3DBoundedObject.h>
39 
40 namespace H3D {
41 
78  class H3DAPI_API NurbsCurve :
80  public:
81 
86  Field,
89 
90 
100  class H3DAPI_API SFBound:
101  public TypedField< X3DBoundedObject::SFBound,
102  SFCoordinateNode > {
103  protected:
106  virtual void update();
107 
108  private:
109  friend class NurbsCurve;
110  };
111 
116  class H3DAPI_API DisplayList: public X3DGeometryNode::DisplayList {
117  public:
119  virtual void callList( bool build_list = true );
120  };
121 
123  NurbsCurve( Inst< SFNode > _metadata = 0,
124  Inst< SFBound > _bound = 0,
125  Inst< DisplayList > _displayList = 0,
126  Inst< MFBool > _isTouched = 0,
127  Inst< MFVec3f > _force = 0,
128  Inst< MFVec3f > _contactPoint = 0,
129  Inst< MFVec3f > _contactNormal = 0,
130  Inst< SFCoordinateNode > _controlPoint = 0,
131  Inst< SFInt32 > _tessellation = 0,
132  Inst< MFDouble > _weight = 0,
133  Inst< MFDouble > _knot = 0,
134  Inst< SFInt32 > _order = 0,
135  Inst< SFBool > _closed = 0 );
136 
137 
139  virtual void render();
140 
159  H3DUniquePtr< SFInt32 > tessellation;
160 
173  H3DUniquePtr< MFDouble > weight;
174 
180  H3DUniquePtr< MFDouble > knot;
181 
195  H3DUniquePtr< SFInt32 > order;
196 
203  H3DUniquePtr< SFBool > closed;
204 
210  H3DUniquePtr< SFCoordinateNode > controlPoint;
211 
214 
215  protected:
216  GLUnurbsObj *theNurb;
219  H3DUniquePtr< Field > printWarning;
220  };
221 }
222 
223 #endif
Contains the DependentSFNode and DependentMFNode template classes.
Contains the MFDouble field class.
Contains the SFBool field class.
Contains the SFInt32 field class.
Header file for X3DBoundedObject.
Header file for X3DCoordinateNode, X3D scene-graph node.
Header file for X3DParametricGeometryNode, X3D scene-graph node.
DependentSFNode are modified TypedSFNode fields where the field dirty status is dependent on fields i...
Definition: DependentNodeFields.h:294
Class used for specifying a field member of a node in a DependentSFNode or DependentMFNode specificat...
Definition: DependentNodeFields.h:48
The Field class.
Definition: Field.h:46
Display list is extended in order to set color to emissive color from material outside of display lis...
Definition: NurbsCurve.h:116
SFBound is specialized to update from the SFBound fields routed to it.
Definition: NurbsCurve.h:102
The NurbsCurve node is a geometry node defining a parametric curve in 3D space.
Definition: NurbsCurve.h:79
H3DUniquePtr< MFDouble > knot
Specifies the knots of the curve.
Definition: NurbsCurve.h:180
H3DUniquePtr< MFDouble > weight
A weight value that shall be greater than zero is assigned to each controlPoint.
Definition: NurbsCurve.h:173
H3DUniquePtr< SFInt32 > order
Defines the order of curve.
Definition: NurbsCurve.h:195
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: NurbsCurve.h:213
H3DUniquePtr< SFInt32 > tessellation
The tessellation field gives a hint to the curve tessellator by setting an absolute number of subdivi...
Definition: NurbsCurve.h:159
DependentSFNode< X3DCoordinateNode, FieldRef< X3DGeometricPropertyNode, Field, &X3DCoordinateNode::propertyChanged > > SFCoordinateNode
SFCoordinateNode is dependent on coordChanged field in X3DCoordinateNode.
Definition: NurbsCurve.h:88
H3DUniquePtr< SFBool > closed
closed define whether or not to evaluate the curve as closed.
Definition: NurbsCurve.h:203
H3DUniquePtr< SFCoordinateNode > controlPoint
The controlPoint field.
Definition: NurbsCurve.h:210
H3DUniquePtr< Field > printWarning
A field used to check if a warning should be printed.
Definition: NurbsCurve.h:219
A template modifier class for adding type checking on the routes to any Field class.
Definition: TypedField.h:84
This is the base node type for all coordinate node types in X3D.
Definition: X3DCoordinateNode.h:47
This is the base node type for all geometric property node types defined in X3D.
Definition: X3DGeometricPropertyNode.h:43
H3DUniquePtr< Field > propertyChanged
Field that indicated whether the properties have changed.
Definition: X3DGeometricPropertyNode.h:53
Display list is extended in order to set front sidedness of triangles outside the display list.
Definition: X3DGeometryNode.h:76
This abstract node type is the base type for all geometry node types that are created parametrically ...
Definition: X3DParametricGeometryNode.h:44
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