Developer Documentation
ACG::SceneGraph::MeshNodeT< Mesh > Class Template Reference
Inheritance diagram for ACG::SceneGraph::MeshNodeT< Mesh >:
ACG::SceneGraph::MeshNodeBase ACG::SceneGraph::BaseNode

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...
 
- Public Member Functions inherited from ACG::SceneGraph::MeshNodeBase
void updatePolyEdgeBuf ()
 
- Public Member Functions inherited from ACG::SceneGraph::BaseNode
 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)
 
BaseNodefind (const std::string &_name)
 
BaseNodeparent ()
 Get the nodes parent node. More...
 
const BaseNodeparent () 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::UniformPoolgetRenderObjectUniformPool ()
 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...
 
RenderObjectModifiergetRenderObjectModifier ()
 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

Meshmesh_
 The mesh this node works on. More...
 
const Meshmesh () 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

- Public Types inherited from ACG::SceneGraph::BaseNode
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...
 
- Protected Member Functions inherited from ACG::SceneGraph::MeshNodeBase
 MeshNodeBase (BaseNode *_parent, std::string _name)
 
void supplyDrawMesh (DrawMeshBase *drawMeshBase)
 
- Protected Attributes inherited from ACG::SceneGraph::MeshNodeBase
DrawMeshBasedrawMeshBase_
 
GLuint polyEdgeBuf_
 
int polyEdgeBufSize_
 
GLuint polyEdgeBufTex_
 

Detailed Description

template<class Mesh>
class ACG::SceneGraph::MeshNodeT< Mesh >

This node draws a mesh using triangle strips.

Definition at line 104 of file MeshNode2T.hh.

Member Typedef Documentation

◆ Color

template<class Mesh >
typedef Mesh::Color ACG::SceneGraph::MeshNodeT< Mesh >::Color
private

Definition at line 162 of file MeshNode2T.hh.

◆ ColorScalar

template<class Mesh >
typedef Color::value_type ACG::SceneGraph::MeshNodeT< Mesh >::ColorScalar
private

Definition at line 163 of file MeshNode2T.hh.

◆ Normal

template<class Mesh >
typedef Mesh::Normal ACG::SceneGraph::MeshNodeT< Mesh >::Normal
private

Definition at line 160 of file MeshNode2T.hh.

◆ NormalScalar

template<class Mesh >
typedef Normal::value_type ACG::SceneGraph::MeshNodeT< Mesh >::NormalScalar
private

Definition at line 161 of file MeshNode2T.hh.

◆ Point

template<class Mesh >
typedef Mesh::Point 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 158 of file MeshNode2T.hh.

◆ PointScalar

template<class Mesh >
typedef Point::value_type ACG::SceneGraph::MeshNodeT< Mesh >::PointScalar
private

Definition at line 159 of file MeshNode2T.hh.

Member Enumeration Documentation

◆ ArrayType

template<class Mesh >
enum ACG::SceneGraph::MeshNodeT::ArrayType
private

Enum controlling which array should be used for rendering.

Definition at line 269 of file MeshNode2T.hh.

Constructor & Destructor Documentation

◆ MeshNodeT()

template<class Mesh >
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.

Todo:
: Handle vbo not supported

Definition at line 75 of file MeshNode2T_impl.hh.

◆ ~MeshNodeT()

template<class Mesh >
ACG::SceneGraph::MeshNodeT< Mesh >::~MeshNodeT
virtual

Destructor.

Definition at line 107 of file MeshNode2T_impl.hh.

Member Function Documentation

◆ add_face_RenderObjects()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::add_face_RenderObjects ( IRenderer _renderer,
const RenderObject _baseObj,
bool  _nonindexed = false 
)
private

Draws the object.

get bound texture buffer and target

Todo:
We can render also wireframe shaded and with vertex colors
Todo:
Integrate shader here!

Definition at line 992 of file MeshNode2T_impl.hh.

◆ add_point_RenderObjects()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::add_point_RenderObjects ( IRenderer _renderer,
const RenderObject _baseObj 
)
inlineprivate

Draws the object.

get bound texture buffer and target

Todo:
We can render also wireframe shaded and with vertex colors
Todo:
Integrate shader here!

Definition at line 945 of file MeshNode2T_impl.hh.

◆ availableDrawModes()

template<class Mesh >
DrawModes::DrawMode ACG::SceneGraph::MeshNodeT< Mesh >::availableDrawModes
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.

◆ boundingBox()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::boundingBox ( Vec3d _bbMin,
Vec3d _bbMax 
)
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.

◆ colorsEnabled()

template<class Mesh >
bool ACG::SceneGraph::MeshNodeT< Mesh >::colorsEnabled ( )
inline

Returns if the color array is currently activated.

Definition at line 241 of file MeshNode2T.hh.

◆ draw()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::draw ( GLState _state,
const DrawModes::DrawMode _drawMode 
)
overridevirtual

Draws the object.

get bound texture buffer and target

