Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ACG::SceneGraph::ACG::SceneGraph::BaseNode Class Referenceabstract

#include <ACG/Scenegraph/BaseNode.hh>

Inheritance diagram for ACG::SceneGraph::ACG::SceneGraph::BaseNode:
ACG::SceneGraph::ACG::SceneGraph::MaterialNode ACG::SceneGraph::ACG::SceneGraph::MeshNodeBase ACG::SceneGraph::ArrayResourceManagerNodeT< T > ACG::SceneGraph::BSplineCurveNodeT< BSplineCurve > ACG::SceneGraph::BSplineSurfaceNodeT< BSplineSurfaceType > ACG::SceneGraph::CameraNode ACG::SceneGraph::CartesianClippingNode ACG::SceneGraph::ClippingNode ACG::SceneGraph::CoordinateSystemNode ACG::SceneGraph::CoordsysNode ACG::SceneGraph::GlutPrimitiveNode ACG::SceneGraph::LightNode ACG::SceneGraph::LightSourceNode ACG::SceneGraph::MaterialNode ACG::SceneGraph::MeshNodeBase ACG::SceneGraph::OBJNode ACG::SceneGraph::OSDTransformNode ACG::SceneGraph::PointNode ACG::SceneGraph::PolyLineNodeT< PolyLine > ACG::SceneGraph::PtrResourceManagerNodeT< T > ACG::SceneGraph::QtWidgetNode ACG::SceneGraph::QuadNode ACG::SceneGraph::SeparatorNode ACG::SceneGraph::ShaderNode ACG::SceneGraph::SkeletonNodeT< SkeletonType > ACG::SceneGraph::SliceNode ACG::SceneGraph::SplatCloudNode ACG::SceneGraph::StatusViewNodeT< MeshT > ACG::SceneGraph::StencilRefNode ACG::SceneGraph::TextNode ACG::SceneGraph::Texture3DNode ACG::SceneGraph::TextureNode ACG::SceneGraph::TransformNode ACG::SceneGraph::TriangleNode ACG::SceneGraph::VolumeMeshNodeT< VolumeMeshT > ACG::SceneGraph::BSplineCurveNodeT< ACG::BSplineCurveT > ACG::SceneGraph::BSplineSurfaceNodeT< ACG::BSplineSurfaceT > ACG::SceneGraph::PolyLineNodeT< ACG::PolyLineT > ACG::SceneGraph::SkeletonNodeT< SkeletonT > ACG::SceneGraph::StatusViewNodeT< PolyMesh > ACG::SceneGraph::StatusViewNodeT< TriMesh > ACG::SceneGraph::VolumeMeshNodeT< MeshT >

Classes

struct  ShaderSet
 

Public Types

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::list< BaseNode * >
::const_iterator 
ConstChildIter
 allows to iterate over children
 
typedef std::list< BaseNode * >
::iterator 
ChildIter
 allows to iterate over children
 
typedef std::list< BaseNode * >
::const_reverse_iterator 
ConstChildRIter
 allows to reverse iterate over children
 
typedef std::list< BaseNode * >
::reverse_iterator 
ChildRIter
 allows to reverse iterate over children
 

Public Member Functions

 BaseNode (BaseNode *_parent=0, std::string _name="<unknown>")
 Default constructor.
 
 BaseNode (BaseNode *_parent, BaseNode *_child, std::string _name="<unknown>")
 Put this node between _parent and _child.
 
virtual ~BaseNode ()
 Destructor.
 
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 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 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)
 
void setDirty (bool _dirty=true)
 mark node for redrawn
 
bool isDirty () const
 Check if node should be redrawn.
 
ChildIter childrenBegin ()
 Returns: begin-iterator of children.
 
ConstChildIter childrenBegin () const
 Same but cont.
 
ChildIter childrenEnd ()
 Returns: end-iterator of children.
 
ConstChildIter childrenEnd () const
 Same but const.
 
ChildRIter childrenRBegin ()
 Returns: reverse begin-iterator of children.
 
ConstChildRIter childrenRBegin () const
 Same but const.
 
ChildRIter childrenREnd ()
 Returns: reverse end-iterator of children.
 
ConstChildRIter childrenREnd () const
 Same but const.
 
void push_back (BaseNode *_node)
 Insert _node at the end of the list of children.
 
void remove (ChildIter _pos)
 
