fixed: compile issue
[opensg.git] / Source / Contrib / VTK / OSGVTKPolyDataMapperBase.h
blob3646050e54632f986c0df6ba9bf7d89c884bf70e
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 VTKPolyDataMapper
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGVTKPOLYDATAMAPPERBASE_H_
55 #define _OSGVTKPOLYDATAMAPPERBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
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"
80 OSG_BEGIN_NAMESPACE
83 class VTKPolyDataMapper;
85 //! \brief VTKPolyDataMapper Base Class.
87 class OSG_CONTRIBVTK_DLLMAPPING VTKPolyDataMapperBase : public Group
89 public:
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 =================================*/
101 public:
103 enum
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 */
154 /*! \{ */
156 static FieldContainerType &getClassType (void);
157 static UInt32 getClassTypeId (void);
158 static UInt16 getClassGroupId(void);
160 /*! \} */
161 /*---------------------------------------------------------------------*/
162 /*! \name FieldContainer Get */
163 /*! \{ */
165 virtual FieldContainerType &getType (void);
166 virtual const FieldContainerType &getType (void) const;
168 virtual UInt32 getContainerSize(void) const;
170 /*! \} */
171 /*---------------------------------------------------------------------*/
172 /*! \name Field Get */
173 /*! \{ */
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;
217 /*! \} */
218 /*---------------------------------------------------------------------*/
219 /*! \name Field Set */
220 /*! \{ */
222 void setRoot (Node * const value);
224 /*! \} */
225 /*---------------------------------------------------------------------*/
226 /*! \name Ptr Field Set */
227 /*! \{ */
229 /*! \} */
230 /*---------------------------------------------------------------------*/
231 /*! \name Ptr MField Set */
232 /*! \{ */
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 );
288 /*! \} */
289 /*---------------------------------------------------------------------*/
290 /*! \name Binary Access */
291 /*! \{ */
293 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
294 virtual void copyToBin (BinaryDataHandler &pMem,
295 ConstFieldMaskArg whichField);
296 virtual void copyFromBin(BinaryDataHandler &pMem,
297 ConstFieldMaskArg whichField);
300 /*! \} */
301 /*---------------------------------------------------------------------*/
302 /*! \name Construction */
303 /*! \{ */
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);
316 /*! \} */
317 /*---------------------------------------------------------------------*/
318 /*! \name Copy */
319 /*! \{ */
321 virtual FieldContainerTransitPtr shallowCopy (void) const;
322 virtual FieldContainerTransitPtr shallowCopyLocal(
323 BitVector bFlags = FCLocal::All) const;
324 virtual FieldContainerTransitPtr shallowCopyDependent(
325 BitVector bFlags) const;
327 /*! \} */
328 /*========================= PROTECTED ===============================*/
330 protected:
332 static TypeObject _type;
334 static void classDescInserter(TypeObject &oType);
335 static const Char8 *getClassname (void );
337 /*---------------------------------------------------------------------*/
338 /*! \name Fields */
339 /*! \{ */
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;
352 /*! \} */
353 /*---------------------------------------------------------------------*/
354 /*! \name Constructors */
355 /*! \{ */
357 VTKPolyDataMapperBase(void);
358 VTKPolyDataMapperBase(const VTKPolyDataMapperBase &source);
360 /*! \} */
361 /*---------------------------------------------------------------------*/
362 /*! \name Destructors */
363 /*! \{ */
365 virtual ~VTKPolyDataMapperBase(void);
367 /*! \} */
368 /*---------------------------------------------------------------------*/
369 /*! \name onCreate */
370 /*! \{ */
372 void onCreate(const VTKPolyDataMapper *source = NULL);
374 /*! \} */
375 /*---------------------------------------------------------------------*/
376 /*! \name Generic Field Access */
377 /*! \{ */
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);
400 /*! \} */
401 /*---------------------------------------------------------------------*/
402 /*! \name Sync */
403 /*! \{ */
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);
417 #endif
419 /*! \} */
420 /*---------------------------------------------------------------------*/
421 /*! \name Edit */
422 /*! \{ */
424 /*! \} */
425 /*---------------------------------------------------------------------*/
426 /*! \name Aspect Create */
427 /*! \{ */
429 #ifdef OSG_MT_CPTR_ASPECT
430 virtual FieldContainer *createAspectCopy(
431 const FieldContainer *pRefAspect) const;
432 #endif
434 /*! \} */
435 /*---------------------------------------------------------------------*/
436 /*! \name Edit */
437 /*! \{ */
438 /*! \} */
439 /*---------------------------------------------------------------------*/
440 /*! \name Sync */
441 /*! \{ */
443 virtual void resolveLinks(void);
445 /*! \} */
446 /*========================== PRIVATE ================================*/
448 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;
460 OSG_END_NAMESPACE
462 #endif /* _OSGVTKPOLYDATAMAPPERBASE_H_ */