H3D API
2.4.1
|
The NurbsCurve node is a geometry node defining a parametric curve in 3D space. More...
#include <H3D/NurbsCurve.h>
Classes | |
class | DisplayList |
Display list is extended in order to set color to emissive color from material outside of display list, since we have to do a glGet to get the value. More... | |
class | SFBound |
SFBound is specialized to update from the SFBound fields routed to it. More... | |
Public Types | |
typedef DependentSFNode< X3DCoordinateNode, FieldRef< X3DGeometricPropertyNode, Field, &X3DCoordinateNode::propertyChanged > > | SFCoordinateNode |
SFCoordinateNode is dependent on coordChanged field in X3DCoordinateNode. | |
![]() | |
typedef std::map< Node *, Node * > | DeepCopyMap |
A map type used during a deep copy clone() to map from original nodes to cloned nodes. | |
Public Member Functions | |
NurbsCurve (Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< DisplayList > _displayList=0, Inst< MFBool > _isTouched=0, Inst< MFVec3f > _force=0, Inst< MFVec3f > _contactPoint=0, Inst< MFVec3f > _contactNormal=0, Inst< SFCoordinateNode > _controlPoint=0, Inst< SFInt32 > _tessellation=0, Inst< MFDouble > _weight=0, Inst< MFDouble > _knot=0, Inst< SFInt32 > _order=0, Inst< SFBool > _closed=0) | |
Constructor. | |
virtual void | render () |
Render the NurbsCurve with OpenGL. | |
![]() | |
X3DParametricGeometryNode (Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< DisplayList > _displayList=0, Inst< MFBool > _isTouched=0, Inst< MFVec3f > _force=0, Inst< MFVec3f > _contactPoint=0, Inst< MFVec3f > _contactNormal=0) | |
Constructor. | |
![]() | |
X3DGeometryNode (Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< DisplayList > _displayList=0, Inst< MFBool > _isTouched=0, Inst< MFVec3f > _force=0, Inst< MFVec3f > _contactPoint=0, Inst< MFVec3f > _contactNormal=0, Inst< MFVec3f > _contactTexCoord=0, Inst< SFBoundTree > _boundTree=0, Inst< SFVec3f > _centerOfMass=0) | |
Constructor. | |
virtual void | traverseSG (TraverseInfo &ti) |
Traverse the scenegraph. More... | |
virtual bool | lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result) |
Detect intersection between a line segment and this geometry. More... | |
virtual void | closestPoint (const Vec3f &p, NodeIntersectResult &result) |
Find closest point on this geometry to point p. More... | |
virtual bool | movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result) |
Detect collision between a moving sphere and the geometry. More... | |
virtual void | glRender () |
Function overridden from HAPIGLShape. More... | |
virtual H3DShadowObjectNode * | getShadowObject () |
Get the H3DShadowObjectNode used to create a shadow volume for this geometry. More... | |
void | useCulling (bool enabled) |
This function should be used by the render() function to disable or enable face culling. More... | |
bool | usingCulling () |
Returns if face culling is in use or not. | |
void | allowCulling (bool allow) |
Control if face culling is allowed or not. More... | |
void | useBackFaceCulling (bool enabled) |
Enabling/disabling back face culling. More... | |
bool | allowingCulling () |
Returns true if back face culling is allowed, false otherwise. | |
void | setCullFace (GLenum face) |
Set which side of a polygon to cull. More... | |
GLenum | getCullFace () |
Get which face will be culled if culling is enabled. | |
template<class OptionNodeType > | |
void | getOptionNode (OptionNodeType *&option) |
Get the first option node of the type of the pointer given as argument from the renderOptions fieeld The option argument will contain the node afterwards, or NULL if no option of that type exists. | |
int | getHapticShapeId (unsigned int index) |
Get a shape id to be used for rendering of this geometry with HLAPI for the given haptics device. More... | |
virtual | ~X3DGeometryNode () |
Destructor. | |
HAPI::HAPIHapticShape * | getOpenGLHapticShape (unsigned int hd_index, H3DSurfaceNode *_surface, const Matrix4f &_transform, int _nr_vertices=-1) |
Returns a either a HLFeedbackShape or a HLDepthBufferShape with the X3DGeometryNode. More... | |
virtual string | defaultXMLContainerField () |
Returns the default xml containerField attribute value. More... | |
virtual bool | supportsTangentAttributes () |
Returns true if this geometry supports the automatic generation of tangents and binormals as FloatVertexAttribues(needed by e.g. More... | |
virtual void | getBound (HAPI::Vec3 ¢er, HAPI::Vec3 &size) |
Overriden from HAPIGLShape to use the bound field in he X3DGeometryNode. More... | |
virtual void | initialize () |
Changes behaviour of X3DGeometryNode to be a thread safe RefCountedClass. | |
![]() | |
X3DChildNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
![]() | |
X3DNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
X3DMetadataObject * | getMetadataByName (const string &_name) |
Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More... | |
![]() | |
Node () | |
Constructor. | |
virtual Node * | clone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL) |
Returns a new instance of this node type with the same state as this one. More... | |
virtual | ~Node () |
Destructor. | |
X3DPrototypeInstance * | getProtoInstanceParent () |
If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More... | |
void | setProtoInstanceParent (X3DPrototypeInstance *p) |
Set the X3DPrototypeInstance this node is the the root node if applicaple. | |
virtual Field * | getField (const string &_name) const |
return a pointer to the field specified by name within this instance | |
int | addDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
int | removeDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
![]() | |
H3DBoundedObject (Inst< SFBound > _bound=0) | |
Constructor. | |
![]() | |
H3DDisplayListObject (Inst< DisplayList > _displayList=0) | |
Constructor. | |
Public Attributes | |
H3DUniquePtr< SFInt32 > | tessellation |
The tessellation field gives a hint to the curve tessellator by setting an absolute number of subdivision steps. More... | |
H3DUniquePtr< MFDouble > | weight |
A weight value that shall be greater than zero is assigned to each controlPoint. More... | |
H3DUniquePtr< MFDouble > | knot |
Specifies the knots of the curve. More... | |
H3DUniquePtr< SFInt32 > | order |
Defines the order of curve. More... | |
H3DUniquePtr< SFBool > | closed |
closed define whether or not to evaluate the curve as closed. More... | |
H3DUniquePtr< SFCoordinateNode > | controlPoint |
The controlPoint field. More... | |
![]() | |
H3DUniquePtr< MFBool > | isTouched |
Tells if a HapticsDevice has been in contact with the geometry in the last scenegraph loop. More... | |
H3DUniquePtr< MFVec3f > | force |
The last force delivered by this geometry to the haptics device. More... | |
H3DUniquePtr< MFVec3f > | contactPoint |
The last contact points of the HapticDevices on the geometry. More... | |
H3DUniquePtr< MFVec3f > | contactTexCoord |
The texture coordinate of last the contact points of the HapticDevices on the geometry. More... | |
H3DUniquePtr< MFVec3f > | contactNormal |
The normal at the last contact points of the HapticDevices on the geometry. More... | |
H3DUniquePtr< SFVec3f > | centerOfMass |
The field contains center of mass for the object, based on its bounding box. More... | |
H3DUniquePtr< SFBoundTree > | boundTree |
Contains a tree of the HAPI::GeometryPrimitives that build up the X3DGeometryNode. More... | |
H3DUniquePtr< MFOptionsNode > | options |
Contains nodes with options for haptics and graphics rendering. More... | |
![]() | |
H3DUniquePtr< SFNode > | metadata |
Meta data about the node. More... | |
![]() | |
H3DUniquePtr< SFBound > | bound |
The field containing the bound object. More... | |
![]() | |
H3DUniquePtr< DisplayList > | displayList |
The DisplayList instance handling the OpenGL caching of this object. | |
Static Public Attributes | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Protected Attributes | |
H3DUniquePtr< Field > | printWarning |
A field used to check if a warning should be printed. More... | |
![]() | |
AutoRef< Node > | shadow_volume |
The shadow volume used for this geometry when shadows enabled. More... | |
vector< pair< int, pair< Matrix4f, H3DTime > > > | haptic_shape_ids |
identifiers for the shapes geometry. | |
Additional Inherited Members | |
![]() | |
static unsigned int | nrNodesAlive () |
Returns the nr of nodes currently alive, i.e. nodes created but not destructed. | |
static int | nrNodesCreated () |
Returns the number of nodes created in total since the start of the program. | |
![]() | |
void | cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for the clone() method. More... | |
![]() | |
static void | cleanUpFunction (void *userdata) |
Function sent to HAPIHapticsShape created to allow for deletion of X3DGeometryNode at the correct time. More... | |
![]() | |
static Node * | getClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for nodes that implement clone() More... | |
The NurbsCurve node is a geometry node defining a parametric curve in 3D space.
The tessellation field gives a hint to the curve tessellator by setting an absolute number of subdivision steps. These values shall be greater than or equal to the Order field. A value of 0 indicates that the browser choose a suitable tessellation. Interpretation of values below 0 is implementation dependent.
For an implementation subdividing the surface into an equal number of subdivision steps, tessellation values are interpreted as follows:
For implementations doing tessellations based on chord length, tessellation values less than zero are interpreted as the maximum chord length deviation in pixels. Implementations doing fully automatic tessellation may ignore the tessellation hint parameters.
Examples:
H3DUniquePtr< SFBool > H3D::NurbsCurve::closed |
closed define whether or not to evaluate the curve as closed.
Access type: inputOutput
Default value: FALSE
Referenced by NurbsCurve().
H3DUniquePtr< SFCoordinateNode > H3D::NurbsCurve::controlPoint |
H3DUniquePtr< MFDouble > H3D::NurbsCurve::knot |
Specifies the knots of the curve.
Access type: inputOutput
Referenced by NurbsCurve(), and render().
H3DUniquePtr< SFInt32 > H3D::NurbsCurve::order |
Defines the order of curve.
From a mathematical point of view, the curve is defined by a polynomial of the degree order=1. The value of order shall be greater than or equal to 2. An implementation may limit order to a certain number. If it does so, then a warning shall be generated and the surface not displayed. An implementation shall at least support orders 2,3 and 4. The number of control points shall be at least equal to the order of the curve. The order defines the number of adjacent control points that influence a given control point.
Access type: inputOutput
Default value: 3
Referenced by NurbsCurve(), and render().
|
protected |
A field used to check if a warning should be printed.
C++ internal field only.
Referenced by NurbsCurve(), and render().
H3DUniquePtr< SFInt32 > H3D::NurbsCurve::tessellation |
The tessellation field gives a hint to the curve tessellator by setting an absolute number of subdivision steps.
These values shall be greater than or equal to the Order field. The tessellation values are interpreted as follows:
Access type: inputOutput
Default value: 0
Referenced by NurbsCurve(), and render().
H3DUniquePtr< MFDouble > H3D::NurbsCurve::weight |
A weight value that shall be greater than zero is assigned to each controlPoint.
The ordering of the values is equivalent to the ordering of the control point values. The number of values shall be identical to the number of control points. If the length of the weight vector is 0, the default weight 1.0 is assumed for each control point, thus defining a non-Rational curve. If the number of weight values is less than the number of control points, all weight values shall be ignored and a value of 1.0 shall be used.
Access type: inputOutput
Referenced by NurbsCurve(), and render().