size_t nChildren () const
 number of children
 
ChildIter find (BaseNode *_node)
 
BaseNodefind (const std::string &_name)
 
BaseNodeparent ()
 Get the nodes parent node.
 
const BaseNodeparent () const
 Get the nodes parent node.
 
void set_parent (BaseNode *_parent)
 Set the parent of this node. More...
 
StatusMode status () const
 Get node's status.
 
void set_status (StatusMode _s)
 Set the status of this node.
 
void hide ()
 Hide Node: set status to HideNode.
 
void show ()
 Show node: set status to Active.
 
bool visible ()
 Is node visible (status == Active)?
 
bool hidden ()
 Is node not visible (status != Active)?
 
std::string name () const
 Returns: name of node (needs not be unique)
 
void name (const std::string &_name)
 rename a node
 
unsigned int id () const
 
DrawModes::DrawMode drawMode () const
 Return the own draw modes of this node.
 
void drawMode (DrawModes::DrawMode _drawMode)
 
unsigned int traverseMode () const
 Return how the node should be traversed.
 
void setTraverseMode (unsigned int _mode)
 Set traverse mode for node.
 

Private Member Functions

 BaseNode (const BaseNode &)
 Copy constructor. Disabled.
 
void operator= (const BaseNode &)
 Assignment operator. Disabled.
 

Private Attributes

BaseNodeparent_
 pointer to parent node
 
std::string name_
 name of node
 
StatusMode status_
 node status()
 
std::list< BaseNode * > children_
 list of children
 
unsigned int id_
 ID of node.
 
DrawModes::DrawMode drawMode_
 private draw mode
 
bool pickingEnabled_
 
bool dirty_
 Flag indicating that the node has to be redrawn.
 
unsigned int traverseMode_
 traverse mode
 
std::map
< DrawModes::DrawModePrimitive,
ShaderSet
shaderSettings_
 shader settings for primitive modes
 
std::map< int,
RenderObject::Texture
textureSettings_
 texture settings for shader based rendering
 
const GLSL::UniformPooluniformPool_
 user provided uniform pool for shader constants
 
RenderObjectModifierrenderModifier_
 render-object modifier
 

Static Private Attributes

static unsigned int last_id_used__ = 0
 used to provide unique IDs to nodes
 

Render pass controls

The render pass controls are only used during multipass traversal. There are two types of multipass controls. One type controls if the enter and leave functions of the nodes are used (RenderStatusPass) or if the actual draw function is called (RenderDrawPass). The bitmasks define if the functions are called by the traverse_multipass operation. The bitmask are initialized to run in the first path.

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.
 
typedef unsigned int MultipassBitMask
 Multipass pass bit mask type.
 
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...
 

RenderObject controls

The render pass controls are only used during shader-based rendering with render-objects. It is possible to provide shader and state settings that are copied to render-objects. These functions do not affect the fixed-function pipeline implementation of the scenegraph (enter() draw() leave()).

MultipassBitMask multipassStatus_
 
MultipassBitMask multipassNode_
 
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...
 

Detailed Description

This is the base for all scenegraph nodes. All virtual functions should be reimplemented when inheriting from this class.

Definition at line 135 of file MeshNode2T.cc.

Member Enumeration Documentation

Status modi.

Enumerator
Active 

Draw node & children.

HideNode 

Hide this node, but draw children.

HideChildren 

Draw this node, but hide children.

HideSubtree 

Hide this node and its children.

Definition at line 365 of file MeshNode2T.cc.

Node traverse types.

Enumerator
NodeFirst 

Execute action on node first and then on its children.

ChildrenFirst 

Execute action the children first and then on this node.

SecondPass 

Draw node in second pass.

Definition at line 414 of file MeshNode2T.cc.

Member Function Documentation

void ACG::SceneGraph::BaseNode::applyRenderObjectSettings ( DrawModes::DrawModePrimitive  _primitive,
RenderObject _obj 
) const

Set shaders, textures and uniforms as provided by user to a render-object.

A derived node can use this convenience function to copy shader, uniform and texture settings to a render-object.

Parameters
_primitivethe primitive type of the render-object
_objthe render-object [in/out]

Definition at line 307 of file BaseNode.cc.

