Developer Documentation

Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ACG::SceneGraph::BaseNode Class Referenceabstract

`#include <ACG/Scenegraph/BaseNode.hh>`

Inheritance diagram for ACG::SceneGraph::BaseNode:

## 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::vector< BaseNode * >::const_iterator | ConstChildIter
| allows to iterate over children
typedef std::vector< BaseNode * >::iterator | ChildIter
| allows to iterate over children
typedef std::vector< BaseNode * >::const_reverse_iterator | ConstChildRIter
| allows to reverse iterate over children
typedef std::vector< 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 | 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)
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)
BaseNode * | find (const std::string &_name)
BaseNode * | parent ()
| Get the nodes parent node.
const BaseNode * | parent () 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
BaseNode * | parent_
| pointer to parent node
std::string | name_
| name of node
StatusMode | status_
| node status()
std::vector< 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::UniformPool * | uniformPool_
| user provided uniform pool for shader constants
RenderObjectModifier * | renderModifier_
| render-object modifier

## Static Private Attributes
static unsigned int | last_id_used__
| 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::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...

## Detailed Description

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

Definition at line 104 of file BaseNode.hh.

## Member Enumeration Documentation

## ◆ StatusMode

enum ACG::SceneGraph::BaseNode::StatusMode

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 389 of file BaseNode.hh.

## ◆ TraverseMode

enum ACG::SceneGraph::BaseNode::TraverseMode

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 438 of file BaseNode.hh.

## Member Function Documentation

## ◆ applyRenderObjectSettings()

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

  _primitive | the primitive type of the render-object
  _obj | the render-object [in/out]

## ◆ availableDrawModes()

virtual DrawModes::DrawMode ACG::SceneGraph::BaseNode::availableDrawModes | ( |  | ) | const
| inline virtual

Return a list of available draw modes for this node: should be OR'ed from the items of the enum DrawModeIDs.

Reimplemented in PlaneNode.

Definition at line 136 of file BaseNode.hh.

## ◆ boundingBox()

virtual void ACG::SceneGraph::BaseNode::boundingBox | ( | Vec3d & | ,
|  | Vec3d & |
| ) |  |
| inline virtual

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 PlaneNode.

Definition at line 143 of file BaseNode.hh.

## ◆ delete_subtree()

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.

## ◆ draw()

virtual void ACG::SceneGraph::BaseNode::draw | ( | GLState & | ,
|  | const DrawModes::DrawMode & |
| ) |  |
| inline virtual

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 PlaneNode.

Definition at line 192 of file BaseNode.hh.

## ◆ drawMode()

void 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 433 of file BaseNode.hh.

## ◆ enablePicking()

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

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

Definition at line 265 of file BaseNode.hh.

## ◆ enter() [1/2]

virtual void ACG::SceneGraph::BaseNode::enter | ( | GLState & | ,
|  | const DrawModes::DrawMode & |
| ) |  |
| inline virtual

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.

There are two overloads of the enter() function, one with IRenderer* parameter, the other one without. As long the overload with IRenderer* parameter is not being overridden, all renderers will make use of the overload without the IRenderer* parameter. If the overload with IRenderer* parameter is being overridden, only legacy renderers will use the version without the additional parameter and new renderers implementing the IRenderer interface will use the version with the additional parameter.

See also
  MaterialNode

Definition at line 160 of file BaseNode.hh.

## ◆ enter() [2/2]

virtual void ACG::SceneGraph::BaseNode::enter | ( | IRenderer * | ,
|  | GLState & | _state,
|  | const DrawModes::DrawMode & | _drawMode
| ) |  |
| inline virtual

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.

If you do not need the IRenderer* argument in your override of this function, simply use the override without the additional parameter.

There are two overloads of the enter() function, one with IRenderer* parameter, the other one without. As long the overload with IRenderer* parameter is not being overridden, all renderers will make use of the overload without the IRenderer* parameter. If the overload with IRenderer* parameter is being overridden, only legacy renderers will use the version without the additional parameter and new renderers implementing the IRenderer interface will use the version with the additional parameter.

Definition at line 178 of file BaseNode.hh.

## ◆ enterPick()

virtual 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.

## ◆ find() [1/2]

ChildIter 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 346 of file BaseNode.hh.

## ◆ find() [2/2]

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

Find a node of a given name

Definition at line 355 of file BaseNode.hh.

## ◆ getRenderObjectModifier()

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

Get render-object modifier.

Definition at line 670 of file BaseNode.hh.

## ◆ getRenderObjects()

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

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

  _renderer | The renderer which will be used. Add your geometry into this class
  _state | The current GL State when this object is called
  _drawMode | The active draw mode
  _mat | Current material

Reimplemented in PlaneNode.

Definition at line 210 of file BaseNode.hh.

## ◆ getRenderObjectUniformPool()

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

Get uniforms for shader based rendering.

Definition at line 641 of file BaseNode.hh.

