Developer Documentation
SceneGraph.hh
Go to the documentation of this file.
1 /*===========================================================================*\
2  * *
3  * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39  * *
40 \*===========================================================================*/
41 
42 
43 
51 //=============================================================================
52 //
53 // CLASS SceneGraph
54 //
55 //=============================================================================
56 
57 #ifndef ACG_SCENEGRAPH_HH
58 #define ACG_SCENEGRAPH_HH
59 
60 
61 //== INCLUDES =================================================================
62 
63 #include "BaseNode.hh"
64 #include "DrawModes.hh"
65 #include "../Math/VectorT.hh"
66 #include <cfloat>
67 
68 #include <QMouseEvent>
69 
70 //== NAMESPACES ===============================================================
71 
72 namespace ACG {
73 namespace SceneGraph {
74 
75 
76 //== CLASS DEFINITION =========================================================
77 
81 template<bool C, typename T = void>
82 struct enable_if {
83  typedef T type;
84 };
85 
86 template<typename T>
87 struct enable_if<false, T> { };
88 
89 #define HAS_MEM_FUNC(func) \
90  template<typename T, typename Sign> \
91  struct has_##func { \
92  template <typename U, U> struct type_check; \
93  template <typename _1> static char (& chk(type_check<Sign, &_1::func> *))[1]; \
94  template <typename > static char (& chk(...))[2]; \
95  static bool const value = sizeof(chk<T>(0)) == 1; \
96  };
97 
98 HAS_MEM_FUNC(enter)
99 
100 // if the enter function is implemented
101 template<typename Action>
103 if_has_enter(Action &_action, BaseNode *_node) {
104  _action.enter (_node);
105 }
106 
107 // if the enter function isn't implemented
108 template<typename Action>
110 if_has_enter(Action &, BaseNode *) {
111 }
112 
113 HAS_MEM_FUNC(leave)
114 
115 // if the enter function is implemented
116 template<typename Action>
118 if_has_leave(Action &_action, BaseNode *_node) {
119  _action.leave (_node);
120 }
121 
122 // if the enter function isn't implemented
123 template<typename Action>
125 if_has_leave(Action &, BaseNode *) {
126 }
127 
128 //----------------------------------------------------------------------------
129 
130 
135 template <class Action>
136 void
137 traverse( BaseNode* _node, Action& _action )
138 {
139  if (_node)
140  {
141  BaseNode::StatusMode status(_node->status());
142 
143 
144  // If the subtree is hidden, ignore this node and its children while rendering
145  if (status != BaseNode::HideSubtree)
146  {
147 
148  bool process_children(status != BaseNode::HideChildren);
149 
150  // If the node itself is hidden, ignore it but continue with its children
151  if (_node->status() != BaseNode::HideNode)
152  {
153  // Executes this nodes enter function (if available)
154  if_has_enter (_action, _node);
155 
156  // Test rendering order. If NodeFirst, execute this node and the children later.
157  if (_node->traverseMode() & BaseNode::NodeFirst)
158  process_children &= _action(_node);
159  }
160 
161  if (process_children)
162  {
163 
164  BaseNode::ChildIter cIt, cEnd(_node->childrenEnd());
165 
166  // Process all children which are not second pass
167  for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
168  if (~(*cIt)->traverseMode() & BaseNode::SecondPass)
169  traverse(*cIt, _action);
170 
171  // Process all children which are second pass
172  for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
173  if ((*cIt)->traverseMode() & BaseNode::SecondPass)
174  traverse(*cIt, _action);
175 
176  }
177 
178  // If the node is not hidden
179  if (_node->status() != BaseNode::HideNode)
180  {
181 
182  // If the children had to be rendered first, we now render the node afterwards
183  if (_node->traverseMode() & BaseNode::ChildrenFirst)
184  _action(_node);
185 
186  // Call the leave function of the node.
187  if_has_leave (_action, _node);
188  }
189 
190  }
191  }
192 }
193 
194 //---------------------------------------------------------------------------------
195 
200 template <class Action>
201 void
202 traverse_all( BaseNode* _node, Action & _action)
203 {
204  if(_node)
205  {
206  bool process_children(true);
207 
208  // Executes this nodes enter function (if available)
209  if_has_enter(_action, _node);
210 
211  // Test rendering order. If NodeFirst, execute this node and the children later.
212  if(_node->traverseMode() & BaseNode::NodeFirst)
213  process_children &= _action(_node);
214 
215  if(process_children)
216  {
217  BaseNode::ChildIter cIt, cEnd(_node->childrenEnd());
218 
219  // Process all children which are not second pass
220  for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
221  if (~(*cIt)->traverseMode() & BaseNode::SecondPass)
222  traverse_all(*cIt, _action);
223 
224  // Process all children which are second pass
225  for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
226  if ((*cIt)->traverseMode() & BaseNode::SecondPass)
227  traverse_all(*cIt, _action);
228  }
229 
230  // If the children had to be rendered first, we now render the node afterwards
231  if (_node->traverseMode() & BaseNode::ChildrenFirst)
232  _action(_node);
233 
234  // Call the leave function of the node.
235  if_has_leave (_action, _node);
236  }
237 }
238 
239 //---------------------------------------------------------------------------------
240 
252 template <class Action>
253 void
254 traverse_multipass ( BaseNode* _node, Action& _action, const unsigned int& _pass )
255 {
256 
257  // Process node if it exists
258  if (_node) {
259  BaseNode::StatusMode status(_node->status());
260 
261 
262  // If the subtree is hidden, ignore this node and its children while rendering
263  if (status != BaseNode::HideSubtree) {
264 
265  bool process_children(status != BaseNode::HideChildren);
266 
267  // Executes this nodes enter function (if available and active in multipass)
268  if ( _node->multipassStatusActive(_pass) ) {
269  if_has_enter(_action, _node);
270  }
271 
272  // If the node itself is hidden, don't call the action on it.
273  // Additionally check if rendering order is node first. otherwise, we will call it after the children.
274  // And check if it should be called in this rendering pass.
275  if ( (_node->status() != BaseNode::HideNode ) && ( _node->traverseMode() & BaseNode::NodeFirst ) && _node->multipassNodeActive(_pass))
276  process_children &= _action(_node);
277 
278  if (process_children) {
279 
280  BaseNode::ChildIter cIt, cEnd(_node->childrenEnd());
281 
282  // Process all children
283  for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
284  if (~(*cIt)->traverseMode() & BaseNode::SecondPass)
285  traverse_multipass(*cIt, _action, _pass);
286 
287  // Process all children which are second pass
288  for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
289  if ((*cIt)->traverseMode() & BaseNode::SecondPass)
290  traverse_multipass(*cIt, _action, _pass);
291 
292  }
293 
294 
295  // If we are in childrenfirst node, the children have been painted andwe now check, if we can draw this node.
296  // If its hidden, ignore it.
297  // If it should not be rendered in this pass, ignore it too.
298  if ( (_node->traverseMode() & BaseNode::ChildrenFirst ) && (_node->status() != BaseNode::HideNode) && _node->multipassNodeActive(_pass) )
299  _action(_node);
300 
301  // Call the leave function of the node (if available and active in multipass).
302  if ( _node->multipassStatusActive(_pass) )
303  if_has_leave(_action, _node);
304 
305  } // if (status != BaseNode::HideSubtree)
306  } // if(node_)
307 }
308 
309 
310 //----------------------------------------------------------------------------
311 
327 template <class Action>
328 void
330  Action& _action,
331  GLState& _state,
333 {
334  // Reset render pass counter
335  _state.reset_render_pass();
336 
337  // Get max render passes
338  unsigned int max_passes = _state.max_render_passes();
339 
340  // Render all passes
341  for(unsigned int pass = BaseNode::PASS_1; pass <= (BaseNode::PASS_1 + max_passes); ++pass) {
342 
343  // Traverse scenegraph
344  traverse_multipass (_node, _action, pass);
345  // Increment render pass counter by 1
346  _state.next_render_pass();
347  }
348 
349  // Reset render pass counter
350  _state.reset_render_pass();
351 }
352 
353 //--------------------------------------------------------------------------------
354 
363 {
364 public:
365 
367  bbMin_( FLT_MAX, FLT_MAX, FLT_MAX),
368  bbMax_(-FLT_MAX, -FLT_MAX, -FLT_MAX),
369  state_(false, ACG::compatibilityProfile())
370  { }
371 
372  bool operator()(BaseNode* _node)
373  {
374  Vec3d bbMin( FLT_MAX, FLT_MAX, FLT_MAX);
375  Vec3d bbMax(-FLT_MAX, -FLT_MAX, -FLT_MAX);
376  _node->boundingBox(bbMin, bbMax);
377 
378  if ((bbMin[0] > bbMax[0]) ||
379  (bbMin[1] > bbMax[1]) ||
380  (bbMin[2] > bbMax[2]))
381  return true;
382 
383  bbMin_.minimize(state_.modelview().transform_point (bbMin));
384  bbMin_.minimize(state_.modelview().transform_point (bbMax));
385  bbMax_.maximize(state_.modelview().transform_point (bbMin));
386  bbMax_.maximize(state_.modelview().transform_point (bbMax));
387  return true;
388  }
389 
390  void enter (BaseNode *_node)
391  {
392  _node->enter(state_, DrawModes::DEFAULT);
393  }
394 
395  void leave (BaseNode *_node)
396  {
397  _node->leave(state_, DrawModes::DEFAULT);
398  }
399 
401  const Vec3d& bbMin() const { return bbMin_; }
403  const Vec3d& bbMax() const { return bbMax_; }
404 
405 private:
406 
407  Vec3d bbMin_, bbMax_;
408  GLState state_;
409 };
410 
411 
412 //-----------------------------------------------------------------------------
413 
414 
427 {
428 public:
429 
431  statusPasses_(BaseNode::ALLPASSES),
432  nodePasses_(BaseNode::ALLPASSES)
433  {}
434 
435  bool operator()(BaseNode* _node) {
436 
437  // Get status pass
438  BaseNode::MultipassBitMask statusPass = _node->multipassStatus();
439 
440  // Ignore if set to ALLPASSES as we want to get the real maximum pass number
441  if ( statusPass != BaseNode::ALLPASSES) {
442  // Convert render pass bit mask to
443  // decimal value (0x001011 -> 4)
444  // Note: Same as (int)log2(bitmask)
445  unsigned int c = 0;
446 
447  // Skip the first one as this is the ALLPASSES flag
448  statusPass = statusPass >> 1;
449 
450  while( statusPass != 0u ) {
451  statusPass = statusPass >> 1;
452  ++c;
453  }
454  statusPasses_ = c > statusPasses_ ? c : statusPasses_;
455  }
456 
457 
458  // Get Node pass
459  BaseNode::MultipassBitMask nodePass = _node->multipassNode();
460 
461  // Ignore if set to ALLPASSES as we want to get the real maximum pass number
462  if ( nodePass != BaseNode::ALLPASSES) {
463  // Convert render pass bit mask to
464  // decimal value (0x001011 -> 4)
465  // Note: Same as (int)log2(bitmask)
466  unsigned int c = 0;
467 
468  // Skip the first one as this is the ALLPASSES flag
469  nodePass = nodePass >> 1;
470 
471  while(nodePass != 0u) {
472  nodePass = nodePass >> 1;
473  ++c;
474  }
475  nodePasses_ = c > nodePasses_ ? c : nodePasses_;
476  }
477 
478  return true;
479  }
480 
485  unsigned int getMaxPasses() const {
486  unsigned int maxpasses = std::max(statusPasses_,nodePasses_);
487 
488  // if maxpasses is 0 we have all nodes in ALLPASSES mode so we render only once
489  return maxpasses == 0 ? 1 : maxpasses;
490  }
491 
496  unsigned int getStatusPasses() { return statusPasses_ == 0 ? 1 : statusPasses_; };
497 
502  unsigned int getNodePasses() { return nodePasses_ == 0 ? 1 : nodePasses_; };
503 
504 private:
505 
506  unsigned int statusPasses_;
507  unsigned int nodePasses_;
508 
509 };
510 
511 
512 //----------------------------------------------------------------------------
513 
514 
524 {
525 public:
526 
528  explicit FindNodeAction(unsigned int _node_id) :
529  node_id_(_node_id), node_ptr_(0) {}
530 
531  bool operator()(BaseNode* _node)
532  {
533  if (_node->id() == node_id_)
534  {
535  node_ptr_ = _node;
536  return false;
537  }
538  return true;
539  }
540 
542  BaseNode* node_ptr() { return node_ptr_; }
543 
544 private:
545 
546  unsigned int node_id_;
547  BaseNode* node_ptr_;
548 };
549 
550 
551 ACGDLLEXPORT
552 BaseNode* find_node( BaseNode* _root, unsigned int _node_idx );
553 
554 ACGDLLEXPORT
555 BaseNode* find_hidden_node( BaseNode* _root, unsigned int _node_idx );
556 
557 
558 //----------------------------------------------------------------------------
559 
560 
570 {
571 public:
572 
573  CollectDrawModesAction() : drawModes_(DrawModes::NONE) {}
574 
575  bool operator()(BaseNode* _node)
576  {
577  drawModes_ |= _node->availableDrawModes();
578  return true;
579  }
580 
582  DrawModes::DrawMode drawModes() const { return drawModes_; }
583 
584 private:
585 
586  DrawModes::DrawMode drawModes_;
587 };
588 
589 //----------------------------------------------------------------------------
590 
591 
601 {
602 public:
603 
605 
606  bool operator()(BaseNode* _node)
607  {
608  drawMode_ |= _node->drawMode();
609  return true;
610  }
611 
613  DrawModes::DrawMode drawMode() const { return drawMode_; }
614 
615 private:
616 
617  DrawModes::DrawMode drawMode_;
618 };
619 
620 //----------------------------------------------------------------------------
621 
622 
633 {
634 public:
635 
644  SetDrawModesAction(const DrawModes::DrawMode& _mode, bool _force = false ) : newModes_(_mode),force_(_force) {}
645 
646  bool operator()(BaseNode* _node)
647  {
648  if ( newModes_ == DrawModes::DEFAULT )
649  _node->drawMode( DrawModes::DEFAULT );
650 
651  DrawModes::DrawMode availableModes = _node->availableDrawModes();
652 
653  if ( force_ ) {
654  // if force, we ignore if the mode is supported by the node and set it
655  _node->drawMode( newModes_ );
656  } else if ( availableModes & newModes_ ) {
657  // If its supported, we set it
658  _node->drawMode( availableModes & newModes_ );
659  } else {
660  // otherwise we switch the node to default draw mode (which will use the global mode)
661  _node->drawMode( DrawModes::DEFAULT );
662  }
663 
664 
665  return true;
666  }
667 
668 private:
669  DrawModes::DrawMode newModes_;
670  bool force_;
671 
672 };
673 
674 
675 //----------------------------------------------------------------------------
676 
677 
688 {
689 public:
690 
692  DrawAction(const DrawModes::DrawMode& _drawMode, GLState& _state, bool _blending) :
693  state_(_state),
694  drawMode_(_drawMode),
695  blending_(_blending) {}
696 
697  bool operator()( BaseNode* _node )
698  {
699  // draw only if Material status == DrawAction status
700  if(state_.blending() == blending_)
701  {
702  _node->setDirty (false);
703  if (_node->drawMode() == DrawModes::DEFAULT)
704  _node->draw(state_, drawMode_);
705  else
706  _node->draw(state_, _node->drawMode());
707  }
708  return true;
709  }
710 
711  void enter(BaseNode* _node)
712  {
713  if (_node->drawMode() == DrawModes::DEFAULT)
714  _node->enter(state_, drawMode_);
715  else
716  _node->enter(state_, _node->drawMode());
717  }
718 
719  void leave(BaseNode* _node)
720  {
721  if (_node->drawMode() == DrawModes::DEFAULT)
722  _node->leave(state_, drawMode_);
723  else
724  _node->leave(state_, _node->drawMode());
725  }
726 
727 private:
728 
729  GLState& state_;
730  DrawModes::DrawMode drawMode_;
731  bool blending_;
732 };
733 
734 
735 //----------------------------------------------------------------------------
736 
737 
746 class ACGDLLEXPORT PickAction
747 {
748 public:
749 
751  PickAction(GLState &_state, PickTarget _target, const DrawModes::DrawMode& _drawmode) :
752  state_(_state),
753  pickTarget_(_target),
754  drawmode_(_drawmode) {}
755 
758  bool operator()(BaseNode* _node);
759 
763  bool operator()(BaseNode* _node, GLState& _state);
764 
765  void enter(BaseNode* _node)
766  {
767  if (_node->drawMode() == DrawModes::DEFAULT)
768  _node->enterPick(state_, pickTarget_, drawmode_);
769  else
770  _node->enterPick(state_, pickTarget_, _node->drawMode());
771  }
772 
773  void leave(BaseNode* _node)
774  {
775  if (_node->drawMode() == DrawModes::DEFAULT)
776  _node->leavePick(state_, pickTarget_, drawmode_);
777  else
778  _node->leavePick(state_, pickTarget_, _node->drawMode());
779  }
780 
781 private:
782 
783  GLState &state_;
784  PickTarget pickTarget_;
785  DrawModes::DrawMode drawmode_;
786 };
787 
788 
789 //----------------------------------------------------------------------------
790 
791 
800 {
801 public:
802 
803 
804  MouseEventAction(QMouseEvent* _event, GLState& _state) :
805  state_(_state),
806  event_(_event) {}
807 
808  bool operator()(BaseNode* _node )
809  {
810  _node->mouseEvent(state_, event_);
811  return true;
812  }
813 
814 private:
815  GLState& state_;
816  QMouseEvent* event_;
817 };
818 
819 //----------------------------------------------------------------------------
820 
821 
830 {
831 public:
832 
833 
834  CheckDirtyAction() : dirty_(false) {}
835 
836  bool operator()(BaseNode* _node)
837  {
838  dirty_ |= _node->isDirty();
839  // don't traverse children if current node is _dirty
840  return !dirty_;
841  }
842 
843  bool isDirty() const { return dirty_; };
844 
845 private:
846 
847  bool dirty_;
848 };
849 
850 
851 //=============================================================================
852 } // namespace SceneGraph
853 } // namespace ACG
854 //=============================================================================
855 #endif // ACG_SCENEGRAPH_HH defined
856 //=============================================================================
857 
Draw this node, but hide children.
Definition: BaseNode.hh:396
PickAction(GLState &_state, PickTarget _target, const DrawModes::DrawMode &_drawmode)
constructor: what picking target to use
Definition: SceneGraph.hh:751
Namespace providing different geometric functions concerning angles.
Execute action on node first and then on its children.
Definition: BaseNode.hh:441
virtual void enterPick(GLState &_state, PickTarget _target, const DrawModes::DrawMode &_drawMode)
virtual void mouseEvent(GLState &, QMouseEvent *)
Handle mouse event (some interaction, e.g. modeling)
Definition: BaseNode.hh:272
unsigned int MultipassBitMask
Multipass pass bit mask type.
Definition: BaseNode.hh:469
Draw node in second pass.
Definition: BaseNode.hh:445
DrawModes::DrawMode drawMode() const
Get the collected draw modes.
Definition: SceneGraph.hh:613
ChildIter childrenEnd()
Returns: end-iterator of children.
Definition: BaseNode.hh:298
SetDrawModesAction(const DrawModes::DrawMode &_mode, bool _force=false)
Set draw modes for all nodes traversed with this action.
Definition: SceneGraph.hh:644
StatusMode
Status modi.
Definition: BaseNode.hh:389
virtual void leave(GLState &, const DrawModes::DrawMode &)
Definition: BaseNode.hh:223
DrawModes::DrawMode drawModes() const
Get the collected draw modes.
Definition: SceneGraph.hh:582
ChildIter childrenBegin()
Returns: begin-iterator of children.
Definition: BaseNode.hh:294
Hide this node, but draw children.
Definition: BaseNode.hh:394
Hide this node and its children.
Definition: BaseNode.hh:398
void reset_render_pass()
reset render pass counter
Definition: GLState.hh:987
bool multipassStatusActive(const unsigned int _i) const
Get multipass status to traverse in a specific pass.
void compatibilityProfile(bool _enableCoreProfile)
Store opengl core profile setting.
Definition: gl.cc:166
DrawModes::DrawMode drawMode() const
Return the own draw modes of this node.
Definition: BaseNode.hh:430
FindNodeAction(unsigned int _node_id)
constructor: _node_id is the node to be searched for
Definition: SceneGraph.hh:528
DrawMode DEFAULT
use the default (global) draw mode and not the node&#39;s own.
Definition: DrawModes.cc:72
bool multipassNodeActive(const unsigned int _i) const
Get Node status to traverse in a specific pass.
virtual void boundingBox(Vec3d &, Vec3d &)
Definition: BaseNode.hh:143
unsigned int traverseMode() const
Return how the node should be traversed.
Definition: BaseNode.hh:449
void setDirty(bool _dirty=true)
mark node for redrawn
Definition: BaseNode.hh:275
unsigned int getNodePasses()
Get the number of required node traversals from Scenegraph.
Definition: SceneGraph.hh:502
virtual void enter(GLState &, const DrawModes::DrawMode &)
Definition: BaseNode.hh:160
void traverse_all(BaseNode *_node, Action &_action)
Definition: SceneGraph.hh:202
unsigned int getStatusPasses()
Get the number of required status traversals from Scenegraph.
Definition: SceneGraph.hh:496
DrawMode NONE
not a valid draw mode
Definition: DrawModes.cc:71
const Vec3d & bbMin() const
Returns minimum point of the bounding box.
Definition: SceneGraph.hh:401
Execute action the children first and then on this node.
Definition: BaseNode.hh:443
BaseNode * node_ptr()
Get the pointer of the node (is 0 if node was not found)
Definition: SceneGraph.hh:542
virtual DrawModes::DrawMode availableDrawModes() const
Definition: BaseNode.hh:136
virtual void draw(GLState &, const DrawModes::DrawMode &)
Draw this node using the draw modes _drawMode.
Definition: BaseNode.hh:192
PickTarget
What target to use for picking.
Definition: PickTarget.hh:73
void traverse_multipass(BaseNode *_node, Action &_action, const unsigned int &_pass)
Definition: SceneGraph.hh:254
void traverse(BaseNode *_node, Action &_action)
Definition: SceneGraph.hh:137
BaseNode * find_node(BaseNode *_root, unsigned int _node_idx)
Find a node in the scene graph.
Definition: SceneGraph.cc:77
MultipassBitMask multipassStatus() const
Get the current multipass settings for the nodes status functions.
Definition: BaseNode.hh:493
virtual void leavePick(GLState &_state, PickTarget _target, const DrawModes::DrawMode &_drawMode)
unsigned int max_render_passes() const
get maximum number of render passes
Definition: GLState.hh:993
BaseNode * find_hidden_node(BaseNode *_root, unsigned int _node_idx)
Find a node in the scene graph.
Definition: SceneGraph.cc:93
unsigned int id() const
Definition: BaseNode.hh:423
MultipassBitMask multipassNode() const
Get the current multipass settings for the node.
Definition: BaseNode.hh:537
std::vector< BaseNode * >::iterator ChildIter
allows to iterate over children
Definition: BaseNode.hh:286
const Vec3d & bbMax() const
Returns maximum point of the bounding box.
Definition: SceneGraph.hh:403
void next_render_pass()
increment render pass counter
Definition: GLState.hh:990
DrawAction(const DrawModes::DrawMode &_drawMode, GLState &_state, bool _blending)
Constructor: draws the scenegraph using _drawMode.
Definition: SceneGraph.hh:692
bool isDirty() const
Check if node should be redrawn.
Definition: BaseNode.hh:278
StatusMode status() const
Get node&#39;s status.
Definition: BaseNode.hh:401
unsigned int getMaxPasses() const
Get the number of required traverse passes from Scenegraph.
Definition: SceneGraph.hh:485