Developer Documentation

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 * *
44 * $Revision$ *
45 * $Author$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49
57 //=============================================================================
58 //
59 // CLASS SceneGraph
60 //
61 //=============================================================================
62
63 #ifndef ACG_SCENEGRAPH_HH
64 #define ACG_SCENEGRAPH_HH
65
66
67 //== INCLUDES =================================================================
68
69 #include "BaseNode.hh"
70 #include "DrawModes.hh"
71 #include "../Math/VectorT.hh"
72 #include <cfloat>
73
74 #include <QMouseEvent>
75
76 //== NAMESPACES ===============================================================
77
78 namespace ACG {
79 namespace SceneGraph {
80
81
82 //== CLASS DEFINITION =========================================================
83
87 template<bool C, typename T = void>
88 struct enable_if {
89 typedef T type;
90 };
91
92 template<typename T>
93 struct enable_if<false, T> { };
94
95 #define HAS_MEM_FUNC(func) \
96 template<typename T, typename Sign> \
97 struct has_##func { \
98 template <typename U, U> struct type_check; \
99 template <typename _1> static char (& chk(type_check<Sign, &_1::func> *))[1]; \
100 template <typename > static char (& chk(...))[2]; \
101 static bool const value = sizeof(chk<T>(0)) == 1; \
102 };
103
104 HAS_MEM_FUNC(enter)
105
106 // if the enter function is implemented
107 template<typename Action>
108 typename enable_if<has_enter <Action, void (Action::*) (BaseNode *) >::value, void>::type
109 if_has_enter(Action &_action, BaseNode *_node) {
110 _action.enter (_node);
111 }
112
113 // if the enter function isn't implemented
114 template<typename Action>
115 typename enable_if<!has_enter <Action, void (Action::*) (BaseNode *) >::value, void>::type
116 if_has_enter(Action &, BaseNode *) {
117 }
118
119 HAS_MEM_FUNC(leave)
120
121 // if the enter function is implemented
122 template<typename Action>
123 typename enable_if<has_leave <Action, void (Action::*) (BaseNode *) >::value, void>::type
124 if_has_leave(Action &_action, BaseNode *_node) {
125 _action.leave (_node);
126 }
127
128 // if the enter function isn't implemented
129 template<typename Action>
130 typename enable_if<!has_enter <Action, void (Action::*) (BaseNode *) >::value, void>::type
131 if_has_leave(Action &, BaseNode *) {
132 }
133
134 //----------------------------------------------------------------------------
135
136
141 template <class Action>
142 void
143 traverse( BaseNode* _node, Action& _action )
144 {
145 if (_node)
146 {
147 BaseNode::StatusMode status(_node->status());
148
149
150 // If the subtree is hidden, ignore this node and its children while rendering
151 if (status != BaseNode::HideSubtree)
152 {
153
154 bool process_children(status != BaseNode::HideChildren);
155
156 // If the node itself is hidden, ignore it but continue with its children
157 if (_node->status() != BaseNode::HideNode)
158 {
159 // Executes this nodes enter function (if available)
160 if_has_enter (_action, _node);
161
162 // Test rendering order. If NodeFirst, execute this node and the children later.
163 if (_node->traverseMode() & BaseNode::NodeFirst)
164 process_children &= _action(_node);
165 }
166
167 if (process_children)
168 {
169
170 BaseNode::ChildIter cIt, cEnd(_node->childrenEnd());
171
172 // Process all children which are not second pass
173 for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
174 if (~(*cIt)->traverseMode() & BaseNode::SecondPass)
175 traverse(*cIt, _action);
176
177 // Process all children which are second pass
178 for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
179 if ((*cIt)->traverseMode() & BaseNode::SecondPass)
180 traverse(*cIt, _action);
181
182 }
183
184 // If the node is not hidden
185 if (_node->status() != BaseNode::HideNode)
186 {
187
188 // If the children had to be rendered first, we now render the node afterwards
189 if (_node->traverseMode() & BaseNode::ChildrenFirst)
190 _action(_node);
191
192 // Call the leave function of the node.
193 if_has_leave (_action, _node);
194 }
195
196 }
197 }
198 }
199
200 //---------------------------------------------------------------------------------
201
206 template <class Action>
207 void
208 traverse_all( BaseNode* _node, Action & _action)
209 {
210 if(_node)
211 {
212 bool process_children(true);
213
214 // Executes this nodes enter function (if available)
215 if_has_enter(_action, _node);
216
217 // Test rendering order. If NodeFirst, execute this node and the children later.
218 if(_node->traverseMode() & BaseNode::NodeFirst)
219 process_children &= _action(_node);
220
221 if(process_children)
222 {
223 BaseNode::ChildIter cIt, cEnd(_node->childrenEnd());
224
225 // Process all children which are not second pass
226 for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
227 if (~(*cIt)->traverseMode() & BaseNode::SecondPass)
228 traverse_all(*cIt, _action);
229
230 // Process all children which are second pass
231 for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
232 if ((*cIt)->traverseMode() & BaseNode::SecondPass)
233 traverse_all(*cIt, _action);
234 }
235
236 // If the children had to be rendered first, we now render the node afterwards
237 if (_node->traverseMode() & BaseNode::ChildrenFirst)
238 _action(_node);
239
240 // Call the leave function of the node.
241 if_has_leave (_action, _node);
242 }
243 }
244
245 //---------------------------------------------------------------------------------
246
258 template <class Action>
259 void
260 traverse_multipass ( BaseNode* _node, Action& _action, const unsigned int& _pass )
261 {
262
263 // Process node if it exists
264 if (_node) {
265 BaseNode::StatusMode status(_node->status());
266
267
268 // If the subtree is hidden, ignore this node and its children while rendering
269 if (status != BaseNode::HideSubtree) {
270
271 bool process_children(status != BaseNode::HideChildren);
272
273 // Executes this nodes enter function (if available and active in multipass)
274 if ( _node->multipassStatusActive(_pass) ) {
275 if_has_enter(_action, _node);
276 }
277
278 // If the node itself is hidden, don't call the action on it.
279 // Additionally check if rendering order is node first. otherwise, we will call it after the children.
280 // And check if it should be called in this rendering pass.
281 if ( (_node->status() != BaseNode::HideNode ) && ( _node->traverseMode() & BaseNode::NodeFirst ) && _node->multipassNodeActive(_pass))
282 process_children &= _action(_node);
283
284 if (process_children) {
285
286 BaseNode::ChildIter cIt, cEnd(_node->childrenEnd());
287
288 // Process all children
289 for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
290 if (~(*cIt)->traverseMode() & BaseNode::SecondPass)
291 traverse_multipass(*cIt, _action, _pass);
292
293 // Process all children which are second pass
294 for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
295 if ((*cIt)->traverseMode() & BaseNode::SecondPass)
296 traverse_multipass(*cIt, _action, _pass);
297
298 }
299
300
301 // If we are in childrenfirst node, the children have been painted andwe now check, if we can draw this node.
302 // If its hidden, ignore it.
303 // If it should not be rendered in this pass, ignore it too.
304 if ( (_node->traverseMode() & BaseNode::ChildrenFirst ) && (_node->status() != BaseNode::HideNode) && _node->multipassNodeActive(_pass) )
305 _action(_node);
306
307 // Call the leave function of the node (if available and active in multipass).
308 if ( _node->multipassStatusActive(_pass) )
309 if_has_leave(_action, _node);
310
311 } // if (status != BaseNode::HideSubtree)
312 } // if(node_)
313 }
314
315
316 //----------------------------------------------------------------------------
317
333 template <class Action>
334 void
335 traverse_multipass( BaseNode* _node,
336 Action& _action,
337 GLState& _state,
338 DrawModes::DrawMode /*_drawmode*/=DrawModes::DEFAULT)
339 {
340 // Reset render pass counter
341 _state.reset_render_pass();
342
343 // Get max render passes
344 unsigned int max_passes = _state.max_render_passes();
345
346 // Render all passes
347 for(unsigned int pass = BaseNode::PASS_1; pass <= (BaseNode::PASS_1 + max_passes); ++pass) {
348
349 // Traverse scenegraph
350 traverse_multipass (_node, _action, pass);
351 // Increment render pass counter by 1
352 _state.next_render_pass();
353 }
354
355 // Reset render pass counter
356 _state.reset_render_pass();
357 }
358
359 //--------------------------------------------------------------------------------
360
368 class BoundingBoxAction
369 {
370 public:
371
372 BoundingBoxAction() :
373 bbMin_( FLT_MAX, FLT_MAX, FLT_MAX),
374 bbMax_(-FLT_MAX, -FLT_MAX, -FLT_MAX),
375 state_(false)
376 { }
377
378 bool operator()(BaseNode* _node)
379 {
380 Vec3d bbMin( FLT_MAX, FLT_MAX, FLT_MAX);
381 Vec3d bbMax(-FLT_MAX, -FLT_MAX, -FLT_MAX);
382 _node->boundingBox(bbMin, bbMax);
383
384 if ((bbMin[0] > bbMax[0]) ||
385 (bbMin[1] > bbMax[1]) ||
386 (bbMin[2] > bbMax[2]))
387 return true;
388
389 bbMin_.minimize(state_.modelview().transform_point (bbMin));
390 bbMin_.minimize(state_.modelview().transform_point (bbMax));
391 bbMax_.maximize(state_.modelview().transform_point (bbMin));
392 bbMax_.maximize(state_.modelview().transform_point (bbMax));
393 return true;
394 }
395
396 void enter (BaseNode *_node)
397 {
398 _node->enter(state_, DrawModes::DEFAULT);
399 }
400
401 void leave (BaseNode *_node)
402 {
403 _node->leave(state_, DrawModes::DEFAULT);
404 }
405
407 const Vec3d& bbMin() const { return bbMin_; }
409 const Vec3d& bbMax() const { return bbMax_; }
410
411 private:
412
413 Vec3d bbMin_, bbMax_;
414 GLState state_;
415 };
416
417
418 //-----------------------------------------------------------------------------
419
420
432 class MultiPassInfoAction
433 {
434 public:
435
436 MultiPassInfoAction() :
437 statusPasses_(BaseNode::ALLPASSES),
438 nodePasses_(BaseNode::ALLPASSES)
439 {}
440
441 bool operator()(BaseNode* _node) {
442
443 // Get status pass
444 BaseNode::MultipassBitMask statusPass = _node->multipassStatus();
445
446 // Ignore if set to ALLPASSES as we want to get the real maximum pass number
447 if ( statusPass != BaseNode::ALLPASSES) {
448 // Convert render pass bit mask to
449 // decimal value (0x001011 -> 4)
450 // Note: Same as (int)log2(bitmask)
451 unsigned int c = 0;
452
453 // Skip the first one as this is the ALLPASSES flag
454 statusPass = statusPass >> 1;
455
456 while( statusPass != 0u ) {
457 statusPass = statusPass >> 1;
458 ++c;
459 }
460 statusPasses_ = c > statusPasses_ ? c : statusPasses_;
461 }
462
463
464 // Get Node pass
465 BaseNode::MultipassBitMask nodePass = _node->multipassNode();
466
467 // Ignore if set to ALLPASSES as we want to get the real maximum pass number
468 if ( nodePass != BaseNode::ALLPASSES) {
469 // Convert render pass bit mask to
470 // decimal value (0x001011 -> 4)
471 // Note: Same as (int)log2(bitmask)
472 unsigned int c = 0;
473
474 // Skip the first one as this is the ALLPASSES flag
475 nodePass = nodePass >> 1;
476
477 while(nodePass != 0u) {
478 nodePass = nodePass >> 1;
479 ++c;
480 }
481 nodePasses_ = c > nodePasses_ ? c : nodePasses_;
482 }
483
484 return true;
485 }
486
491 unsigned int getMaxPasses() const {
492 unsigned int maxpasses = std::max(statusPasses_,nodePasses_);
493
494 // if maxpasses is 0 we have all nodes in ALLPASSES mode so we render only once
495 return maxpasses == 0 ? 1 : maxpasses;
496 }
497
502 unsigned int getStatusPasses() { return statusPasses_ == 0 ? 1 : statusPasses_; };
503
508 unsigned int getNodePasses() { return nodePasses_ == 0 ? 1 : nodePasses_; };
509
510 private:
511
512 unsigned int statusPasses_;
513 unsigned int nodePasses_;
514
515 };
516
517
518 //----------------------------------------------------------------------------
519
520
529 class FindNodeAction
530 {
531 public:
532
534 FindNodeAction(unsigned int _node_id) :
535 node_id_(_node_id), node_ptr_(0) {}
536
537 bool operator()(BaseNode* _node)
538 {
539 if (_node->id() == node_id_)
540 {
541 node_ptr_ = _node;
542 return false;
543 }
544 return true;
545 }
546
548 BaseNode* node_ptr() { return node_ptr_; }
549
550 private:
551
552 unsigned int node_id_;
553 BaseNode* node_ptr_;
554 };
555
556
557 ACGDLLEXPORT
558 BaseNode* find_node( BaseNode* _root, unsigned int _node_idx );
559
560 ACGDLLEXPORT
561 BaseNode* find_hidden_node( BaseNode* _root, unsigned int _node_idx );
562
563
564 //----------------------------------------------------------------------------
565
566
575 class CollectDrawModesAction
576 {
577 public:
578
579 CollectDrawModesAction() : drawModes_(DrawModes::NONE) {}
580
581 bool operator()(BaseNode* _node)
582 {
583 drawModes_ |= _node->availableDrawModes();
584 return true;
585 }
586
588 DrawModes::DrawMode drawModes() const { return drawModes_; }
589
590 private:
591
592 DrawModes::DrawMode drawModes_;
593 };
594
595 //----------------------------------------------------------------------------
596
597
606 class CollectActiveDrawModesAction
607 {
608 public:
609
610 CollectActiveDrawModesAction() : drawMode_(DrawModes::NONE) {}
611
612 bool operator()(BaseNode* _node)
613 {
614 drawMode_ |= _node->drawMode();
615 return true;
616 }
617
619 DrawModes::DrawMode drawMode() const { return drawMode_; }
620
621 private:
622
623 DrawModes::DrawMode drawMode_;
624 };
625
626 //----------------------------------------------------------------------------
627
628
638 class SetDrawModesAction
639 {
640 public:
641
650 SetDrawModesAction(DrawModes::DrawMode _mode, bool _force = false ) : newModes_(_mode),force_(_force) {}
651
652 bool operator()(BaseNode* _node)
653 {
654 if ( newModes_ == DrawModes::DEFAULT )
655 _node->drawMode( DrawModes::DEFAULT );
656
657 DrawModes::DrawMode availableModes = _node->availableDrawModes();
658
659 if ( force_ ) {
660 // if force, we ignore if the mode is supported by the node and set it
661 _node->drawMode( newModes_ );
662 } else if ( availableModes & newModes_ ) {
663 // If its supported, we set it
664 _node->drawMode( availableModes & newModes_ );
665 } else {
666 // otherwise we switch the node to default draw mode (which will use the global mode)
667 _node->drawMode( DrawModes::DEFAULT );
668 }
669
670
671 return true;
672 }
673
674 private:
675 DrawModes::DrawMode newModes_;
676 bool force_;
677
678 };
679
680
681 //----------------------------------------------------------------------------
682
683
693 class DrawAction
694 {
695 public:
696
698 DrawAction(DrawModes::DrawMode _drawMode, GLState& _state, bool _blending) :
699 state_(_state),
700 drawMode_(_drawMode),
701 blending_(_blending) {}
702
703 bool operator()( BaseNode* _node )
704 {
705 // draw only if Material status == DrawAction status
706 if(state_.blending() == blending_)
707 {
708 _node->setDirty (false);
709 if (_node->drawMode() == DrawModes::DEFAULT)
710 _node->draw(state_, drawMode_);
711 else
712 _node->draw(state_, _node->drawMode());
713 }
714 return true;
715 }
716
717 void enter(BaseNode* _node)
718 {
719 if (_node->drawMode() == DrawModes::DEFAULT)
720 _node->enter(state_, drawMode_);
721 else
722 _node->enter(state_, _node->drawMode());
723 }
724
725 void leave(BaseNode* _node)
726 {
727 if (_node->drawMode() == DrawModes::DEFAULT)
728 _node->leave(state_, drawMode_);
729 else
730 _node->leave(state_, _node->drawMode());
731 }
732
733 private:
734
735 GLState& state_;
736 DrawModes::DrawMode drawMode_;
737 bool blending_;
738 };
739
740
741 //----------------------------------------------------------------------------
742
743
752 class ACGDLLEXPORT PickAction
753 {
754 public:
755
757 PickAction(GLState &_state, PickTarget _target, DrawModes::DrawMode _drawmode) :
758 state_(_state),
759 pickTarget_(_target),
760 drawmode_(_drawmode) {}
761
764 bool operator()(BaseNode* _node);
765
769 bool operator()(BaseNode* _node, GLState& _state);
770
771 void enter(BaseNode* _node)
772 {
773 if (_node->drawMode() == DrawModes::DEFAULT)
774 _node->enterPick(state_, pickTarget_, drawmode_);
775 else
776 _node->enterPick(state_, pickTarget_, _node->drawMode());
777 }
778
779 void leave(BaseNode* _node)
780 {
781 if (_node->drawMode() == DrawModes::DEFAULT)
782 _node->leavePick(state_, pickTarget_, drawmode_);
783 else
784 _node->leavePick(state_, pickTarget_, _node->drawMode());
785 }
786
787 private:
788
789 GLState &state_;
790 PickTarget pickTarget_;
791 DrawModes::DrawMode drawmode_;
792 };
793
794
795 //----------------------------------------------------------------------------
796
797
805 class MouseEventAction
806 {
807 public:
808
809
810 MouseEventAction(QMouseEvent* _event, GLState& _state) :
811 state_(_state),
812 event_(_event) {}
813
814 bool operator()(BaseNode* _node )
815 {
816 _node->mouseEvent(state_, event_);
817 return true;
818 }
819
820 private:
821 GLState& state_;
822 QMouseEvent* event_;
823 };
824
825 //----------------------------------------------------------------------------
826
827
835 class CheckDirtyAction
836 {
837 public:
838
839
840 CheckDirtyAction() : dirty_(false) {}
841
842 bool operator()(BaseNode* _node)
843 {
844 dirty_ |= _node->isDirty();
845 // don't traverse children if current node is _dirty
846 return !dirty_;
847 }
848
849 bool isDirty() const { return dirty_; };
850
851 private:
852
853 bool dirty_;
854 };
855
856
857 //=============================================================================
858 } // namespace SceneGraph
859 } // namespace ACG
860 //=============================================================================
861 #endif // ACG_SCENEGRAPH_HH defined
862 //=============================================================================
863
ACG::SceneGraph::SetDrawModesAction
Definition: SceneGraph.hh:638
ACG
Namespace providing different geometric functions concerning angles.
Definition: DBSCANT.cc:51
ACG::SceneGraph::BaseNode::id
unsigned int id() const
Definition: BaseNode.hh:399
ACG::SceneGraph::DrawAction::DrawAction
DrawAction(DrawModes::DrawMode _drawMode, GLState &_state, bool _blending)
Constructor: draws the scenegraph using _drawMode.
Definition: SceneGraph.hh:698
ACG::SceneGraph::BaseNode
Definition: BaseNode.hh:135
ACG::SceneGraph::PickAction
Definition: SceneGraph.hh:752
ACG::SceneGraph::PickTarget
PickTarget
What target to use for picking.
Definition: BaseNode.hh:99
ACG::SceneGraph::CollectDrawModesAction::drawModes
DrawModes::DrawMode drawModes() const
Get the collected draw modes.
Definition: SceneGraph.hh:588
ACG::GLState::blending
bool blending()
get whether transparenet or solid objects should be drawn
Definition: GLState.hh:1038
ACG::SceneGraph::DrawModes::DEFAULT
DrawMode DEFAULT
use the default (global) draw mode and not the node's own.
Definition: DrawModes.cc:78
ACG::SceneGraph::CheckDirtyAction
Definition: SceneGraph.hh:835
ACG::SceneGraph::DrawAction
Definition: SceneGraph.hh:693
ACG::GLState::next_render_pass
void next_render_pass()
increment render pass counter
Definition: GLState.hh:993
ACG::SceneGraph::BaseNode::draw
virtual void draw(GLState &, const DrawModes::DrawMode &)
Draw this node using the draw modes _drawMode.
Definition: BaseNode.hh:194
ACG::SceneGraph::MouseEventAction
Definition: SceneGraph.hh:805
ACG::SceneGraph::BaseNode::isDirty
bool isDirty() const
Check if node should be redrawn.
Definition: BaseNode.hh:254
ACG::SceneGraph::BaseNode::MultipassBitMask
unsigned int MultipassBitMask
Multipass pass bit mask type.
Definition: BaseNode.hh:445
ACG::SceneGraph::BaseNode::HideSubtree
Hide this node and its children.
Definition: BaseNode.hh:374
ACG::SceneGraph::CollectDrawModesAction
Definition: SceneGraph.hh:575
ACG::SceneGraph::BaseNode::multipassNodeActive
bool multipassNodeActive(const unsigned int _i) const
Get Node status to traverse in a specific pass.
ACG::SceneGraph::BaseNode::NodeFirst
Execute action on node first and then on its children.
Definition: BaseNode.hh:417
ACG::SceneGraph::BaseNode::childrenBegin
ChildIter childrenBegin()
Returns: begin-iterator of children.
Definition: BaseNode.hh:270
ACG::SceneGraph::BaseNode::leavePick
virtual void leavePick(GLState &_state, PickTarget _target, const DrawModes::DrawMode &_drawMode)
ACG::SceneGraph::BoundingBoxAction
Definition: SceneGraph.hh:368
ACG::SceneGraph::BaseNode::enter
virtual void enter(GLState &, const DrawModes::DrawMode &)
Definition: BaseNode.hh:182
ACG::GLState::modelview
const GLMatrixd & modelview() const
get modelview matrix
Definition: GLState.hh:794
ACG::SceneGraph::traverse_multipass
void traverse_multipass(BaseNode *_node, Action &_action, const unsigned int &_pass)
Definition: SceneGraph.hh:260
ACG::SceneGraph::CollectActiveDrawModesAction::drawMode
DrawModes::DrawMode drawMode() const
Get the collected draw modes.
Definition: SceneGraph.hh:619
ACG::GLState
Definition: GLState.hh:220
ACG::SceneGraph::MultiPassInfoAction
Definition: SceneGraph.hh:432
ACG::GLState::reset_render_pass
void reset_render_pass()
reset render pass counter
Definition: GLState.hh:990
ACG::SceneGraph::BaseNode::enterPick
virtual void enterPick(GLState &_state, PickTarget _target, const DrawModes::DrawMode &_drawMode)
ACG::SceneGraph::BaseNode::ChildIter
std::list< BaseNode * >::iterator ChildIter
allows to iterate over children
Definition: BaseNode.hh:262
ACG::SceneGraph::DrawModes::DrawMode
Specifies a DrawMode.
Definition: DrawModes.hh:294
ACG::SceneGraph::BoundingBoxAction::bbMax
const Vec3d & bbMax() const
Returns maximum point of the bounding box.
Definition: SceneGraph.hh:409
ACG::SceneGraph::BaseNode::HideChildren
Draw this node, but hide children.
Definition: BaseNode.hh:372
ACG::SceneGraph::MultiPassInfoAction::getMaxPasses
unsigned int getMaxPasses() const
Get the number of required traverse passes from Scenegraph.
Definition: SceneGraph.hh:491
ACG::SceneGraph::BaseNode::SecondPass
Draw node in second pass.
Definition: BaseNode.hh:421
ACG::SceneGraph::BaseNode::StatusMode
StatusMode
Status modi.
Definition: BaseNode.hh:365
ACG::SceneGraph::FindNodeAction::node_ptr
BaseNode * node_ptr()
Get the pointer of the node (is 0 if node was not found)
Definition: SceneGraph.hh:548
ACG::SceneGraph::BaseNode::ChildrenFirst
Execute action the children first and then on this node.
Definition: BaseNode.hh:419
ACG::SceneGraph::BaseNode::drawMode
DrawModes::DrawMode drawMode() const
Return the own draw modes of this node.
Definition: BaseNode.hh:406
OpenMesh::VectorT
Definition: Vector11T.hh:83
ACG::SceneGraph::BaseNode::availableDrawModes
virtual DrawModes::DrawMode availableDrawModes() const
Definition: BaseNode.hh:167
ACG::SceneGraph::BaseNode::status
StatusMode status() const
Get node's status.
Definition: BaseNode.hh:377
ACG::SceneGraph::BaseNode::boundingBox
virtual void boundingBox(Vec3d &, Vec3d &)
Definition: BaseNode.hh:174
ACG::SceneGraph::MultiPassInfoAction::getStatusPasses
unsigned int getStatusPasses()
Get the number of required status traversals from Scenegraph.
Definition: SceneGraph.hh:502
ACG::SceneGraph::BoundingBoxAction::bbMin
const Vec3d & bbMin() const
Returns minimum point of the bounding box.
Definition: SceneGraph.hh:407
ACG::SceneGraph::find_hidden_node
BaseNode * find_hidden_node(BaseNode *_root, unsigned int _node_idx)
Find a node in the scene graph.
Definition: SceneGraph.cc:99
ACG::SceneGraph::BaseNode::setDirty
void setDirty(bool _dirty=true)
mark node for redrawn
Definition: BaseNode.hh:251
ACG::GLState::max_render_passes
unsigned int max_render_passes() const
get maximum number of render passes
Definition: GLState.hh:996
ACG::SceneGraph::enable_if
Definition: SceneGraph.hh:88
ACG::SceneGraph::SetDrawModesAction::SetDrawModesAction
SetDrawModesAction(DrawModes::DrawMode _mode, bool _force=false)
Set draw modes for all nodes traversed with this action.
Definition: SceneGraph.hh:650
ACG::SceneGraph::traverse_all
void traverse_all(BaseNode *_node, Action &_action)
Definition: SceneGraph.hh:208
ACG::Matrix4x4T::transform_point
VectorT< T, 3 > transform_point(const VectorT< T, 3 > &_v) const
transform point (x',y',z',1) = M * (x,y,z,1)
Definition: Matrix4x4T.cc:202
ACG::SceneGraph::find_node
BaseNode * find_node(BaseNode *_root, unsigned int _node_idx)
Find a node in the scene graph.
Definition: SceneGraph.cc:83
ACG::SceneGraph::MultiPassInfoAction::getNodePasses
unsigned int getNodePasses()
Get the number of required node traversals from Scenegraph.
Definition: SceneGraph.hh:508
ACG::SceneGraph::BaseNode::HideNode
Hide this node, but draw children.
Definition: BaseNode.hh:370
ACG::SceneGraph::BaseNode::multipassStatusActive
bool multipassStatusActive(const unsigned int _i) const
Get multipass status to traverse in a specific pass.
ACG::SceneGraph::FindNodeAction
Definition: SceneGraph.hh:529
ACG::SceneGraph::FindNodeAction::FindNodeAction
FindNodeAction(unsigned int _node_id)
constructor: _node_id is the node to be searched for
Definition: SceneGraph.hh:534
ACG::SceneGraph::BaseNode::mouseEvent
virtual void mouseEvent(GLState &, QMouseEvent *)
Handle mouse event (some interaction, e.g. modeling)
Definition: BaseNode.hh:248
ACG::SceneGraph::traverse
void traverse(BaseNode *_node, Action &_action)
Definition: SceneGraph.hh:143
ACG::SceneGraph::BaseNode::multipassNode
MultipassBitMask multipassNode() const
Get the current multipass settings for the node.
Definition: BaseNode.hh:513
ACG::SceneGraph::BaseNode::multipassStatus
MultipassBitMask multipassStatus() const
Get the current multipass settings for the nodes status functions.
Definition: BaseNode.hh:469
ACG::SceneGraph::BaseNode::childrenEnd
ChildIter childrenEnd()
Returns: end-iterator of children.
Definition: BaseNode.hh:274
ACG::SceneGraph::PickAction::PickAction
PickAction(GLState &_state, PickTarget _target, DrawModes::DrawMode _drawmode)
constructor: what picking target to use
Definition: SceneGraph.hh:757
ACG::SceneGraph::DrawModes::NONE
DrawMode NONE
not a valid draw mode
Definition: DrawModes.cc:77
ACG::SceneGraph::BaseNode::traverseMode
unsigned int traverseMode() const
Return how the node should be traversed.
Definition: BaseNode.hh:425
ACG::SceneGraph::CollectActiveDrawModesAction
Definition: SceneGraph.hh:606
ACG::SceneGraph::BaseNode::leave
virtual void leave(GLState &, const DrawModes::DrawMode &)
Definition: BaseNode.hh:217