## ◆ id()

unsigned int 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 423 of file BaseNode.hh.

## ◆ leave() [1/2]

virtual void ACG::SceneGraph::BaseNode::leave | ( | GLState & | ,
|  | const DrawModes::DrawMode & |
| ) |  |
| inline virtual

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

There are two overloads of the leave() function, one with IRenderer* parameter, the other one without. As long the overload with IRenderer* parameter is not being overridden, all renderers will make use of the overload without the IRenderer* parameter. If the overload with IRenderer* parameter is being overridden, only legacy renderers will use the version without the additional parameter and new renderers implementing the IRenderer interface will use the version with the additional parameter.

Definition at line 223 of file BaseNode.hh.

## ◆ leave() [2/2]

virtual void ACG::SceneGraph::BaseNode::leave | ( | IRenderer * | ,
|  | GLState & | _state,
|  | const DrawModes::DrawMode & | _drawMode
| ) |  |
| inline virtual

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

If you do not need the IRenderer* argument in your override of this function, simply use the override without the additional parameter.

There are two overloads of the leave() function, one with IRenderer* parameter, the other one without. As long the overload with IRenderer* parameter is not being overridden, all renderers will make use of the overload without the IRenderer* parameter. If the overload with IRenderer* parameter is being overridden, only legacy renderers will use the version without the additional parameter and new renderers implementing the IRenderer interface will use the version with the additional parameter.

Definition at line 239 of file BaseNode.hh.

## ◆ leavePick()

virtual 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.

## ◆ multipassNode()

MultipassBitMask 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 537 of file BaseNode.hh.

## ◆ multipassNodeActive()

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

  _i | Check this pass if an action will be applied to the node.

## ◆ multipassNodeSetActive()

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

  _i | Pass in which the node should be rendered
  _active | Enable or disable node in this pass?

## ◆ multipassStatus()

MultipassBitMask 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 493 of file BaseNode.hh.

## ◆ multipassStatusActive()

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

  _i | Check this pass if the nodes enter/leave functions are active

## ◆ multipassStatusSetActive()

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

  _i | Pass in which the node should be rendered
  _active | Activate or deactivate in this pass?

## ◆ pick()

virtual void ACG::SceneGraph::BaseNode::pick | ( | GLState & | ,
|  | PickTarget |
| ) |  |
| inline virtual

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 PlaneNode.

Definition at line 254 of file BaseNode.hh.

## ◆ pickingEnabled()

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

Check if picking is enabled for this node

Definition at line 269 of file BaseNode.hh.

## ◆ remove()

void 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 330 of file BaseNode.hh.

## ◆ set_parent()

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.

## ◆ setMultipassNode()

void 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

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

Definition at line 549 of file BaseNode.hh.

## ◆ setMultipassStatus()

void 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

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

Definition at line 505 of file BaseNode.hh.

## ◆ setRenderObjectModifier()

void 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

  _modifier | pointer to address of modifier, address must be valid whenever the node creates render-objects

Definition at line 665 of file BaseNode.hh.

## ◆ setRenderObjectShaders() [1/2]

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

  _vertexShaderFile | filename of vertex shader template compatible with ACG::ShaderGenerator
  _geometryShaderFile | filename of geometry shader template compatible with ACG::ShaderGenerator
  _fragmentShaderFile | filename of fragment shader template compatible with ACG::ShaderGenerator
  _relativePaths | filenames are relative or absolute
  _primitiveType | assign shaders to rendering this type of primitive of the polyline

## ◆ setRenderObjectShaders() [2/2]

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

  _vertexShaderFile | filename of vertex shader template compatible with ACG::ShaderGenerator
  _tessControlShaderFile | filename of tessellation-control shader template compatible with ACG::ShaderGenerator
  _tessEvalShaderFile | filename of tessellation-eval shader template compatible with ACG::ShaderGenerator
  _geometryShaderFile | filename of geometry shader template compatible with ACG::ShaderGenerator
  _fragmentShaderFile | filename of fragment shader template compatible with ACG::ShaderGenerator
  _relativePaths | filenames are relative or absolute
  _primitiveType | assign shaders to rendering this type of primitive of the polyline

## ◆ setRenderObjectTexture()

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

  _samplerSlot | sampler slot to bind the texture to, zero-based index
  _texId | gl texture id
  _texType | gl texture type ie. GL_TEXTURE_1D, ..

## ◆ setRenderObjectUniformPool()

void 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

  _pool | pointer to address of a uniform pool

Definition at line 636 of file BaseNode.hh.

## Member Data Documentation

## ◆ multipassNode_

MultipassBitMask 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 696 of file BaseNode.hh.

## ◆ multipassStatus_

MultipassBitMask 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 690 of file BaseNode.hh.

## ◆ pickingEnabled_

bool 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 733 of file BaseNode.hh.

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

- OpenFlipper/libs_required/ACG/Scenegraph/BaseNode.hh