29 #ifndef __INDEXEDTRIANGLESET_H__
30 #define __INDEXEDTRIANGLESET_H__
101 Types< SFBool, SFCoordinateNode, MFInt32, SFBool > > {
104 virtual void update();
124 const vector< int > &index,
146 const vector< int > &index,
163 Types< SFBool, SFCoordinateNode, MFInt32, SFTextureCoordinateNode > > {
167 virtual void update();
175 virtual void generateTangentsPerVertex(
178 const vector< int > &index,
190 virtual void generateTangentsPerFace(
193 const vector< int > &index,
208 void calculateTangent(
const Vec3f &a,
const Vec3f &b,
const Vec3f &c,
209 const Vec3f &ta,
const Vec3f &tb,
const Vec3f &tc,
210 Vec3f &tangent, Vec3f &binormal );
216 virtual void onValueChange (
const H3DInt32 &new_value) {
218 if( new_value >= 0 ) {
231 IndexedTriangleSet( Inst< SFNode > _metadata = 0,
232 Inst< SFBound > _bound = 0,
233 Inst< DisplayList > _displayList = 0,
234 Inst< SFColorNode > _color = 0,
235 Inst< SFCoordinateNode > _coord = 0,
236 Inst< SFNormalNode > _normal = 0,
237 Inst< SFTextureCoordinateNode > _texCoord = 0,
238 Inst< SFBool > _ccw = 0,
239 Inst< SFBool > _colorPerVertex = 0,
240 Inst< SFBool > _normalPerVertex = 0,
241 Inst< SFBool > _solid = 0,
242 Inst< MFVertexAttributeNode > _attrib = 0,
243 Inst< AutoNormal > _autoNormal = 0,
244 Inst< MFInt32 > _set_index = 0,
245 Inst< MFInt32 > _index = 0,
246 Inst< SFFogCoordinate > _fogCoord = 0,
247 Inst< SFInt32InstanceCount > _instanceCount = 0 );
250 virtual ~IndexedTriangleSet();
254 virtual void traverseSG( TraverseInfo &ti );
257 virtual void render();
261 return index->size() / 3;
274 render_patches = _renderPatches;
279 return render_patches;
283 bool previous_allow = allowingCulling();
284 bool prev_draw = draw_debug_options;
285 allowCulling(
false );
286 draw_debug_options =
false;
287 bool prev_patches = getRenderPatches();
289 setRenderPatches(
false );
291 setRenderPatches( prev_patches );
293 displayList->callList(
false );
295 draw_debug_options = prev_draw;
296 allowCulling( previous_allow );
Header file for CoordBoundField, specialiced field class.
Contains the DependentSFNode and DependentMFNode template classes.
Header file for FloatVertexAttribute.
Contains the MFInt32 field class.
Contains the SFInt32 field class.
Header file for X3DColorNode, X3D scene-graph node.
Header file for X3DComposedGeometryNode, X3D scene-graph node.
Header file for X3DCoordinateNode, X3D scene-graph node.
The CoordBoundField is specialized update itself from a X3DCoordinateNode.
Definition: CoordBoundField.h:43
The FloatVertexAttribute node defines a set of per-vertex single precision floating point attributes.
Definition: FloatVertexAttribute.h:56
@ OFF
Caching is off.
Definition: H3DDisplayListObject.h:95
@ OPTIONS
Caching is depending on the GraphicalRenderingOptions in use.
Definition: H3DDisplayListObject.h:97
H3DUniquePtr< DisplayList > displayList
The DisplayList instance handling the OpenGL caching of this object.
Definition: H3DDisplayListObject.h:256
Specialized field for automatically generating normals from coordinates.
Definition: IndexedTriangleSet.h:101
Specialized field for automatically generating two FloatVertexAttribute nodes representing the tangen...
Definition: IndexedTriangleSet.h:163
Thrown if the number of colors in the color field is less than the number coordinates in the coord fi...
Definition: IndexedTriangleSet.h:83
Thrown if the number of texture coordinates in the color field is less than the number coordinates in...
Definition: IndexedTriangleSet.h:87
The IndexedTriangleSet node represents a 3D shape composed of a collection of individual triangles.
Definition: IndexedTriangleSet.h:78
virtual void glRender()
Function overridden from HAPIGLShape.
Definition: IndexedTriangleSet.h:282
H3DUniquePtr< MFInt32 > index
The index field is used to specify the vertices of each triangle from the coord field.
Definition: IndexedTriangleSet.h:327
H3DUniquePtr< Field > vboFieldsUpToDate
Internal field used to know if vertex buffer object can be created.
Definition: IndexedTriangleSet.h:358
bool getRenderPatches()
Returns true if rendering using patches for tessellation is enabled.
Definition: IndexedTriangleSet.h:278
H3DUniquePtr< MFInt32 > set_index
Field for setting the value of the index field.
Definition: IndexedTriangleSet.h:315
virtual int nrTriangles()
The number of triangles renderered in this geometry.
Definition: IndexedTriangleSet.h:260
virtual bool supportsTangentAttributes()
Returns true if this geometry supports the automatic generation of tangents and binormals as FloatVer...
Definition: IndexedTriangleSet.h:268
CoordBoundField SFBound
The bound field for IndexedFaceSet is a CoordBoundField.
Definition: IndexedTriangleSet.h:90
H3DUniquePtr< AutoTangent > autoTangent
Auto-generated vertex attributes for tangents and binormals.
Definition: IndexedTriangleSet.h:309
H3DUniquePtr< AutoNormal > autoNormal
Auto-generated normals that are used if the normal field is NULL.
Definition: IndexedTriangleSet.h:303
void setRenderPatches(bool _renderPatches)
Explicitly enable or disable the rendering of patches for tessellation.
Definition: IndexedTriangleSet.h:273
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: IndexedTriangleSet.h:343
bool render_tangents
This will be set to true in traverseSG if the render function is supposed to render tangent vertex at...
Definition: IndexedTriangleSet.h:347
H3DUniquePtr< SFInt32InstanceCount > instanceCount
If 0 or greater, then instanced rendering is used to render instanceCount instances of the mesh.
Definition: IndexedTriangleSet.h:340
bool render_patches
This will be set to true in traverseSG if the render function is supposed to render GL_PATCHES instea...
Definition: IndexedTriangleSet.h:354
Template for adding the virtual function onValueChange that can be overridden in subclasses in order ...
Definition: FieldTemplates.h:49
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 composed 3D geometry in X3D.
Definition: X3DComposedGeometryNode.h:93
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 normal node types in X3D.
Definition: X3DNormalNode.h:45
This abstract node type is the base type for all node types which specify texture coordinates.
Definition: X3DTextureCoordinateNode.h:55
H3D_VALUE_EXCEPTION(string, InvalidType)
An exception thrown when a field is of the wrong type when it is checked.
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