changed: gcc8 base update
[opensg.git] / Source / System / NodeCores / Drawables / Particles / OSGParticlesBase.h
blobc981bc4272887a90bcbb029c5bd8260357ceead0
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 Particles
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGPARTICLESBASE_H_
55 #define _OSGPARTICLESBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGDrawableDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGMaterialDrawable.h" // Parent
68 #include "OSGSysFields.h" // Mode type
69 #include "OSGGeoVectorPropertyFields.h" // Positions type
70 #include "OSGVecFields.h" // Sizes type
71 #include "OSGParticleBSP.h" // Bsp type
73 #include "OSGParticlesFields.h"
75 OSG_BEGIN_NAMESPACE
78 class Particles;
80 //! \brief Particles Base Class.
82 class OSG_DRAWABLE_DLLMAPPING ParticlesBase : public MaterialDrawable
84 public:
86 typedef MaterialDrawable Inherited;
87 typedef MaterialDrawable ParentContainer;
89 typedef Inherited::TypeObject TypeObject;
90 typedef TypeObject::InitPhase InitPhase;
92 OSG_GEN_INTERNALPTR(Particles);
94 /*========================== PUBLIC =================================*/
96 public:
98 enum
100 ModeFieldId = Inherited::NextFieldId,
101 PositionsFieldId = ModeFieldId + 1,
102 SizesFieldId = PositionsFieldId + 1,
103 SecPositionsFieldId = SizesFieldId + 1,
104 ColorsFieldId = SecPositionsFieldId + 1,
105 NormalsFieldId = ColorsFieldId + 1,
106 IndicesFieldId = NormalsFieldId + 1,
107 TextureZsFieldId = IndicesFieldId + 1,
108 DrawOrderFieldId = TextureZsFieldId + 1,
109 DynamicFieldId = DrawOrderFieldId + 1,
110 PumpFieldId = DynamicFieldId + 1,
111 BspFieldId = PumpFieldId + 1,
112 NumParticlesFieldId = BspFieldId + 1,
113 NextFieldId = NumParticlesFieldId + 1
116 static const OSG::BitVector ModeFieldMask =
117 (TypeTraits<BitVector>::One << ModeFieldId);
118 static const OSG::BitVector PositionsFieldMask =
119 (TypeTraits<BitVector>::One << PositionsFieldId);
120 static const OSG::BitVector SizesFieldMask =
121 (TypeTraits<BitVector>::One << SizesFieldId);
122 static const OSG::BitVector SecPositionsFieldMask =
123 (TypeTraits<BitVector>::One << SecPositionsFieldId);
124 static const OSG::BitVector ColorsFieldMask =
125 (TypeTraits<BitVector>::One << ColorsFieldId);
126 static const OSG::BitVector NormalsFieldMask =
127 (TypeTraits<BitVector>::One << NormalsFieldId);
128 static const OSG::BitVector IndicesFieldMask =
129 (TypeTraits<BitVector>::One << IndicesFieldId);
130 static const OSG::BitVector TextureZsFieldMask =
131 (TypeTraits<BitVector>::One << TextureZsFieldId);
132 static const OSG::BitVector DrawOrderFieldMask =
133 (TypeTraits<BitVector>::One << DrawOrderFieldId);
134 static const OSG::BitVector DynamicFieldMask =
135 (TypeTraits<BitVector>::One << DynamicFieldId);
136 static const OSG::BitVector PumpFieldMask =
137 (TypeTraits<BitVector>::One << PumpFieldId);
138 static const OSG::BitVector BspFieldMask =
139 (TypeTraits<BitVector>::One << BspFieldId);
140 static const OSG::BitVector NumParticlesFieldMask =
141 (TypeTraits<BitVector>::One << NumParticlesFieldId);
142 static const OSG::BitVector NextFieldMask =
143 (TypeTraits<BitVector>::One << NextFieldId);
145 typedef SFUInt32 SFModeType;
146 typedef SFUnrecChildGeoVectorPropertyPtr SFPositionsType;
147 typedef MFVec3f MFSizesType;
148 typedef SFUnrecChildGeoVectorPropertyPtr SFSecPositionsType;
149 typedef SFUnrecChildGeoVectorPropertyPtr SFColorsType;
150 typedef SFUnrecChildGeoVectorPropertyPtr SFNormalsType;
151 typedef MFInt32 MFIndicesType;
152 typedef MFReal32 MFTextureZsType;
153 typedef SFUInt32 SFDrawOrderType;
154 typedef SFBool SFDynamicType;
155 typedef SFUInt32 SFPumpType;
156 typedef SFParticleBSPTree SFBspType;
157 typedef SFInt32 SFNumParticlesType;
159 /*---------------------------------------------------------------------*/
160 /*! \name Class Get */
161 /*! \{ */
163 static FieldContainerType &getClassType (void);
164 static UInt32 getClassTypeId (void);
165 static UInt16 getClassGroupId(void);
167 /*! \} */
168 /*---------------------------------------------------------------------*/
169 /*! \name FieldContainer Get */
170 /*! \{ */
172 virtual FieldContainerType &getType (void);
173 virtual const FieldContainerType &getType (void) const;
175 virtual UInt32 getContainerSize(void) const;
177 /*! \} */
178 /*---------------------------------------------------------------------*/
179 /*! \name Field Get */
180 /*! \{ */
183 SFUInt32 *editSFMode (void);
184 const SFUInt32 *getSFMode (void) const;
185 const SFUnrecChildGeoVectorPropertyPtr *getSFPositions (void) const;
186 SFUnrecChildGeoVectorPropertyPtr *editSFPositions (void);
188 MFVec3f *editMFSizes (void);
189 const MFVec3f *getMFSizes (void) const;
190 const SFUnrecChildGeoVectorPropertyPtr *getSFSecPositions (void) const;
191 SFUnrecChildGeoVectorPropertyPtr *editSFSecPositions (void);
192 const SFUnrecChildGeoVectorPropertyPtr *getSFColors (void) const;
193 SFUnrecChildGeoVectorPropertyPtr *editSFColors (void);
194 const SFUnrecChildGeoVectorPropertyPtr *getSFNormals (void) const;
195 SFUnrecChildGeoVectorPropertyPtr *editSFNormals (void);
197 MFInt32 *editMFIndices (void);
198 const MFInt32 *getMFIndices (void) const;
200 MFReal32 *editMFTextureZs (void);
201 const MFReal32 *getMFTextureZs (void) const;
203 SFUInt32 *editSFDrawOrder (void);
204 const SFUInt32 *getSFDrawOrder (void) const;
206 SFBool *editSFDynamic (void);
207 const SFBool *getSFDynamic (void) const;
209 SFParticleBSPTree *editSFBsp (void);
210 const SFParticleBSPTree *getSFBsp (void) const;
212 SFInt32 *editSFNumParticles (void);
213 const SFInt32 *getSFNumParticles (void) const;
216 UInt32 &editMode (void);
217 UInt32 getMode (void) const;
219 GeoVectorProperty * getPositions (void) const;
221 MFVec3f ::reference editSizes (const UInt32 index);
222 const Vec3f &getSizes (const UInt32 index) const;
224 GeoVectorProperty * getSecPositions (void) const;
226 GeoVectorProperty * getColors (void) const;
228 GeoVectorProperty * getNormals (void) const;
230 MFInt32 ::reference editIndices (const UInt32 index);
231 Int32 getIndices (const UInt32 index) const;
233 MFReal32 ::reference editTextureZs (const UInt32 index);
234 Real32 getTextureZs (const UInt32 index) const;
236 UInt32 &editDrawOrder (void);
237 UInt32 getDrawOrder (void) const;
239 bool &editDynamic (void);
240 bool getDynamic (void) const;
242 ParticleBSPTree &editBsp (void);
243 const ParticleBSPTree &getBsp (void) const;
245 Int32 &editNumParticles (void);
246 Int32 getNumParticles (void) const;
248 /*! \} */
249 /*---------------------------------------------------------------------*/
250 /*! \name Field Set */
251 /*! \{ */
253 void setMode (const UInt32 value);
254 void setPositions (GeoVectorProperty * const value);
255 void setSecPositions (GeoVectorProperty * const value);
256 void setColors (GeoVectorProperty * const value);
257 void setNormals (GeoVectorProperty * const value);
258 void setDrawOrder (const UInt32 value);
259 void setDynamic (const bool value);
260 void setBsp (const ParticleBSPTree &value);
261 void setNumParticles (const Int32 value);
263 /*! \} */
264 /*---------------------------------------------------------------------*/
265 /*! \name Ptr Field Set */
266 /*! \{ */
268 /*! \} */
269 /*---------------------------------------------------------------------*/
270 /*! \name Ptr MField Set */
271 /*! \{ */
273 /*! \} */
274 /*---------------------------------------------------------------------*/
275 /*! \name Binary Access */
276 /*! \{ */
278 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
279 virtual void copyToBin (BinaryDataHandler &pMem,
280 ConstFieldMaskArg whichField);
281 virtual void copyFromBin(BinaryDataHandler &pMem,
282 ConstFieldMaskArg whichField);
285 /*! \} */
286 /*---------------------------------------------------------------------*/
287 /*! \name Construction */
288 /*! \{ */
290 static ParticlesTransitPtr create (void);
291 static Particles *createEmpty (void);
293 static ParticlesTransitPtr createLocal (
294 BitVector bFlags = FCLocal::All);
296 static Particles *createEmptyLocal(
297 BitVector bFlags = FCLocal::All);
299 static ParticlesTransitPtr createDependent (BitVector bFlags);
301 /*! \} */
302 /*---------------------------------------------------------------------*/
303 /*! \name Copy */
304 /*! \{ */
306 virtual FieldContainerTransitPtr shallowCopy (void) const;
307 virtual FieldContainerTransitPtr shallowCopyLocal(
308 BitVector bFlags = FCLocal::All) const;
309 virtual FieldContainerTransitPtr shallowCopyDependent(
310 BitVector bFlags) const;
312 /*! \} */
313 /*========================= PROTECTED ===============================*/
315 protected:
317 static TypeObject _type;
319 static void classDescInserter(TypeObject &oType);
320 static const Char8 *getClassname (void );
322 /*---------------------------------------------------------------------*/
323 /*! \name Fields */
324 /*! \{ */
326 SFUInt32 _sfMode;
327 SFUnrecChildGeoVectorPropertyPtr _sfPositions;
328 MFVec3f _mfSizes;
329 SFUnrecChildGeoVectorPropertyPtr _sfSecPositions;
330 SFUnrecChildGeoVectorPropertyPtr _sfColors;
331 SFUnrecChildGeoVectorPropertyPtr _sfNormals;
332 MFInt32 _mfIndices;
333 MFReal32 _mfTextureZs;
334 SFUInt32 _sfDrawOrder;
335 SFBool _sfDynamic;
336 SFUInt32 _sfPump;
337 SFParticleBSPTree _sfBsp;
338 SFInt32 _sfNumParticles;
340 /*! \} */
341 /*---------------------------------------------------------------------*/
342 /*! \name Constructors */
343 /*! \{ */
345 ParticlesBase(void);
346 ParticlesBase(const ParticlesBase &source);
348 /*! \} */
349 /*---------------------------------------------------------------------*/
350 /*! \name Destructors */
351 /*! \{ */
353 virtual ~ParticlesBase(void);
355 /*! \} */
356 /*---------------------------------------------------------------------*/
357 /*! \name onCreate */
358 /*! \{ */
360 void onCreate(const Particles *source = NULL);
362 /*! \} */
363 /*---------------------------------------------------------------------*/
364 /*! \name Child linking */
365 /*! \{ */
367 virtual bool unlinkChild(FieldContainer * const pChild,
368 UInt16 const childFieldId);
370 /*! \} */
371 /*---------------------------------------------------------------------*/
372 /*! \name Generic Field Access */
373 /*! \{ */
375 GetFieldHandlePtr getHandleMode (void) const;
376 EditFieldHandlePtr editHandleMode (void);
377 GetFieldHandlePtr getHandlePositions (void) const;
378 EditFieldHandlePtr editHandlePositions (void);
379 GetFieldHandlePtr getHandleSizes (void) const;
380 EditFieldHandlePtr editHandleSizes (void);
381 GetFieldHandlePtr getHandleSecPositions (void) const;
382 EditFieldHandlePtr editHandleSecPositions (void);
383 GetFieldHandlePtr getHandleColors (void) const;
384 EditFieldHandlePtr editHandleColors (void);
385 GetFieldHandlePtr getHandleNormals (void) const;
386 EditFieldHandlePtr editHandleNormals (void);
387 GetFieldHandlePtr getHandleIndices (void) const;
388 EditFieldHandlePtr editHandleIndices (void);
389 GetFieldHandlePtr getHandleTextureZs (void) const;
390 EditFieldHandlePtr editHandleTextureZs (void);
391 GetFieldHandlePtr getHandleDrawOrder (void) const;
392 EditFieldHandlePtr editHandleDrawOrder (void);
393 GetFieldHandlePtr getHandleDynamic (void) const;
394 EditFieldHandlePtr editHandleDynamic (void);
395 GetFieldHandlePtr getHandlePump (void) const;
396 EditFieldHandlePtr editHandlePump (void);
397 GetFieldHandlePtr getHandleBsp (void) const;
398 EditFieldHandlePtr editHandleBsp (void);
399 GetFieldHandlePtr getHandleNumParticles (void) const;
400 EditFieldHandlePtr editHandleNumParticles (void);
402 /*! \} */
403 /*---------------------------------------------------------------------*/
404 /*! \name Field Get */
405 /*! \{ */
408 SFUInt32 *editSFPump (void);
409 const SFUInt32 *getSFPump (void) const;
412 UInt32 &editPump (void);
413 UInt32 getPump (void) const;
415 /*! \} */
416 /*---------------------------------------------------------------------*/
417 /*! \name Field Set */
418 /*! \{ */
420 void setPump (const UInt32 value);
422 /*! \} */
423 /*---------------------------------------------------------------------*/
424 /*! \name Ptr MField Set */
425 /*! \{ */
427 /*! \} */
428 /*---------------------------------------------------------------------*/
429 /*! \name Sync */
430 /*! \{ */
432 #ifdef OSG_MT_CPTR_ASPECT
433 virtual void execSyncV( FieldContainer &oFrom,
434 ConstFieldMaskArg whichField,
435 AspectOffsetStore &oOffsets,
436 ConstFieldMaskArg syncMode ,
437 const UInt32 uiSyncInfo);
439 void execSync ( ParticlesBase *pFrom,
440 ConstFieldMaskArg whichField,
441 AspectOffsetStore &oOffsets,
442 ConstFieldMaskArg syncMode ,
443 const UInt32 uiSyncInfo);
444 #endif
446 /*! \} */
447 /*---------------------------------------------------------------------*/
448 /*! \name Edit */
449 /*! \{ */
451 /*! \} */
452 /*---------------------------------------------------------------------*/
453 /*! \name Aspect Create */
454 /*! \{ */
456 #ifdef OSG_MT_CPTR_ASPECT
457 virtual FieldContainer *createAspectCopy(
458 const FieldContainer *pRefAspect) const;
459 #endif
461 /*! \} */
462 /*---------------------------------------------------------------------*/
463 /*! \name Edit */
464 /*! \{ */
465 /*! \} */
466 /*---------------------------------------------------------------------*/
467 /*! \name Sync */
468 /*! \{ */
470 virtual void resolveLinks(void);
472 /*! \} */
473 /*========================== PRIVATE ================================*/
475 private:
476 /*---------------------------------------------------------------------*/
478 // prohibit default functions (move to 'public' if you need one)
479 void operator =(const ParticlesBase &source);
482 typedef ParticlesBase *ParticlesBaseP;
484 OSG_END_NAMESPACE
486 #endif /* _OSGPARTICLESBASE_H_ */