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 \*****************************************************************************/
56 #include "OSGConfig.h"
60 #include "OSGNode.h" // Root Class
61 #include "OSGGeometry.h" // Geometries Class
62 #include "OSGChunkMaterial.h" // Materials Class
63 #include "OSGMaterialChunk.h" // MaterialChunks Class
64 #include "OSGGeoPnt3fProperty.h" // Positions Class
65 #include "OSGGeoUInt32Property.h" // Length Class
66 #include "OSGGeoUInt8Property.h" // Types Class
67 #include "OSGGeoColor4fProperty.h" // Colors Class
68 #include "OSGGeoVec3fProperty.h" // Normals Class
70 #include "OSGVTKPolyDataMapperBase.h"
71 #include "OSGVTKPolyDataMapper.h"
73 #include <boost/bind.hpp>
75 #ifdef WIN32 // turn off 'this' : used in base member initializer list warning
76 #pragma warning(disable:4355)
81 /***************************************************************************\
83 \***************************************************************************/
85 /*! \class OSG::VTKPolyDataMapper
89 /***************************************************************************\
90 * Field Documentation *
91 \***************************************************************************/
93 /*! \var Node * VTKPolyDataMapperBase::_sfRoot
97 /*! \var Node * VTKPolyDataMapperBase::_mfGeoRoots
101 /*! \var Geometry * VTKPolyDataMapperBase::_mfGeometries
105 /*! \var ChunkMaterial * VTKPolyDataMapperBase::_mfMaterials
109 /*! \var MaterialChunk * VTKPolyDataMapperBase::_mfMaterialChunks
113 /*! \var GeoPnt3fProperty * VTKPolyDataMapperBase::_mfPositions
117 /*! \var GeoUInt32Property * VTKPolyDataMapperBase::_mfLength
121 /*! \var GeoUInt8Property * VTKPolyDataMapperBase::_mfTypes
125 /*! \var GeoColor4fProperty * VTKPolyDataMapperBase::_mfColors
129 /*! \var GeoVec3fProperty * VTKPolyDataMapperBase::_mfNormals
134 /***************************************************************************\
135 * FieldType/FieldTrait Instantiation *
136 \***************************************************************************/
138 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
139 PointerType FieldTraits
<VTKPolyDataMapper
*, nsOSG
>::_type(
140 "VTKPolyDataMapperPtr",
142 VTKPolyDataMapper::getClassType(),
146 OSG_FIELDTRAITS_GETTYPE_NS(VTKPolyDataMapper
*, nsOSG
)
148 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
152 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
156 /***************************************************************************\
157 * Field Description *
158 \***************************************************************************/
160 void VTKPolyDataMapperBase::classDescInserter(TypeObject
&oType
)
162 FieldDescriptionBase
*pDesc
= NULL
;
165 pDesc
= new SFUnrecNodePtr::Description(
166 SFUnrecNodePtr::getClassType(),
169 RootFieldId
, RootFieldMask
,
171 (Field::SFDefaultFlags
| Field::FStdAccess
),
172 static_cast<FieldEditMethodSig
>(&VTKPolyDataMapper::editHandleRoot
),
173 static_cast<FieldGetMethodSig
>(&VTKPolyDataMapper::getHandleRoot
));
175 oType
.addInitialDesc(pDesc
);
177 pDesc
= new MFUnrecNodePtr::Description(
178 MFUnrecNodePtr::getClassType(),
181 GeoRootsFieldId
, GeoRootsFieldMask
,
183 (Field::FStdAccess
| Field::FClusterLocal
),
184 static_cast<FieldEditMethodSig
>(&VTKPolyDataMapper::editHandleGeoRoots
),
185 static_cast<FieldGetMethodSig
>(&VTKPolyDataMapper::getHandleGeoRoots
));
187 oType
.addInitialDesc(pDesc
);
189 pDesc
= new MFUnrecGeometryPtr::Description(
190 MFUnrecGeometryPtr::getClassType(),
193 GeometriesFieldId
, GeometriesFieldMask
,
195 (Field::FStdAccess
| Field::FClusterLocal
),
196 static_cast<FieldEditMethodSig
>(&VTKPolyDataMapper::editHandleGeometries
),
197 static_cast<FieldGetMethodSig
>(&VTKPolyDataMapper::getHandleGeometries
));
199 oType
.addInitialDesc(pDesc
);
201 pDesc
= new MFUnrecChunkMaterialPtr::Description(
202 MFUnrecChunkMaterialPtr::getClassType(),
205 MaterialsFieldId
, MaterialsFieldMask
,
207 (Field::FStdAccess
| Field::FClusterLocal
),
208 static_cast<FieldEditMethodSig
>(&VTKPolyDataMapper::editHandleMaterials
),
209 static_cast<FieldGetMethodSig
>(&VTKPolyDataMapper::getHandleMaterials
));
211 oType
.addInitialDesc(pDesc
);
213 pDesc
= new MFUnrecMaterialChunkPtr::Description(
214 MFUnrecMaterialChunkPtr::getClassType(),
217 MaterialChunksFieldId
, MaterialChunksFieldMask
,
219 (Field::FStdAccess
| Field::FClusterLocal
),
220 static_cast<FieldEditMethodSig
>(&VTKPolyDataMapper::editHandleMaterialChunks
),
221 static_cast<FieldGetMethodSig
>(&VTKPolyDataMapper::getHandleMaterialChunks
));
223 oType
.addInitialDesc(pDesc
);
225 pDesc
= new MFUnrecGeoPnt3fPropertyPtr::Description(
226 MFUnrecGeoPnt3fPropertyPtr::getClassType(),
229 PositionsFieldId
, PositionsFieldMask
,
231 (Field::FStdAccess
| Field::FClusterLocal
),
232 static_cast<FieldEditMethodSig
>(&VTKPolyDataMapper::editHandlePositions
),
233 static_cast<FieldGetMethodSig
>(&VTKPolyDataMapper::getHandlePositions
));
235 oType
.addInitialDesc(pDesc
);
237 pDesc
= new MFUnrecGeoUInt32PropertyPtr::Description(
238 MFUnrecGeoUInt32PropertyPtr::getClassType(),
241 LengthFieldId
, LengthFieldMask
,
243 (Field::FStdAccess
| Field::FClusterLocal
),
244 static_cast<FieldEditMethodSig
>(&VTKPolyDataMapper::editHandleLength
),
245 static_cast<FieldGetMethodSig
>(&VTKPolyDataMapper::getHandleLength
));
247 oType
.addInitialDesc(pDesc
);
249 pDesc
= new MFUnrecGeoUInt8PropertyPtr::Description(
250 MFUnrecGeoUInt8PropertyPtr::getClassType(),
253 TypesFieldId
, TypesFieldMask
,
255 (Field::FStdAccess
| Field::FClusterLocal
),
256 static_cast<FieldEditMethodSig
>(&VTKPolyDataMapper::editHandleTypes
),
257 static_cast<FieldGetMethodSig
>(&VTKPolyDataMapper::getHandleTypes
));
259 oType
.addInitialDesc(pDesc
);
261 pDesc
= new MFUnrecGeoColor4fPropertyPtr::Description(
262 MFUnrecGeoColor4fPropertyPtr::getClassType(),
265 ColorsFieldId
, ColorsFieldMask
,
267 (Field::FStdAccess
| Field::FClusterLocal
),
268 static_cast<FieldEditMethodSig
>(&VTKPolyDataMapper::editHandleColors
),
269 static_cast<FieldGetMethodSig
>(&VTKPolyDataMapper::getHandleColors
));
271 oType
.addInitialDesc(pDesc
);
273 pDesc
= new MFUnrecGeoVec3fPropertyPtr::Description(
274 MFUnrecGeoVec3fPropertyPtr::getClassType(),
277 NormalsFieldId
, NormalsFieldMask
,
279 (Field::FStdAccess
| Field::FClusterLocal
),
280 static_cast<FieldEditMethodSig
>(&VTKPolyDataMapper::editHandleNormals
),
281 static_cast<FieldGetMethodSig
>(&VTKPolyDataMapper::getHandleNormals
));
283 oType
.addInitialDesc(pDesc
);
287 VTKPolyDataMapperBase::TypeObject
VTKPolyDataMapperBase::_type(
288 VTKPolyDataMapperBase::getClassname(),
289 Inherited::getClassname(),
292 reinterpret_cast<PrototypeCreateF
>(&VTKPolyDataMapperBase::createEmptyLocal
),
293 VTKPolyDataMapper::initMethod
,
294 VTKPolyDataMapper::exitMethod
,
295 reinterpret_cast<InitalInsertDescFunc
>(&VTKPolyDataMapper::classDescInserter
),
298 "<?xml version=\"1.0\" ?>\n"
301 " name=\"VTKPolyDataMapper\"\n"
302 " parent=\"Group\"\n"
303 " library=\"ContribVTK\"\n"
304 " structure=\"concrete\"\n"
305 " pointerfieldtypes=\"both\"\n"
306 " systemcomponent=\"true\"\n"
307 " parentsystemcomponent=\"true\"\n"
308 " isNodeCore=\"true\"\n"
312 " type=\"NodePtr\"\n"
313 " cardinality=\"single\"\n"
314 " visibility=\"external\"\n"
315 " access=\"public\"\n"
319 " name=\"geoRoots\"\n"
320 " type=\"NodePtr\"\n"
321 " cardinality=\"multi\"\n"
322 " visibility=\"external\"\n"
323 " access=\"public\"\n"
324 " fieldFlags=\"FStdAccess, FClusterLocal\"\n"
328 " name=\"geometries\"\n"
329 " type=\"GeometryPtr\"\n"
330 " cardinality=\"multi\"\n"
331 " visibility=\"external\"\n"
332 " access=\"public\"\n"
333 " fieldFlags=\"FStdAccess, FClusterLocal\"\n"
337 " name=\"materials\"\n"
338 " type=\"ChunkMaterialPtr\"\n"
339 " cardinality=\"multi\"\n"
340 " visibility=\"external\"\n"
341 " access=\"public\"\n"
342 " fieldFlags=\"FStdAccess, FClusterLocal\"\n"
346 " name=\"materialChunks\"\n"
347 " type=\"MaterialChunkPtr\"\n"
348 " cardinality=\"multi\"\n"
349 " visibility=\"external\"\n"
350 " access=\"public\"\n"
351 " fieldFlags=\"FStdAccess, FClusterLocal\"\n"
355 " name=\"positions\"\n"
356 " type=\"GeoPnt3fPropertyPtr\"\n"
357 " cardinality=\"multi\"\n"
358 " visibility=\"external\"\n"
359 " access=\"public\"\n"
360 " fieldFlags=\"FStdAccess, FClusterLocal\"\n"
365 " type=\"GeoUInt32PropertyPtr\"\n"
366 " cardinality=\"multi\"\n"
367 " visibility=\"external\"\n"
368 " access=\"public\"\n"
369 " fieldFlags=\"FStdAccess, FClusterLocal\"\n"
374 " type=\"GeoUInt8PropertyPtr\"\n"
375 " cardinality=\"multi\"\n"
376 " visibility=\"external\"\n"
377 " access=\"public\"\n"
378 " fieldFlags=\"FStdAccess, FClusterLocal\"\n"
383 " type=\"GeoColor4fPropertyPtr\"\n"
384 " cardinality=\"multi\"\n"
385 " visibility=\"external\"\n"
386 " access=\"public\"\n"
387 " fieldFlags=\"FStdAccess, FClusterLocal\"\n"
391 " name=\"normals\"\n"
392 " type=\"GeoVec3fPropertyPtr\"\n"
393 " cardinality=\"multi\"\n"
394 " visibility=\"external\"\n"
395 " access=\"public\"\n"
396 " fieldFlags=\"FStdAccess, FClusterLocal\"\n"
399 "</FieldContainer>\n",
403 /*------------------------------ get -----------------------------------*/
405 FieldContainerType
&VTKPolyDataMapperBase::getType(void)
410 const FieldContainerType
&VTKPolyDataMapperBase::getType(void) const
415 UInt32
VTKPolyDataMapperBase::getContainerSize(void) const
417 return sizeof(VTKPolyDataMapper
);
420 /*------------------------- decorator get ------------------------------*/
423 //! Get the VTKPolyDataMapper::_sfRoot field.
424 const SFUnrecNodePtr
*VTKPolyDataMapperBase::getSFRoot(void) const
429 SFUnrecNodePtr
*VTKPolyDataMapperBase::editSFRoot (void)
431 editSField(RootFieldMask
);
436 //! Get the value of the VTKPolyDataMapper::_sfRoot field.
437 Node
* VTKPolyDataMapperBase::getRoot(void) const
439 return _sfRoot
.getValue();
442 //! Set the value of the VTKPolyDataMapper::_sfRoot field.
443 void VTKPolyDataMapperBase::setRoot(Node
* const value
)
445 editSField(RootFieldMask
);
447 _sfRoot
.setValue(value
);
451 //! Get the VTKPolyDataMapper::_mfGeoRoots field.
452 const MFUnrecNodePtr
*VTKPolyDataMapperBase::getMFGeoRoots(void) const
457 MFUnrecNodePtr
*VTKPolyDataMapperBase::editMFGeoRoots (void)
459 editMField(GeoRootsFieldMask
, _mfGeoRoots
);
463 Node
* VTKPolyDataMapperBase::getGeoRoots(const UInt32 index
) const
465 return _mfGeoRoots
[index
];
468 //! Get the VTKPolyDataMapper::_mfGeometries field.
469 const MFUnrecGeometryPtr
*VTKPolyDataMapperBase::getMFGeometries(void) const
471 return &_mfGeometries
;
474 MFUnrecGeometryPtr
*VTKPolyDataMapperBase::editMFGeometries (void)
476 editMField(GeometriesFieldMask
, _mfGeometries
);
478 return &_mfGeometries
;
480 Geometry
* VTKPolyDataMapperBase::getGeometries(const UInt32 index
) const
482 return _mfGeometries
[index
];
485 //! Get the VTKPolyDataMapper::_mfMaterials field.
486 const MFUnrecChunkMaterialPtr
*VTKPolyDataMapperBase::getMFMaterials(void) const
488 return &_mfMaterials
;
491 MFUnrecChunkMaterialPtr
*VTKPolyDataMapperBase::editMFMaterials (void)
493 editMField(MaterialsFieldMask
, _mfMaterials
);
495 return &_mfMaterials
;
497 ChunkMaterial
* VTKPolyDataMapperBase::getMaterials(const UInt32 index
) const
499 return _mfMaterials
[index
];
502 //! Get the VTKPolyDataMapper::_mfMaterialChunks field.
503 const MFUnrecMaterialChunkPtr
*VTKPolyDataMapperBase::getMFMaterialChunks(void) const
505 return &_mfMaterialChunks
;
508 MFUnrecMaterialChunkPtr
*VTKPolyDataMapperBase::editMFMaterialChunks (void)
510 editMField(MaterialChunksFieldMask
, _mfMaterialChunks
);
512 return &_mfMaterialChunks
;
514 MaterialChunk
* VTKPolyDataMapperBase::getMaterialChunks(const UInt32 index
) const
516 return _mfMaterialChunks
[index
];
519 //! Get the VTKPolyDataMapper::_mfPositions field.
520 const MFUnrecGeoPnt3fPropertyPtr
*VTKPolyDataMapperBase::getMFPositions(void) const
522 return &_mfPositions
;
525 MFUnrecGeoPnt3fPropertyPtr
*VTKPolyDataMapperBase::editMFPositions (void)
527 editMField(PositionsFieldMask
, _mfPositions
);
529 return &_mfPositions
;
531 GeoPnt3fProperty
* VTKPolyDataMapperBase::getPositions(const UInt32 index
) const
533 return _mfPositions
[index
];
536 //! Get the VTKPolyDataMapper::_mfLength field.
537 const MFUnrecGeoUInt32PropertyPtr
*VTKPolyDataMapperBase::getMFLength(void) const
542 MFUnrecGeoUInt32PropertyPtr
*VTKPolyDataMapperBase::editMFLength (void)
544 editMField(LengthFieldMask
, _mfLength
);
548 GeoUInt32Property
* VTKPolyDataMapperBase::getLength(const UInt32 index
) const
550 return _mfLength
[index
];
553 //! Get the VTKPolyDataMapper::_mfTypes field.
554 const MFUnrecGeoUInt8PropertyPtr
*VTKPolyDataMapperBase::getMFTypes(void) const
559 MFUnrecGeoUInt8PropertyPtr
*VTKPolyDataMapperBase::editMFTypes (void)
561 editMField(TypesFieldMask
, _mfTypes
);
565 GeoUInt8Property
* VTKPolyDataMapperBase::getTypes(const UInt32 index
) const
567 return _mfTypes
[index
];
570 //! Get the VTKPolyDataMapper::_mfColors field.
571 const MFUnrecGeoColor4fPropertyPtr
*VTKPolyDataMapperBase::getMFColors(void) const
576 MFUnrecGeoColor4fPropertyPtr
*VTKPolyDataMapperBase::editMFColors (void)
578 editMField(ColorsFieldMask
, _mfColors
);
582 GeoColor4fProperty
* VTKPolyDataMapperBase::getColors(const UInt32 index
) const
584 return _mfColors
[index
];
587 //! Get the VTKPolyDataMapper::_mfNormals field.
588 const MFUnrecGeoVec3fPropertyPtr
*VTKPolyDataMapperBase::getMFNormals(void) const
593 MFUnrecGeoVec3fPropertyPtr
*VTKPolyDataMapperBase::editMFNormals (void)
595 editMField(NormalsFieldMask
, _mfNormals
);
599 GeoVec3fProperty
* VTKPolyDataMapperBase::getNormals(const UInt32 index
) const
601 return _mfNormals
[index
];
606 void VTKPolyDataMapperBase::pushToGeoRoots(Node
* const value
)
608 editMField(GeoRootsFieldMask
, _mfGeoRoots
);
610 _mfGeoRoots
.push_back(value
);
613 void VTKPolyDataMapperBase::assignGeoRoots (const MFUnrecNodePtr
&value
)
615 MFUnrecNodePtr ::const_iterator elemIt
=
617 MFUnrecNodePtr ::const_iterator elemEnd
=
620 static_cast<VTKPolyDataMapper
*>(this)->clearGeoRoots();
622 while(elemIt
!= elemEnd
)
624 this->pushToGeoRoots(*elemIt
);
630 void VTKPolyDataMapperBase::removeFromGeoRoots(UInt32 uiIndex
)
632 if(uiIndex
< _mfGeoRoots
.size())
634 editMField(GeoRootsFieldMask
, _mfGeoRoots
);
636 _mfGeoRoots
.erase(uiIndex
);
640 void VTKPolyDataMapperBase::removeObjFromGeoRoots(Node
* const value
)
642 Int32 iElemIdx
= _mfGeoRoots
.findIndex(value
);
646 editMField(GeoRootsFieldMask
, _mfGeoRoots
);
648 _mfGeoRoots
.erase(iElemIdx
);
651 void VTKPolyDataMapperBase::clearGeoRoots(void)
653 editMField(GeoRootsFieldMask
, _mfGeoRoots
);
659 void VTKPolyDataMapperBase::pushToGeometries(Geometry
* const value
)
661 editMField(GeometriesFieldMask
, _mfGeometries
);
663 _mfGeometries
.push_back(value
);
666 void VTKPolyDataMapperBase::assignGeometries(const MFUnrecGeometryPtr
&value
)
668 MFUnrecGeometryPtr::const_iterator elemIt
=
670 MFUnrecGeometryPtr::const_iterator elemEnd
=
673 static_cast<VTKPolyDataMapper
*>(this)->clearGeometries();
675 while(elemIt
!= elemEnd
)
677 this->pushToGeometries(*elemIt
);
683 void VTKPolyDataMapperBase::removeFromGeometries(UInt32 uiIndex
)
685 if(uiIndex
< _mfGeometries
.size())
687 editMField(GeometriesFieldMask
, _mfGeometries
);
689 _mfGeometries
.erase(uiIndex
);
693 void VTKPolyDataMapperBase::removeObjFromGeometries(Geometry
* const value
)
695 Int32 iElemIdx
= _mfGeometries
.findIndex(value
);
699 editMField(GeometriesFieldMask
, _mfGeometries
);
701 _mfGeometries
.erase(iElemIdx
);
704 void VTKPolyDataMapperBase::clearGeometries(void)
706 editMField(GeometriesFieldMask
, _mfGeometries
);
709 _mfGeometries
.clear();
712 void VTKPolyDataMapperBase::pushToMaterials(ChunkMaterial
* const value
)
714 editMField(MaterialsFieldMask
, _mfMaterials
);
716 _mfMaterials
.push_back(value
);
719 void VTKPolyDataMapperBase::assignMaterials(const MFUnrecChunkMaterialPtr
&value
)
721 MFUnrecChunkMaterialPtr::const_iterator elemIt
=
723 MFUnrecChunkMaterialPtr::const_iterator elemEnd
=
726 static_cast<VTKPolyDataMapper
*>(this)->clearMaterials();
728 while(elemIt
!= elemEnd
)
730 this->pushToMaterials(*elemIt
);
736 void VTKPolyDataMapperBase::removeFromMaterials(UInt32 uiIndex
)
738 if(uiIndex
< _mfMaterials
.size())
740 editMField(MaterialsFieldMask
, _mfMaterials
);
742 _mfMaterials
.erase(uiIndex
);
746 void VTKPolyDataMapperBase::removeObjFromMaterials(ChunkMaterial
* const value
)
748 Int32 iElemIdx
= _mfMaterials
.findIndex(value
);
752 editMField(MaterialsFieldMask
, _mfMaterials
);
754 _mfMaterials
.erase(iElemIdx
);
757 void VTKPolyDataMapperBase::clearMaterials(void)
759 editMField(MaterialsFieldMask
, _mfMaterials
);
762 _mfMaterials
.clear();
765 void VTKPolyDataMapperBase::pushToMaterialChunks(MaterialChunk
* const value
)
767 editMField(MaterialChunksFieldMask
, _mfMaterialChunks
);
769 _mfMaterialChunks
.push_back(value
);
772 void VTKPolyDataMapperBase::assignMaterialChunks(const MFUnrecMaterialChunkPtr
&value
)
774 MFUnrecMaterialChunkPtr::const_iterator elemIt
=
776 MFUnrecMaterialChunkPtr::const_iterator elemEnd
=
779 static_cast<VTKPolyDataMapper
*>(this)->clearMaterialChunks();
781 while(elemIt
!= elemEnd
)
783 this->pushToMaterialChunks(*elemIt
);
789 void VTKPolyDataMapperBase::removeFromMaterialChunks(UInt32 uiIndex
)
791 if(uiIndex
< _mfMaterialChunks
.size())
793 editMField(MaterialChunksFieldMask
, _mfMaterialChunks
);
795 _mfMaterialChunks
.erase(uiIndex
);
799 void VTKPolyDataMapperBase::removeObjFromMaterialChunks(MaterialChunk
* const value
)
801 Int32 iElemIdx
= _mfMaterialChunks
.findIndex(value
);
805 editMField(MaterialChunksFieldMask
, _mfMaterialChunks
);
807 _mfMaterialChunks
.erase(iElemIdx
);
810 void VTKPolyDataMapperBase::clearMaterialChunks(void)
812 editMField(MaterialChunksFieldMask
, _mfMaterialChunks
);
815 _mfMaterialChunks
.clear();
818 void VTKPolyDataMapperBase::pushToPositions(GeoPnt3fProperty
* const value
)
820 editMField(PositionsFieldMask
, _mfPositions
);
822 _mfPositions
.push_back(value
);
825 void VTKPolyDataMapperBase::assignPositions(const MFUnrecGeoPnt3fPropertyPtr
&value
)
827 MFUnrecGeoPnt3fPropertyPtr::const_iterator elemIt
=
829 MFUnrecGeoPnt3fPropertyPtr::const_iterator elemEnd
=
832 static_cast<VTKPolyDataMapper
*>(this)->clearPositions();
834 while(elemIt
!= elemEnd
)
836 this->pushToPositions(*elemIt
);
842 void VTKPolyDataMapperBase::removeFromPositions(UInt32 uiIndex
)
844 if(uiIndex
< _mfPositions
.size())
846 editMField(PositionsFieldMask
, _mfPositions
);
848 _mfPositions
.erase(uiIndex
);
852 void VTKPolyDataMapperBase::removeObjFromPositions(GeoPnt3fProperty
* const value
)
854 Int32 iElemIdx
= _mfPositions
.findIndex(value
);
858 editMField(PositionsFieldMask
, _mfPositions
);
860 _mfPositions
.erase(iElemIdx
);
863 void VTKPolyDataMapperBase::clearPositions(void)
865 editMField(PositionsFieldMask
, _mfPositions
);
868 _mfPositions
.clear();
871 void VTKPolyDataMapperBase::pushToLength(GeoUInt32Property
* const value
)
873 editMField(LengthFieldMask
, _mfLength
);
875 _mfLength
.push_back(value
);
878 void VTKPolyDataMapperBase::assignLength (const MFUnrecGeoUInt32PropertyPtr
&value
)
880 MFUnrecGeoUInt32PropertyPtr::const_iterator elemIt
=
882 MFUnrecGeoUInt32PropertyPtr::const_iterator elemEnd
=
885 static_cast<VTKPolyDataMapper
*>(this)->clearLength();
887 while(elemIt
!= elemEnd
)
889 this->pushToLength(*elemIt
);
895 void VTKPolyDataMapperBase::removeFromLength(UInt32 uiIndex
)
897 if(uiIndex
< _mfLength
.size())
899 editMField(LengthFieldMask
, _mfLength
);
901 _mfLength
.erase(uiIndex
);
905 void VTKPolyDataMapperBase::removeObjFromLength(GeoUInt32Property
* const value
)
907 Int32 iElemIdx
= _mfLength
.findIndex(value
);
911 editMField(LengthFieldMask
, _mfLength
);
913 _mfLength
.erase(iElemIdx
);
916 void VTKPolyDataMapperBase::clearLength(void)
918 editMField(LengthFieldMask
, _mfLength
);
924 void VTKPolyDataMapperBase::pushToTypes(GeoUInt8Property
* const value
)
926 editMField(TypesFieldMask
, _mfTypes
);
928 _mfTypes
.push_back(value
);
931 void VTKPolyDataMapperBase::assignTypes (const MFUnrecGeoUInt8PropertyPtr
&value
)
933 MFUnrecGeoUInt8PropertyPtr::const_iterator elemIt
=
935 MFUnrecGeoUInt8PropertyPtr::const_iterator elemEnd
=
938 static_cast<VTKPolyDataMapper
*>(this)->clearTypes();
940 while(elemIt
!= elemEnd
)
942 this->pushToTypes(*elemIt
);
948 void VTKPolyDataMapperBase::removeFromTypes(UInt32 uiIndex
)
950 if(uiIndex
< _mfTypes
.size())
952 editMField(TypesFieldMask
, _mfTypes
);
954 _mfTypes
.erase(uiIndex
);
958 void VTKPolyDataMapperBase::removeObjFromTypes(GeoUInt8Property
* const value
)
960 Int32 iElemIdx
= _mfTypes
.findIndex(value
);
964 editMField(TypesFieldMask
, _mfTypes
);
966 _mfTypes
.erase(iElemIdx
);
969 void VTKPolyDataMapperBase::clearTypes(void)
971 editMField(TypesFieldMask
, _mfTypes
);
977 void VTKPolyDataMapperBase::pushToColors(GeoColor4fProperty
* const value
)
979 editMField(ColorsFieldMask
, _mfColors
);
981 _mfColors
.push_back(value
);
984 void VTKPolyDataMapperBase::assignColors (const MFUnrecGeoColor4fPropertyPtr
&value
)
986 MFUnrecGeoColor4fPropertyPtr::const_iterator elemIt
=
988 MFUnrecGeoColor4fPropertyPtr::const_iterator elemEnd
=
991 static_cast<VTKPolyDataMapper
*>(this)->clearColors();
993 while(elemIt
!= elemEnd
)
995 this->pushToColors(*elemIt
);
1001 void VTKPolyDataMapperBase::removeFromColors(UInt32 uiIndex
)
1003 if(uiIndex
< _mfColors
.size())
1005 editMField(ColorsFieldMask
, _mfColors
);
1007 _mfColors
.erase(uiIndex
);
1011 void VTKPolyDataMapperBase::removeObjFromColors(GeoColor4fProperty
* const value
)
1013 Int32 iElemIdx
= _mfColors
.findIndex(value
);
1017 editMField(ColorsFieldMask
, _mfColors
);
1019 _mfColors
.erase(iElemIdx
);
1022 void VTKPolyDataMapperBase::clearColors(void)
1024 editMField(ColorsFieldMask
, _mfColors
);
1030 void VTKPolyDataMapperBase::pushToNormals(GeoVec3fProperty
* const value
)
1032 editMField(NormalsFieldMask
, _mfNormals
);
1034 _mfNormals
.push_back(value
);
1037 void VTKPolyDataMapperBase::assignNormals (const MFUnrecGeoVec3fPropertyPtr
&value
)
1039 MFUnrecGeoVec3fPropertyPtr::const_iterator elemIt
=
1041 MFUnrecGeoVec3fPropertyPtr::const_iterator elemEnd
=
1044 static_cast<VTKPolyDataMapper
*>(this)->clearNormals();
1046 while(elemIt
!= elemEnd
)
1048 this->pushToNormals(*elemIt
);
1054 void VTKPolyDataMapperBase::removeFromNormals(UInt32 uiIndex
)
1056 if(uiIndex
< _mfNormals
.size())
1058 editMField(NormalsFieldMask
, _mfNormals
);
1060 _mfNormals
.erase(uiIndex
);
1064 void VTKPolyDataMapperBase::removeObjFromNormals(GeoVec3fProperty
* const value
)
1066 Int32 iElemIdx
= _mfNormals
.findIndex(value
);
1070 editMField(NormalsFieldMask
, _mfNormals
);
1072 _mfNormals
.erase(iElemIdx
);
1075 void VTKPolyDataMapperBase::clearNormals(void)
1077 editMField(NormalsFieldMask
, _mfNormals
);
1085 /*------------------------------ access -----------------------------------*/
1087 SizeT
VTKPolyDataMapperBase::getBinSize(ConstFieldMaskArg whichField
)
1089 SizeT returnValue
= Inherited::getBinSize(whichField
);
1091 if(FieldBits::NoField
!= (RootFieldMask
& whichField
))
1093 returnValue
+= _sfRoot
.getBinSize();
1095 if(FieldBits::NoField
!= (GeoRootsFieldMask
& whichField
))
1097 returnValue
+= _mfGeoRoots
.getBinSize();
1099 if(FieldBits::NoField
!= (GeometriesFieldMask
& whichField
))
1101 returnValue
+= _mfGeometries
.getBinSize();
1103 if(FieldBits::NoField
!= (MaterialsFieldMask
& whichField
))
1105 returnValue
+= _mfMaterials
.getBinSize();
1107 if(FieldBits::NoField
!= (MaterialChunksFieldMask
& whichField
))
1109 returnValue
+= _mfMaterialChunks
.getBinSize();
1111 if(FieldBits::NoField
!= (PositionsFieldMask
& whichField
))
1113 returnValue
+= _mfPositions
.getBinSize();
1115 if(FieldBits::NoField
!= (LengthFieldMask
& whichField
))
1117 returnValue
+= _mfLength
.getBinSize();
1119 if(FieldBits::NoField
!= (TypesFieldMask
& whichField
))
1121 returnValue
+= _mfTypes
.getBinSize();
1123 if(FieldBits::NoField
!= (ColorsFieldMask
& whichField
))
1125 returnValue
+= _mfColors
.getBinSize();
1127 if(FieldBits::NoField
!= (NormalsFieldMask
& whichField
))
1129 returnValue
+= _mfNormals
.getBinSize();
1135 void VTKPolyDataMapperBase::copyToBin(BinaryDataHandler
&pMem
,
1136 ConstFieldMaskArg whichField
)
1138 Inherited::copyToBin(pMem
, whichField
);
1140 if(FieldBits::NoField
!= (RootFieldMask
& whichField
))
1142 _sfRoot
.copyToBin(pMem
);
1144 if(FieldBits::NoField
!= (GeoRootsFieldMask
& whichField
))
1146 _mfGeoRoots
.copyToBin(pMem
);
1148 if(FieldBits::NoField
!= (GeometriesFieldMask
& whichField
))
1150 _mfGeometries
.copyToBin(pMem
);
1152 if(FieldBits::NoField
!= (MaterialsFieldMask
& whichField
))
1154 _mfMaterials
.copyToBin(pMem
);
1156 if(FieldBits::NoField
!= (MaterialChunksFieldMask
& whichField
))
1158 _mfMaterialChunks
.copyToBin(pMem
);
1160 if(FieldBits::NoField
!= (PositionsFieldMask
& whichField
))
1162 _mfPositions
.copyToBin(pMem
);
1164 if(FieldBits::NoField
!= (LengthFieldMask
& whichField
))
1166 _mfLength
.copyToBin(pMem
);
1168 if(FieldBits::NoField
!= (TypesFieldMask
& whichField
))
1170 _mfTypes
.copyToBin(pMem
);
1172 if(FieldBits::NoField
!= (ColorsFieldMask
& whichField
))
1174 _mfColors
.copyToBin(pMem
);
1176 if(FieldBits::NoField
!= (NormalsFieldMask
& whichField
))
1178 _mfNormals
.copyToBin(pMem
);
1182 void VTKPolyDataMapperBase::copyFromBin(BinaryDataHandler
&pMem
,
1183 ConstFieldMaskArg whichField
)
1185 Inherited::copyFromBin(pMem
, whichField
);
1187 if(FieldBits::NoField
!= (RootFieldMask
& whichField
))
1189 editSField(RootFieldMask
);
1190 _sfRoot
.copyFromBin(pMem
);
1192 if(FieldBits::NoField
!= (GeoRootsFieldMask
& whichField
))
1194 editMField(GeoRootsFieldMask
, _mfGeoRoots
);
1195 _mfGeoRoots
.copyFromBin(pMem
);
1197 if(FieldBits::NoField
!= (GeometriesFieldMask
& whichField
))
1199 editMField(GeometriesFieldMask
, _mfGeometries
);
1200 _mfGeometries
.copyFromBin(pMem
);
1202 if(FieldBits::NoField
!= (MaterialsFieldMask
& whichField
))
1204 editMField(MaterialsFieldMask
, _mfMaterials
);
1205 _mfMaterials
.copyFromBin(pMem
);
1207 if(FieldBits::NoField
!= (MaterialChunksFieldMask
& whichField
))
1209 editMField(MaterialChunksFieldMask
, _mfMaterialChunks
);
1210 _mfMaterialChunks
.copyFromBin(pMem
);
1212 if(FieldBits::NoField
!= (PositionsFieldMask
& whichField
))
1214 editMField(PositionsFieldMask
, _mfPositions
);
1215 _mfPositions
.copyFromBin(pMem
);
1217 if(FieldBits::NoField
!= (LengthFieldMask
& whichField
))
1219 editMField(LengthFieldMask
, _mfLength
);
1220 _mfLength
.copyFromBin(pMem
);
1222 if(FieldBits::NoField
!= (TypesFieldMask
& whichField
))
1224 editMField(TypesFieldMask
, _mfTypes
);
1225 _mfTypes
.copyFromBin(pMem
);
1227 if(FieldBits::NoField
!= (ColorsFieldMask
& whichField
))
1229 editMField(ColorsFieldMask
, _mfColors
);
1230 _mfColors
.copyFromBin(pMem
);
1232 if(FieldBits::NoField
!= (NormalsFieldMask
& whichField
))
1234 editMField(NormalsFieldMask
, _mfNormals
);
1235 _mfNormals
.copyFromBin(pMem
);
1239 //! create a new instance of the class
1240 VTKPolyDataMapperTransitPtr
VTKPolyDataMapperBase::createLocal(BitVector bFlags
)
1242 VTKPolyDataMapperTransitPtr fc
;
1244 if(getClassType().getPrototype() != NULL
)
1246 FieldContainerTransitPtr tmpPtr
=
1247 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
1249 fc
= dynamic_pointer_cast
<VTKPolyDataMapper
>(tmpPtr
);
1255 //! create a new instance of the class, copy the container flags
1256 VTKPolyDataMapperTransitPtr
VTKPolyDataMapperBase::createDependent(BitVector bFlags
)
1258 VTKPolyDataMapperTransitPtr fc
;
1260 if(getClassType().getPrototype() != NULL
)
1262 FieldContainerTransitPtr tmpPtr
=
1263 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
1265 fc
= dynamic_pointer_cast
<VTKPolyDataMapper
>(tmpPtr
);
1271 //! create a new instance of the class
1272 VTKPolyDataMapperTransitPtr
VTKPolyDataMapperBase::create(void)
1274 VTKPolyDataMapperTransitPtr fc
;
1276 if(getClassType().getPrototype() != NULL
)
1278 FieldContainerTransitPtr tmpPtr
=
1279 getClassType().getPrototype()-> shallowCopy();
1281 fc
= dynamic_pointer_cast
<VTKPolyDataMapper
>(tmpPtr
);
1287 VTKPolyDataMapper
*VTKPolyDataMapperBase::createEmptyLocal(BitVector bFlags
)
1289 VTKPolyDataMapper
*returnValue
;
1291 newPtr
<VTKPolyDataMapper
>(returnValue
, bFlags
);
1293 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
1298 //! create an empty new instance of the class, do not copy the prototype
1299 VTKPolyDataMapper
*VTKPolyDataMapperBase::createEmpty(void)
1301 VTKPolyDataMapper
*returnValue
;
1303 newPtr
<VTKPolyDataMapper
>(returnValue
, Thread::getCurrentLocalFlags());
1305 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
1306 ~Thread::getCurrentLocalFlags();
1312 FieldContainerTransitPtr
VTKPolyDataMapperBase::shallowCopyLocal(
1313 BitVector bFlags
) const
1315 VTKPolyDataMapper
*tmpPtr
;
1317 newPtr(tmpPtr
, dynamic_cast<const VTKPolyDataMapper
*>(this), bFlags
);
1319 FieldContainerTransitPtr
returnValue(tmpPtr
);
1321 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
1326 FieldContainerTransitPtr
VTKPolyDataMapperBase::shallowCopyDependent(
1327 BitVector bFlags
) const
1329 VTKPolyDataMapper
*tmpPtr
;
1331 newPtr(tmpPtr
, dynamic_cast<const VTKPolyDataMapper
*>(this), ~bFlags
);
1333 FieldContainerTransitPtr
returnValue(tmpPtr
);
1335 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
1340 FieldContainerTransitPtr
VTKPolyDataMapperBase::shallowCopy(void) const
1342 VTKPolyDataMapper
*tmpPtr
;
1345 dynamic_cast<const VTKPolyDataMapper
*>(this),
1346 Thread::getCurrentLocalFlags());
1348 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
1350 FieldContainerTransitPtr
returnValue(tmpPtr
);
1358 /*------------------------- constructors ----------------------------------*/
1360 VTKPolyDataMapperBase::VTKPolyDataMapperBase(void) :
1366 _mfMaterialChunks (),
1375 VTKPolyDataMapperBase::VTKPolyDataMapperBase(const VTKPolyDataMapperBase
&source
) :
1381 _mfMaterialChunks (),
1391 /*-------------------------- destructors ----------------------------------*/
1393 VTKPolyDataMapperBase::~VTKPolyDataMapperBase(void)
1397 void VTKPolyDataMapperBase::onCreate(const VTKPolyDataMapper
*source
)
1399 Inherited::onCreate(source
);
1403 VTKPolyDataMapper
*pThis
= static_cast<VTKPolyDataMapper
*>(this);
1405 pThis
->setRoot(source
->getRoot());
1407 MFUnrecNodePtr::const_iterator GeoRootsIt
=
1408 source
->_mfGeoRoots
.begin();
1409 MFUnrecNodePtr::const_iterator GeoRootsEnd
=
1410 source
->_mfGeoRoots
.end ();
1412 while(GeoRootsIt
!= GeoRootsEnd
)
1414 pThis
->pushToGeoRoots(*GeoRootsIt
);
1419 MFUnrecGeometryPtr::const_iterator GeometriesIt
=
1420 source
->_mfGeometries
.begin();
1421 MFUnrecGeometryPtr::const_iterator GeometriesEnd
=
1422 source
->_mfGeometries
.end ();
1424 while(GeometriesIt
!= GeometriesEnd
)
1426 pThis
->pushToGeometries(*GeometriesIt
);
1431 MFUnrecChunkMaterialPtr::const_iterator MaterialsIt
=
1432 source
->_mfMaterials
.begin();
1433 MFUnrecChunkMaterialPtr::const_iterator MaterialsEnd
=
1434 source
->_mfMaterials
.end ();
1436 while(MaterialsIt
!= MaterialsEnd
)
1438 pThis
->pushToMaterials(*MaterialsIt
);
1443 MFUnrecMaterialChunkPtr::const_iterator MaterialChunksIt
=
1444 source
->_mfMaterialChunks
.begin();
1445 MFUnrecMaterialChunkPtr::const_iterator MaterialChunksEnd
=
1446 source
->_mfMaterialChunks
.end ();
1448 while(MaterialChunksIt
!= MaterialChunksEnd
)
1450 pThis
->pushToMaterialChunks(*MaterialChunksIt
);
1455 MFUnrecGeoPnt3fPropertyPtr::const_iterator PositionsIt
=
1456 source
->_mfPositions
.begin();
1457 MFUnrecGeoPnt3fPropertyPtr::const_iterator PositionsEnd
=
1458 source
->_mfPositions
.end ();
1460 while(PositionsIt
!= PositionsEnd
)
1462 pThis
->pushToPositions(*PositionsIt
);
1467 MFUnrecGeoUInt32PropertyPtr::const_iterator LengthIt
=
1468 source
->_mfLength
.begin();
1469 MFUnrecGeoUInt32PropertyPtr::const_iterator LengthEnd
=
1470 source
->_mfLength
.end ();
1472 while(LengthIt
!= LengthEnd
)
1474 pThis
->pushToLength(*LengthIt
);
1479 MFUnrecGeoUInt8PropertyPtr::const_iterator TypesIt
=
1480 source
->_mfTypes
.begin();
1481 MFUnrecGeoUInt8PropertyPtr::const_iterator TypesEnd
=
1482 source
->_mfTypes
.end ();
1484 while(TypesIt
!= TypesEnd
)
1486 pThis
->pushToTypes(*TypesIt
);
1491 MFUnrecGeoColor4fPropertyPtr::const_iterator ColorsIt
=
1492 source
->_mfColors
.begin();
1493 MFUnrecGeoColor4fPropertyPtr::const_iterator ColorsEnd
=
1494 source
->_mfColors
.end ();
1496 while(ColorsIt
!= ColorsEnd
)
1498 pThis
->pushToColors(*ColorsIt
);
1503 MFUnrecGeoVec3fPropertyPtr::const_iterator NormalsIt
=
1504 source
->_mfNormals
.begin();
1505 MFUnrecGeoVec3fPropertyPtr::const_iterator NormalsEnd
=
1506 source
->_mfNormals
.end ();
1508 while(NormalsIt
!= NormalsEnd
)
1510 pThis
->pushToNormals(*NormalsIt
);
1517 GetFieldHandlePtr
VTKPolyDataMapperBase::getHandleRoot (void) const
1519 SFUnrecNodePtr::GetHandlePtr
returnValue(
1520 new SFUnrecNodePtr::GetHandle(
1522 this->getType().getFieldDesc(RootFieldId
),
1523 const_cast<VTKPolyDataMapperBase
*>(this)));
1528 EditFieldHandlePtr
VTKPolyDataMapperBase::editHandleRoot (void)
1530 SFUnrecNodePtr::EditHandlePtr
returnValue(
1531 new SFUnrecNodePtr::EditHandle(
1533 this->getType().getFieldDesc(RootFieldId
),
1536 returnValue
->setSetMethod(
1537 boost::bind(&VTKPolyDataMapper::setRoot
,
1538 static_cast<VTKPolyDataMapper
*>(this), _1
));
1540 editSField(RootFieldMask
);
1545 GetFieldHandlePtr
VTKPolyDataMapperBase::getHandleGeoRoots (void) const
1547 MFUnrecNodePtr::GetHandlePtr
returnValue(
1548 new MFUnrecNodePtr::GetHandle(
1550 this->getType().getFieldDesc(GeoRootsFieldId
),
1551 const_cast<VTKPolyDataMapperBase
*>(this)));
1556 EditFieldHandlePtr
VTKPolyDataMapperBase::editHandleGeoRoots (void)
1558 MFUnrecNodePtr::EditHandlePtr
returnValue(
1559 new MFUnrecNodePtr::EditHandle(
1561 this->getType().getFieldDesc(GeoRootsFieldId
),
1564 returnValue
->setAddMethod(
1565 boost::bind(&VTKPolyDataMapper::pushToGeoRoots
,
1566 static_cast<VTKPolyDataMapper
*>(this), _1
));
1567 returnValue
->setRemoveMethod(
1568 boost::bind(&VTKPolyDataMapper::removeFromGeoRoots
,
1569 static_cast<VTKPolyDataMapper
*>(this), _1
));
1570 returnValue
->setRemoveObjMethod(
1571 boost::bind(&VTKPolyDataMapper::removeObjFromGeoRoots
,
1572 static_cast<VTKPolyDataMapper
*>(this), _1
));
1573 returnValue
->setClearMethod(
1574 boost::bind(&VTKPolyDataMapper::clearGeoRoots
,
1575 static_cast<VTKPolyDataMapper
*>(this)));
1577 editMField(GeoRootsFieldMask
, _mfGeoRoots
);
1582 GetFieldHandlePtr
VTKPolyDataMapperBase::getHandleGeometries (void) const
1584 MFUnrecGeometryPtr::GetHandlePtr
returnValue(
1585 new MFUnrecGeometryPtr::GetHandle(
1587 this->getType().getFieldDesc(GeometriesFieldId
),
1588 const_cast<VTKPolyDataMapperBase
*>(this)));
1593 EditFieldHandlePtr
VTKPolyDataMapperBase::editHandleGeometries (void)
1595 MFUnrecGeometryPtr::EditHandlePtr
returnValue(
1596 new MFUnrecGeometryPtr::EditHandle(
1598 this->getType().getFieldDesc(GeometriesFieldId
),
1601 returnValue
->setAddMethod(
1602 boost::bind(&VTKPolyDataMapper::pushToGeometries
,
1603 static_cast<VTKPolyDataMapper
*>(this), _1
));
1604 returnValue
->setRemoveMethod(
1605 boost::bind(&VTKPolyDataMapper::removeFromGeometries
,
1606 static_cast<VTKPolyDataMapper
*>(this), _1
));
1607 returnValue
->setRemoveObjMethod(
1608 boost::bind(&VTKPolyDataMapper::removeObjFromGeometries
,
1609 static_cast<VTKPolyDataMapper
*>(this), _1
));
1610 returnValue
->setClearMethod(
1611 boost::bind(&VTKPolyDataMapper::clearGeometries
,
1612 static_cast<VTKPolyDataMapper
*>(this)));
1614 editMField(GeometriesFieldMask
, _mfGeometries
);
1619 GetFieldHandlePtr
VTKPolyDataMapperBase::getHandleMaterials (void) const
1621 MFUnrecChunkMaterialPtr::GetHandlePtr
returnValue(
1622 new MFUnrecChunkMaterialPtr::GetHandle(
1624 this->getType().getFieldDesc(MaterialsFieldId
),
1625 const_cast<VTKPolyDataMapperBase
*>(this)));
1630 EditFieldHandlePtr
VTKPolyDataMapperBase::editHandleMaterials (void)
1632 MFUnrecChunkMaterialPtr::EditHandlePtr
returnValue(
1633 new MFUnrecChunkMaterialPtr::EditHandle(
1635 this->getType().getFieldDesc(MaterialsFieldId
),
1638 returnValue
->setAddMethod(
1639 boost::bind(&VTKPolyDataMapper::pushToMaterials
,
1640 static_cast<VTKPolyDataMapper
*>(this), _1
));
1641 returnValue
->setRemoveMethod(
1642 boost::bind(&VTKPolyDataMapper::removeFromMaterials
,
1643 static_cast<VTKPolyDataMapper
*>(this), _1
));
1644 returnValue
->setRemoveObjMethod(
1645 boost::bind(&VTKPolyDataMapper::removeObjFromMaterials
,
1646 static_cast<VTKPolyDataMapper
*>(this), _1
));
1647 returnValue
->setClearMethod(
1648 boost::bind(&VTKPolyDataMapper::clearMaterials
,
1649 static_cast<VTKPolyDataMapper
*>(this)));
1651 editMField(MaterialsFieldMask
, _mfMaterials
);
1656 GetFieldHandlePtr
VTKPolyDataMapperBase::getHandleMaterialChunks (void) const
1658 MFUnrecMaterialChunkPtr::GetHandlePtr
returnValue(
1659 new MFUnrecMaterialChunkPtr::GetHandle(
1661 this->getType().getFieldDesc(MaterialChunksFieldId
),
1662 const_cast<VTKPolyDataMapperBase
*>(this)));
1667 EditFieldHandlePtr
VTKPolyDataMapperBase::editHandleMaterialChunks (void)
1669 MFUnrecMaterialChunkPtr::EditHandlePtr
returnValue(
1670 new MFUnrecMaterialChunkPtr::EditHandle(
1672 this->getType().getFieldDesc(MaterialChunksFieldId
),
1675 returnValue
->setAddMethod(
1676 boost::bind(&VTKPolyDataMapper::pushToMaterialChunks
,
1677 static_cast<VTKPolyDataMapper
*>(this), _1
));
1678 returnValue
->setRemoveMethod(
1679 boost::bind(&VTKPolyDataMapper::removeFromMaterialChunks
,
1680 static_cast<VTKPolyDataMapper
*>(this), _1
));
1681 returnValue
->setRemoveObjMethod(
1682 boost::bind(&VTKPolyDataMapper::removeObjFromMaterialChunks
,
1683 static_cast<VTKPolyDataMapper
*>(this), _1
));
1684 returnValue
->setClearMethod(
1685 boost::bind(&VTKPolyDataMapper::clearMaterialChunks
,
1686 static_cast<VTKPolyDataMapper
*>(this)));
1688 editMField(MaterialChunksFieldMask
, _mfMaterialChunks
);
1693 GetFieldHandlePtr
VTKPolyDataMapperBase::getHandlePositions (void) const
1695 MFUnrecGeoPnt3fPropertyPtr::GetHandlePtr
returnValue(
1696 new MFUnrecGeoPnt3fPropertyPtr::GetHandle(
1698 this->getType().getFieldDesc(PositionsFieldId
),
1699 const_cast<VTKPolyDataMapperBase
*>(this)));
1704 EditFieldHandlePtr
VTKPolyDataMapperBase::editHandlePositions (void)
1706 MFUnrecGeoPnt3fPropertyPtr::EditHandlePtr
returnValue(
1707 new MFUnrecGeoPnt3fPropertyPtr::EditHandle(
1709 this->getType().getFieldDesc(PositionsFieldId
),
1712 returnValue
->setAddMethod(
1713 boost::bind(&VTKPolyDataMapper::pushToPositions
,
1714 static_cast<VTKPolyDataMapper
*>(this), _1
));
1715 returnValue
->setRemoveMethod(
1716 boost::bind(&VTKPolyDataMapper::removeFromPositions
,
1717 static_cast<VTKPolyDataMapper
*>(this), _1
));
1718 returnValue
->setRemoveObjMethod(
1719 boost::bind(&VTKPolyDataMapper::removeObjFromPositions
,
1720 static_cast<VTKPolyDataMapper
*>(this), _1
));
1721 returnValue
->setClearMethod(
1722 boost::bind(&VTKPolyDataMapper::clearPositions
,
1723 static_cast<VTKPolyDataMapper
*>(this)));
1725 editMField(PositionsFieldMask
, _mfPositions
);
1730 GetFieldHandlePtr
VTKPolyDataMapperBase::getHandleLength (void) const
1732 MFUnrecGeoUInt32PropertyPtr::GetHandlePtr
returnValue(
1733 new MFUnrecGeoUInt32PropertyPtr::GetHandle(
1735 this->getType().getFieldDesc(LengthFieldId
),
1736 const_cast<VTKPolyDataMapperBase
*>(this)));
1741 EditFieldHandlePtr
VTKPolyDataMapperBase::editHandleLength (void)
1743 MFUnrecGeoUInt32PropertyPtr::EditHandlePtr
returnValue(
1744 new MFUnrecGeoUInt32PropertyPtr::EditHandle(
1746 this->getType().getFieldDesc(LengthFieldId
),
1749 returnValue
->setAddMethod(
1750 boost::bind(&VTKPolyDataMapper::pushToLength
,
1751 static_cast<VTKPolyDataMapper
*>(this), _1
));
1752 returnValue
->setRemoveMethod(
1753 boost::bind(&VTKPolyDataMapper::removeFromLength
,
1754 static_cast<VTKPolyDataMapper
*>(this), _1
));
1755 returnValue
->setRemoveObjMethod(
1756 boost::bind(&VTKPolyDataMapper::removeObjFromLength
,
1757 static_cast<VTKPolyDataMapper
*>(this), _1
));
1758 returnValue
->setClearMethod(
1759 boost::bind(&VTKPolyDataMapper::clearLength
,
1760 static_cast<VTKPolyDataMapper
*>(this)));
1762 editMField(LengthFieldMask
, _mfLength
);
1767 GetFieldHandlePtr
VTKPolyDataMapperBase::getHandleTypes (void) const
1769 MFUnrecGeoUInt8PropertyPtr::GetHandlePtr
returnValue(
1770 new MFUnrecGeoUInt8PropertyPtr::GetHandle(
1772 this->getType().getFieldDesc(TypesFieldId
),
1773 const_cast<VTKPolyDataMapperBase
*>(this)));
1778 EditFieldHandlePtr
VTKPolyDataMapperBase::editHandleTypes (void)
1780 MFUnrecGeoUInt8PropertyPtr::EditHandlePtr
returnValue(
1781 new MFUnrecGeoUInt8PropertyPtr::EditHandle(
1783 this->getType().getFieldDesc(TypesFieldId
),
1786 returnValue
->setAddMethod(
1787 boost::bind(&VTKPolyDataMapper::pushToTypes
,
1788 static_cast<VTKPolyDataMapper
*>(this), _1
));
1789 returnValue
->setRemoveMethod(
1790 boost::bind(&VTKPolyDataMapper::removeFromTypes
,
1791 static_cast<VTKPolyDataMapper
*>(this), _1
));
1792 returnValue
->setRemoveObjMethod(
1793 boost::bind(&VTKPolyDataMapper::removeObjFromTypes
,
1794 static_cast<VTKPolyDataMapper
*>(this), _1
));
1795 returnValue
->setClearMethod(
1796 boost::bind(&VTKPolyDataMapper::clearTypes
,
1797 static_cast<VTKPolyDataMapper
*>(this)));
1799 editMField(TypesFieldMask
, _mfTypes
);
1804 GetFieldHandlePtr
VTKPolyDataMapperBase::getHandleColors (void) const
1806 MFUnrecGeoColor4fPropertyPtr::GetHandlePtr
returnValue(
1807 new MFUnrecGeoColor4fPropertyPtr::GetHandle(
1809 this->getType().getFieldDesc(ColorsFieldId
),
1810 const_cast<VTKPolyDataMapperBase
*>(this)));
1815 EditFieldHandlePtr
VTKPolyDataMapperBase::editHandleColors (void)
1817 MFUnrecGeoColor4fPropertyPtr::EditHandlePtr
returnValue(
1818 new MFUnrecGeoColor4fPropertyPtr::EditHandle(
1820 this->getType().getFieldDesc(ColorsFieldId
),
1823 returnValue
->setAddMethod(
1824 boost::bind(&VTKPolyDataMapper::pushToColors
,
1825 static_cast<VTKPolyDataMapper
*>(this), _1
));
1826 returnValue
->setRemoveMethod(
1827 boost::bind(&VTKPolyDataMapper::removeFromColors
,
1828 static_cast<VTKPolyDataMapper
*>(this), _1
));
1829 returnValue
->setRemoveObjMethod(
1830 boost::bind(&VTKPolyDataMapper::removeObjFromColors
,
1831 static_cast<VTKPolyDataMapper
*>(this), _1
));
1832 returnValue
->setClearMethod(
1833 boost::bind(&VTKPolyDataMapper::clearColors
,
1834 static_cast<VTKPolyDataMapper
*>(this)));
1836 editMField(ColorsFieldMask
, _mfColors
);
1841 GetFieldHandlePtr
VTKPolyDataMapperBase::getHandleNormals (void) const
1843 MFUnrecGeoVec3fPropertyPtr::GetHandlePtr
returnValue(
1844 new MFUnrecGeoVec3fPropertyPtr::GetHandle(
1846 this->getType().getFieldDesc(NormalsFieldId
),
1847 const_cast<VTKPolyDataMapperBase
*>(this)));
1852 EditFieldHandlePtr
VTKPolyDataMapperBase::editHandleNormals (void)
1854 MFUnrecGeoVec3fPropertyPtr::EditHandlePtr
returnValue(
1855 new MFUnrecGeoVec3fPropertyPtr::EditHandle(
1857 this->getType().getFieldDesc(NormalsFieldId
),
1860 returnValue
->setAddMethod(
1861 boost::bind(&VTKPolyDataMapper::pushToNormals
,
1862 static_cast<VTKPolyDataMapper
*>(this), _1
));
1863 returnValue
->setRemoveMethod(
1864 boost::bind(&VTKPolyDataMapper::removeFromNormals
,
1865 static_cast<VTKPolyDataMapper
*>(this), _1
));
1866 returnValue
->setRemoveObjMethod(
1867 boost::bind(&VTKPolyDataMapper::removeObjFromNormals
,
1868 static_cast<VTKPolyDataMapper
*>(this), _1
));
1869 returnValue
->setClearMethod(
1870 boost::bind(&VTKPolyDataMapper::clearNormals
,
1871 static_cast<VTKPolyDataMapper
*>(this)));
1873 editMField(NormalsFieldMask
, _mfNormals
);
1879 #ifdef OSG_MT_CPTR_ASPECT
1880 void VTKPolyDataMapperBase::execSyncV( FieldContainer
&oFrom
,
1881 ConstFieldMaskArg whichField
,
1882 AspectOffsetStore
&oOffsets
,
1883 ConstFieldMaskArg syncMode
,
1884 const UInt32 uiSyncInfo
)
1886 VTKPolyDataMapper
*pThis
= static_cast<VTKPolyDataMapper
*>(this);
1888 pThis
->execSync(static_cast<VTKPolyDataMapper
*>(&oFrom
),
1897 #ifdef OSG_MT_CPTR_ASPECT
1898 FieldContainer
*VTKPolyDataMapperBase::createAspectCopy(
1899 const FieldContainer
*pRefAspect
) const
1901 VTKPolyDataMapper
*returnValue
;
1903 newAspectCopy(returnValue
,
1904 dynamic_cast<const VTKPolyDataMapper
*>(pRefAspect
),
1905 dynamic_cast<const VTKPolyDataMapper
*>(this));
1911 void VTKPolyDataMapperBase::resolveLinks(void)
1913 Inherited::resolveLinks();
1915 static_cast<VTKPolyDataMapper
*>(this)->setRoot(NULL
);
1917 static_cast<VTKPolyDataMapper
*>(this)->clearGeoRoots();
1919 static_cast<VTKPolyDataMapper
*>(this)->clearGeometries();
1921 static_cast<VTKPolyDataMapper
*>(this)->clearMaterials();
1923 static_cast<VTKPolyDataMapper
*>(this)->clearMaterialChunks();
1925 static_cast<VTKPolyDataMapper
*>(this)->clearPositions();
1927 static_cast<VTKPolyDataMapper
*>(this)->clearLength();
1929 static_cast<VTKPolyDataMapper
*>(this)->clearTypes();
1931 static_cast<VTKPolyDataMapper
*>(this)->clearColors();
1933 static_cast<VTKPolyDataMapper
*>(this)->clearNormals();