virtual DrawModes::DrawMode ACG::SceneGraph::ACG::SceneGraph::BaseNode::availableDrawModes ( ) const
inlinevirtual
virtual void ACG::SceneGraph::ACG::SceneGraph::BaseNode::boundingBox ( Vec3d ,
Vec3d  
)
inlinevirtual

Compute the bounding box of this node and update the values _bbMin and _bbMax accordingly. Do not initialize _bbMin and _bbMax since they may already store values of previous nodes' bounding box computation.

Reimplemented in ACG::SceneGraph::LightNode, ACG::SceneGraph::TranslationManipulatorNode, ACG::SceneGraph::GlutPrimitiveNode, ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >, ACG::SceneGraph::MeshNodeT< Mesh >, ACG::SceneGraph::MeshNodeT< MeshT >, ACG::SceneGraph::MeshNodeT< PolyMesh >, ACG::SceneGraph::MeshNodeT< TriMesh >, ACG::SceneGraph::BSplineCurveNodeT< BSplineCurve >, ACG::SceneGraph::BSplineCurveNodeT< ACG::BSplineCurveT >, ACG::SceneGraph::BSplineSurfaceNodeT< BSplineSurfaceType >, ACG::SceneGraph::BSplineSurfaceNodeT< ACG::BSplineSurfaceT >, ACG::SceneGraph::LineNode, ACG::SceneGraph::TextNode, ACG::SceneGraph::CoordsysNode, ACG::SceneGraph::VolumeMeshNodeT< VolumeMeshT >, ACG::SceneGraph::VolumeMeshNodeT< MeshT >, ACG::SceneGraph::SplatCloudNode, ACG::SceneGraph::PointNode, ACG::SceneGraph::PolyLineNodeT< PolyLine >, ACG::SceneGraph::PolyLineNodeT< ACG::PolyLineT >, ACG::SceneGraph::GridNode, ACG::SceneGraph::SkeletonNodeT< SkeletonType >, ACG::SceneGraph::SkeletonNodeT< SkeletonT >, ACG::SceneGraph::OBJNode, ACG::SceneGraph::CoordinateSystemNode, ACG::SceneGraph::CoordFrameNode, ACG::SceneGraph::CameraNode, ACG::SceneGraph::ArrowNode, ACG::SceneGraph::SliceNode, ACG::SceneGraph::QtWidgetNode, ACG::SceneGraph::TriangleNode, and ACG::SceneGraph::QuadNode.

Definition at line 174 of file MeshNode2T.cc.

void ACG::SceneGraph::BaseNode::delete_subtree ( )

Delete the whole subtree of this node.

This function will remove the whole subtree below this node. All children in this nodes bubtree will be automatically removed from the tree and their destructor is called. The node itself will be removed from the list of its parents children. Afterwards it will also call its own destructor.

Definition at line 176 of file BaseNode.cc.

virtual void ACG::SceneGraph::ACG::SceneGraph::BaseNode::draw ( GLState ,
const DrawModes::DrawMode  
)
inlinevirtual

Draw this node using the draw modes _drawMode.

This function is called when the scenegraph is traversed by the classical draw routines.

In this call the node should draw it's content via OpenGL.

Note
Keep in mind, that you should use the currently active state and don't change it (at least reset it the original values you got). Otherwise nodes that are drawn after this node might get an inconsistent state.

Reimplemented in ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >.

Definition at line 194 of file MeshNode2T.cc.

void ACG::SceneGraph::ACG::SceneGraph::BaseNode::drawMode ( DrawModes::DrawMode  _drawMode)
inline

Set this node's own draw mode. It will be used for drawing instead of the the global draw mode.

Definition at line 409 of file MeshNode2T.cc.

void ACG::SceneGraph::ACG::SceneGraph::BaseNode::enablePicking ( bool  _enable)
inline

Enable or Disable picking for this node ( default: enabled )

Definition at line 241 of file MeshNode2T.cc.

virtual void ACG::SceneGraph::ACG::SceneGraph::BaseNode::enter ( GLState ,
const DrawModes::DrawMode  
)
inlinevirtual

This function is called when traversing the scene graph and arriving at this node. It can be used to store GL states that will be changed in order to restore then in the leave() function.

See also
MaterialNode

Reimplemented in ACG::SceneGraph::ACG::SceneGraph::MaterialNode.

Definition at line 182 of file MeshNode2T.cc.

