Developer Documentation
ACG::SceneGraph Namespace Reference

Namespaces

 DrawModes
 

Classes

class  ArrayResourceManagerNodeT
 
class  ArrowNode
 
class  BaseNode
 
class  BoundingBoxAction
 
class  BoundingBoxNode
 
struct  BoxElement
 
class  BoxesNode
 
class  BSplineCurveNodeT
 
class  BSplineSurfaceNodeT
 
class  CameraNode
 
class  CartesianClippingNode
 
class  CheckDirtyAction
 
class  ClippingNode
 
class  CollectActiveDrawModesAction
 
class  CollectDrawModesAction
 
class  CoordFrameNode
 
class  CoordinateSystemNode
 Node for displaying coordinate systems. More...
 
class  CoordsysNode
 
class  DrawAction
 
struct  enable_if
 
struct  enable_if< false, T >
 
class  EnvMapNode
 
class  FindNodeAction
 
class  GlutPrimitiveNode
 
class  GridNode
 
class  LightNode
 
class  LightSource
 Structure to hold options for one LightSource. More...
 
class  LightSourceHandle
 
class  LightSourceNode
 
class  LineNode
 
struct  LockModT
 
class  LockNodeT
 
class  ManipulatorNode
 
class  Material
 
class  MaterialNode
 
class  MeshNodeBase
 
class  MeshNodeT
 
class  MouseEventAction
 
class  MultiPassInfoAction
 
class  OBJNode
 
class  OSDTransformNode
 
class  PickAction
 
class  PointNode
 
class  PolyLineCollectionNodeT
 
class  PolyLineNodeT
 
class  PrincipalAxisNode
 
struct  PrincipalComponent
 
class  PtrResourceManagerNodeT
 
class  QtManipulatorNode
 
class  QtTranslationManipulatorNode
 
class  QtWidgetNode
 
class  QuadNode
 
struct  SelectionModT
 
class  SelectionNodeT
 
class  SeparatorNode
 
class  SetDrawModesAction
 
class  ShaderNode
 
class  SkeletonNodeT
 
class  SliceNode
 
class  SplatCloudNode
 
struct  StatusModT
 
class  StatusNodeBaseT
 
class  StatusNodeBaseT< Mesh, Mod, false >
 
class  StatusNodeBaseT< Mesh, Mod, true >
 
class  StatusNodesBase
 The StatusNodesBase class extends StatusNodesT with a halfEdge vbo for coreProfile rendering support. More...
 
class  StatusNodeT
 
class  StatusViewNodeT
 
class  StencilRefNode
 
class  Strip
 class for managing a single triangle strip. More...
 
class  StripProcessorT
 
class  SwitchNode
 
class  TextNode
 
class  Texture3DNode
 
class  TextureNode
 
class  TextureRenderInfo
 
class  TrackballNode
 
class  TransformNode
 
class  TranslationManipulatorNode
 
class  TriangleNode
 
class  TriStripNodeDeprecatedT
 
class  VolumeMeshNodeT
 

Enumerations

enum  PickTarget {
  PICK_CELL, PICK_FACE, PICK_EDGE, PICK_VERTEX,
  PICK_ANYTHING, PICK_FRONT_EDGE, PICK_FRONT_VERTEX, PICK_SPLINE
}
 What target to use for picking. More...
 

Functions

BaseNodefind_node (BaseNode *_root, unsigned int _node_idx)
 Find a node in the scene graph. More...
 
BaseNodefind_hidden_node (BaseNode *_root, unsigned int _node_idx)
 Find a node in the scene graph. More...
 
template<typename Action >
enable_if< has_enter< Action, void(Action::*)(BaseNode *) >::value, void >::type if_has_enter (Action &_action, BaseNode *_node)
 
template<typename Action >
enable_if<!has_enter< Action, void(Action::*)(BaseNode *) >::value, void >::type if_has_enter (Action &, BaseNode *)
 