Todo:
We can render also wireframe shaded and with vertex colors
Todo:
Integrate shader here!

Reimplemented from ACG::SceneGraph::BaseNode.

Definition at line 201 of file MeshNode2T_impl.hh.

◆ draw_faces()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::draw_faces
private

draws all faces of the mesh

Definition at line 985 of file MeshNode2T_impl.hh.

◆ draw_halfedges()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::draw_halfedges
inlineprivate

draws all halfedges of the mesh

Definition at line 973 of file MeshNode2T_impl.hh.

◆ draw_lines()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::draw_lines
inlineprivate

draws all edges of the mesh

Definition at line 959 of file MeshNode2T_impl.hh.

◆ draw_vertices()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::draw_vertices
inlineprivate

draws all vertices of the mesh

Definition at line 952 of file MeshNode2T_impl.hh.

◆ enable_arrays()

template<class Mesh >
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.

◆ enableColors()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::enableColors ( bool  _enable)
inline

Enable or disable the use of color array.

Definition at line 244 of file MeshNode2T.hh.

◆ enableNormals()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::enableNormals ( bool  _enable)
inline

Enable or disable the use of the normal array.

Definition at line 226 of file MeshNode2T.hh.

◆ getDrawMesh()

template<class Mesh >
DrawMeshT< Mesh > * ACG::SceneGraph::MeshNodeT< Mesh >::getDrawMesh

Get DrawMesh instance.

Definition at line 1677 of file MeshNode2T_impl.hh.

◆ getMemoryUsage()

template<class Mesh >
unsigned int ACG::SceneGraph::MeshNodeT< Mesh >::getMemoryUsage

measures the size in bytes of allocated memory

Definition at line 1664 of file MeshNode2T_impl.hh.

◆ getRenderObjects()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::getRenderObjects ( IRenderer _renderer,
GLState _state,
const DrawModes::DrawMode _drawMode,
const Material _mat 
)
overridevirtual

Draws the object deferred.

Reimplemented from ACG::SceneGraph::BaseNode.

Definition at line 672 of file MeshNode2T_impl.hh.

◆ indexPropertyName()

template<class Mesh >
const std::string & ACG::SceneGraph::MeshNodeT< Mesh >::indexPropertyName

Get current texture index property name.

Definition at line 1646 of file MeshNode2T_impl.hh.

◆ mesh()

template<class Mesh >
const Mesh & ACG::SceneGraph::MeshNodeT< Mesh >::mesh ( ) const
inline

get the internal mesh

Definition at line 174 of file MeshNode2T.hh.

◆ normalsEnabled()

template<class Mesh >
bool ACG::SceneGraph::MeshNodeT< Mesh >::normalsEnabled ( )
inline

Returns if the normal array is currently activated.

Definition at line 223 of file MeshNode2T.hh.

◆ pick()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::pick ( GLState _state,
PickTarget  _target 
)
overridevirtual

Draws the object in picking mode.

Reimplemented from ACG::SceneGraph::BaseNode.

Definition at line 1111 of file MeshNode2T_impl.hh.

◆ pick_any()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::pick_any ( GLState _state)
private

Renders picking for all primitives.

Definition at line 1455 of file MeshNode2T_impl.hh.

◆ pick_edges()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::pick_edges ( GLState _state,
bool  _front = false 
)
private

Renders picking for edges _front: Only render front edges (not occluded by geometry)

Definition at line 1257 of file MeshNode2T_impl.hh.

◆ pick_faces()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::pick_faces ( GLState _state)
private

Renders picking for faces _front: Only render front faces (not occluded by geometry)

Definition at line 1353 of file MeshNode2T_impl.hh.

◆ pick_vertices()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::pick_vertices ( GLState _state,
bool  _front = false 
)
private

Renders picking for vertices _front: Only render front vertices (not occluded by geometry)

Definition at line 1158 of file MeshNode2T_impl.hh.

◆ set_offset()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::set_offset ( bool  enable)
inline

Definition at line 504 of file MeshNode2T.hh.

◆ set_property_map()

template<class Mesh >
void ACG::SceneGraph::MeshNodeT< Mesh >::set_property_map ( std::map< int, std::string > *  _map)
inline
Todo:
Remove all these functions afterwards!

Definition at line 493 of file MeshNode2T.hh.

◆ setHalfedgeTextcoordPropertyName()

template<class Mesh >
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.

◆ setIndexPropertyName()

template<class Mesh >
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.

Todo:
Remove the external texture loading and do it here.

Definition at line 1637 of file MeshNode2T_impl.hh.

◆ setTextureMap()

template<class Mesh >
void 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.

Parameters
_mapmaps 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.

◆ update_color()

template<class Mesh >
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.

◆ update_geometry()

template<class Mesh >
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.

Todo:
check the following statements. If only geometry changed, the normals,vertices have to be updated nothing else!

Definition at line 1558 of file MeshNode2T_impl.hh.

◆ update_textures()

