#include <ACG/Scenegraph/MeshNodeT.hh>


Public Member Functions | |
| ACG_CLASSNAME (MeshNode) | |
| MeshNodeT (Mesh &_mesh, BaseNode *_parent=0, std::string _name="<MeshNode>") | |
| Default constructor. | |
| virtual | ~MeshNodeT () |
| Destructor. | |
| void | update_geometry () |
| the geometry of the mesh has changed | |
| void | update_topology () |
| the topology of the mesh has changed | |
| void | update_color () |
| the colors of the mesh have changed | |
| void | set_property_map (std::map< int, std::string > *_map) |
general picking functions | |
| void | pick (GLState &_state, PickTarget _target) |
| Draws the object in picking mode. | |
Private Types | |
| typedef Mesh::Point | Point |
| typedef Point::value_type | PointScalar |
| typedef Mesh::Normal | Normal |
| typedef Normal::value_type | NormalScalar |
| typedef Mesh::Color | Color |
| typedef Color::value_type | ColorScalar |
Private Attributes | |
Strip generation and handling | |
| StripProcessorT< Mesh > | stripProcessor_ |
Vertex Buffer | |
| GLuint | vertexBuffer_ |
| Vertex buffer. | |
| bool | vertexBufferInitialized_ |
| Vertex buffer initialization flag. | |
| std::vector< ACG::Vec3f > | vertices_ |
| Internal buffer used when rendering non float vertex coordinates. | |
Line buffer | |
| std::vector< unsigned int > | lineIndices_ |
| Vector storing vertices for rendering all edges in the mesh. | |
| GLuint | lineIndexBuffer_ |
| Index buffer for lines. | |
| bool | lineIndexBufferInitialized_ |
| lineIndexBuffer initialization flag | |
Array control functions | |
|
| |
| enum | ArrayType { NONE = 0, VERTEX_ARRAY = 1, NORMAL_VERTEX_ARRAY = 2, COLOR_VERTEX_ARRAY = 4, TEXCOORD_VERTEX_ARRAY = 8, LINE_INDEX_ARRAY = 16, PER_EDGE_VERTEX_ARRAY = 32, PER_EDGE_COLOR_ARRAY = 64, PER_FACE_VERTEX_ARRAY = 128, PER_FACE_NORMAL_ARRAY = 256, PER_FACE_COLOR_ARRAY = 512, PER_FACE_TEXCOORD_ARRAY = 1024 } |
Enum controlling which array should be used for rendering. | |
| unsigned int | enabled_arrays_ |
| which arrays are currently enabled? | |
| void | enable_arrays (unsigned int _arrays) |
| enable/disable vertex arrays according to the bits in _arrays | |
Rendering functions | |
|
| |
| enum | FaceMode { PER_VERTEX, PER_FACE } |
| void | draw (GLState &_state, DrawModes::DrawMode _drawMode) |
| Draws the object. | |
| void | draw_vertices () |
| draws all vertices of the mesh | |
| void | draw_lines () |
| draws all edges of the mesh | |
| void | draw_faces (FaceMode _mode) |
| draws all faces of the mesh | |
| ACG::SceneGraph::DrawModes::DrawMode | availableDrawModes () const |
| return available draw modes | |
Mesh Handling | |
|
| |
| Mesh & | mesh_ |
| The mesh this node works on. | |
| const Mesh & | mesh () const |
| get the internal mesh | |
Bounding Box | |
|
| |
| Vec3d | bbMin_ |
| bounding box lower left corner | |
| Vec3d | bbMax_ |
| bounding box upper right corner | |
| void | boundingBox (Vec3d &_bbMin, Vec3d &_bbMax) |
| Current bounding box. | |
Normal Buffer | |
|
| |
| bool | enableNormals_ |
| Flag if normals should be used. | |
| GLuint | normalVertexBuffer_ |
| Normal buffer. | |
| bool | normalVertexBufferInitialized_ |
| normal buffer initialization flag | |
| std::vector< ACG::Vec3f > | normals_ |
| Internal buffer used when rendering non float normals. | |
| bool | normalsEnabled () |
| Returns if the normal array is currently activated. | |
| void | enableNormals (bool _enable) |
| Enable or disable the use of the normal array. | |
Color buffer | |
|
| |
| bool | enableColors_ |
| GLuint | colorVertexbuffer_ |
| color buffer | |
| bool | colorVertexBufferInitialized_ |
| normal buffer initialization flag | |
| std::vector< ACG::Vec4f > | colors_ |
| Internal buffer used when rendering non Vec4f colors. | |
| bool | colorsEnabled () |
| Returns if the color array is currently activated. | |
| void | enableColors (bool _enable) |
| Enable or disable the use of color array. | |
Texcoord buffer | |
|
| |
| bool | enableTexCoords_ |
| bool | texCoordEnabled () |
| Returns if the per vertex Texture coordinates array is currently activated. | |
| void | enableTexCoords (bool _enable) |
| Enable or disable the use of the per vertex Texture coordinates array. | |
vertex picking functions | |
|
| |
| bool | updateVertexPickingList_ |
| Flag indicating if the vertex picking display list has to be updates. | |
| unsigned int | vertexPickingBaseIndex_ |
| Index of the first vertex in vertexpicking. | |
| GLuint | vertexPickingList_ |
| Dispplay list for rendering vertex picking. | |
| void | pick_vertices (GLState &_state, bool _front=false) |
| Renders picking for vertices. | |
edge picking functions | |
|
| |
| bool | updateEdgePickingList_ |
| Flag indicating if the edge picking display list has to be updates. | |
| unsigned int | edgePickingBaseIndex_ |
| Index of the first edge in edgepicking. | |
| GLuint | edgePickingList_ |
| Dispplay list for rendering edge picking. | |
| void | pick_edges (GLState &_state, bool _front=false) |
| Renders picking for edges. | |
face picking functions | |
|
| |
| bool | updateFacePickingList_ |
| Flag indicating if the edge picking display list has to be updates. | |
| unsigned int | facePickingBaseIndex_ |
| Index of the first face in facepicking. | |
| GLuint | facePickingList_ |
| Dispplay list for rendering edge picking. | |
| void | pick_faces (GLState &_state) |
| Renders picking for faces. | |
anything picking functions | |
|
| |
| bool | updateAnyPickingList_ |
| Flag indicating if the any picking display list has to be updates. | |
| unsigned int | anyPickingBaseIndex_ |
| Index of the first face in anypicking. | |
| GLuint | anyPickingList_ |
| Dispplay list for rendering general picking. | |
| void | pick_any (GLState &_state) |
| Renders picking for all primitives. | |
Texture handling | |
|
| |
| bool | perFaceTextureIndexAvailable_ |
| This flag indicates if we have a per Face texture index property. | |
| bool | perFaceTextureCoordsAvailable_ |
| This flag indicates if we have a per Face texture coordinate property. | |
| std::map< int, GLuint > * | textureMap_ |
| Mapping of mesh face texture indices to gltexture id ( has to be provided externally ). | |
| void | setIndexPropertyName (std::string _indexPropertyName) |
| set the name of the property used for texture index specification | |
| void | setHalfedgeTextcoordPropertyName (std::string _halfedgeTextcoordPropertyName) |
| Set the name of the per face texture coordinate property. | |
| void | setTextureMap (std::map< int, GLuint > *_map) |
| Setup a mapping between internal texture ids on the mesh and the ids for the loaded textures in opengl. | |
This node draws a mesh using triangle strips.
Definition at line 75 of file MeshNode2T.cc.
typedef Mesh::Point ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::Point [private] |
Typedefs of the mesh representation
These typedefs are used to specifiy and convert all input to float for rendering
Definition at line 123 of file MeshNode2T.cc.
| ACG::SceneGraph::MeshNodeT< Mesh >::MeshNodeT | ( | Mesh & | _mesh, | |
| BaseNode * | _parent = 0, |
|||
| std::string | _name = "<MeshNode>" | |||
| ) | [inline] |
Default constructor.
The constructor needs a mesh on which this node will work.
Definition at line 68 of file MeshNode2T.cc.
| DrawModes::DrawMode ACG::SceneGraph::MeshNodeT< Mesh >::availableDrawModes | ( | ) | const [inline, private, virtual] |
return available draw modes
The drawmodes are constructed based on the mesh properties and the hardware capabilities of the system.
Reimplemented from ACG::SceneGraph::ACG::SceneGraph::BaseNode.
Definition at line 150 of file MeshNode2T.cc.
| void ACG::SceneGraph::MeshNodeT< Mesh >::boundingBox | ( | Vec3d & | _bbMin, | |
| Vec3d & | _bbMax | |||
| ) | [inline, virtual] |
Current bounding box.
This function returns the bounding box of the node.
Reimplemented from ACG::SceneGraph::ACG::SceneGraph::BaseNode.
Definition at line 201 of file MeshNode2T.cc.
References ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::bbMin_.
| void ACG::SceneGraph::MeshNodeT< Mesh >::draw | ( | GLState & | _state, | |
| DrawModes::DrawMode | _drawMode | |||
| ) | [inline, virtual] |
Draws the object.
Reimplemented from ACG::SceneGraph::ACG::SceneGraph::BaseNode.
Definition at line 209 of file MeshNode2T.cc.
| void ACG::SceneGraph::MeshNodeT< Mesh >::draw_faces | ( | FaceMode | _mode | ) | [inline, private] |
draws all faces of the mesh
TODO dont skip the face, draw without texture instead
TODO dont skip the face, draw without texture instead
Reimplemented in ACG::SceneGraph::TriStripNodeT< Mesh >.
Definition at line 481 of file MeshNode2T.cc.
Referenced by ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick_edges(), and ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick_vertices().
| void ACG::SceneGraph::MeshNodeT< Mesh >::draw_lines | ( | ) | [inline, private] |
draws all edges of the mesh
Definition at line 459 of file MeshNode2T.cc.
| void ACG::SceneGraph::MeshNodeT< Mesh >::draw_vertices | ( | ) | [inline, private] |
draws all vertices of the mesh
Definition at line 449 of file MeshNode2T.cc.
References ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::mesh_, and ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::vertexBufferInitialized_.
| void ACG::SceneGraph::MeshNodeT< Mesh >::enable_arrays | ( | unsigned int | _arrays | ) | [inline] |
enable/disable vertex arrays according to the bits in _arrays
Use this function to enable or disable the appropriate array for rendering. Currently the arrays in ArrayType are supported
Definition at line 537 of file MeshNode2T.cc.
Referenced by ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick_any(), ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick_edges(), ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick_faces(), and ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick_vertices().
| void ACG::SceneGraph::MeshNodeT< Mesh >::pick | ( | GLState & | _state, | |
| PickTarget | _target | |||
| ) | [inline, virtual] |
Draws the object in picking mode.
Reimplemented from ACG::SceneGraph::ACG::SceneGraph::BaseNode.
Definition at line 818 of file MeshNode2T.cc.
References ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick_any(), ACG::SceneGraph::PICK_ANYTHING, ACG::SceneGraph::PICK_EDGE, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick_edges(), ACG::SceneGraph::PICK_FACE, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick_faces(), ACG::SceneGraph::PICK_FRONT_EDGE, ACG::SceneGraph::PICK_FRONT_VERTEX, ACG::SceneGraph::PICK_VERTEX, and ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick_vertices().
| void ACG::SceneGraph::MeshNodeT< Mesh >::pick_any | ( | GLState & | _state | ) | [inline, private] |
Renders picking for all primitives.
Definition at line 1089 of file MeshNode2T.cc.
References ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::anyPickingBaseIndex_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::anyPickingList_, ACG::SceneGraph::ACG::GLState::color_picking(), ACG::SceneGraph::ACG::SceneGraph::BaseNode::depthFunc(), ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::enable_arrays(), ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::mesh_, ACG::SceneGraph::ACG::GLState::pick_current_index(), ACG::SceneGraph::ACG::GLState::pick_set_maximum(), and ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::updateAnyPickingList_.
Referenced by ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick().
| void ACG::SceneGraph::MeshNodeT< Mesh >::pick_edges | ( | GLState & | _state, | |
| bool | _front = false | |||
| ) | [inline, private] |
Renders picking for edges.
Definition at line 945 of file MeshNode2T.cc.
References ACG::SceneGraph::ACG::GLState::base_color(), ACG::SceneGraph::ACG::GLState::clear_color(), ACG::SceneGraph::ACG::GLState::color_picking(), ACG::SceneGraph::ACG::SceneGraph::BaseNode::depthFunc(), ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::draw_faces(), ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::edgePickingBaseIndex_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::edgePickingList_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::enable_arrays(), ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::mesh_, ACG::SceneGraph::ACG::GLState::pick_current_index(), ACG::SceneGraph::ACG::GLState::pick_set_maximum(), ACG::SceneGraph::ACG::GLState::set_base_color(), and ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::updateEdgePickingList_.
Referenced by ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick().
| void ACG::SceneGraph::MeshNodeT< Mesh >::pick_faces | ( | GLState & | _state | ) | [inline, private] |
Renders picking for faces.
Definition at line 1026 of file MeshNode2T.cc.
References ACG::SceneGraph::ACG::GLState::color_picking(), ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::enable_arrays(), ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::facePickingBaseIndex_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::facePickingList_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::mesh_, ACG::SceneGraph::ACG::GLState::pick_current_index(), ACG::SceneGraph::ACG::GLState::pick_set_maximum(), and ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::updateFacePickingList_.
Referenced by ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick().
| void ACG::SceneGraph::MeshNodeT< Mesh >::pick_vertices | ( | GLState & | _state, | |
| bool | _front = false | |||
| ) | [inline, private] |
Renders picking for vertices.
Definition at line 863 of file MeshNode2T.cc.
References ACG::SceneGraph::ACG::GLState::base_color(), ACG::SceneGraph::ACG::GLState::clear_color(), ACG::SceneGraph::ACG::GLState::color_picking(), ACG::SceneGraph::ACG::SceneGraph::BaseNode::depthFunc(), ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::draw_faces(), ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::enable_arrays(), ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::mesh_, ACG::SceneGraph::ACG::GLState::pick_current_index(), ACG::SceneGraph::ACG::GLState::pick_set_maximum(), ACG::SceneGraph::ACG::GLState::set_base_color(), ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::updateVertexPickingList_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::vertexPickingBaseIndex_, and ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::vertexPickingList_.
Referenced by ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::pick().
| void ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::set_property_map | ( | std::map< int, std::string > * | _map | ) | [inline] |
Definition at line 525 of file MeshNode2T.cc.
| void ACG::SceneGraph::MeshNodeT< Mesh >::setHalfedgeTextcoordPropertyName | ( | std::string | _halfedgeTextcoordPropertyName | ) | [inline] |
Set the name of the per face texture coordinate property.
Set this property for per face per vertex texture coordinates. Additionally you have to set the IndexPropertyName to make texturing with multiple textures work.
Definition at line 1438 of file MeshNode2T.cc.
References ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::perFaceTextureCoordsAvailable_.
| void ACG::SceneGraph::MeshNodeT< Mesh >::setIndexPropertyName | ( | std::string | _indexPropertyName | ) | [inline] |
set the name of the property used for texture index specification
The given property name will define a texture index. This index is used to make a lookup in the texture correspondence map containing for each index the gluint for the texture to be used. A zero in the property means, that no texture will be bound for the face. If you define a non existing name here, texture switching will be disabled and it is assumed that a texture is bound already.
Definition at line 1428 of file MeshNode2T.cc.
References ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::perFaceTextureIndexAvailable_.
| void ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::setTextureMap | ( | std::map< int, GLuint > * | _map | ) | [inline] |
Setup a mapping between internal texture ids on the mesh and the ids for the loaded textures in opengl.
| _map | maps between an int index stored in the Mesh describing which texture to use for a face, and the GluInt name of the texture bound by the TextureNode. If such a map is not available ( =0 ), assume TextureNode has already bound a texture And render without switching textures |
Definition at line 507 of file MeshNode2T.cc.
References ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::textureMap_.
| void ACG::SceneGraph::MeshNodeT< Mesh >::update_color | ( | ) | [inline] |
the colors of the mesh have changed
call this function if you changed the colors of the mesh. All buffers related to the color will be updated.
if you also updated the topology, the color is updated automatically
Definition at line 1369 of file MeshNode2T.cc.
References ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::colors_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::colorVertexbuffer_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::colorVertexBufferInitialized_, and ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::mesh_.
| void ACG::SceneGraph::MeshNodeT< Mesh >::update_geometry | ( | ) | [inline] |
the geometry of the mesh has changed
call this function if you changed the geometry of the mesh. All buffers related to the geometry will be updated.
Definition at line 1189 of file MeshNode2T.cc.
References ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::bbMax_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::bbMin_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::mesh_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::normals_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::normalVertexBuffer_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::normalVertexBufferInitialized_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::updateAnyPickingList_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::updateEdgePickingList_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::updateFacePickingList_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::updateVertexPickingList_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::vertexBuffer_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::vertexBufferInitialized_, and ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::vertices_.
| void ACG::SceneGraph::MeshNodeT< Mesh >::update_topology | ( | ) | [inline] |
the topology of the mesh has changed
call this function if you changed the topology of the mesh. All buffers related to the topology will be updated.
this also triggers an update for the colors
Reimplemented in ACG::SceneGraph::TriStripNodeT< Mesh >.
Definition at line 1315 of file MeshNode2T.cc.
References ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::lineIndexBuffer_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::lineIndexBufferInitialized_, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::lineIndices_, and ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >::mesh_.