fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Window / Background / OSGTextureBackgroundBase.h
blob5c1fcc8a9ad6c47edcffd74a642b974da1d00d1f
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 TextureBackground
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGTEXTUREBACKGROUNDBASE_H_
55 #define _OSGTEXTUREBACKGROUNDBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGWindowDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGBackground.h" // Parent
68 #include "OSGBaseFields.h" // Color type
69 #include "OSGTextureBaseChunkFields.h" // Texture type
70 #include "OSGVecFields.h" // TexCoords type
71 #include "OSGSysFields.h" // RadialDistortion type
73 #include "OSGTextureBackgroundFields.h"
75 OSG_BEGIN_NAMESPACE
78 class TextureBackground;
80 //! \brief TextureBackground Base Class.
82 class OSG_WINDOW_DLLMAPPING TextureBackgroundBase : public Background
84 public:
86 typedef Background Inherited;
87 typedef Background ParentContainer;
89 typedef Inherited::TypeObject TypeObject;
90 typedef TypeObject::InitPhase InitPhase;
92 OSG_GEN_INTERNALPTR(TextureBackground);
94 /*========================== PUBLIC =================================*/
96 public:
98 enum
100 ColorFieldId = Inherited::NextFieldId,
101 TextureFieldId = ColorFieldId + 1,
102 TexCoordsFieldId = TextureFieldId + 1,
103 RadialDistortionFieldId = TexCoordsFieldId + 1,
104 CenterOfDistortionFieldId = RadialDistortionFieldId + 1,
105 HorFieldId = CenterOfDistortionFieldId + 1,
106 VertFieldId = HorFieldId + 1,
107 NextFieldId = VertFieldId + 1
110 static const OSG::BitVector ColorFieldMask =
111 (TypeTraits<BitVector>::One << ColorFieldId);
112 static const OSG::BitVector TextureFieldMask =
113 (TypeTraits<BitVector>::One << TextureFieldId);
114 static const OSG::BitVector TexCoordsFieldMask =
115 (TypeTraits<BitVector>::One << TexCoordsFieldId);
116 static const OSG::BitVector RadialDistortionFieldMask =
117 (TypeTraits<BitVector>::One << RadialDistortionFieldId);
118 static const OSG::BitVector CenterOfDistortionFieldMask =
119 (TypeTraits<BitVector>::One << CenterOfDistortionFieldId);
120 static const OSG::BitVector HorFieldMask =
121 (TypeTraits<BitVector>::One << HorFieldId);
122 static const OSG::BitVector VertFieldMask =
123 (TypeTraits<BitVector>::One << VertFieldId);
124 static const OSG::BitVector NextFieldMask =
125 (TypeTraits<BitVector>::One << NextFieldId);
127 typedef SFColor4f SFColorType;
128 typedef SFUnrecTextureBaseChunkPtr SFTextureType;
129 typedef MFPnt2f MFTexCoordsType;
130 typedef SFReal32 SFRadialDistortionType;
131 typedef SFVec2f SFCenterOfDistortionType;
132 typedef SFUInt16 SFHorType;
133 typedef SFUInt16 SFVertType;
135 /*---------------------------------------------------------------------*/
136 /*! \name Class Get */
137 /*! \{ */
139 static FieldContainerType &getClassType (void);
140 static UInt32 getClassTypeId (void);
141 static UInt16 getClassGroupId(void);
143 /*! \} */
144 /*---------------------------------------------------------------------*/
145 /*! \name FieldContainer Get */
146 /*! \{ */
148 virtual FieldContainerType &getType (void);
149 virtual const FieldContainerType &getType (void) const;
151 virtual UInt32 getContainerSize(void) const;
153 /*! \} */
154 /*---------------------------------------------------------------------*/
155 /*! \name Field Get */
156 /*! \{ */
159 SFColor4f *editSFColor (void);
160 const SFColor4f *getSFColor (void) const;
161 const SFUnrecTextureBaseChunkPtr *getSFTexture (void) const;
162 SFUnrecTextureBaseChunkPtr *editSFTexture (void);
164 MFPnt2f *editMFTexCoords (void);
165 const MFPnt2f *getMFTexCoords (void) const;
167 SFReal32 *editSFRadialDistortion(void);
168 const SFReal32 *getSFRadialDistortion (void) const;
170 SFVec2f *editSFCenterOfDistortion(void);
171 const SFVec2f *getSFCenterOfDistortion (void) const;
173 SFUInt16 *editSFHor (void);
174 const SFUInt16 *getSFHor (void) const;
176 SFUInt16 *editSFVert (void);
177 const SFUInt16 *getSFVert (void) const;
180 Color4f &editColor (void);
181 const Color4f &getColor (void) const;
183 TextureBaseChunk * getTexture (void) const;
185 MFPnt2f ::reference editTexCoords (const UInt32 index);
186 const Pnt2f &getTexCoords (const UInt32 index) const;
188 Real32 &editRadialDistortion(void);
189 Real32 getRadialDistortion (void) const;
191 Vec2f &editCenterOfDistortion(void);
192 const Vec2f &getCenterOfDistortion (void) const;
194 UInt16 &editHor (void);
195 UInt16 getHor (void) const;
197 UInt16 &editVert (void);
198 UInt16 getVert (void) const;
200 /*! \} */
201 /*---------------------------------------------------------------------*/
202 /*! \name Field Set */
203 /*! \{ */
205 void setColor (const Color4f &value);
206 void setTexture (TextureBaseChunk * const value);
207 void setRadialDistortion(const Real32 value);
208 void setCenterOfDistortion(const Vec2f &value);
209 void setHor (const UInt16 value);
210 void setVert (const UInt16 value);
212 /*! \} */
213 /*---------------------------------------------------------------------*/
214 /*! \name Ptr Field Set */
215 /*! \{ */
217 /*! \} */
218 /*---------------------------------------------------------------------*/
219 /*! \name Ptr MField Set */
220 /*! \{ */
222 /*! \} */
223 /*---------------------------------------------------------------------*/
224 /*! \name Binary Access */
225 /*! \{ */
227 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
228 virtual void copyToBin (BinaryDataHandler &pMem,
229 ConstFieldMaskArg whichField);
230 virtual void copyFromBin(BinaryDataHandler &pMem,
231 ConstFieldMaskArg whichField);
234 /*! \} */
235 /*---------------------------------------------------------------------*/
236 /*! \name Construction */
237 /*! \{ */
239 static TextureBackgroundTransitPtr create (void);
240 static TextureBackground *createEmpty (void);
242 static TextureBackgroundTransitPtr createLocal (
243 BitVector bFlags = FCLocal::All);
245 static TextureBackground *createEmptyLocal(
246 BitVector bFlags = FCLocal::All);
248 static TextureBackgroundTransitPtr createDependent (BitVector bFlags);
250 /*! \} */
251 /*---------------------------------------------------------------------*/
252 /*! \name Copy */
253 /*! \{ */
255 virtual FieldContainerTransitPtr shallowCopy (void) const;
256 virtual FieldContainerTransitPtr shallowCopyLocal(
257 BitVector bFlags = FCLocal::All) const;
258 virtual FieldContainerTransitPtr shallowCopyDependent(
259 BitVector bFlags) const;
261 /*! \} */
262 /*========================= PROTECTED ===============================*/
264 protected:
266 static TypeObject _type;
268 static void classDescInserter(TypeObject &oType);
269 static const Char8 *getClassname (void );
271 /*---------------------------------------------------------------------*/
272 /*! \name Fields */
273 /*! \{ */
275 SFColor4f _sfColor;
276 SFUnrecTextureBaseChunkPtr _sfTexture;
277 MFPnt2f _mfTexCoords;
278 SFReal32 _sfRadialDistortion;
279 SFVec2f _sfCenterOfDistortion;
280 SFUInt16 _sfHor;
281 SFUInt16 _sfVert;
283 /*! \} */
284 /*---------------------------------------------------------------------*/
285 /*! \name Constructors */
286 /*! \{ */
288 TextureBackgroundBase(void);
289 TextureBackgroundBase(const TextureBackgroundBase &source);
291 /*! \} */
292 /*---------------------------------------------------------------------*/
293 /*! \name Destructors */
294 /*! \{ */
296 virtual ~TextureBackgroundBase(void);
298 /*! \} */
299 /*---------------------------------------------------------------------*/
300 /*! \name onCreate */
301 /*! \{ */
303 void onCreate(const TextureBackground *source = NULL);
305 /*! \} */
306 /*---------------------------------------------------------------------*/
307 /*! \name Generic Field Access */
308 /*! \{ */
310 GetFieldHandlePtr getHandleColor (void) const;
311 EditFieldHandlePtr editHandleColor (void);
312 GetFieldHandlePtr getHandleTexture (void) const;
313 EditFieldHandlePtr editHandleTexture (void);
314 GetFieldHandlePtr getHandleTexCoords (void) const;
315 EditFieldHandlePtr editHandleTexCoords (void);
316 GetFieldHandlePtr getHandleRadialDistortion (void) const;
317 EditFieldHandlePtr editHandleRadialDistortion(void);
318 GetFieldHandlePtr getHandleCenterOfDistortion (void) const;
319 EditFieldHandlePtr editHandleCenterOfDistortion(void);
320 GetFieldHandlePtr getHandleHor (void) const;
321 EditFieldHandlePtr editHandleHor (void);
322 GetFieldHandlePtr getHandleVert (void) const;
323 EditFieldHandlePtr editHandleVert (void);
325 /*! \} */
326 /*---------------------------------------------------------------------*/
327 /*! \name Sync */
328 /*! \{ */
330 #ifdef OSG_MT_CPTR_ASPECT
331 virtual void execSyncV( FieldContainer &oFrom,
332 ConstFieldMaskArg whichField,
333 AspectOffsetStore &oOffsets,
334 ConstFieldMaskArg syncMode ,
335 const UInt32 uiSyncInfo);
337 void execSync ( TextureBackgroundBase *pFrom,
338 ConstFieldMaskArg whichField,
339 AspectOffsetStore &oOffsets,
340 ConstFieldMaskArg syncMode ,
341 const UInt32 uiSyncInfo);
342 #endif
344 /*! \} */
345 /*---------------------------------------------------------------------*/
346 /*! \name Edit */
347 /*! \{ */
349 /*! \} */
350 /*---------------------------------------------------------------------*/
351 /*! \name Aspect Create */
352 /*! \{ */
354 #ifdef OSG_MT_CPTR_ASPECT
355 virtual FieldContainer *createAspectCopy(
356 const FieldContainer *pRefAspect) const;
357 #endif
359 /*! \} */
360 /*---------------------------------------------------------------------*/
361 /*! \name Edit */
362 /*! \{ */
363 /*! \} */
364 /*---------------------------------------------------------------------*/
365 /*! \name Sync */
366 /*! \{ */
368 virtual void resolveLinks(void);
370 /*! \} */
371 /*========================== PRIVATE ================================*/
373 private:
374 /*---------------------------------------------------------------------*/
376 // prohibit default functions (move to 'public' if you need one)
377 void operator =(const TextureBackgroundBase &source);
380 typedef TextureBackgroundBase *TextureBackgroundBaseP;
382 OSG_END_NAMESPACE
384 #endif /* _OSGTEXTUREBACKGROUNDBASE_H_ */