template<class Mesh >
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.

◆ update_topology()

template<class Mesh >
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.

Member Data Documentation

◆ anyPickingBaseIndex_

template<class Mesh >
size_t ACG::SceneGraph::MeshNodeT< Mesh >::anyPickingBaseIndex_
private

Index of the first face in anypicking.

Definition at line 434 of file MeshNode2T.hh.

◆ bbMax_

template<class Mesh >
Vec3d ACG::SceneGraph::MeshNodeT< Mesh >::bbMax_
private

bounding box upper right corner

Definition at line 212 of file MeshNode2T.hh.

◆ bbMin_

template<class Mesh >
Vec3d ACG::SceneGraph::MeshNodeT< Mesh >::bbMin_
private

bounding box lower left corner

Definition at line 209 of file MeshNode2T.hh.

◆ draw_with_offset_

template<class Mesh >
bool ACG::SceneGraph::MeshNodeT< Mesh >::draw_with_offset_
private

Definition at line 501 of file MeshNode2T.hh.

◆ drawMesh_

template<class Mesh >
DrawMeshT<Mesh>* ACG::SceneGraph::MeshNodeT< Mesh >::drawMesh_
private

Definition at line 187 of file MeshNode2T.hh.

◆ edgePickingBaseIndex_

template<class Mesh >
size_t ACG::SceneGraph::MeshNodeT< Mesh >::edgePickingBaseIndex_
private

Index of the first edge in edgepicking.

Definition at line 392 of file MeshNode2T.hh.

◆ enableColors_

template<class Mesh >
bool ACG::SceneGraph::MeshNodeT< Mesh >::enableColors_
private

Returns if the color array is currently activated.

Definition at line 248 of file MeshNode2T.hh.

◆ enabled_arrays_

template<class Mesh >
unsigned int ACG::SceneGraph::MeshNodeT< Mesh >::enabled_arrays_
private

which arrays are currently enabled?

Definition at line 279 of file MeshNode2T.hh.

◆ enableNormals_

template<class Mesh >
bool ACG::SceneGraph::MeshNodeT< Mesh >::enableNormals_
private

Flag if normals should be used.

Definition at line 231 of file MeshNode2T.hh.

◆ facePickingBaseIndex_

template<class Mesh >
size_t ACG::SceneGraph::MeshNodeT< Mesh >::facePickingBaseIndex_
private

Index of the first face in facepicking.

Definition at line 413 of file MeshNode2T.hh.

◆ halfedgeDecl

template<class Mesh >
VertexDeclaration ACG::SceneGraph::MeshNodeT< Mesh >::halfedgeDecl
private

Draws the object.

get bound texture buffer and target

Todo:
We can render also wireframe shaded and with vertex colors
Todo:
Integrate shader here!

Definition at line 340 of file MeshNode2T.hh.

◆ mesh_

template<class Mesh >
Mesh& ACG::SceneGraph::MeshNodeT< Mesh >::mesh_
private

The mesh this node works on.

Definition at line 178 of file MeshNode2T.hh.

◆ perFaceTextureIndexAvailable_

template<class Mesh >
bool ACG::SceneGraph::MeshNodeT< Mesh >::perFaceTextureIndexAvailable_
private

This flag indicates if we have a per Face texture index property.

Definition at line 483 of file MeshNode2T.hh.

◆ textureMap_

template<class Mesh >
std::map< int, GLuint>* ACG::SceneGraph::MeshNodeT< Mesh >::textureMap_
private

Mapping of mesh face texture indices to gltexture id ( has to be provided externally )

Definition at line 486 of file MeshNode2T.hh.

◆ updateAnyPicking_

template<class Mesh >
bool ACG::SceneGraph::MeshNodeT< Mesh >::updateAnyPicking_
private

Flag indicating if the any picking has to be updated.

Definition at line 431 of file MeshNode2T.hh.

◆ updateEdgePicking_

template<class Mesh >
bool ACG::SceneGraph::MeshNodeT< Mesh >::updateEdgePicking_
private

Flag indicating if the edge picking has to be updated.

Definition at line 389 of file MeshNode2T.hh.

◆ updateFacePicking_

template<class Mesh >
bool ACG::SceneGraph::MeshNodeT< Mesh >::updateFacePicking_
private

Flag indicating if the edge picking has to be updated.

Definition at line 410 of file MeshNode2T.hh.

◆ updateVertexPicking_

template<class Mesh >
bool ACG::SceneGraph::MeshNodeT< Mesh >::updateVertexPicking_
private

Flag indicating if the vertex picking has to be updated.

Definition at line 368 of file MeshNode2T.hh.

◆ vertexPickingBaseIndex_

template<class Mesh >
size_t ACG::SceneGraph::MeshNodeT< Mesh >::vertexPickingBaseIndex_
private

Index of the first vertex in vertexpicking.

Definition at line 371 of file MeshNode2T.hh.


The documentation for this class was generated from the following files: