Developer Documentation
|
Public Member Functions | |
ACG_CLASSNAME (MeshNode) | |
MeshNodeT (Mesh &_mesh, BaseNode *_parent=0, const std::string &_name="<MeshNode>") | |
Default constructor. More... | |
virtual | ~MeshNodeT () |
Destructor. More... | |
void | update_geometry () |
the geometry of the mesh has changed More... | |
void | update_topology () |
the topology of the mesh has changed More... | |
void | update_color () |
the colors of the mesh have changed More... | |
void | update_textures () |
force an texture update More... | |
void | set_property_map (std::map< int, std::string > *_map) |
unsigned int | getMemoryUsage () |
measures the size in bytes of allocated memory More... | |
void | set_offset (bool enable) |
general picking functions | |
void | pick (GLState &_state, PickTarget _target) override |
Draws the object in picking mode. More... | |
![]() | |
void | updatePolyEdgeBuf () |
![]() | |
BaseNode (BaseNode *_parent=0, std::string _name="<unknown>") | |
Default constructor. More... | |
BaseNode (BaseNode *_parent, BaseNode *_child, std::string _name="<unknown>") | |
Put this node between _parent and _child. More... | |
virtual | ~BaseNode () |
Destructor. More... | |
void | delete_subtree () |
Delete the whole subtree of this node. More... | |
virtual const std::string & | className () const =0 |
Return class name (implemented by the ACG_CLASSNAME macro) | |
virtual DrawModes::DrawMode | availableDrawModes () const |
virtual void | boundingBox (Vec3d &, Vec3d &) |
virtual void | enter (GLState &, const DrawModes::DrawMode &) |
virtual void | enter (IRenderer *, GLState &_state, const DrawModes::DrawMode &_drawMode) |
virtual void | draw (GLState &, const DrawModes::DrawMode &) |
Draw this node using the draw modes _drawMode. More... | |
virtual void | getRenderObjects (IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat) |
Deferred draw call with shader based renderer. More... | |
virtual void | leave (GLState &, const DrawModes::DrawMode &) |
virtual void | leave (IRenderer *, GLState &_state, const DrawModes::DrawMode &_drawMode) |
virtual void | enterPick (GLState &_state, PickTarget _target, const DrawModes::DrawMode &_drawMode) |
virtual void | pick (GLState &, PickTarget) |
virtual void | leavePick (GLState &_state, PickTarget _target, const DrawModes::DrawMode &_drawMode) |
void | enablePicking (bool _enable) |
bool | pickingEnabled () |
virtual void | mouseEvent (GLState &, QMouseEvent *) |
Handle mouse event (some interaction, e.g. modeling) More... | |
void | setDirty (bool _dirty=true) |
mark node for redrawn More... | |
bool | isDirty () const |
Check if node should be redrawn. More... | |
ChildIter | childrenBegin () |
Returns: begin-iterator of children. More... | |
ConstChildIter | childrenBegin () const |
Same but cont . More... | |
ChildIter | childrenEnd () |
Returns: end-iterator of children. More... | |
ConstChildIter | childrenEnd () const |
Same but const . More... | |
ChildRIter | childrenRBegin () |
Returns: reverse begin-iterator of children. More... | |
ConstChildRIter | childrenRBegin () const |
Same but const. More... | |
ChildRIter | childrenREnd () |
Returns: reverse end-iterator of children. More... | |
ConstChildRIter | childrenREnd () const |
Same but const . More... | |
void | push_back (BaseNode *_node) |
Insert _node at the end of the list of children. More... | |
void | remove (ChildIter _pos) |
size_t | nChildren () const |
number of children More... | |
ChildIter | find (BaseNode *_node) |
BaseNode * | find (const std::string &_name) |
BaseNode * | parent () |
Get the nodes parent node. More... | |
const BaseNode * | parent () const |
Get the nodes parent node. More... | |
void | set_parent (BaseNode *_parent) |
Set the parent of this node. More... | |
StatusMode | status () const |
Get node's status. More... | |
void | set_status (StatusMode _s) |
Set the status of this node. More... | |
void | hide () |
Hide Node: set status to HideNode. More... | |
void | show () |
Show node: set status to Active. More... | |
bool | visible () |
Is node visible (status == Active)? More... | |
bool | hidden () |
Is node not visible (status != Active)? More... | |
std::string | name () const |
Returns: name of node (needs not be unique) More... | |
void | name (const std::string &_name) |
rename a node More... | |
unsigned int | id () const |
DrawModes::DrawMode | drawMode () const |
Return the own draw modes of this node. More... | |
void | drawMode (DrawModes::DrawMode _drawMode) |
unsigned int | traverseMode () const |
Return how the node should be traversed. More... | |
void | setTraverseMode (unsigned int _mode) |
Set traverse mode for node. More... | |
MultipassBitMask | multipassStatus () const |
Get the current multipass settings for the nodes status functions. More... | |
void | setMultipassStatus (const MultipassBitMask _passStatus) |
Set multipass settings for the nodes status functions. More... | |
void | multipassStatusSetActive (const unsigned int _i, bool _active) |
Set multipass status to traverse in a specific pass. More... | |
bool | multipassStatusActive (const unsigned int _i) const |
Get multipass status to traverse in a specific pass. More... | |
MultipassBitMask | multipassNode () const |
Get the current multipass settings for the node. More... | |
void | setMultipassNode (const MultipassBitMask _passNode) |
Set multipass settings for the node. More... | |
void | multipassNodeSetActive (const unsigned int _i, bool _active) |
Set Node status to traverse in a specific pass. More... | |
bool | multipassNodeActive (const unsigned int _i) const |
Get Node status to traverse in a specific pass. More... | |
void | setRenderObjectShaders (const std::string &_vertexShaderFile, const std::string &_geometryShaderFile, const std::string &_fragmentShaderFile, bool _relativePaths=true, DrawModes::DrawModePrimitive _primitiveType=DrawModes::PRIMITIVE_POLYGON) |
Set custom shaders. More... | |
void | setRenderObjectShaders (const std::string &_vertexShaderFile, const std::string &_tessControlShaderFile, const std::string &_tessEvalShaderFile, const std::string &_geometryShaderFile, const std::string &_fragmentShaderFile, bool _relativePaths=true, DrawModes::DrawModePrimitive _primitiveType=DrawModes::PRIMITIVE_POLYGON) |
Set custom shaders. More... | |
void | setRenderObjectUniformPool (const GLSL::UniformPool *_pool) |
Set uniforms for shader based rendering. More... | |
const GLSL::UniformPool * | getRenderObjectUniformPool () |
Get uniforms for shader based rendering. More... | |
void | setRenderObjectTexture (int _samplerSlot, GLuint _texId, GLenum _texType=GL_TEXTURE_2D) |
Set textures for shader based rendering. More... | |
void | setRenderObjectModifier (RenderObjectModifier *_modifier) |
Set modifier for render objects. More... | |
RenderObjectModifier * | getRenderObjectModifier () |
Get render-object modifier. More... | |
void | applyRenderObjectSettings (DrawModes::DrawModePrimitive _primitive, RenderObject *_obj) const |
Set shaders, textures and uniforms as provided by user to a render-object. More... | |
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 | |
bool | draw_with_offset_ |
Draw-mesh handling | |
DrawMeshT< Mesh > * | drawMesh_ |
Array control functions | |
enum | ArrayType { NONE = 0 , PER_EDGE_VERTEX_ARRAY = 1 , PER_EDGE_COLOR_ARRAY = 2 , PER_HALFEDGE_VERTEX_ARRAY = 4 , PER_HALFEDGE_COLOR_ARRAY = 8 } |
Enum controlling which array should be used for rendering. More... | |
unsigned int | enabled_arrays_ |
which arrays are currently enabled? More... | |
void | enable_arrays (unsigned int _arrays) |
enable/disable vertex arrays according to the bits in _arrays More... | |
Mesh Handling | |
Mesh & | mesh_ |
The mesh this node works on. More... | |
const Mesh & | mesh () const |
get the internal mesh More... | |
Bounding Box | |
Vec3d | bbMin_ |
bounding box lower left corner More... | |
Vec3d | bbMax_ |
bounding box upper right corner More... | |
void | boundingBox (Vec3d &_bbMin, Vec3d &_bbMax) override |
Current bounding box. More... | |
Normal Buffer | |
bool | enableNormals_ |
Flag if normals should be used. More... | |
bool | normalsEnabled () |
Returns if the normal array is currently activated. More... | |
void | enableNormals (bool _enable) |
Enable or disable the use of the normal array. More... | |
Color buffer | |
bool | enableColors_ |
Returns if the color array is currently activated. More... | |
bool | colorsEnabled () |
Returns if the color array is currently activated. More... | |
void | enableColors (bool _enable) |
Enable or disable the use of color array. More... | |
Rendering functions | |
VertexDeclaration | halfedgeDecl |
Draws the object. More... | |
void | draw (GLState &_state, const DrawModes::DrawMode &_drawMode) override |
Draws the object. More... | |
void | getRenderObjects (IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat) override |
Draws the object deferred. More... | |
DrawMeshT< Mesh > * | getDrawMesh () |
Get DrawMesh instance. More... | |
ACG::SceneGraph::DrawModes::DrawMode | availableDrawModes () const override |
return available draw modes More... | |
void | draw_vertices () |
draws all vertices of the mesh More... | |
void | add_point_RenderObjects (IRenderer *_renderer, const RenderObject *_baseObj) |
Draws the object. More... | |
void | draw_lines () |
draws all edges of the mesh More... | |
void | draw_halfedges () |
draws all halfedges of the mesh More... | |
void | draw_faces () |
draws all faces of the mesh More... | |
void | add_face_RenderObjects (IRenderer *_renderer, const RenderObject *_baseObj, bool _nonindexed=false) |
Draws the object. More... | |
vertex picking functions | |
bool | updateVertexPicking_ |
Flag indicating if the vertex picking has to be updated. More... | |
size_t | vertexPickingBaseIndex_ |
Index of the first vertex in vertexpicking. More... | |
void | pick_vertices (GLState &_state, bool _front=false) |
Renders picking for vertices _front: Only render front vertices (not occluded by geometry) More... | |
edge picking functions | |
bool | updateEdgePicking_ |
Flag indicating if the edge picking has to be updated. More... | |
size_t | edgePickingBaseIndex_ |
Index of the first edge in edgepicking. More... | |
void | pick_edges (GLState &_state, bool _front=false) |
Renders picking for edges _front: Only render front edges (not occluded by geometry) More... | |
face picking functions | |
bool | updateFacePicking_ |
Flag indicating if the edge picking has to be updated. More... | |
size_t | facePickingBaseIndex_ |
Index of the first face in facepicking. More... | |
void | pick_faces (GLState &_state) |
Renders picking for faces _front: Only render front faces (not occluded by geometry) More... | |
anything picking functions | |
bool | updateAnyPicking_ |
Flag indicating if the any picking has to be updated. More... | |
size_t | anyPickingBaseIndex_ |
Index of the first face in anypicking. More... | |
void | pick_any (GLState &_state) |
Renders picking for all primitives. More... | |
Texture handling | |
bool | perFaceTextureIndexAvailable_ |
This flag indicates if we have a per Face texture index property. More... | |
std::map< int, GLuint > * | textureMap_ |
Mapping of mesh face texture indices to gltexture id ( has to be provided externally ) More... | |
void | setIndexPropertyName (std::string _indexPropertyName) |
set the name of the property used for texture index specification More... | |
const std::string & | indexPropertyName () const |
Get current texture index property name. More... | |
void | setHalfedgeTextcoordPropertyName (std::string _halfedgeTextcoordPropertyName) |
Set the name of the per face texture coordinate property. More... | |
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. More... | |
Additional Inherited Members | |
![]() | |
enum | StatusMode { Active = 0x1 , HideNode = 0x2 , HideChildren = 0x4 , HideSubtree = 0x8 } |
Status modi. More... | |
enum | TraverseMode { NodeFirst = 0x1 , ChildrenFirst = 0x2 , SecondPass = 0x4 } |
Node traverse types. More... | |
typedef std::vector< BaseNode * >::const_iterator | ConstChildIter |
allows to iterate over children More... | |
typedef std::vector< BaseNode * >::iterator | ChildIter |
allows to iterate over children More... | |
typedef std::vector< BaseNode * >::const_reverse_iterator | ConstChildRIter |
allows to reverse iterate over children More... | |
typedef std::vector< BaseNode * >::reverse_iterator | ChildRIter |
allows to reverse iterate over children More... | |
enum | PASSES { NOPASS = 0 , ALLPASSES = 1 << 0 , PASS_1 = 1 << 1 , PASS_2 = 1 << 2 , PASS_3 = 1 << 3 , PASS_4 = 1 << 4 , PASS_5 = 1 << 5 , PASS_6 = 1 << 6 , PASS_7 = 1 << 7 , PASS_8 = 1 << 8 } |
This enum should be used to enable rendering of a node in different. More... | |
typedef unsigned int | MultipassBitMask |
Multipass pass bit mask type. More... | |
![]() | |
MeshNodeBase (BaseNode *_parent, std::string _name) | |
void | supplyDrawMesh (DrawMeshBase *drawMeshBase) |
![]() | |
DrawMeshBase * | drawMeshBase_ |
GLuint | polyEdgeBuf_ |
int | polyEdgeBufSize_ |
GLuint | polyEdgeBufTex_ |
This node draws a mesh using triangle strips.
Definition at line 104 of file MeshNode2T.hh.
|
private |
Definition at line 162 of file MeshNode2T.hh.
|
private |
Definition at line 163 of file MeshNode2T.hh.
|
private |
Definition at line 160 of file MeshNode2T.hh.
|
private |
Definition at line 161 of file MeshNode2T.hh.
|
private |
Typedefs of the mesh representation
These typedefs are used to specifiy and convert all input to float for rendering
Definition at line 158 of file MeshNode2T.hh.
|
private |
Definition at line 159 of file MeshNode2T.hh.
|
private |
Enum controlling which array should be used for rendering.
Definition at line 269 of file MeshNode2T.hh.
ACG::SceneGraph::MeshNodeT< Mesh >::MeshNodeT | ( | Mesh & | _mesh, |
BaseNode * | _parent = 0 , |
||
const std::string & | _name = "<MeshNode>" |
||
) |
Default constructor.
The constructor needs a mesh on which this node will work.
Definition at line 75 of file MeshNode2T_impl.hh.
|
virtual |
Destructor.
Definition at line 107 of file MeshNode2T_impl.hh.
|
private |
Draws the object.
get bound texture buffer and target
Definition at line 992 of file MeshNode2T_impl.hh.
|
inlineprivate |
Draws the object.
get bound texture buffer and target
Definition at line 945 of file MeshNode2T_impl.hh.
|
overridevirtual |
return available draw modes
The drawmodes are constructed based on the mesh properties and the hardware capabilities of the system.
Reimplemented from ACG::SceneGraph::BaseNode.
Definition at line 116 of file MeshNode2T_impl.hh.
|
overridevirtual |
Current bounding box.
This function returns the bounding box of the node.
Reimplemented from ACG::SceneGraph::BaseNode.
Definition at line 193 of file MeshNode2T_impl.hh.
|
inline |
Returns if the color array is currently activated.
Definition at line 241 of file MeshNode2T.hh.
|
overridevirtual |
Draws the object.
get bound texture buffer and target
Reimplemented from ACG::SceneGraph::BaseNode.
Definition at line 201 of file MeshNode2T_impl.hh.
|
private |
draws all faces of the mesh
Definition at line 985 of file MeshNode2T_impl.hh.
|
inlineprivate |
draws all halfedges of the mesh
Definition at line 973 of file MeshNode2T_impl.hh.
|
inlineprivate |
draws all edges of the mesh
Definition at line 959 of file MeshNode2T_impl.hh.
|
inlineprivate |
draws all vertices of the mesh
Definition at line 952 of file MeshNode2T_impl.hh.
void ACG::SceneGraph::MeshNodeT< Mesh >::enable_arrays | ( | unsigned int | _arrays | ) |
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 999 of file MeshNode2T_impl.hh.
|
inline |
Enable or disable the use of color array.
Definition at line 244 of file MeshNode2T.hh.
|
inline |
Enable or disable the use of the normal array.
Definition at line 226 of file MeshNode2T.hh.
DrawMeshT< Mesh > * ACG::SceneGraph::MeshNodeT< Mesh >::getDrawMesh |
Get DrawMesh instance.
Definition at line 1677 of file MeshNode2T_impl.hh.
unsigned int ACG::SceneGraph::MeshNodeT< Mesh >::getMemoryUsage |
measures the size in bytes of allocated memory
Definition at line 1664 of file MeshNode2T_impl.hh.
|
overridevirtual |
Draws the object deferred.
Reimplemented from ACG::SceneGraph::BaseNode.
Definition at line 672 of file MeshNode2T_impl.hh.
const std::string & ACG::SceneGraph::MeshNodeT< Mesh >::indexPropertyName |
Get current texture index property name.
Definition at line 1646 of file MeshNode2T_impl.hh.
|
inline |
get the internal mesh
Definition at line 174 of file MeshNode2T.hh.
|
inline |
Returns if the normal array is currently activated.
Definition at line 223 of file MeshNode2T.hh.
|
overridevirtual |
Draws the object in picking mode.
Reimplemented from ACG::SceneGraph::BaseNode.
Definition at line 1111 of file MeshNode2T_impl.hh.
|
private |
Renders picking for all primitives.
Definition at line 1455 of file MeshNode2T_impl.hh.
|
private |
Renders picking for edges _front: Only render front edges (not occluded by geometry)
Definition at line 1257 of file MeshNode2T_impl.hh.
|
private |
Renders picking for faces _front: Only render front faces (not occluded by geometry)
Definition at line 1353 of file MeshNode2T_impl.hh.
|
private |
Renders picking for vertices _front: Only render front vertices (not occluded by geometry)
Definition at line 1158 of file MeshNode2T_impl.hh.
|
inline |
Definition at line 504 of file MeshNode2T.hh.
|
inline |
Definition at line 493 of file MeshNode2T.hh.
void ACG::SceneGraph::MeshNodeT< Mesh >::setHalfedgeTextcoordPropertyName | ( | std::string | _halfedgeTextcoordPropertyName | ) |
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 1654 of file MeshNode2T_impl.hh.
void ACG::SceneGraph::MeshNodeT< Mesh >::setIndexPropertyName | ( | std::string | _indexPropertyName | ) |
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 1637 of file MeshNode2T_impl.hh.
|
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 478 of file MeshNode2T.hh.
void ACG::SceneGraph::MeshNodeT< Mesh >::update_color |
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 1623 of file MeshNode2T_impl.hh.
void ACG::SceneGraph::MeshNodeT< Mesh >::update_geometry |
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 1558 of file MeshNode2T_impl.hh.
void ACG::SceneGraph::MeshNodeT< Mesh >::update_textures |
force an texture update
This function has to be called, when the textures have changed
Definition at line 1610 of file MeshNode2T_impl.hh.
void ACG::SceneGraph::MeshNodeT< Mesh >::update_topology |
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
Definition at line 1595 of file MeshNode2T_impl.hh.
|
private |
Index of the first face in anypicking.
Definition at line 434 of file MeshNode2T.hh.
|
private |
bounding box upper right corner
Definition at line 212 of file MeshNode2T.hh.
|
private |
bounding box lower left corner
Definition at line 209 of file MeshNode2T.hh.
|
private |
Definition at line 501 of file MeshNode2T.hh.
|
private |
Definition at line 187 of file MeshNode2T.hh.
|
private |
Index of the first edge in edgepicking.
Definition at line 392 of file MeshNode2T.hh.
|
private |
Returns if the color array is currently activated.
Definition at line 248 of file MeshNode2T.hh.
|
private |
which arrays are currently enabled?
Definition at line 279 of file MeshNode2T.hh.
|
private |
Flag if normals should be used.
Definition at line 231 of file MeshNode2T.hh.
|
private |
Index of the first face in facepicking.
Definition at line 413 of file MeshNode2T.hh.
|
private |
Draws the object.
get bound texture buffer and target
Definition at line 340 of file MeshNode2T.hh.
|
private |
The mesh this node works on.
Definition at line 178 of file MeshNode2T.hh.
|
private |
This flag indicates if we have a per Face texture index property.
Definition at line 483 of file MeshNode2T.hh.
|
private |
Mapping of mesh face texture indices to gltexture id ( has to be provided externally )
Definition at line 486 of file MeshNode2T.hh.
|
private |
Flag indicating if the any picking has to be updated.
Definition at line 431 of file MeshNode2T.hh.
|
private |
Flag indicating if the edge picking has to be updated.
Definition at line 389 of file MeshNode2T.hh.
|
private |
Flag indicating if the edge picking has to be updated.
Definition at line 410 of file MeshNode2T.hh.
|
private |
Flag indicating if the vertex picking has to be updated.
Definition at line 368 of file MeshNode2T.hh.
|
private |
Index of the first vertex in vertexpicking.
Definition at line 371 of file MeshNode2T.hh.