fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Window / Base / OSGViewportBase.h
blob66e486378e6a28c29b37930f5ae2ca2885011532
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
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 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class Viewport
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGVIEWPORTBASE_H_
55 #define _OSGVIEWPORTBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGViewarea.h" // Parent
68 #include "OSGFieldContainerFields.h" // Parent type
69 #include "OSGCameraFields.h" // Camera type
70 #include "OSGNodeFields.h" // Root type
71 #include "OSGBackgroundFields.h" // Background type
72 #include "OSGForegroundFields.h" // Foregrounds type
74 #include "OSGViewportFields.h"
76 OSG_BEGIN_NAMESPACE
79 class Viewport;
81 //! \brief Viewport Base Class.
83 class OSG_SYSTEM_DLLMAPPING ViewportBase : public Viewarea
85 public:
87 typedef Viewarea Inherited;
88 typedef Viewarea ParentContainer;
90 typedef Inherited::TypeObject TypeObject;
91 typedef TypeObject::InitPhase InitPhase;
93 OSG_GEN_INTERNALPTR(Viewport);
95 /*========================== PUBLIC =================================*/
97 public:
99 enum
101 ParentFieldId = Inherited::NextFieldId,
102 CameraFieldId = ParentFieldId + 1,
103 RootFieldId = CameraFieldId + 1,
104 BackgroundFieldId = RootFieldId + 1,
105 ForegroundsFieldId = BackgroundFieldId + 1,
106 NextFieldId = ForegroundsFieldId + 1
109 static const OSG::BitVector ParentFieldMask =
110 (TypeTraits<BitVector>::One << ParentFieldId);
111 static const OSG::BitVector CameraFieldMask =
112 (TypeTraits<BitVector>::One << CameraFieldId);
113 static const OSG::BitVector RootFieldMask =
114 (TypeTraits<BitVector>::One << RootFieldId);
115 static const OSG::BitVector BackgroundFieldMask =
116 (TypeTraits<BitVector>::One << BackgroundFieldId);
117 static const OSG::BitVector ForegroundsFieldMask =
118 (TypeTraits<BitVector>::One << ForegroundsFieldId);
119 static const OSG::BitVector NextFieldMask =
120 (TypeTraits<BitVector>::One << NextFieldId);
122 typedef SFParentFieldContainerPtr SFParentType;
123 typedef SFUnrecCameraPtr SFCameraType;
124 typedef SFUnrecNodePtr SFRootType;
125 typedef SFUnrecBackgroundPtr SFBackgroundType;
126 typedef MFUnrecForegroundPtr MFForegroundsType;
128 /*---------------------------------------------------------------------*/
129 /*! \name Class Get */
130 /*! \{ */
132 static FieldContainerType &getClassType (void);
133 static UInt32 getClassTypeId (void);
134 static UInt16 getClassGroupId(void);
136 /*! \} */
137 /*---------------------------------------------------------------------*/
138 /*! \name FieldContainer Get */
139 /*! \{ */
141 virtual FieldContainerType &getType (void);
142 virtual const FieldContainerType &getType (void) const;
144 virtual UInt32 getContainerSize(void) const;
146 /*! \} */
147 /*---------------------------------------------------------------------*/
148 /*! \name Field Get */
149 /*! \{ */
151 const SFUnrecCameraPtr *getSFCamera (void) const;
152 SFUnrecCameraPtr *editSFCamera (void);
153 const SFUnrecNodePtr *getSFRoot (void) const;
154 SFUnrecNodePtr *editSFRoot (void);
155 const SFUnrecBackgroundPtr *getSFBackground (void) const;
156 SFUnrecBackgroundPtr *editSFBackground (void);
157 const MFUnrecForegroundPtr *getMFForegrounds (void) const;
158 MFUnrecForegroundPtr *editMFForegrounds (void);
161 Camera * getCamera (void) const;
163 Node * getRoot (void) const;
165 Background * getBackground (void) const;
167 Foreground * getForegrounds (const UInt32 index) const;
169 /*! \} */
170 /*---------------------------------------------------------------------*/
171 /*! \name Field Set */
172 /*! \{ */
174 void setCamera (Camera * const value);
175 void setRoot (Node * const value);
176 void setBackground (Background * const value);
178 /*! \} */
179 /*---------------------------------------------------------------------*/
180 /*! \name Ptr Field Set */
181 /*! \{ */
183 /*! \} */
184 /*---------------------------------------------------------------------*/
185 /*! \name Ptr MField Set */
186 /*! \{ */
188 void addForeground (Foreground * const value );
189 void assignForegrounds (const MFUnrecForegroundPtr &value);
190 void removeFromForegrounds (UInt32 uiIndex );
191 void removeObjFromForegrounds(Foreground * const value );
192 void clearForegrounds (void );
194 /*! \} */
195 /*---------------------------------------------------------------------*/
196 /*! \name Binary Access */
197 /*! \{ */
199 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
200 virtual void copyToBin (BinaryDataHandler &pMem,
201 ConstFieldMaskArg whichField);
202 virtual void copyFromBin(BinaryDataHandler &pMem,
203 ConstFieldMaskArg whichField);
206 /*! \} */
207 /*---------------------------------------------------------------------*/
208 /*! \name Construction */
209 /*! \{ */
211 static ViewportTransitPtr create (void);
212 static Viewport *createEmpty (void);
214 static ViewportTransitPtr createLocal (
215 BitVector bFlags = FCLocal::All);
217 static Viewport *createEmptyLocal(
218 BitVector bFlags = FCLocal::All);
220 static ViewportTransitPtr createDependent (BitVector bFlags);
222 /*! \} */
223 /*---------------------------------------------------------------------*/
224 /*! \name Copy */
225 /*! \{ */
227 virtual FieldContainerTransitPtr shallowCopy (void) const;
228 virtual FieldContainerTransitPtr shallowCopyLocal(
229 BitVector bFlags = FCLocal::All) const;
230 virtual FieldContainerTransitPtr shallowCopyDependent(
231 BitVector bFlags) const;
233 /*! \} */
234 /*========================= PROTECTED ===============================*/
236 protected:
238 static TypeObject _type;
240 static void classDescInserter(TypeObject &oType);
241 static const Char8 *getClassname (void );
243 /*---------------------------------------------------------------------*/
244 /*! \name Fields */
245 /*! \{ */
247 SFParentFieldContainerPtr _sfParent;
248 SFUnrecCameraPtr _sfCamera;
249 SFUnrecNodePtr _sfRoot;
250 SFUnrecBackgroundPtr _sfBackground;
251 MFUnrecForegroundPtr _mfForegrounds;
253 /*! \} */
254 /*---------------------------------------------------------------------*/
255 /*! \name Constructors */
256 /*! \{ */
258 ViewportBase(void);
259 ViewportBase(const ViewportBase &source);
261 /*! \} */
262 /*---------------------------------------------------------------------*/
263 /*! \name Destructors */
264 /*! \{ */
266 virtual ~ViewportBase(void);
268 /*! \} */
269 /*---------------------------------------------------------------------*/
270 /*! \name onCreate */
271 /*! \{ */
273 void onCreate(const Viewport *source = NULL);
275 /*! \} */
276 /*---------------------------------------------------------------------*/
277 /*! \name Parent linking */
278 /*! \{ */
280 virtual bool linkParent (FieldContainer * const pParent,
281 UInt16 const childFieldId,
282 UInt16 const parentFieldId);
283 virtual bool unlinkParent(FieldContainer * const pParent,
284 UInt16 const parentFieldId);
286 /*! \} */
287 /*---------------------------------------------------------------------*/
288 /*! \name Generic Field Access */
289 /*! \{ */
291 GetFieldHandlePtr getHandleParent (void) const;
292 EditFieldHandlePtr editHandleParent (void);
293 GetFieldHandlePtr getHandleCamera (void) const;
294 EditFieldHandlePtr editHandleCamera (void);
295 GetFieldHandlePtr getHandleRoot (void) const;
296 EditFieldHandlePtr editHandleRoot (void);
297 GetFieldHandlePtr getHandleBackground (void) const;
298 EditFieldHandlePtr editHandleBackground (void);
299 GetFieldHandlePtr getHandleForegrounds (void) const;
300 EditFieldHandlePtr editHandleForegrounds (void);
302 /*! \} */
303 /*---------------------------------------------------------------------*/
304 /*! \name Sync */
305 /*! \{ */
307 #ifdef OSG_MT_CPTR_ASPECT
308 virtual void execSyncV( FieldContainer &oFrom,
309 ConstFieldMaskArg whichField,
310 AspectOffsetStore &oOffsets,
311 ConstFieldMaskArg syncMode ,
312 const UInt32 uiSyncInfo);
314 void execSync ( ViewportBase *pFrom,
315 ConstFieldMaskArg whichField,
316 AspectOffsetStore &oOffsets,
317 ConstFieldMaskArg syncMode ,
318 const UInt32 uiSyncInfo);
319 #endif
321 /*! \} */
322 /*---------------------------------------------------------------------*/
323 /*! \name Edit */
324 /*! \{ */
326 /*! \} */
327 /*---------------------------------------------------------------------*/
328 /*! \name Aspect Create */
329 /*! \{ */
331 #ifdef OSG_MT_CPTR_ASPECT
332 virtual FieldContainer *createAspectCopy(
333 const FieldContainer *pRefAspect) const;
334 #endif
336 /*! \} */
337 /*---------------------------------------------------------------------*/
338 /*! \name Edit */
339 /*! \{ */
340 /*! \} */
341 /*---------------------------------------------------------------------*/
342 /*! \name Sync */
343 /*! \{ */
345 virtual void resolveLinks(void);
347 /*! \} */
348 /*========================== PRIVATE ================================*/
350 private:
351 /*---------------------------------------------------------------------*/
353 // prohibit default functions (move to 'public' if you need one)
354 void operator =(const ViewportBase &source);
357 typedef ViewportBase *ViewportBaseP;
359 OSG_END_NAMESPACE
361 #endif /* _OSGVIEWPORTBASE_H_ */