fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / NodeCores / Groups / Misc / OSGScreenTransformBase.h
blob90df972d5509d7040c1e334024c6af9af867e75b
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 ScreenTransform
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSCREENTRANSFORMBASE_H_
55 #define _OSGSCREENTRANSFORMBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGGroupDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGGroup.h" // Parent
68 #include "OSGNodeFields.h" // Beacon type
69 #include "OSGSysFields.h" // InvertWorldTransform type
70 #include "OSGMathFields.h" // View type
72 #include "OSGScreenTransformFields.h"
74 OSG_BEGIN_NAMESPACE
77 class ScreenTransform;
79 //! \brief ScreenTransform Base Class.
81 class OSG_GROUP_DLLMAPPING ScreenTransformBase : public Group
83 public:
85 typedef Group Inherited;
86 typedef Group ParentContainer;
88 typedef Inherited::TypeObject TypeObject;
89 typedef TypeObject::InitPhase InitPhase;
91 OSG_GEN_INTERNALPTR(ScreenTransform);
93 /*========================== PUBLIC =================================*/
95 public:
97 enum
99 BeaconFieldId = Inherited::NextFieldId,
100 InvertWorldTransformFieldId = BeaconFieldId + 1,
101 InvertViewTransformFieldId = InvertWorldTransformFieldId + 1,
102 ApplyBeaconRotationFieldId = InvertViewTransformFieldId + 1,
103 ApplyBeaconScreenTranslationFieldId = ApplyBeaconRotationFieldId + 1,
104 ViewFieldId = ApplyBeaconScreenTranslationFieldId + 1,
105 NextFieldId = ViewFieldId + 1
108 static const OSG::BitVector BeaconFieldMask =
109 (TypeTraits<BitVector>::One << BeaconFieldId);
110 static const OSG::BitVector InvertWorldTransformFieldMask =
111 (TypeTraits<BitVector>::One << InvertWorldTransformFieldId);
112 static const OSG::BitVector InvertViewTransformFieldMask =
113 (TypeTraits<BitVector>::One << InvertViewTransformFieldId);
114 static const OSG::BitVector ApplyBeaconRotationFieldMask =
115 (TypeTraits<BitVector>::One << ApplyBeaconRotationFieldId);
116 static const OSG::BitVector ApplyBeaconScreenTranslationFieldMask =
117 (TypeTraits<BitVector>::One << ApplyBeaconScreenTranslationFieldId);
118 static const OSG::BitVector ViewFieldMask =
119 (TypeTraits<BitVector>::One << ViewFieldId);
120 static const OSG::BitVector NextFieldMask =
121 (TypeTraits<BitVector>::One << NextFieldId);
123 typedef SFWeakNodePtr SFBeaconType;
124 typedef SFBool SFInvertWorldTransformType;
125 typedef SFBool SFInvertViewTransformType;
126 typedef SFBool SFApplyBeaconRotationType;
127 typedef SFBool SFApplyBeaconScreenTranslationType;
128 typedef SFMatrix SFViewType;
130 /*---------------------------------------------------------------------*/
131 /*! \name Class Get */
132 /*! \{ */
134 static FieldContainerType &getClassType (void);
135 static UInt32 getClassTypeId (void);
136 static UInt16 getClassGroupId(void);
138 /*! \} */
139 /*---------------------------------------------------------------------*/
140 /*! \name FieldContainer Get */
141 /*! \{ */
143 virtual FieldContainerType &getType (void);
144 virtual const FieldContainerType &getType (void) const;
146 virtual UInt32 getContainerSize(void) const;
148 /*! \} */
149 /*---------------------------------------------------------------------*/
150 /*! \name Field Get */
151 /*! \{ */
153 const SFWeakNodePtr *getSFBeacon (void) const;
154 SFWeakNodePtr *editSFBeacon (void);
156 SFBool *editSFInvertWorldTransform(void);
157 const SFBool *getSFInvertWorldTransform (void) const;
159 SFBool *editSFInvertViewTransform(void);
160 const SFBool *getSFInvertViewTransform (void) const;
162 SFBool *editSFApplyBeaconRotation(void);
163 const SFBool *getSFApplyBeaconRotation (void) const;
165 SFBool *editSFApplyBeaconScreenTranslation(void);
166 const SFBool *getSFApplyBeaconScreenTranslation (void) const;
168 SFMatrix *editSFView (void);
169 const SFMatrix *getSFView (void) const;
172 Node * getBeacon (void) const;
174 bool &editInvertWorldTransform(void);
175 bool getInvertWorldTransform (void) const;
177 bool &editInvertViewTransform(void);
178 bool getInvertViewTransform (void) const;
180 bool &editApplyBeaconRotation(void);
181 bool getApplyBeaconRotation (void) const;
183 bool &editApplyBeaconScreenTranslation(void);
184 bool getApplyBeaconScreenTranslation (void) const;
186 Matrix &editView (void);
187 const Matrix &getView (void) const;
189 /*! \} */
190 /*---------------------------------------------------------------------*/
191 /*! \name Field Set */
192 /*! \{ */
194 void setBeacon (Node * const value);
195 void setInvertWorldTransform(const bool value);
196 void setInvertViewTransform(const bool value);
197 void setApplyBeaconRotation(const bool value);
198 void setApplyBeaconScreenTranslation(const bool value);
199 void setView (const Matrix &value);
201 /*! \} */
202 /*---------------------------------------------------------------------*/
203 /*! \name Ptr Field Set */
204 /*! \{ */
206 /*! \} */
207 /*---------------------------------------------------------------------*/
208 /*! \name Ptr MField Set */
209 /*! \{ */
211 /*! \} */
212 /*---------------------------------------------------------------------*/
213 /*! \name Binary Access */
214 /*! \{ */
216 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
217 virtual void copyToBin (BinaryDataHandler &pMem,
218 ConstFieldMaskArg whichField);
219 virtual void copyFromBin(BinaryDataHandler &pMem,
220 ConstFieldMaskArg whichField);
223 /*! \} */
224 /*---------------------------------------------------------------------*/
225 /*! \name Construction */
226 /*! \{ */
228 static ScreenTransformTransitPtr create (void);
229 static ScreenTransform *createEmpty (void);
231 static ScreenTransformTransitPtr createLocal (
232 BitVector bFlags = FCLocal::All);
234 static ScreenTransform *createEmptyLocal(
235 BitVector bFlags = FCLocal::All);
237 static ScreenTransformTransitPtr createDependent (BitVector bFlags);
239 /*! \} */
240 /*---------------------------------------------------------------------*/
241 /*! \name Copy */
242 /*! \{ */
244 virtual FieldContainerTransitPtr shallowCopy (void) const;
245 virtual FieldContainerTransitPtr shallowCopyLocal(
246 BitVector bFlags = FCLocal::All) const;
247 virtual FieldContainerTransitPtr shallowCopyDependent(
248 BitVector bFlags) const;
250 /*! \} */
251 /*========================= PROTECTED ===============================*/
253 protected:
255 static TypeObject _type;
257 static void classDescInserter(TypeObject &oType);
258 static const Char8 *getClassname (void );
260 /*---------------------------------------------------------------------*/
261 /*! \name Fields */
262 /*! \{ */
264 SFWeakNodePtr _sfBeacon;
265 SFBool _sfInvertWorldTransform;
266 SFBool _sfInvertViewTransform;
267 SFBool _sfApplyBeaconRotation;
268 SFBool _sfApplyBeaconScreenTranslation;
269 SFMatrix _sfView;
271 /*! \} */
272 /*---------------------------------------------------------------------*/
273 /*! \name Constructors */
274 /*! \{ */
276 ScreenTransformBase(void);
277 ScreenTransformBase(const ScreenTransformBase &source);
279 /*! \} */
280 /*---------------------------------------------------------------------*/
281 /*! \name Destructors */
282 /*! \{ */
284 virtual ~ScreenTransformBase(void);
286 /*! \} */
287 /*---------------------------------------------------------------------*/
288 /*! \name onCreate */
289 /*! \{ */
291 void onCreate(const ScreenTransform *source = NULL);
293 /*! \} */
294 /*---------------------------------------------------------------------*/
295 /*! \name Generic Field Access */
296 /*! \{ */
298 GetFieldHandlePtr getHandleBeacon (void) const;
299 EditFieldHandlePtr editHandleBeacon (void);
300 GetFieldHandlePtr getHandleInvertWorldTransform (void) const;
301 EditFieldHandlePtr editHandleInvertWorldTransform(void);
302 GetFieldHandlePtr getHandleInvertViewTransform (void) const;
303 EditFieldHandlePtr editHandleInvertViewTransform(void);
304 GetFieldHandlePtr getHandleApplyBeaconRotation (void) const;
305 EditFieldHandlePtr editHandleApplyBeaconRotation(void);
306 GetFieldHandlePtr getHandleApplyBeaconScreenTranslation (void) const;
307 EditFieldHandlePtr editHandleApplyBeaconScreenTranslation(void);
308 GetFieldHandlePtr getHandleView (void) const;
309 EditFieldHandlePtr editHandleView (void);
311 /*! \} */
312 /*---------------------------------------------------------------------*/
313 /*! \name Sync */
314 /*! \{ */
316 #ifdef OSG_MT_CPTR_ASPECT
317 virtual void execSyncV( FieldContainer &oFrom,
318 ConstFieldMaskArg whichField,
319 AspectOffsetStore &oOffsets,
320 ConstFieldMaskArg syncMode ,
321 const UInt32 uiSyncInfo);
323 void execSync ( ScreenTransformBase *pFrom,
324 ConstFieldMaskArg whichField,
325 AspectOffsetStore &oOffsets,
326 ConstFieldMaskArg syncMode ,
327 const UInt32 uiSyncInfo);
328 #endif
330 /*! \} */
331 /*---------------------------------------------------------------------*/
332 /*! \name Edit */
333 /*! \{ */
335 /*! \} */
336 /*---------------------------------------------------------------------*/
337 /*! \name Aspect Create */
338 /*! \{ */
340 #ifdef OSG_MT_CPTR_ASPECT
341 virtual FieldContainer *createAspectCopy(
342 const FieldContainer *pRefAspect) const;
343 #endif
345 /*! \} */
346 /*---------------------------------------------------------------------*/
347 /*! \name Edit */
348 /*! \{ */
349 /*! \} */
350 /*---------------------------------------------------------------------*/
351 /*! \name Sync */
352 /*! \{ */
354 virtual void resolveLinks(void);
356 /*! \} */
357 /*========================== PRIVATE ================================*/
359 private:
360 /*---------------------------------------------------------------------*/
362 // prohibit default functions (move to 'public' if you need one)
363 void operator =(const ScreenTransformBase &source);
366 typedef ScreenTransformBase *ScreenTransformBaseP;
368 typedef CoredNodeRefPtr <ScreenTransform> ScreenTransformNodeRefPtr;
369 typedef CoredNodeMTRefPtr<ScreenTransform> ScreenTransformNodeMTRefPtr;
371 OSG_END_NAMESPACE
373 #endif /* _OSGSCREENTRANSFORMBASE_H_ */