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 **
48 ** class VTKPolyDataMapper
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGVTKPOLYDATAMAPPERBASE_H_
55 #define _OSGVTKPOLYDATAMAPPERBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGContribVTKDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGGroup.h" // Parent
68 #include "OSGNodeFields.h" // Root type
69 #include "OSGGeometryFields.h" // Geometries type
70 #include "OSGChunkMaterialFields.h" // Materials type
71 #include "OSGMaterialChunkFields.h" // MaterialChunks type
72 #include "OSGGeoPnt3fPropertyFields.h" // Positions type
73 #include "OSGGeoUInt32PropertyFields.h" // Length type
74 #include "OSGGeoUInt8PropertyFields.h" // Types type
75 #include "OSGGeoColor4fPropertyFields.h" // Colors type
76 #include "OSGGeoVec3fPropertyFields.h" // Normals type
78 #include "OSGVTKPolyDataMapperFields.h"
83 class VTKPolyDataMapper
;
85 //! \brief VTKPolyDataMapper Base Class.
87 class OSG_CONTRIBVTK_DLLMAPPING VTKPolyDataMapperBase
: public Group
91 typedef Group Inherited
;
92 typedef Group ParentContainer
;
94 typedef Inherited::TypeObject TypeObject
;
95 typedef TypeObject::InitPhase InitPhase
;
97 OSG_GEN_INTERNALPTR(VTKPolyDataMapper
);
99 /*========================== PUBLIC =================================*/
105 RootFieldId
= Inherited::NextFieldId
,
106 GeoRootsFieldId
= RootFieldId
+ 1,
107 GeometriesFieldId
= GeoRootsFieldId
+ 1,
108 MaterialsFieldId
= GeometriesFieldId
+ 1,
109 MaterialChunksFieldId
= MaterialsFieldId
+ 1,
110 PositionsFieldId
= MaterialChunksFieldId
+ 1,
111 LengthFieldId
= PositionsFieldId
+ 1,
112 TypesFieldId
= LengthFieldId
+ 1,
113 ColorsFieldId
= TypesFieldId
+ 1,
114 NormalsFieldId
= ColorsFieldId
+ 1,
115 NextFieldId
= NormalsFieldId
+ 1
118 static const OSG::BitVector RootFieldMask
=
119 (TypeTraits
<BitVector
>::One
<< RootFieldId
);
120 static const OSG::BitVector GeoRootsFieldMask
=
121 (TypeTraits
<BitVector
>::One
<< GeoRootsFieldId
);
122 static const OSG::BitVector GeometriesFieldMask
=
123 (TypeTraits
<BitVector
>::One
<< GeometriesFieldId
);
124 static const OSG::BitVector MaterialsFieldMask
=
125 (TypeTraits
<BitVector
>::One
<< MaterialsFieldId
);
126 static const OSG::BitVector MaterialChunksFieldMask
=
127 (TypeTraits
<BitVector
>::One
<< MaterialChunksFieldId
);
128 static const OSG::BitVector PositionsFieldMask
=
129 (TypeTraits
<BitVector
>::One
<< PositionsFieldId
);
130 static const OSG::BitVector LengthFieldMask
=
131 (TypeTraits
<BitVector
>::One
<< LengthFieldId
);
132 static const OSG::BitVector TypesFieldMask
=
133 (TypeTraits
<BitVector
>::One
<< TypesFieldId
);
134 static const OSG::BitVector ColorsFieldMask
=
135 (TypeTraits
<BitVector
>::One
<< ColorsFieldId
);
136 static const OSG::BitVector NormalsFieldMask
=
137 (TypeTraits
<BitVector
>::One
<< NormalsFieldId
);
138 static const OSG::BitVector NextFieldMask
=
139 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
141 typedef SFUnrecNodePtr SFRootType
;
142 typedef MFUnrecNodePtr MFGeoRootsType
;
143 typedef MFUnrecGeometryPtr MFGeometriesType
;
144 typedef MFUnrecChunkMaterialPtr MFMaterialsType
;
145 typedef MFUnrecMaterialChunkPtr MFMaterialChunksType
;
146 typedef MFUnrecGeoPnt3fPropertyPtr MFPositionsType
;
147 typedef MFUnrecGeoUInt32PropertyPtr MFLengthType
;
148 typedef MFUnrecGeoUInt8PropertyPtr MFTypesType
;
149 typedef MFUnrecGeoColor4fPropertyPtr MFColorsType
;
150 typedef MFUnrecGeoVec3fPropertyPtr MFNormalsType
;
152 /*---------------------------------------------------------------------*/
153 /*! \name Class Get */
156 static FieldContainerType
&getClassType (void);
157 static UInt32
getClassTypeId (void);
158 static UInt16
getClassGroupId(void);
161 /*---------------------------------------------------------------------*/
162 /*! \name FieldContainer Get */
165 virtual FieldContainerType
&getType (void);
166 virtual const FieldContainerType
&getType (void) const;
168 virtual UInt32
getContainerSize(void) const;
171 /*---------------------------------------------------------------------*/
172 /*! \name Field Get */
175 const SFUnrecNodePtr
*getSFRoot (void) const;
176 SFUnrecNodePtr
*editSFRoot (void);
177 const MFUnrecNodePtr
*getMFGeoRoots (void) const;
178 MFUnrecNodePtr
*editMFGeoRoots (void);
179 const MFUnrecGeometryPtr
*getMFGeometries (void) const;
180 MFUnrecGeometryPtr
*editMFGeometries (void);
181 const MFUnrecChunkMaterialPtr
*getMFMaterials (void) const;
182 MFUnrecChunkMaterialPtr
*editMFMaterials (void);
183 const MFUnrecMaterialChunkPtr
*getMFMaterialChunks (void) const;
184 MFUnrecMaterialChunkPtr
*editMFMaterialChunks (void);
185 const MFUnrecGeoPnt3fPropertyPtr
*getMFPositions (void) const;
186 MFUnrecGeoPnt3fPropertyPtr
*editMFPositions (void);
187 const MFUnrecGeoUInt32PropertyPtr
*getMFLength (void) const;
188 MFUnrecGeoUInt32PropertyPtr
*editMFLength (void);
189 const MFUnrecGeoUInt8PropertyPtr
*getMFTypes (void) const;
190 MFUnrecGeoUInt8PropertyPtr
*editMFTypes (void);
191 const MFUnrecGeoColor4fPropertyPtr
*getMFColors (void) const;
192 MFUnrecGeoColor4fPropertyPtr
*editMFColors (void);
193 const MFUnrecGeoVec3fPropertyPtr
*getMFNormals (void) const;
194 MFUnrecGeoVec3fPropertyPtr
*editMFNormals (void);
197 Node
* getRoot (void) const;
199 Node
* getGeoRoots (const UInt32 index
) const;
201 Geometry
* getGeometries (const UInt32 index
) const;
203 ChunkMaterial
* getMaterials (const UInt32 index
) const;
205 MaterialChunk
* getMaterialChunks (const UInt32 index
) const;
207 GeoPnt3fProperty
* getPositions (const UInt32 index
) const;
209 GeoUInt32Property
* getLength (const UInt32 index
) const;
211 GeoUInt8Property
* getTypes (const UInt32 index
) const;
213 GeoColor4fProperty
* getColors (const UInt32 index
) const;
215 GeoVec3fProperty
* getNormals (const UInt32 index
) const;
218 /*---------------------------------------------------------------------*/
219 /*! \name Field Set */
222 void setRoot (Node
* const value
);
225 /*---------------------------------------------------------------------*/
226 /*! \name Ptr Field Set */
230 /*---------------------------------------------------------------------*/
231 /*! \name Ptr MField Set */
234 void pushToGeoRoots (Node
* const value
);
235 void assignGeoRoots (const MFUnrecNodePtr
&value
);
236 void removeFromGeoRoots (UInt32 uiIndex
);
237 void removeObjFromGeoRoots(Node
* const value
);
238 void clearGeoRoots (void );
240 void pushToGeometries (Geometry
* const value
);
241 void assignGeometries (const MFUnrecGeometryPtr
&value
);
242 void removeFromGeometries (UInt32 uiIndex
);
243 void removeObjFromGeometries(Geometry
* const value
);
244 void clearGeometries (void );
246 void pushToMaterials (ChunkMaterial
* const value
);
247 void assignMaterials (const MFUnrecChunkMaterialPtr
&value
);
248 void removeFromMaterials (UInt32 uiIndex
);
249 void removeObjFromMaterials(ChunkMaterial
* const value
);
250 void clearMaterials (void );
252 void pushToMaterialChunks (MaterialChunk
* const value
);
253 void assignMaterialChunks (const MFUnrecMaterialChunkPtr
&value
);
254 void removeFromMaterialChunks (UInt32 uiIndex
);
255 void removeObjFromMaterialChunks(MaterialChunk
* const value
);
256 void clearMaterialChunks (void );
258 void pushToPositions (GeoPnt3fProperty
* const value
);
259 void assignPositions (const MFUnrecGeoPnt3fPropertyPtr
&value
);
260 void removeFromPositions (UInt32 uiIndex
);
261 void removeObjFromPositions(GeoPnt3fProperty
* const value
);
262 void clearPositions (void );
264 void pushToLength (GeoUInt32Property
* const value
);
265 void assignLength (const MFUnrecGeoUInt32PropertyPtr
&value
);
266 void removeFromLength (UInt32 uiIndex
);
267 void removeObjFromLength(GeoUInt32Property
* const value
);
268 void clearLength (void );
270 void pushToTypes (GeoUInt8Property
* const value
);
271 void assignTypes (const MFUnrecGeoUInt8PropertyPtr
&value
);
272 void removeFromTypes (UInt32 uiIndex
);
273 void removeObjFromTypes(GeoUInt8Property
* const value
);
274 void clearTypes (void );
276 void pushToColors (GeoColor4fProperty
* const value
);
277 void assignColors (const MFUnrecGeoColor4fPropertyPtr
&value
);
278 void removeFromColors (UInt32 uiIndex
);
279 void removeObjFromColors(GeoColor4fProperty
* const value
);
280 void clearColors (void );
282 void pushToNormals (GeoVec3fProperty
* const value
);
283 void assignNormals (const MFUnrecGeoVec3fPropertyPtr
&value
);
284 void removeFromNormals (UInt32 uiIndex
);
285 void removeObjFromNormals(GeoVec3fProperty
* const value
);
286 void clearNormals (void );
289 /*---------------------------------------------------------------------*/
290 /*! \name Binary Access */
293 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
294 virtual void copyToBin (BinaryDataHandler
&pMem
,
295 ConstFieldMaskArg whichField
);
296 virtual void copyFromBin(BinaryDataHandler
&pMem
,
297 ConstFieldMaskArg whichField
);
301 /*---------------------------------------------------------------------*/
302 /*! \name Construction */
305 static VTKPolyDataMapperTransitPtr
create (void);
306 static VTKPolyDataMapper
*createEmpty (void);
308 static VTKPolyDataMapperTransitPtr
createLocal (
309 BitVector bFlags
= FCLocal::All
);
311 static VTKPolyDataMapper
*createEmptyLocal(
312 BitVector bFlags
= FCLocal::All
);
314 static VTKPolyDataMapperTransitPtr
createDependent (BitVector bFlags
);
317 /*---------------------------------------------------------------------*/
321 virtual FieldContainerTransitPtr
shallowCopy (void) const;
322 virtual FieldContainerTransitPtr
shallowCopyLocal(
323 BitVector bFlags
= FCLocal::All
) const;
324 virtual FieldContainerTransitPtr
shallowCopyDependent(
325 BitVector bFlags
) const;
328 /*========================= PROTECTED ===============================*/
332 static TypeObject _type
;
334 static void classDescInserter(TypeObject
&oType
);
335 static const Char8
*getClassname (void );
337 /*---------------------------------------------------------------------*/
341 SFUnrecNodePtr _sfRoot
;
342 MFUnrecNodePtr _mfGeoRoots
;
343 MFUnrecGeometryPtr _mfGeometries
;
344 MFUnrecChunkMaterialPtr _mfMaterials
;
345 MFUnrecMaterialChunkPtr _mfMaterialChunks
;
346 MFUnrecGeoPnt3fPropertyPtr _mfPositions
;
347 MFUnrecGeoUInt32PropertyPtr _mfLength
;
348 MFUnrecGeoUInt8PropertyPtr _mfTypes
;
349 MFUnrecGeoColor4fPropertyPtr _mfColors
;
350 MFUnrecGeoVec3fPropertyPtr _mfNormals
;
353 /*---------------------------------------------------------------------*/
354 /*! \name Constructors */
357 VTKPolyDataMapperBase(void);
358 VTKPolyDataMapperBase(const VTKPolyDataMapperBase
&source
);
361 /*---------------------------------------------------------------------*/
362 /*! \name Destructors */
365 virtual ~VTKPolyDataMapperBase(void);
368 /*---------------------------------------------------------------------*/
369 /*! \name onCreate */
372 void onCreate(const VTKPolyDataMapper
*source
= NULL
);
375 /*---------------------------------------------------------------------*/
376 /*! \name Generic Field Access */
379 GetFieldHandlePtr
getHandleRoot (void) const;
380 EditFieldHandlePtr
editHandleRoot (void);
381 GetFieldHandlePtr
getHandleGeoRoots (void) const;
382 EditFieldHandlePtr
editHandleGeoRoots (void);
383 GetFieldHandlePtr
getHandleGeometries (void) const;
384 EditFieldHandlePtr
editHandleGeometries (void);
385 GetFieldHandlePtr
getHandleMaterials (void) const;
386 EditFieldHandlePtr
editHandleMaterials (void);
387 GetFieldHandlePtr
getHandleMaterialChunks (void) const;
388 EditFieldHandlePtr
editHandleMaterialChunks (void);
389 GetFieldHandlePtr
getHandlePositions (void) const;
390 EditFieldHandlePtr
editHandlePositions (void);
391 GetFieldHandlePtr
getHandleLength (void) const;
392 EditFieldHandlePtr
editHandleLength (void);
393 GetFieldHandlePtr
getHandleTypes (void) const;
394 EditFieldHandlePtr
editHandleTypes (void);
395 GetFieldHandlePtr
getHandleColors (void) const;
396 EditFieldHandlePtr
editHandleColors (void);
397 GetFieldHandlePtr
getHandleNormals (void) const;
398 EditFieldHandlePtr
editHandleNormals (void);
401 /*---------------------------------------------------------------------*/
405 #ifdef OSG_MT_CPTR_ASPECT
406 virtual void execSyncV( FieldContainer
&oFrom
,
407 ConstFieldMaskArg whichField
,
408 AspectOffsetStore
&oOffsets
,
409 ConstFieldMaskArg syncMode
,
410 const UInt32 uiSyncInfo
);
412 void execSync ( VTKPolyDataMapperBase
*pFrom
,
413 ConstFieldMaskArg whichField
,
414 AspectOffsetStore
&oOffsets
,
415 ConstFieldMaskArg syncMode
,
416 const UInt32 uiSyncInfo
);
420 /*---------------------------------------------------------------------*/
425 /*---------------------------------------------------------------------*/
426 /*! \name Aspect Create */
429 #ifdef OSG_MT_CPTR_ASPECT
430 virtual FieldContainer
*createAspectCopy(
431 const FieldContainer
*pRefAspect
) const;
435 /*---------------------------------------------------------------------*/
439 /*---------------------------------------------------------------------*/
443 virtual void resolveLinks(void);
446 /*========================== PRIVATE ================================*/
449 /*---------------------------------------------------------------------*/
451 // prohibit default functions (move to 'public' if you need one)
452 void operator =(const VTKPolyDataMapperBase
&source
);
455 typedef VTKPolyDataMapperBase
*VTKPolyDataMapperBaseP
;
457 typedef CoredNodeRefPtr
<VTKPolyDataMapper
> VTKPolyDataMapperNodeRefPtr
;
458 typedef CoredNodeMTRefPtr
<VTKPolyDataMapper
> VTKPolyDataMapperNodeMTRefPtr
;
462 #endif /* _OSGVTKPOLYDATAMAPPERBASE_H_ */