fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Window / FrameBufferObjects / OSGRenderBufferBase.h
blobbf21fe92626e7ba8eb0172c69cada3ffec4ad484
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 RenderBuffer
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGRENDERBUFFERBASE_H_
55 #define _OSGRENDERBUFFERBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGFrameBufferAttachment.h" // Parent
68 #include "OSGBaseFields.h" // GLId type
69 #include "OSGImageFields.h" // Image type
70 #include "OSGSysFields.h" // ColorSamples type
72 #include "OSGRenderBufferFields.h"
74 OSG_BEGIN_NAMESPACE
77 class RenderBuffer;
79 //! \brief RenderBuffer Base Class.
81 class OSG_SYSTEM_DLLMAPPING RenderBufferBase : public FrameBufferAttachment
83 public:
85 typedef FrameBufferAttachment Inherited;
86 typedef FrameBufferAttachment ParentContainer;
88 typedef Inherited::TypeObject TypeObject;
89 typedef TypeObject::InitPhase InitPhase;
91 OSG_GEN_INTERNALPTR(RenderBuffer);
93 /*========================== PUBLIC =================================*/
95 public:
97 enum
99 GLIdFieldId = Inherited::NextFieldId,
100 InternalFormatFieldId = GLIdFieldId + 1,
101 ImageFieldId = InternalFormatFieldId + 1,
102 ColorSamplesFieldId = ImageFieldId + 1,
103 CoverageSamplesFieldId = ColorSamplesFieldId + 1,
104 FixedSampleLocationFieldId = CoverageSamplesFieldId + 1,
105 NextFieldId = FixedSampleLocationFieldId + 1
108 static const OSG::BitVector GLIdFieldMask =
109 (TypeTraits<BitVector>::One << GLIdFieldId);
110 static const OSG::BitVector InternalFormatFieldMask =
111 (TypeTraits<BitVector>::One << InternalFormatFieldId);
112 static const OSG::BitVector ImageFieldMask =
113 (TypeTraits<BitVector>::One << ImageFieldId);
114 static const OSG::BitVector ColorSamplesFieldMask =
115 (TypeTraits<BitVector>::One << ColorSamplesFieldId);
116 static const OSG::BitVector CoverageSamplesFieldMask =
117 (TypeTraits<BitVector>::One << CoverageSamplesFieldId);
118 static const OSG::BitVector FixedSampleLocationFieldMask =
119 (TypeTraits<BitVector>::One << FixedSampleLocationFieldId);
120 static const OSG::BitVector NextFieldMask =
121 (TypeTraits<BitVector>::One << NextFieldId);
123 typedef SFGLenum SFGLIdType;
124 typedef SFGLenum SFInternalFormatType;
125 typedef SFUnrecImagePtr SFImageType;
126 typedef SFUInt32 SFColorSamplesType;
127 typedef SFUInt32 SFCoverageSamplesType;
128 typedef SFBool SFFixedSampleLocationType;
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 /*! \{ */
154 SFGLenum *editSFGLId (void);
155 const SFGLenum *getSFGLId (void) const;
157 SFGLenum *editSFInternalFormat (void);
158 const SFGLenum *getSFInternalFormat (void) const;
159 const SFUnrecImagePtr *getSFImage (void) const;
160 SFUnrecImagePtr *editSFImage (void);
162 SFUInt32 *editSFColorSamples (void);
163 const SFUInt32 *getSFColorSamples (void) const;
165 SFUInt32 *editSFCoverageSamples(void);
166 const SFUInt32 *getSFCoverageSamples (void) const;
168 SFBool *editSFFixedSampleLocation(void);
169 const SFBool *getSFFixedSampleLocation (void) const;
172 GLenum &editGLId (void);
173 const GLenum &getGLId (void) const;
175 GLenum &editInternalFormat (void);
176 const GLenum &getInternalFormat (void) const;
178 Image * getImage (void) const;
180 UInt32 &editColorSamples (void);
181 UInt32 getColorSamples (void) const;
183 UInt32 &editCoverageSamples(void);
184 UInt32 getCoverageSamples (void) const;
186 bool &editFixedSampleLocation(void);
187 bool getFixedSampleLocation (void) const;
189 /*! \} */
190 /*---------------------------------------------------------------------*/
191 /*! \name Field Set */
192 /*! \{ */
194 void setGLId (const GLenum &value);
195 void setInternalFormat (const GLenum &value);
196 void setImage (Image * const value);
197 void setColorSamples (const UInt32 value);
198 void setCoverageSamples(const UInt32 value);
199 void setFixedSampleLocation(const bool 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 RenderBufferTransitPtr create (void);
229 static RenderBuffer *createEmpty (void);
231 static RenderBufferTransitPtr createLocal (
232 BitVector bFlags = FCLocal::All);
234 static RenderBuffer *createEmptyLocal(
235 BitVector bFlags = FCLocal::All);
237 static RenderBufferTransitPtr 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 SFGLenum _sfGLId;
265 SFGLenum _sfInternalFormat;
266 SFUnrecImagePtr _sfImage;
267 SFUInt32 _sfColorSamples;
268 SFUInt32 _sfCoverageSamples;
269 SFBool _sfFixedSampleLocation;
271 /*! \} */
272 /*---------------------------------------------------------------------*/
273 /*! \name Constructors */
274 /*! \{ */
276 RenderBufferBase(void);
277 RenderBufferBase(const RenderBufferBase &source);
279 /*! \} */
280 /*---------------------------------------------------------------------*/
281 /*! \name Destructors */
282 /*! \{ */
284 virtual ~RenderBufferBase(void);
286 /*! \} */
287 /*---------------------------------------------------------------------*/
288 /*! \name onCreate */
289 /*! \{ */
291 void onCreate(const RenderBuffer *source = NULL);
293 /*! \} */
294 /*---------------------------------------------------------------------*/
295 /*! \name Generic Field Access */
296 /*! \{ */
298 GetFieldHandlePtr getHandleGLId (void) const;
299 EditFieldHandlePtr editHandleGLId (void);
300 GetFieldHandlePtr getHandleInternalFormat (void) const;
301 EditFieldHandlePtr editHandleInternalFormat (void);
302 GetFieldHandlePtr getHandleImage (void) const;
303 EditFieldHandlePtr editHandleImage (void);
304 GetFieldHandlePtr getHandleColorSamples (void) const;
305 EditFieldHandlePtr editHandleColorSamples (void);
306 GetFieldHandlePtr getHandleCoverageSamples (void) const;
307 EditFieldHandlePtr editHandleCoverageSamples(void);
308 GetFieldHandlePtr getHandleFixedSampleLocation (void) const;
309 EditFieldHandlePtr editHandleFixedSampleLocation(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 ( RenderBufferBase *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 RenderBufferBase &source);
366 typedef RenderBufferBase *RenderBufferBaseP;
368 OSG_END_NAMESPACE
370 #endif /* _OSGRENDERBUFFERBASE_H_ */