fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / State / Base / OSGMultiPropertyUBOChunkBase.h
blob9b68ff1e2ebb976db5a50beba949e12ade5e1ac5
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 MultiPropertyUBOChunk
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGMULTIPROPERTYUBOCHUNKBASE_H_
55 #define _OSGMULTIPROPERTYUBOCHUNKBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGUniformBufferObjStd140Chunk.h" // Parent
68 #include "OSGSysFields.h" // Types type
69 #include "OSGVecFields.h" // Vec3Values type
70 #include "OSGMathFields.h" // MatrixValues type
72 #include "OSGMultiPropertyUBOChunkFields.h"
74 OSG_BEGIN_NAMESPACE
77 class MultiPropertyUBOChunk;
79 //! \brief MultiPropertyUBOChunk Base Class.
81 class OSG_SYSTEM_DLLMAPPING MultiPropertyUBOChunkBase : public UniformBufferObjStd140Chunk
83 public:
85 typedef UniformBufferObjStd140Chunk Inherited;
86 typedef UniformBufferObjStd140Chunk ParentContainer;
88 typedef Inherited::TypeObject TypeObject;
89 typedef TypeObject::InitPhase InitPhase;
91 OSG_GEN_INTERNALPTR(MultiPropertyUBOChunk);
93 /*========================== PUBLIC =================================*/
95 public:
97 enum
99 TypesFieldId = Inherited::NextFieldId,
100 CardinalityFieldId = TypesFieldId + 1,
101 CardinalitiesFieldId = CardinalityFieldId + 1,
102 NumPropertiesFieldId = CardinalitiesFieldId + 1,
103 FloatValuesFieldId = NumPropertiesFieldId + 1,
104 DoubleValuesFieldId = FloatValuesFieldId + 1,
105 IntValuesFieldId = DoubleValuesFieldId + 1,
106 UIntValuesFieldId = IntValuesFieldId + 1,
107 BoolValuesFieldId = UIntValuesFieldId + 1,
108 Vec3ValuesFieldId = BoolValuesFieldId + 1,
109 Vec4ValuesFieldId = Vec3ValuesFieldId + 1,
110 MatrixValuesFieldId = Vec4ValuesFieldId + 1,
111 NextFieldId = MatrixValuesFieldId + 1
114 static const OSG::BitVector TypesFieldMask =
115 (TypeTraits<BitVector>::One << TypesFieldId);
116 static const OSG::BitVector CardinalityFieldMask =
117 (TypeTraits<BitVector>::One << CardinalityFieldId);
118 static const OSG::BitVector CardinalitiesFieldMask =
119 (TypeTraits<BitVector>::One << CardinalitiesFieldId);
120 static const OSG::BitVector NumPropertiesFieldMask =
121 (TypeTraits<BitVector>::One << NumPropertiesFieldId);
122 static const OSG::BitVector FloatValuesFieldMask =
123 (TypeTraits<BitVector>::One << FloatValuesFieldId);
124 static const OSG::BitVector DoubleValuesFieldMask =
125 (TypeTraits<BitVector>::One << DoubleValuesFieldId);
126 static const OSG::BitVector IntValuesFieldMask =
127 (TypeTraits<BitVector>::One << IntValuesFieldId);
128 static const OSG::BitVector UIntValuesFieldMask =
129 (TypeTraits<BitVector>::One << UIntValuesFieldId);
130 static const OSG::BitVector BoolValuesFieldMask =
131 (TypeTraits<BitVector>::One << BoolValuesFieldId);
132 static const OSG::BitVector Vec3ValuesFieldMask =
133 (TypeTraits<BitVector>::One << Vec3ValuesFieldId);
134 static const OSG::BitVector Vec4ValuesFieldMask =
135 (TypeTraits<BitVector>::One << Vec4ValuesFieldId);
136 static const OSG::BitVector MatrixValuesFieldMask =
137 (TypeTraits<BitVector>::One << MatrixValuesFieldId);
138 static const OSG::BitVector NextFieldMask =
139 (TypeTraits<BitVector>::One << NextFieldId);
141 typedef MFUInt8 MFTypesType;
142 typedef MFUInt32 MFCardinalityType;
143 typedef MFUInt32 MFCardinalitiesType;
144 typedef SFUInt32 SFNumPropertiesType;
145 typedef MFReal32 MFFloatValuesType;
146 typedef MFReal64 MFDoubleValuesType;
147 typedef MFInt32 MFIntValuesType;
148 typedef MFUInt32 MFUIntValuesType;
149 typedef MFBool MFBoolValuesType;
150 typedef MFVec3f MFVec3ValuesType;
151 typedef MFVec4f MFVec4ValuesType;
152 typedef MFMatrix MFMatrixValuesType;
154 /*---------------------------------------------------------------------*/
155 /*! \name Class Get */
156 /*! \{ */
158 static FieldContainerType &getClassType (void);
159 static UInt32 getClassTypeId (void);
160 static UInt16 getClassGroupId(void);
162 /*! \} */
163 /*---------------------------------------------------------------------*/
164 /*! \name FieldContainer Get */
165 /*! \{ */
167 virtual FieldContainerType &getType (void);
168 virtual const FieldContainerType &getType (void) const;
170 virtual UInt32 getContainerSize(void) const;
172 /*! \} */
173 /*---------------------------------------------------------------------*/
174 /*! \name Binary Access */
175 /*! \{ */
177 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
178 virtual void copyToBin (BinaryDataHandler &pMem,
179 ConstFieldMaskArg whichField);
180 virtual void copyFromBin(BinaryDataHandler &pMem,
181 ConstFieldMaskArg whichField);
184 /*! \} */
185 /*---------------------------------------------------------------------*/
186 /*! \name Construction */
187 /*! \{ */
189 static MultiPropertyUBOChunkTransitPtr create (void);
190 static MultiPropertyUBOChunk *createEmpty (void);
192 static MultiPropertyUBOChunkTransitPtr createLocal (
193 BitVector bFlags = FCLocal::All);
195 static MultiPropertyUBOChunk *createEmptyLocal(
196 BitVector bFlags = FCLocal::All);
198 static MultiPropertyUBOChunkTransitPtr createDependent (BitVector bFlags);
200 /*! \} */
201 /*---------------------------------------------------------------------*/
202 /*! \name Copy */
203 /*! \{ */
205 virtual FieldContainerTransitPtr shallowCopy (void) const;
206 virtual FieldContainerTransitPtr shallowCopyLocal(
207 BitVector bFlags = FCLocal::All) const;
208 virtual FieldContainerTransitPtr shallowCopyDependent(
209 BitVector bFlags) const;
211 /*! \} */
212 /*========================= PROTECTED ===============================*/
214 protected:
216 static TypeObject _type;
218 static void classDescInserter(TypeObject &oType);
219 static const Char8 *getClassname (void );
221 /*---------------------------------------------------------------------*/
222 /*! \name Fields */
223 /*! \{ */
225 MFUInt8 _mfTypes;
226 MFUInt32 _mfCardinality;
227 MFUInt32 _mfCardinalities;
228 SFUInt32 _sfNumProperties;
229 MFReal32 _mfFloatValues;
230 MFReal64 _mfDoubleValues;
231 MFInt32 _mfIntValues;
232 MFUInt32 _mfUIntValues;
233 MFBool _mfBoolValues;
234 MFVec3f _mfVec3Values;
235 MFVec4f _mfVec4Values;
236 MFMatrix _mfMatrixValues;
238 /*! \} */
239 /*---------------------------------------------------------------------*/
240 /*! \name Constructors */
241 /*! \{ */
243 MultiPropertyUBOChunkBase(void);
244 MultiPropertyUBOChunkBase(const MultiPropertyUBOChunkBase &source);
246 /*! \} */
247 /*---------------------------------------------------------------------*/
248 /*! \name Destructors */
249 /*! \{ */
251 virtual ~MultiPropertyUBOChunkBase(void);
253 /*! \} */
254 /*---------------------------------------------------------------------*/
255 /*! \name onCreate */
256 /*! \{ */
259 /*! \} */
260 /*---------------------------------------------------------------------*/
261 /*! \name Generic Field Access */
262 /*! \{ */
264 GetFieldHandlePtr getHandleTypes (void) const;
265 EditFieldHandlePtr editHandleTypes (void);
266 GetFieldHandlePtr getHandleCardinality (void) const;
267 EditFieldHandlePtr editHandleCardinality (void);
268 GetFieldHandlePtr getHandleCardinalities (void) const;
269 EditFieldHandlePtr editHandleCardinalities (void);
270 GetFieldHandlePtr getHandleNumProperties (void) const;
271 EditFieldHandlePtr editHandleNumProperties (void);
272 GetFieldHandlePtr getHandleFloatValues (void) const;
273 EditFieldHandlePtr editHandleFloatValues (void);
274 GetFieldHandlePtr getHandleDoubleValues (void) const;
275 EditFieldHandlePtr editHandleDoubleValues (void);
276 GetFieldHandlePtr getHandleIntValues (void) const;
277 EditFieldHandlePtr editHandleIntValues (void);
278 GetFieldHandlePtr getHandleUIntValues (void) const;
279 EditFieldHandlePtr editHandleUIntValues (void);
280 GetFieldHandlePtr getHandleBoolValues (void) const;
281 EditFieldHandlePtr editHandleBoolValues (void);
282 GetFieldHandlePtr getHandleVec3Values (void) const;
283 EditFieldHandlePtr editHandleVec3Values (void);
284 GetFieldHandlePtr getHandleVec4Values (void) const;
285 EditFieldHandlePtr editHandleVec4Values (void);
286 GetFieldHandlePtr getHandleMatrixValues (void) const;
287 EditFieldHandlePtr editHandleMatrixValues (void);
289 /*! \} */
290 /*---------------------------------------------------------------------*/
291 /*! \name Field Get */
292 /*! \{ */
295 MFUInt8 *editMFTypes (void);
296 const MFUInt8 *getMFTypes (void) const;
298 MFUInt32 *editMFCardinality (void);
299 const MFUInt32 *getMFCardinality (void) const;
301 MFUInt32 *editMFCardinalities (void);
302 const MFUInt32 *getMFCardinalities (void) const;
304 SFUInt32 *editSFNumProperties (void);
305 const SFUInt32 *getSFNumProperties (void) const;
307 MFReal32 *editMFFloatValues (void);
308 const MFReal32 *getMFFloatValues (void) const;
310 MFReal64 *editMFDoubleValues (void);
311 const MFReal64 *getMFDoubleValues (void) const;
313 MFInt32 *editMFIntValues (void);
314 const MFInt32 *getMFIntValues (void) const;
316 MFUInt32 *editMFUIntValues (void);
317 const MFUInt32 *getMFUIntValues (void) const;
319 MFBool *editMFBoolValues (void);
320 const MFBool *getMFBoolValues (void) const;
322 MFVec3f *editMFVec3Values (void);
323 const MFVec3f *getMFVec3Values (void) const;
325 MFVec4f *editMFVec4Values (void);
326 const MFVec4f *getMFVec4Values (void) const;
328 MFMatrix *editMFMatrixValues (void);
329 const MFMatrix *getMFMatrixValues (void) const;
332 MFUInt8 ::reference editTypes (const UInt32 index);
333 UInt8 getTypes (const UInt32 index) const;
335 MFUInt32 ::reference editCardinality (const UInt32 index);
336 UInt32 getCardinality (const UInt32 index) const;
338 MFUInt32 ::reference editCardinalities (const UInt32 index);
339 UInt32 getCardinalities (const UInt32 index) const;
341 UInt32 &editNumProperties (void);
342 UInt32 getNumProperties (void) const;
344 MFReal32 ::reference editFloatValues (const UInt32 index);
345 Real32 getFloatValues (const UInt32 index) const;
347 MFReal64 ::reference editDoubleValues (const UInt32 index);
348 Real64 getDoubleValues (const UInt32 index) const;
350 MFInt32 ::reference editIntValues (const UInt32 index);
351 Int32 getIntValues (const UInt32 index) const;
353 MFUInt32 ::reference editUIntValues (const UInt32 index);
354 UInt32 getUIntValues (const UInt32 index) const;
356 MFBool ::reference editBoolValues (const UInt32 index);
357 bool getBoolValues (const UInt32 index) const;
359 MFVec3f ::reference editVec3Values (const UInt32 index);
360 const Vec3f &getVec3Values (const UInt32 index) const;
362 MFVec4f ::reference editVec4Values (const UInt32 index);
363 const Vec4f &getVec4Values (const UInt32 index) const;
365 MFMatrix ::reference editMatrixValues (const UInt32 index);
366 const Matrix &getMatrixValues (const UInt32 index) const;
368 /*! \} */
369 /*---------------------------------------------------------------------*/
370 /*! \name Field Set */
371 /*! \{ */
373 void setNumProperties (const UInt32 value);
375 /*! \} */
376 /*---------------------------------------------------------------------*/
377 /*! \name Ptr MField Set */
378 /*! \{ */
380 /*! \} */
381 /*---------------------------------------------------------------------*/
382 /*! \name Sync */
383 /*! \{ */
385 #ifdef OSG_MT_CPTR_ASPECT
386 virtual void execSyncV( FieldContainer &oFrom,
387 ConstFieldMaskArg whichField,
388 AspectOffsetStore &oOffsets,
389 ConstFieldMaskArg syncMode ,
390 const UInt32 uiSyncInfo);
392 void execSync ( MultiPropertyUBOChunkBase *pFrom,
393 ConstFieldMaskArg whichField,
394 AspectOffsetStore &oOffsets,
395 ConstFieldMaskArg syncMode ,
396 const UInt32 uiSyncInfo);
397 #endif
399 /*! \} */
400 /*---------------------------------------------------------------------*/
401 /*! \name Edit */
402 /*! \{ */
404 /*! \} */
405 /*---------------------------------------------------------------------*/
406 /*! \name Aspect Create */
407 /*! \{ */
409 #ifdef OSG_MT_CPTR_ASPECT
410 virtual FieldContainer *createAspectCopy(
411 const FieldContainer *pRefAspect) const;
412 #endif
414 /*! \} */
415 /*---------------------------------------------------------------------*/
416 /*! \name Edit */
417 /*! \{ */
418 /*! \} */
419 /*---------------------------------------------------------------------*/
420 /*! \name Sync */
421 /*! \{ */
423 virtual void resolveLinks(void);
425 /*! \} */
426 /*========================== PRIVATE ================================*/
428 private:
429 /*---------------------------------------------------------------------*/
431 // prohibit default functions (move to 'public' if you need one)
432 void operator =(const MultiPropertyUBOChunkBase &source);
435 typedef MultiPropertyUBOChunkBase *MultiPropertyUBOChunkBaseP;
437 OSG_END_NAMESPACE
439 #endif /* _OSGMULTIPROPERTYUBOCHUNKBASE_H_ */