void ACG::SceneGraph::BaseNode::enterPick ( GLState _state,
PickTarget  _target,
const DrawModes::DrawMode _drawMode 
)
virtual

This function is called when traversing the scene graph during picking and arriving at this node. It can be used to store GL states that will be changed in order to restore then in the leavePick() function. Its default implementation will call the enter() function.

Reimplemented in ACG::SceneGraph::ACG::SceneGraph::MaterialNode.

Definition at line 186 of file BaseNode.cc.

ChildIter ACG::SceneGraph::ACG::SceneGraph::BaseNode::find ( BaseNode _node)
inline

Find a specific node in the list of children.
This method is designed to convert a node pointer to an iterator that may be used e.g. for insert()'ing a new node at a distinct position.
Returns childrenEnd() if no appropriate node is found.

Definition at line 322 of file MeshNode2T.cc.

BaseNode* ACG::SceneGraph::ACG::SceneGraph::BaseNode::find ( const std::string &  _name)
inline

Find a node of a given name

Definition at line 331 of file MeshNode2T.cc.

RenderObjectModifier* ACG::SceneGraph::ACG::SceneGraph::BaseNode::getRenderObjectModifier ( )
inline

Get render-object modifier.

Definition at line 646 of file MeshNode2T.cc.

virtual void ACG::SceneGraph::ACG::SceneGraph::BaseNode::getRenderObjects ( IRenderer _renderer,
GLState _state,
const DrawModes::DrawMode _drawMode,
const Material _mat 
)
inlinevirtual

Deferred draw call with shader based renderer.

The renderer calls this function to collect the geometry that should be rendered from the nodes.

Add any renderable geometry to the renderer via _renderer->addRenderObject()

The material is fetched from the last active material node and may be used to setup Renderobjects, but may as well be ignored.

Note
You should not draw anything yourself in this function.
Parameters
_rendererThe renderer which will be used. Add your geometry into this class
_stateThe current GL State when this object is called
_drawModeThe active draw mode
_matCurrent material

Reimplemented in ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >, ACG::SceneGraph::TextNode, ACG::SceneGraph::PolyLineNodeT< PolyLine >, ACG::SceneGraph::PolyLineNodeT< ACG::PolyLineT >, and ACG::SceneGraph::QtWidgetNode.

Definition at line 212 of file MeshNode2T.cc.

const GLSL::UniformPool* ACG::SceneGraph::ACG::SceneGraph::BaseNode::getRenderObjectUniformPool ( )
inline

Get uniforms for shader based rendering.

Definition at line 617 of file MeshNode2T.cc.

unsigned int ACG::SceneGraph::ACG::SceneGraph::BaseNode::id ( ) const
inline

Get unique ID of node. IDs are always positive and may be used e.g. for picking.

Definition at line 399 of file MeshNode2T.cc.

virtual void ACG::SceneGraph::ACG::SceneGraph::BaseNode::leave ( GLState ,
const DrawModes::DrawMode  
)
inlinevirtual

The leave function is used to restore GL states the have been changed. This function must restore the status before enter() !

Reimplemented in ACG::SceneGraph::ACG::SceneGraph::MaterialNode.

Definition at line 217 of file MeshNode2T.cc.

void ACG::SceneGraph::BaseNode::leavePick ( GLState _state,
PickTarget  _target,
const DrawModes::DrawMode _drawMode 
)
virtual

The leavePick function is used to restore GL states the have been changed. This function must restore the status before enterPick() ! Its default implementation will call the leave() function.

Reimplemented in ACG::SceneGraph::ACG::SceneGraph::MaterialNode.

Definition at line 194 of file BaseNode.cc.

MultipassBitMask ACG::SceneGraph::ACG::SceneGraph::BaseNode::multipassNode ( ) const
inline

Get the current multipass settings for the node.

Get a bitmask defining in which traverse path an action is applied to the node. (1-indexed) Use the PASSES enum above to control multipass rendering!

Returns
Bitmask defining in which traverse passes an action is applied to the node.

Definition at line 513 of file MeshNode2T.cc.

bool ACG::SceneGraph::BaseNode::multipassNodeActive ( const unsigned int  _i) const

Get Node status to traverse in a specific pass.

Check multipass setting for the node if an action will be applied in the given pass. Use the PASSES enum above to control multipass rendering!

Parameters
_iCheck this pass if an action will be applied to the node.