template<typename Action >
enable_if< has_leave< Action, void(Action::*)(BaseNode *) >::value, void >::type if_has_leave (Action &_action, BaseNode *_node)
 
template<typename Action >
enable_if<!has_enter< Action, void(Action::*)(BaseNode *) >::value, void >::type if_has_leave (Action &, BaseNode *)
 
template<class Action >
void traverse (BaseNode *_node, Action &_action)
 
template<class Action >
void traverse_all (BaseNode *_node, Action &_action)
 
template<class Action >
void traverse_multipass (BaseNode *_node, Action &_action, const unsigned int &_pass)
 
template<class Action >
void traverse_multipass (BaseNode *_node, Action &_action, GLState &_state, DrawModes::DrawMode=DrawModes::DEFAULT)
 
void analyzeSceneGraph (ACG::SceneGraph::BaseNode *_root, unsigned int &_maxPasses, ACG::Vec3d &_bbmin, ACG::Vec3d &_bbmax)
 Analyze the SceneGraph <ACG/Scenegraph/SceneGraphAnalysis.hh> More...
 
bool stripTextureCompare (const Strip &i, const Strip &j)
 Compare function for sorting Strips depending on their texture index.
 

Variables

const Vec4f cylinder_color (0.8f, 0.4f, 0.4f, 1.0f)
 
const Vec4f sphere_color (0.8f, 0.4f, 0.4f, 1.0f)
 
const Vec4f select_color (1.0f, 0.1f, 0.1f, 1.0f)
 
const float SCALE_CONST = 5.0f
 
const Vec4f colors [4][6]
 

Detailed Description

This namespace holds the ACG scene graph, all its nodes and helpers.

Enumeration Type Documentation

◆ PickTarget

What target to use for picking.

Enumerator
PICK_CELL 

picks faces (may not be implemented for all nodes)

PICK_FACE 

picks faces (should be implemented for all nodes)

PICK_EDGE 

picks edges (may not be implemented for all nodes)

PICK_VERTEX 

picks verices (may not be implemented for all nodes)

PICK_ANYTHING 

pick any of the prior targets (should be implemented for all nodes)

PICK_FRONT_EDGE 

picks only visible front edges (may not be implemented for all nodes)

PICK_FRONT_VERTEX 

picks only visible front verices (may not be implemented for all nodes)

PICK_SPLINE 

Pick spline curve or surface (picks u or u,v coords respectively)

Definition at line 73 of file PickTarget.hh.

Function Documentation

◆ analyzeSceneGraph()

ACGDLLEXPORT void ACG::SceneGraph::analyzeSceneGraph ( ACG::SceneGraph::BaseNode _root,
unsigned int &  _maxPasses,
ACG::Vec3d _bbmin,
ACG::Vec3d _bbmax 
)

Analyze the SceneGraph <ACG/Scenegraph/SceneGraphAnalysis.hh>

Parameters
_rootRoot node of the scenegraph
_maxPassesReturns the maximal number of render passes
_bbminReturns lower left of the bounding box
_bbmaxReturns upper right of the bounding box

Definition at line 56 of file SceneGraphAnalysis.cc.

◆ find_hidden_node()

ACGDLLEXPORT BaseNode * ACG::SceneGraph::find_hidden_node ( BaseNode _root,
unsigned int  _node_idx 
)

Find a node in the scene graph.

Traverses scenegraph just like the find_node function, but includes hidden nodes.

Definition at line 93 of file SceneGraph.cc.

◆ find_node()

ACGDLLEXPORT BaseNode * ACG::SceneGraph::find_node ( BaseNode _root,
unsigned int  _node_idx 
)

Find a node in the scene graph.

Traverse scenegraph starting at _root, looking for a node whose id is _node_idx . Returns 0 if node wasn't found.

Parameters
_rootThe root node where the traversal starts (not necessary the root node of the scenegraph)
_node_idxThe node index this function should look for
Returns
0 if the node was not found, otherwise a pointer to the node.

