H3D API
2.4.1
|
The IndexedLineSet node represents a 3D geometry formed by constructing polylines from 3D vertices specified in the coord field. More...
#include <H3D/IndexedLineSet.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 | InvalidColorIndex |
Thrown when the colorIndex field does not match the coordIndex field properly. More... | |
class | InvalidColorIndexSize |
Thrown when the colorIndex field's size does not match the coordIndex field properly. More... | |
class | MFVertexAttributeNode |
The MFVertexAttributeNode is dependent on the propertyChanged field of the contained X3DVertexAttributeNode. More... | |
Public Types | |
typedef DependentSFNode< X3DCoordinateNode, FieldRef< X3DGeometricPropertyNode, Field, &X3DCoordinateNode::propertyChanged > > | SFCoordinateNode |
SFCoordinateNode is dependent on coordChanged field in X3DCoordinateNode. | |
typedef DependentSFNode< X3DColorNode, FieldRef< X3DGeometricPropertyNode, Field, &X3DColorNode::propertyChanged > > | SFColorNode |
SFColorNode is dependent on colorChanged field in X3DColorNode. | |
typedef DependentSFNode< FogCoordinate, FieldRef< X3DGeometricPropertyNode, Field, &FogCoordinate::propertyChanged > > | SFFogCoordinate |
The SFFogCoordinate is dependent on the propertyChanged field of the contained FogCoordinate. | |
![]() | |
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 | |
IndexedLineSet (Inst< SFNode > _metadata=0, Inst< CoordBoundField > _bound=0, Inst< DisplayList > _displayList=0, Inst< MFInt32 > _set_colorIndex=0, Inst< MFInt32 > _set_coordIndex=0, Inst< SFColorNode > _color=0, Inst< SFCoordinateNode > _coord=0, Inst< MFInt32 > _colorIndex=0, Inst< SFBool > _colorPerVertex=0, Inst< MFInt32 > _coordIndex=0, Inst< SFFogCoordinate > _fogCoord=0, Inst< MFVertexAttributeNode > _attrib=0) | |
Constructor. | |
virtual int | nrLines () |
The number of lines rendered by this geometry. | |
virtual void | render () |
Render the IndexedLineSet with OpenGL. | |
virtual bool | movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result) |
Detect collision between a moving sphere and the geometry. More... | |
![]() | |
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 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< MFInt32 > | set_colorIndex |
Field for setting the value of the colorIndex field. More... | |
H3DUniquePtr< MFInt32 > | set_coordIndex |
Field for setting the value of the coordIndex field. More... | |
H3DUniquePtr< SFColorNode > | color |
Contains an X3DColorNode which colors are applied to the X3DComposedGeometryNode. More... | |
H3DUniquePtr< SFCoordinateNode > | coord |
The coord field specifies the 3D vertices of the line set and contains a X3DCoordinateNode. More... | |
H3DUniquePtr< MFInt32 > | colorIndex |
Indices into the color field. More... | |
H3DUniquePtr< SFBool > | colorPerVertex |
If TRUE the colors in the color field are applied per vertex, otherwise it is applied per polyline. More... | |
H3DUniquePtr< MFInt32 > | coordIndex |
Indices into the coord field. More... | |
H3DUniquePtr< SFFogCoordinate > | fogCoord |
If the fogCoord field is not empty, it shall contain a list of per-vertex depth values for calculating fog depth. More... | |
H3DUniquePtr< MFVertexAttributeNode > | attrib |
If the attrib field is not empty it shall contain a list of X3DVertexAttributeNode instances with per-vertex attribute information for programmable shaders. 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 instance for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Protected Attributes | |
H3DUniquePtr< Field > | vboFieldsUpToDate |
Internal field used to know if vertex buffer object can be created. 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 IndexedLineSet node represents a 3D geometry formed by constructing polylines from 3D vertices specified in the coord field.
IndexedLineSet uses the indices in its coordIndex field to specify the polylines by connecting vertices from the coord field. An index of "-1" indicates that the current polyline has ended and the next one begins. The last polyline may be (but does not have to be) followed by a "-1". IndexedLineSet is specified in the local coordinate system and is affected by the transformations of its ancestors.
The coord field specifies the 3D vertices of the line set and contains a X3DCoordinateNode.
Lines are not lit, are not texture-mapped, and do not participate in collision detection. The width of lines is implementation dependent and each line segment is solid (i.e., not dashed).
If the color field is not NULL, it shall contain a Color node. The colours are applied to the line(s) as follows:
If colorPerVertex is FALSE:
If the color field is NULL and there is a Material defined for the Appearance affecting this IndexedLineSet, the emissiveColor of the Material shall be used to draw the lines.
Examples:
|
virtual |
Detect collision between a moving sphere and the geometry.
radius | The radius of the sphere |
from | The start position of the sphere |
to | The end position of the sphere. |
result | A struct containing various results of intersections such as which geometries intersected the moving sphere. |
Reimplemented from H3D::X3DGeometryNode.
H3DUniquePtr< MFVertexAttributeNode > H3D::IndexedLineSet::attrib |
If the attrib field is not empty it shall contain a list of X3DVertexAttributeNode instances with per-vertex attribute information for programmable shaders.
Access type: inputOutput
Referenced by IndexedLineSet(), and render().
H3DUniquePtr< SFColorNode > H3D::IndexedLineSet::color |
Contains an X3DColorNode which colors are applied to the X3DComposedGeometryNode.
If the color field is NULL and there is a Material defined for the Appearance affecting this IndexedLineSet, the emissiveColor of the Material shall be used to draw the lines. If a color is not NULL colors are applied as described in the detailed description Access type: inputOutput
Referenced by H3D::IndexedLineSet::DisplayList::callList(), IndexedLineSet(), and render().
H3DUniquePtr< MFInt32 > H3D::IndexedLineSet::colorIndex |
Indices into the color field.
See Detailed description for details on how it is used.
Access type: inputOutput
Value range: [0,inf) or -1
Referenced by IndexedLineSet(), and render().
H3DUniquePtr< SFBool > H3D::IndexedLineSet::colorPerVertex |
If TRUE the colors in the color field are applied per vertex, otherwise it is applied per polyline.
Access type: inputOutput
Default value: TRUE
Referenced by IndexedLineSet(), and render().
H3DUniquePtr< SFCoordinateNode > H3D::IndexedLineSet::coord |
The coord field specifies the 3D vertices of the line set and contains a X3DCoordinateNode.
Access type: inputOutput
Referenced by IndexedLineSet(), and render().
H3DUniquePtr< MFInt32 > H3D::IndexedLineSet::coordIndex |
Indices into the coord field.
See Detailed description for details on how it is used.
Access type: inputOutput
Value range: [0,inf) or -1
Referenced by IndexedLineSet(), and render().
H3DUniquePtr< SFFogCoordinate > H3D::IndexedLineSet::fogCoord |
If the fogCoord field is not empty, it shall contain a list of per-vertex depth values for calculating fog depth.
Access type: inputOutput
Referenced by IndexedLineSet(), and render().
H3DUniquePtr< MFInt32 > H3D::IndexedLineSet::set_colorIndex |
Field for setting the value of the colorIndex field.
Access type: inputOnly
Referenced by IndexedLineSet().
H3DUniquePtr< MFInt32 > H3D::IndexedLineSet::set_coordIndex |
Field for setting the value of the coordIndex field.
Access type: inputOnly
Referenced by IndexedLineSet().
|
protected |
Internal field used to know if vertex buffer object can be created.
C++ only field
Referenced by IndexedLineSet(), and render().