Visualization Library 2.0.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
RenderingTree.cpp
Go to the documentation of this file.
1 /**************************************************************************************/
2 /* */
3 /* Visualization Library */
4 /* http://visualizationlibrary.org */
5 /* */
6 /* Copyright (c) 2005-2020, Michele Bosi */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without modification, */
10 /* are permitted provided that the following conditions are met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, this */
13 /* list of conditions and the following disclaimer. */
14 /* */
15 /* - Redistributions in binary form must reproduce the above copyright notice, this */
16 /* list of conditions and the following disclaimer in the documentation and/or */
17 /* other materials provided with the distribution. */
18 /* */
19 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */
20 /* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */
21 /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
22 /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR */
23 /* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
24 /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
25 /* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
26 /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
27 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
28 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
29 /* */
30 /**************************************************************************************/
31 
33 
34 using namespace vl;
35 
36 //------------------------------------------------------------------------------
38 {
40 }
41 //------------------------------------------------------------------------------
43 {
44  super::operator=(other);
45  *mSubRendering = *other.mSubRendering;
46  return *this;
47 }
48 //------------------------------------------------------------------------------
50 {
51  if ( enableMask() == 0 )
52  return;
53 
55  for(int i=0; i<subRenderings()->size(); ++i)
56  {
57  // dispatch update time
58  subRenderings()->at(i)->setFrameClock( frameClock() );
59  // render child
60  subRenderings()->at(i)->render();
61  }
63 }
64 //------------------------------------------------------------------------------
void dispatchOnRenderingStarted()
Calls the RenderEventCallback::onRenderingStarted() method of all the active callback objects...
virtual void render()
Recursively calls the render() method of its children.
Visualization Library main namespace.
Collection< RenderingAbstract > * subRenderings()
The sub-Rendering (or child-Rendering) objects of a Rendering. A sub-Rendering is rendered before it&#39;...
unsigned int enableMask() const
The enable mask of the Rendering, used to define wheter the rendering is enabled or not...
RenderingTree()
Constructor.
real frameClock() const
The update time of the current rendering frame.
RenderingTree & operator=(const RenderingTree &other)
Assignment operator.
void dispatchOnRenderingFinished()
Calls the RenderEventCallback::onRenderingFinished() method of all the active callback objects...
It&#39;s basically an std::vector for Objects that is itself an Object so it can be reference counted and...
Definition: Collection.hpp:49
The RenderingTree class organizes a set of renderings into an N-ary tree.
ref< Collection< RenderingAbstract > > mSubRendering