1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGGEOINSTANCERBASE_H_
55 #define _OSGGEOINSTANCERBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGDrawableDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGMaterialDrawable.h" // Parent
68 #include "OSGSysFields.h" // NumInstances type
69 #include "OSGGeometryFields.h" // BaseGeometry type
71 #include "OSGGeoInstancerFields.h"
78 //! \brief GeoInstancer Base Class.
80 class OSG_DRAWABLE_DLLMAPPING GeoInstancerBase
: public MaterialDrawable
84 typedef MaterialDrawable Inherited
;
85 typedef MaterialDrawable ParentContainer
;
87 typedef Inherited::TypeObject TypeObject
;
88 typedef TypeObject::InitPhase InitPhase
;
90 OSG_GEN_INTERNALPTR(GeoInstancer
);
92 /*========================== PUBLIC =================================*/
98 NumInstancesFieldId
= Inherited::NextFieldId
,
99 BaseGeometryFieldId
= NumInstancesFieldId
+ 1,
100 NextFieldId
= BaseGeometryFieldId
+ 1
103 static const OSG::BitVector NumInstancesFieldMask
=
104 (TypeTraits
<BitVector
>::One
<< NumInstancesFieldId
);
105 static const OSG::BitVector BaseGeometryFieldMask
=
106 (TypeTraits
<BitVector
>::One
<< BaseGeometryFieldId
);
107 static const OSG::BitVector NextFieldMask
=
108 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
110 typedef SFUInt32 SFNumInstancesType
;
111 typedef SFUnrecChildGeometryPtr SFBaseGeometryType
;
113 /*---------------------------------------------------------------------*/
114 /*! \name Class Get */
117 static FieldContainerType
&getClassType (void);
118 static UInt32
getClassTypeId (void);
119 static UInt16
getClassGroupId(void);
122 /*---------------------------------------------------------------------*/
123 /*! \name FieldContainer Get */
126 virtual FieldContainerType
&getType (void);
127 virtual const FieldContainerType
&getType (void) const;
129 virtual UInt32
getContainerSize(void) const;
132 /*---------------------------------------------------------------------*/
133 /*! \name Field Get */
137 SFUInt32
*editSFNumInstances (void);
138 const SFUInt32
*getSFNumInstances (void) const;
139 const SFUnrecChildGeometryPtr
*getSFBaseGeometry (void) const;
140 SFUnrecChildGeometryPtr
*editSFBaseGeometry (void);
143 UInt32
&editNumInstances (void);
144 UInt32
getNumInstances (void) const;
146 Geometry
* getBaseGeometry (void) const;
149 /*---------------------------------------------------------------------*/
150 /*! \name Field Set */
153 void setNumInstances (const UInt32 value
);
154 void setBaseGeometry (Geometry
* const value
);
157 /*---------------------------------------------------------------------*/
158 /*! \name Ptr Field Set */
162 /*---------------------------------------------------------------------*/
163 /*! \name Ptr MField Set */
167 /*---------------------------------------------------------------------*/
168 /*! \name Binary Access */
171 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
172 virtual void copyToBin (BinaryDataHandler
&pMem
,
173 ConstFieldMaskArg whichField
);
174 virtual void copyFromBin(BinaryDataHandler
&pMem
,
175 ConstFieldMaskArg whichField
);
179 /*---------------------------------------------------------------------*/
180 /*! \name Construction */
183 static GeoInstancerTransitPtr
create (void);
184 static GeoInstancer
*createEmpty (void);
186 static GeoInstancerTransitPtr
createLocal (
187 BitVector bFlags
= FCLocal::All
);
189 static GeoInstancer
*createEmptyLocal(
190 BitVector bFlags
= FCLocal::All
);
192 static GeoInstancerTransitPtr
createDependent (BitVector bFlags
);
195 /*---------------------------------------------------------------------*/
199 virtual FieldContainerTransitPtr
shallowCopy (void) const;
200 virtual FieldContainerTransitPtr
shallowCopyLocal(
201 BitVector bFlags
= FCLocal::All
) const;
202 virtual FieldContainerTransitPtr
shallowCopyDependent(
203 BitVector bFlags
) const;
206 /*========================= PROTECTED ===============================*/
210 static TypeObject _type
;
212 static void classDescInserter(TypeObject
&oType
);
213 static const Char8
*getClassname (void );
215 /*---------------------------------------------------------------------*/
219 SFUInt32 _sfNumInstances
;
220 SFUnrecChildGeometryPtr _sfBaseGeometry
;
223 /*---------------------------------------------------------------------*/
224 /*! \name Constructors */
227 GeoInstancerBase(void);
228 GeoInstancerBase(const GeoInstancerBase
&source
);
231 /*---------------------------------------------------------------------*/
232 /*! \name Destructors */
235 virtual ~GeoInstancerBase(void);
238 /*---------------------------------------------------------------------*/
239 /*! \name onCreate */
242 void onCreate(const GeoInstancer
*source
= NULL
);
245 /*---------------------------------------------------------------------*/
246 /*! \name Child linking */
249 virtual bool unlinkChild(FieldContainer
* const pChild
,
250 UInt16
const childFieldId
);
253 /*---------------------------------------------------------------------*/
254 /*! \name Generic Field Access */
257 GetFieldHandlePtr
getHandleNumInstances (void) const;
258 EditFieldHandlePtr
editHandleNumInstances (void);
259 GetFieldHandlePtr
getHandleBaseGeometry (void) const;
260 EditFieldHandlePtr
editHandleBaseGeometry (void);
263 /*---------------------------------------------------------------------*/
267 #ifdef OSG_MT_CPTR_ASPECT
268 virtual void execSyncV( FieldContainer
&oFrom
,
269 ConstFieldMaskArg whichField
,
270 AspectOffsetStore
&oOffsets
,
271 ConstFieldMaskArg syncMode
,
272 const UInt32 uiSyncInfo
);
274 void execSync ( GeoInstancerBase
*pFrom
,
275 ConstFieldMaskArg whichField
,
276 AspectOffsetStore
&oOffsets
,
277 ConstFieldMaskArg syncMode
,
278 const UInt32 uiSyncInfo
);
282 /*---------------------------------------------------------------------*/
287 /*---------------------------------------------------------------------*/
288 /*! \name Aspect Create */
291 #ifdef OSG_MT_CPTR_ASPECT
292 virtual FieldContainer
*createAspectCopy(
293 const FieldContainer
*pRefAspect
) const;
297 /*---------------------------------------------------------------------*/
301 /*---------------------------------------------------------------------*/
305 virtual void resolveLinks(void);
308 /*========================== PRIVATE ================================*/
311 /*---------------------------------------------------------------------*/
313 // prohibit default functions (move to 'public' if you need one)
314 void operator =(const GeoInstancerBase
&source
);
317 typedef GeoInstancerBase
*GeoInstancerBaseP
;
321 #endif /* _OSGGEOINSTANCERBASE_H_ */