Definition at line 77 of file SceneGraph.cc.

◆ traverse()

template<class Action >
void ACG::SceneGraph::traverse ( BaseNode _node,
Action &  _action 
)

Traverse the scenegraph starting at the node _node and apply the action _action to each node. This traversal function will call the enter/leave functions of the action if they have been implemented.

Definition at line 137 of file SceneGraph.hh.

◆ traverse_all()

template<class Action >
void ACG::SceneGraph::traverse_all ( BaseNode _node,
Action &  _action 
)

Traverse the scenegraph exactly like the traverse() function does, but also include hidden nodes.

Definition at line 202 of file SceneGraph.hh.

◆ traverse_multipass() [1/2]

template<class Action >
void ACG::SceneGraph::traverse_multipass ( BaseNode _node,
Action &  _action,
const unsigned int &  _pass 
)

Traverse the scenegraph starting at the node _node and apply the action _action to each node. This traversal function will call the enter/leave functions of the action if they have been implemented. This function traverses the scene graph multiple times if multipass rendering is turned on. GLState holds attributes to control render passes. Attention: Render passes are 1-indexed.
!!! You should ot use this function directly. Use the traverse_multipass function which controls the glstate too. This function will also manage the passes for you!!!

Definition at line 254 of file SceneGraph.hh.

◆ traverse_multipass() [2/2]

template<class Action >
void ACG::SceneGraph::traverse_multipass ( BaseNode _node,
Action &  _action,
GLState _state,
DrawModes::DrawMode  = DrawModes::DEFAULT 
)

Traverse the scenegraph starting at the node _node and apply the action action to each node. When arriving at a node, its BaseNode::enter() function is called, then _action is applied and the node's children are traversed. After that the BaseNode::leave() method is called. Do this in multiple passes.

You have to initialize glstate before doing this:
In the state you give here use GLState::set_max_render_passes to set the maximum number of renderpasses that should be performed. This is not computed here, as the number only changes if the scenegraph is changed and not for all render calls.

See also
ACG::SceneGraph::BaseNode

Definition at line 329 of file SceneGraph.hh.

Variable Documentation

◆ colors

const Vec4f ACG::SceneGraph::colors[4][6]
Initial value:
= {
{
Vec4f(0.2f,0.2f,0.2f,1.0f), Vec4f(0.5f,0.5f,0.5f,1.0f), Vec4f(0.8f,0.8f,0.8f,1.0f),
Vec4f(0.2f,0.2f,0.2f,0.2f), Vec4f(0.5f,0.5f,0.5f,0.4f), Vec4f(0.8f,0.8f,0.8f,0.6f)
},
{
Vec4f(0.2f,0.0f,0.0f,1.0f), Vec4f(0.5f,0.0f,0.0f,1.0f), Vec4f(0.8f,0.0f,0.0f,1.0f),
Vec4f(0.3f,0.1f,0.1f,0.2f), Vec4f(0.5f,0.2f,0.2f,0.4f), Vec4f(0.8f,0.4f,0.4f,0.6f)
},
{
Vec4f(0.0f,0.2f,0.0f,1.0f), Vec4f(0.0f,0.5f,0.0f,1.0f), Vec4f(0.0f,0.8f,0.0f,1.0f),
Vec4f(0.1f,0.3f,0.1f,0.2f), Vec4f(0.2f,0.5f,0.2f,0.4f), Vec4f(0.4f,0.8f,0.4f,0.6f)
},
{
Vec4f(0.0f,0.0f,0.2f,1.0f), Vec4f(0.0f,0.0f,0.5f,1.0f), Vec4f(0.0f,0.0f,0.8f,1.0f),
Vec4f(0.1f,0.1f,0.3f,0.2f), Vec4f(0.2f,0.2f,0.5f,0.4f), Vec4f(0.4f,0.4f,0.8f,0.6f)
}
}

Definition at line 80 of file TranslationManipulatorNode.cc.