Definition at line 254 of file BaseNode.cc.

void ACG::SceneGraph::BaseNode::multipassNodeSetActive ( const unsigned int  _i,
bool  _active 
)

Set Node status to traverse in a specific pass.

Change multipass setting for the node. An action will be applied to this node in the given pass. Use the PASSES enum above to control multipass rendering!

Parameters
_iPass in which the node should be rendered
_activeEnable or disable node in this pass?

Definition at line 234 of file BaseNode.cc.

MultipassBitMask ACG::SceneGraph::ACG::SceneGraph::BaseNode::multipassStatus ( ) const
inline

Get the current multipass settings for the nodes status functions.

Get a bitmask defining in which traverse pass the enter and leave nodes are used. Use the PASSES enum above to control multipass rendering!

Returns
Bitmask defining in which traverse pass the enter and leave nodes are used

Definition at line 469 of file MeshNode2T.cc.

bool ACG::SceneGraph::BaseNode::multipassStatusActive ( const unsigned int  _i) const

Get multipass status to traverse in a specific pass.

Check multipass setting for the nodes status functions if they should be called in the given render pass. Use the PASSES enum above to control multipass rendering!

Parameters
_iCheck this pass if the nodes enter/leave functions are active

Definition at line 221 of file BaseNode.cc.

void ACG::SceneGraph::BaseNode::multipassStatusSetActive ( const unsigned int  _i,
bool  _active 
)

Set multipass status to traverse in a specific pass.

Change multipass setting for the nodes status functions. The node will call its enter and leave functions in the given pass if its set active. Use the PASSES enum above to control multipass rendering!

Parameters
_iPass in which the node should be rendered
_activeActivate or deactivate in this pass?

Definition at line 201 of file BaseNode.cc.

virtual void ACG::SceneGraph::ACG::SceneGraph::BaseNode::pick ( GLState ,
PickTarget   
)
inlinevirtual

Draw the node using the GL picking name stack. The node's ID will already be on the name stack, so only names identifying e.g. faces should be used ( by pick_set_name() ).

Reimplemented in ACG::SceneGraph::ACG::SceneGraph::MeshNodeT< Mesh >.

Definition at line 230 of file MeshNode2T.cc.

bool ACG::SceneGraph::ACG::SceneGraph::BaseNode::pickingEnabled ( )
inline

Check if picking is enabled for this node

Definition at line 245 of file MeshNode2T.cc.

void ACG::SceneGraph::ACG::SceneGraph::BaseNode::remove ( ChildIter  _pos)
inline

Remove child node at position _pos. This _pos must be reachable from childrenBegin().
This method has no effect if called with childrenEnd() as parameter.

Definition at line 306 of file MeshNode2T.cc.

void ACG::SceneGraph::BaseNode::set_parent ( BaseNode _parent)

Set the parent of this node.

This function will remove this node from its original parents children, if the parent exists. And will add it to the new parents children.

Definition at line 152 of file BaseNode.cc.

void ACG::SceneGraph::ACG::SceneGraph::BaseNode::setMultipassNode ( const MultipassBitMask  _passNode)
inline

Set multipass settings for the node.

Set a bitmask defining in which traverse path an action is applied to the node. (1-indexed) Set to ALLPASSES if you want to render in all passes. Use the PASSES enum above to control multipass rendering!

Parameters
_passNodeBitmask defining in which traverse passes an action is applied to the node.

Definition at line 525 of file MeshNode2T.cc.

void ACG::SceneGraph::ACG::SceneGraph::BaseNode::setMultipassStatus ( const MultipassBitMask  _passStatus)
inline

Set multipass settings for the nodes status functions.

Set a bitmask defining in which traverse pass the enter and leave nodes are used. Use the PASSES enum above to control multipass rendering!

Set to ALLPASSES if you want to render in all passes

Parameters
_passStatusBitmask defining in which traverse pass the enter and leave nodes are used

Definition at line 481 of file MeshNode2T.cc.

void ACG::SceneGraph::ACG::SceneGraph::BaseNode::setRenderObjectModifier ( RenderObjectModifier _modifier)
inline

Set modifier for render objects.

Render-objects can be modified, if the implementation of a node supports this. The currently active modifier should be applied directly before adding an object to the renderer.

Parameters
_modifierpointer to address of modifier, address must be valid whenever the node creates render-objects

