fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Window / Utilities / OSGSimpleSceneManager.h
blob63fcf89ff958180a1cb26131ea4a2eb5fab68bf5
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGSIMPLESCENEMANAGER_H_
40 #define _OSGSIMPLESCENEMANAGER_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGConfig.h"
46 #include "OSGUtilDef.h"
48 #include "OSGBaseTypes.h"
50 #include "OSGRenderAction.h"
52 #include "OSGNode.h"
53 #include "OSGImageForeground.h"
54 #include "OSGTransform.h"
55 #include "OSGGeometry.h"
56 #include "OSGTypedGeoVectorProperty.h"
57 #include "OSGSimpleMaterial.h"
58 #include "OSGCamera.h"
59 #include "OSGDirectionalLight.h"
60 #include "OSGNavigator.h"
61 #include "OSGStatisticsForeground.h"
62 #include "OSGNavigationManager.h"
64 OSG_BEGIN_NAMESPACE
66 /*! \brief A helper class to simplify managing simple applications.
67 \ingroup GrpUtilNavigation
68 \ingroup GrpLibOSGUtil
71 class OSG_UTIL_DLLMAPPING SimpleSceneManager : public NavigationManager
73 /*========================== PUBLIC =================================*/
75 public:
77 OSG_GEN_INTERNAL_MEMOBJPTR(SimpleSceneManager);
79 /*---------------------------------------------------------------------*/
80 /*! \name Constructors */
81 /*! \{ */
83 static ObjTransitPtr create(void);
85 /*! \} */
86 /*---------------------------------------------------------------------*/
87 /*! \name Get */
88 /*! \{ */
90 virtual Node *getRoot (void);
91 virtual Node *getHighlight (void);
92 virtual RenderAction *getRenderAction (void);
93 virtual bool getHeadlightState(void);
94 virtual DirectionalLight *getHeadlight (void);
95 virtual Camera *getCamera (void);
96 virtual Background *getBackground (void);
97 virtual Node *getInternalRoot (void);
99 /*! \} */
100 /*---------------------------------------------------------------------*/
101 /*! \name Set */
102 /*! \{ */
104 virtual void setAction (RenderAction *action );
106 virtual void setRoot (Node *root );
108 virtual void setHighlight (Node *obj );
109 virtual void setHeadlight (bool on );
110 virtual void turnHeadlightOn (void );
111 virtual void turnHeadlightOff (void );
112 virtual void setCamera (Camera *camera );
113 virtual void setBackground (Background *bg );
115 virtual void setUseTraversalAction(bool s );
116 virtual bool getUseTraversalAction(void );
118 virtual void showAll (void );
120 virtual void useOpenSGLogo (void );
122 virtual void setStatistics (bool on );
123 bool getStatistics (void );
125 virtual void addForeground (Foreground * const fg );
126 virtual void removeForeground (Foreground * const fg );
128 /*! \} */
129 /*---------------------------------------------------------------------*/
130 /*! \name Interaction handling */
131 /*! \{ */
133 Line calcViewRay(Int16 x, Int16 y);
135 /*! \} */
136 /*---------------------------------------------------------------------*/
137 /*! \name Actions */
138 /*! \{ */
140 virtual void update( void );
141 virtual void redraw( void );
143 /*! \} */
144 /*---------------------------------------------------------------------*/
145 /*! \name Comparison */
146 /*! \{ */
148 bool operator < (const SimpleSceneManager &other) const;
150 //bool operator == (const SimpleSceneManager &other) const;
151 //bool operator != (const SimpleSceneManager &other) const;
153 /*! \} */
154 /*========================= PROTECTED ===============================*/
156 protected:
158 typedef NavigationManager Inherited;
160 /*---------------------------------------------------------------------*/
161 /*! \name Constructors */
162 /*! \{ */
164 SimpleSceneManager(void);
166 /*! \} */
167 /*---------------------------------------------------------------------*/
168 /*! \name Destructor */
169 /*! \{ */
171 virtual ~SimpleSceneManager(void);
173 /*! \} */
174 /*---------------------------------------------------------------------*/
175 /*! \name Updates */
176 /*! \{ */
178 void initialize (void);
179 virtual void highlightChanged(void);
180 virtual void updateHighlight (void);
182 /*! \} */
183 /*---------------------------------------------------------------------*/
184 /*! \name Member */
185 /*! \{ */
187 NodeRecPtr _root;
189 ImageForegroundRecPtr _foreground;
190 StatisticsForegroundRecPtr _statforeground;
191 bool _statstate;
193 NodeRecPtr _highlight;
194 NodeRecPtr _highlightNode;
195 //GeoPositions3fPtr _highlightPoints;
196 GeoPnt3fPropertyRecPtr _highlightPoints;
198 NodeRecPtr _internalRoot;
199 DirectionalLightRecPtr _headlight;
201 /** The RenderAction to use if using render traversals. */
202 RenderActionRefPtr _rtaction;
204 TransformRecPtr _cart;
205 CameraRecPtr _camera;
207 bool _traversalAction;
209 SimpleMaterialRecPtr _highlightMaterial;
211 /*! \} */
212 /*========================== PRIVATE ================================*/
213 private:
215 /* prohibit default function (move to 'public' if needed) */
217 SimpleSceneManager(const SimpleSceneManager &source);
218 void operator =(const SimpleSceneManager &source);
221 //---------------------------------------------------------------------------
222 // Exported Types
223 //---------------------------------------------------------------------------
225 // class pointer
227 typedef SimpleSceneManager *SimpleSceneManagerP;
229 OSG_GEN_MEMOBJPTR(SimpleSceneManager);
231 OSG_END_NAMESPACE
233 #include "OSGSimpleSceneManager.inl"
235 #endif /* _OSGSIMPLESCENEMANAGER_H_ */