Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lpzviewer.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2011 LpzRobots development team *
3  * Georg Martius <georg dot martius at web dot de> *
4  * Frank Guettler <guettler at informatik dot uni-leipzig dot de *
5  * Frank Hesse <frank at nld dot ds dot mpg dot de> *
6  * Ralf Der <ralfder at mis dot mpg dot de> *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the *
20  * Free Software Foundation, Inc., *
21  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22  * *
23  ***************************************************************************/
24 #ifndef __LPZVIEWER_H
25 #define __LPZVIEWER_H
26 
27 
28 #include <osgViewer/Viewer>
29 #include <osg/Group>
30 
31 namespace lpzrobots {
32 
33  /** Viewer holds a single view on to a single scene
34  that supports the rendering of offscreen RRT (render to texture) cameras
35  at any time (without sync)
36  */
37  class LPZViewer : public osgViewer::Viewer {
38  public:
39 
40  LPZViewer();
41 
42  LPZViewer(osg::ArgumentParser& arguments);
43 
44  LPZViewer(const osgViewer::Viewer& viewer, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
45 
46  virtual ~LPZViewer();
47 
48  ///overwritten to set cpu affinity back
49  void setUpThreading();
50  ///overwritten to set cpu affinity back
51  void startThreading();
52 
53  /// is there a need to do an offscreen rendering?
55 
56  /** call this function to render the off screen scene.
57  If no off screen nodes are supplied than nothing is done
58  */
59  virtual void renderOffScreen();
60 
61  /** set the group that contains the offscreen scene (usually RTT cameras)
62  If no group is set or the group is empty than nothing
63  is done in renderOffscreen();
64  */
65  virtual void setOffScreenData(osg::Group* offscreen);
66 
67  protected:
68  virtual void offScreenRenderingTraversals();
69  osg::Group* offScreenGroup;
70 
72 
73  };
74 
75 }
76 
77 #endif
bool needForOffScreenRendering()
is there a need to do an offscreen rendering?
Definition: lpzviewer.cpp:73
Viewer holds a single view on to a single scene that supports the rendering of offscreen RRT (render ...
Definition: lpzviewer.h:37
void startThreading()
overwritten to set cpu affinity back
Definition: lpzviewer.cpp:67
virtual ~LPZViewer()
Definition: lpzviewer.cpp:51
void setUpThreading()
overwritten to set cpu affinity back
Definition: lpzviewer.cpp:63
virtual void setOffScreenData(osg::Group *offscreen)
set the group that contains the offscreen scene (usually RTT cameras) If no group is set or the group...
Definition: lpzviewer.cpp:54
virtual void renderOffScreen()
call this function to render the off screen scene.
Definition: lpzviewer.cpp:78
virtual void offScreenRenderingTraversals()
Definition: lpzviewer.cpp:95
osg::Group * offScreenGroup
Definition: lpzviewer.h:69
void lpzviewerConstructorInit()
Definition: lpzviewer.cpp:59
LPZViewer()
Definition: lpzviewer.cpp:37