Definition at line 641 of file MeshNode2T.cc.

void ACG::SceneGraph::BaseNode::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.

Assigns a set of shaders to a primitive type of a node. For instance, it is possible to render faces with a different shaders than lines. Default shaders are used instead if no other shaders are provided. Note: the derived node has to actually make use of shaders provided here

Example: set shaders in OpenFlipper/Shaders/MyWireShaders for rendering the line parts of a node: node->setRenderobjectShaders("MyWireShaders/v.glsl", "MyWireShaders/g.glsl", "MyWireShaders/f.glsl", true, ACG::SceneGraph::DrawModes::PRIMITIVE_WIREFRAME);

Parameters
_vertexShaderFilefilename of vertex shader template compatible with ACG::ShaderGenerator
_geometryShaderFilefilename of geometry shader template compatible with ACG::ShaderGenerator
_fragmentShaderFilefilename of fragment shader template compatible with ACG::ShaderGenerator
_relativePathsfilenames are relative or absolute
_primitiveTypeassign shaders to rendering this type of primitive of the polyline

Definition at line 267 of file BaseNode.cc.

void ACG::SceneGraph::BaseNode::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.

Assigns a set of shaders to a primitive type of a node. For instance, it is possible to render faces with a different shaders than lines. Default shaders are used instead if no other shaders are provided. Note: the derived node has to actually make use of shaders provided here

Example: set shaders in OpenFlipper/Shaders/MyWireShaders for rendering the line parts of a node: node->setRenderObjectShaders("MyWireShaders/v.glsl", "MyWireShaders/g.glsl", "MyWireShaders/f.glsl", true, ACG::SceneGraph::DrawModes::PRIMITIVE_WIREFRAME);

Parameters
_vertexShaderFilefilename of vertex shader template compatible with ACG::ShaderGenerator
_tessControlShaderFilefilename of tessellation-control shader template compatible with ACG::ShaderGenerator
_tessEvalShaderFilefilename of tessellation-eval shader template compatible with ACG::ShaderGenerator
_geometryShaderFilefilename of geometry shader template compatible with ACG::ShaderGenerator
_fragmentShaderFilefilename of fragment shader template compatible with ACG::ShaderGenerator
_relativePathsfilenames are relative or absolute
_primitiveTypeassign shaders to rendering this type of primitive of the polyline

Definition at line 280 of file BaseNode.cc.

void ACG::SceneGraph::BaseNode::setRenderObjectTexture ( int  _samplerSlot,
GLuint  _texId,
GLenum  _texType = GL_TEXTURE_2D 
)

Set textures for shader based rendering.

Assign textures to sampler slots. Note: Fixed-function drawing ignores these textures. Also, it is still necessary to set the according sampler index in a UniformPool to access this texture in a shader.

Parameters
_samplerSlotsampler slot to bind the texture to, zero-based index
_texIdgl texture id
_texTypegl texture type ie. GL_TEXTURE_1D, ..

Definition at line 295 of file BaseNode.cc.

void ACG::SceneGraph::ACG::SceneGraph::BaseNode::setRenderObjectUniformPool ( const GLSL::UniformPool _pool)
inline

Set uniforms for shader based rendering.

Uniforms are copied from a pool when rendering with shader-based render-objects. The specified pool has to be a valid memory address whenever the objects are rendered. It does not make a copy of the pool.

Parameters
_poolpointer to address of a uniform pool

Definition at line 612 of file MeshNode2T.cc.

Member Data Documentation

MultipassBitMask ACG::SceneGraph::ACG::SceneGraph::BaseNode::multipassNode_
private

multi pass bit mask (1-indexed) Defines in which multipass runs an action should be applied to the node. (Only applies during multipass traversal!)

Definition at line 672 of file MeshNode2T.cc.

MultipassBitMask ACG::SceneGraph::ACG::SceneGraph::BaseNode::multipassStatus_
private

multi pass bit mask (1-indexed) Defines in which multipass runs the enter and leave functions should be called. (Only applies during multipass traversal!)

Definition at line 666 of file MeshNode2T.cc.

bool ACG::SceneGraph::ACG::SceneGraph::BaseNode::pickingEnabled_
private

Flag indicating if picking should be done for this object This flag has to be checked by your node if you implement picking

Definition at line 709 of file MeshNode2T.cc.


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