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 \*****************************************************************************/
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
61 #include "OSGConfig.h"
65 #include "OSGGeoVectorProperty.h" // ControlPoints Class
67 #include "OSGSurfaceBase.h"
68 #include "OSGSurface.h"
70 #include <boost/bind.hpp>
74 /***************************************************************************\
76 \***************************************************************************/
78 /*! \class OSG::Surface
79 This is the OpenSG NURBS surface node. It supports an arbitrary number of
80 trimming curves. The interface lets you define both rational and nonrational
81 surfaces, and you can also vary rational and nonrational trimming curves.
84 /***************************************************************************\
85 * Field Documentation *
86 \***************************************************************************/
88 /*! \var UInt32 SurfaceBase::_sfDimU
89 The surface dimension in U
92 /*! \var UInt32 SurfaceBase::_sfDimV
93 The surface dimension in V
96 /*! \var Real32 SurfaceBase::_mfKnotsU
97 The surface knots in U direction
100 /*! \var Real32 SurfaceBase::_mfKnotsV
101 The surface knots in V direction
104 /*! \var GeoVectorProperty * SurfaceBase::_sfControlPoints
105 The control points for the surface
108 /*! \var Real32 SurfaceBase::_sfError
109 The approximation error for the tessellation
112 /*! \var UInt32 SurfaceBase::_sfNumCurves
113 The number of trimming curves
116 /*! \var UInt32 SurfaceBase::_mfKnotLengths
117 The knotlengths for the trimming curves
120 /*! \var UInt32 SurfaceBase::_mfDimensions
121 The dimensions for the trimming curves
124 /*! \var Pnt3f SurfaceBase::_mfCurveControlPoints
125 The control points for the trimming curves
128 /*! \var Real32 SurfaceBase::_mfKnots
129 The knotvectors for the trimming curves
132 /*! \var UInt32 SurfaceBase::_mfCurvesPerLoop
133 Specifies the number of trimming curves in each trimming curve loop
136 /*! \var bool SurfaceBase::_sfIsDelaunay
137 Whether to use Delaunay triangulation. Default is no, because it's faster
138 and slightly more robust numerically, but produces a somewhat less "nice"
139 triangulation. Set to true, if you want Delaunay triangulation. The number
140 of triangles generated is the same in both modes.
143 /*! \var GeoVectorProperty * SurfaceBase::_sfTextureControlPoints
144 The control points for textures (always 2D)
147 /*! \var UInt32 SurfaceBase::_sfDirtyMask
151 /*! \var Int32 SurfaceBase::_sfSurfaceGLId
152 Surface GL Id, internal use.
156 /***************************************************************************\
157 * FieldType/FieldTrait Instantiation *
158 \***************************************************************************/
160 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
161 PointerType FieldTraits
<Surface
*, nsOSG
>::_type(
164 Surface::getClassType(),
168 OSG_FIELDTRAITS_GETTYPE_NS(Surface
*, nsOSG
)
170 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
174 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
178 /***************************************************************************\
179 * Field Description *
180 \***************************************************************************/
182 void SurfaceBase::classDescInserter(TypeObject
&oType
)
184 FieldDescriptionBase
*pDesc
= NULL
;
187 pDesc
= new SFUInt32::Description(
188 SFUInt32::getClassType(),
190 "The surface dimension in U\n",
191 DimUFieldId
, DimUFieldMask
,
193 (Field::SFDefaultFlags
| Field::FStdAccess
),
194 static_cast<FieldEditMethodSig
>(&Surface::editHandleDimU
),
195 static_cast<FieldGetMethodSig
>(&Surface::getHandleDimU
));
197 oType
.addInitialDesc(pDesc
);
199 pDesc
= new SFUInt32::Description(
200 SFUInt32::getClassType(),
202 "The surface dimension in V\n",
203 DimVFieldId
, DimVFieldMask
,
205 (Field::SFDefaultFlags
| Field::FStdAccess
),
206 static_cast<FieldEditMethodSig
>(&Surface::editHandleDimV
),
207 static_cast<FieldGetMethodSig
>(&Surface::getHandleDimV
));
209 oType
.addInitialDesc(pDesc
);
211 pDesc
= new MFReal32::Description(
212 MFReal32::getClassType(),
214 "The surface knots in U direction\n",
215 KnotsUFieldId
, KnotsUFieldMask
,
217 (Field::MFDefaultFlags
| Field::FStdAccess
),
218 static_cast<FieldEditMethodSig
>(&Surface::editHandleKnotsU
),
219 static_cast<FieldGetMethodSig
>(&Surface::getHandleKnotsU
));
221 oType
.addInitialDesc(pDesc
);
223 pDesc
= new MFReal32::Description(
224 MFReal32::getClassType(),
226 "The surface knots in V direction\n",
227 KnotsVFieldId
, KnotsVFieldMask
,
229 (Field::MFDefaultFlags
| Field::FStdAccess
),
230 static_cast<FieldEditMethodSig
>(&Surface::editHandleKnotsV
),
231 static_cast<FieldGetMethodSig
>(&Surface::getHandleKnotsV
));
233 oType
.addInitialDesc(pDesc
);
235 pDesc
= new SFUnrecChildGeoVectorPropertyPtr::Description(
236 SFUnrecChildGeoVectorPropertyPtr::getClassType(),
238 "The control points for the surface\n",
239 ControlPointsFieldId
, ControlPointsFieldMask
,
241 (Field::SFDefaultFlags
| Field::FStdAccess
),
242 static_cast<FieldEditMethodSig
>(&Surface::editHandleControlPoints
),
243 static_cast<FieldGetMethodSig
>(&Surface::getHandleControlPoints
));
245 oType
.addInitialDesc(pDesc
);
247 pDesc
= new SFReal32::Description(
248 SFReal32::getClassType(),
250 "The approximation error for the tessellation\n",
251 ErrorFieldId
, ErrorFieldMask
,
253 (Field::SFDefaultFlags
| Field::FStdAccess
),
254 static_cast<FieldEditMethodSig
>(&Surface::editHandleError
),
255 static_cast<FieldGetMethodSig
>(&Surface::getHandleError
));
257 oType
.addInitialDesc(pDesc
);
259 pDesc
= new SFUInt32::Description(
260 SFUInt32::getClassType(),
262 "The number of trimming curves\n",
263 NumCurvesFieldId
, NumCurvesFieldMask
,
265 (Field::SFDefaultFlags
| Field::FStdAccess
),
266 static_cast<FieldEditMethodSig
>(&Surface::editHandleNumCurves
),
267 static_cast<FieldGetMethodSig
>(&Surface::getHandleNumCurves
));
269 oType
.addInitialDesc(pDesc
);
271 pDesc
= new MFUInt32::Description(
272 MFUInt32::getClassType(),
274 "The knotlengths for the trimming curves\n",
275 KnotLengthsFieldId
, KnotLengthsFieldMask
,
277 (Field::MFDefaultFlags
| Field::FStdAccess
),
278 static_cast<FieldEditMethodSig
>(&Surface::editHandleKnotLengths
),
279 static_cast<FieldGetMethodSig
>(&Surface::getHandleKnotLengths
));
281 oType
.addInitialDesc(pDesc
);
283 pDesc
= new MFUInt32::Description(
284 MFUInt32::getClassType(),
286 "The dimensions for the trimming curves\n",
287 DimensionsFieldId
, DimensionsFieldMask
,
289 (Field::MFDefaultFlags
| Field::FStdAccess
),
290 static_cast<FieldEditMethodSig
>(&Surface::editHandleDimensions
),
291 static_cast<FieldGetMethodSig
>(&Surface::getHandleDimensions
));
293 oType
.addInitialDesc(pDesc
);
295 pDesc
= new MFPnt3f::Description(
296 MFPnt3f::getClassType(),
297 "curveControlPoints",
298 "The control points for the trimming curves\n",
299 CurveControlPointsFieldId
, CurveControlPointsFieldMask
,
301 (Field::MFDefaultFlags
| Field::FStdAccess
),
302 static_cast<FieldEditMethodSig
>(&Surface::editHandleCurveControlPoints
),
303 static_cast<FieldGetMethodSig
>(&Surface::getHandleCurveControlPoints
));
305 oType
.addInitialDesc(pDesc
);
307 pDesc
= new MFReal32::Description(
308 MFReal32::getClassType(),
310 "The knotvectors for the trimming curves\n",
311 KnotsFieldId
, KnotsFieldMask
,
313 (Field::MFDefaultFlags
| Field::FStdAccess
),
314 static_cast<FieldEditMethodSig
>(&Surface::editHandleKnots
),
315 static_cast<FieldGetMethodSig
>(&Surface::getHandleKnots
));
317 oType
.addInitialDesc(pDesc
);
319 pDesc
= new MFUInt32::Description(
320 MFUInt32::getClassType(),
322 "Specifies the number of trimming curves in each trimming curve loop\n",
323 CurvesPerLoopFieldId
, CurvesPerLoopFieldMask
,
325 (Field::MFDefaultFlags
| Field::FStdAccess
),
326 static_cast<FieldEditMethodSig
>(&Surface::editHandleCurvesPerLoop
),
327 static_cast<FieldGetMethodSig
>(&Surface::getHandleCurvesPerLoop
));
329 oType
.addInitialDesc(pDesc
);
331 pDesc
= new SFBool::Description(
332 SFBool::getClassType(),
334 "Whether to use Delaunay triangulation. Default is no, because it's faster\n"
335 "and slightly more robust numerically, but produces a somewhat less \"nice\"\n"
336 "triangulation. Set to true, if you want Delaunay triangulation. The number\n"
337 "of triangles generated is the same in both modes.\n",
338 IsDelaunayFieldId
, IsDelaunayFieldMask
,
340 (Field::SFDefaultFlags
| Field::FStdAccess
),
341 static_cast<FieldEditMethodSig
>(&Surface::editHandleIsDelaunay
),
342 static_cast<FieldGetMethodSig
>(&Surface::getHandleIsDelaunay
));
344 oType
.addInitialDesc(pDesc
);
346 pDesc
= new SFUnrecChildGeoVectorPropertyPtr::Description(
347 SFUnrecChildGeoVectorPropertyPtr::getClassType(),
348 "textureControlPoints",
349 "The control points for textures (always 2D)\n",
350 TextureControlPointsFieldId
, TextureControlPointsFieldMask
,
352 (Field::SFDefaultFlags
| Field::FStdAccess
),
353 static_cast<FieldEditMethodSig
>(&Surface::editHandleTextureControlPoints
),
354 static_cast<FieldGetMethodSig
>(&Surface::getHandleTextureControlPoints
));
356 oType
.addInitialDesc(pDesc
);
358 pDesc
= new SFUInt32::Description(
359 SFUInt32::getClassType(),
362 DirtyMaskFieldId
, DirtyMaskFieldMask
,
364 (Field::SFDefaultFlags
| Field::FStdAccess
),
365 static_cast<FieldEditMethodSig
>(&Surface::editHandleDirtyMask
),
366 static_cast<FieldGetMethodSig
>(&Surface::getHandleDirtyMask
));
368 oType
.addInitialDesc(pDesc
);
370 pDesc
= new SFInt32::Description(
371 SFInt32::getClassType(),
373 "Surface GL Id, internal use.\n",
374 SurfaceGLIdFieldId
, SurfaceGLIdFieldMask
,
376 (Field::FClusterLocal
),
377 static_cast<FieldEditMethodSig
>(&Surface::editHandleSurfaceGLId
),
378 static_cast<FieldGetMethodSig
>(&Surface::getHandleSurfaceGLId
));
380 oType
.addInitialDesc(pDesc
);
384 SurfaceBase::TypeObject
SurfaceBase::_type(
385 SurfaceBase::getClassname(),
386 Inherited::getClassname(),
389 reinterpret_cast<PrototypeCreateF
>(&SurfaceBase::createEmptyLocal
),
390 reinterpret_cast<InitContainerF
>(&Surface::initMethod
),
391 reinterpret_cast<ExitContainerF
>(&Surface::exitMethod
),
392 reinterpret_cast<InitalInsertDescFunc
>(
393 reinterpret_cast<void *>(&Surface::classDescInserter
)),
396 "<?xml version=\"1.0\"?>\n"
399 " name=\"Surface\"\n"
400 " parent=\"Geometry\"\n"
401 " library=\"Drawable\"\n"
402 " pointerfieldtypes=\"both\"\n"
403 " structure=\"concrete\"\n"
404 " systemcomponent=\"true\"\n"
405 " parentsystemcomponent=\"true\"\n"
406 " decoratable=\"false\"\n"
407 " isNodeCore=\"true\"\n"
408 " docGroupBase=\"GrpDrawablesNurbs\"\n"
410 " This is the OpenSG NURBS surface node. It supports an arbitrary number of\n"
411 " trimming curves. The interface lets you define both rational and nonrational\n"
412 " surfaces, and you can also vary rational and nonrational trimming curves.\n"
416 " cardinality=\"single\"\n"
417 " visibility=\"external\"\n"
418 " defaultValue=\"0\"\n"
419 " access=\"public\"\n"
421 " The surface dimension in U\n"
426 " cardinality=\"single\"\n"
427 " visibility=\"external\"\n"
428 " defaultValue=\"0\"\n"
429 " access=\"public\"\n"
431 " The surface dimension in V\n"
436 " cardinality=\"multi\"\n"
437 " visibility=\"external\"\n"
438 " access=\"public\"\n"
440 " The surface knots in U direction\n"
445 " cardinality=\"multi\"\n"
446 " visibility=\"external\"\n"
447 " access=\"public\"\n"
449 " The surface knots in V direction\n"
452 " name=\"controlPoints\"\n"
453 " type=\"GeoVectorProperty\"\n"
454 " cardinality=\"single\"\n"
455 " visibility=\"external\"\n"
456 " access=\"public\"\n"
457 " category=\"childpointer\"\n"
458 " childParentType=\"FieldContainer\"\n"
459 " linkParentField=\"Parents\"\n"
461 " The control points for the surface\n"
466 " cardinality=\"single\"\n"
467 " visibility=\"external\"\n"
468 " defaultValue=\"0.5\"\n"
469 " access=\"public\"\n"
471 " The approximation error for the tessellation\n"
474 " name=\"numCurves\"\n"
476 " cardinality=\"single\"\n"
477 " visibility=\"external\"\n"
478 " defaultValue=\"0\"\n"
479 " access=\"protected\"\n"
481 " The number of trimming curves\n"
484 " name=\"knotLengths\"\n"
486 " cardinality=\"multi\"\n"
487 " visibility=\"external\"\n"
488 " access=\"protected\"\n"
490 " The knotlengths for the trimming curves\n"
493 " name=\"dimensions\"\n"
495 " cardinality=\"multi\"\n"
496 " visibility=\"external\"\n"
497 " access=\"protected\"\n"
499 " The dimensions for the trimming curves\n"
502 " name=\"curveControlPoints\"\n"
504 " cardinality=\"multi\"\n"
505 " visibility=\"external\"\n"
506 " access=\"protected\"\n"
508 " The control points for the trimming curves\n"
513 " cardinality=\"multi\"\n"
514 " visibility=\"external\"\n"
515 " access=\"protected\"\n"
517 " The knotvectors for the trimming curves\n"
520 " name=\"curvesPerLoop\"\n"
522 " cardinality=\"multi\"\n"
523 " visibility=\"external\"\n"
524 " access=\"protected\"\n"
526 " Specifies the number of trimming curves in each trimming curve loop\n"
529 " name=\"isDelaunay\"\n"
531 " cardinality=\"single\"\n"
532 " visibility=\"external\"\n"
533 " defaultValue=\"false\"\n"
534 " access=\"public\"\n"
536 " Whether to use Delaunay triangulation. Default is no, because it's faster\n"
537 " and slightly more robust numerically, but produces a somewhat less \"nice\"\n"
538 " triangulation. Set to true, if you want Delaunay triangulation. The number\n"
539 " of triangles generated is the same in both modes.\n"
542 " name=\"textureControlPoints\"\n"
543 " type=\"GeoVectorProperty\"\n"
544 " cardinality=\"single\"\n"
545 " visibility=\"external\"\n"
546 " access=\"public\"\n"
547 " category=\"childpointer\"\n"
548 " childParentType=\"FieldContainer\"\n"
549 " linkParentField=\"Parents\"\n"
551 " The control points for textures (always 2D)\n"
554 " name=\"dirtyMask\"\n"
556 " cardinality=\"single\"\n"
557 " visibility=\"external\"\n"
558 " defaultValue=\"0\"\n"
559 " access=\"protected\"\n"
563 " name=\"surfaceGLId\"\n"
565 " cardinality=\"single\"\n"
566 " visibility=\"internal\"\n"
567 " defaultValue=\"0\"\n"
568 " access=\"protected\"\n"
569 " fieldFlags=\"FClusterLocal\"\n"
571 " Surface GL Id, internal use.\n"
573 "</FieldContainer>\n",
574 "This is the OpenSG NURBS surface node. It supports an arbitrary number of\n"
575 "trimming curves. The interface lets you define both rational and nonrational\n"
576 "surfaces, and you can also vary rational and nonrational trimming curves.\n"
579 /*------------------------------ get -----------------------------------*/
581 FieldContainerType
&SurfaceBase::getType(void)
586 const FieldContainerType
&SurfaceBase::getType(void) const
591 UInt32
SurfaceBase::getContainerSize(void) const
593 return sizeof(Surface
);
596 /*------------------------- decorator get ------------------------------*/
599 SFUInt32
*SurfaceBase::editSFDimU(void)
601 editSField(DimUFieldMask
);
606 const SFUInt32
*SurfaceBase::getSFDimU(void) const
612 SFUInt32
*SurfaceBase::editSFDimV(void)
614 editSField(DimVFieldMask
);
619 const SFUInt32
*SurfaceBase::getSFDimV(void) const
625 MFReal32
*SurfaceBase::editMFKnotsU(void)
627 editMField(KnotsUFieldMask
, _mfKnotsU
);
632 const MFReal32
*SurfaceBase::getMFKnotsU(void) const
638 MFReal32
*SurfaceBase::editMFKnotsV(void)
640 editMField(KnotsVFieldMask
, _mfKnotsV
);
645 const MFReal32
*SurfaceBase::getMFKnotsV(void) const
651 //! Get the Surface::_sfControlPoints field.
652 const SFUnrecChildGeoVectorPropertyPtr
*SurfaceBase::getSFControlPoints(void) const
654 return &_sfControlPoints
;
657 SFUnrecChildGeoVectorPropertyPtr
*SurfaceBase::editSFControlPoints (void)
659 editSField(ControlPointsFieldMask
);
661 return &_sfControlPoints
;
664 //! Get the value of the Surface::_sfControlPoints field.
665 GeoVectorProperty
* SurfaceBase::getControlPoints(void) const
667 return _sfControlPoints
.getValue();
670 //! Set the value of the Surface::_sfControlPoints field.
671 void SurfaceBase::setControlPoints(GeoVectorProperty
* const value
)
673 editSField(ControlPointsFieldMask
);
675 _sfControlPoints
.setValue(value
);
679 SFReal32
*SurfaceBase::editSFError(void)
681 editSField(ErrorFieldMask
);
686 const SFReal32
*SurfaceBase::getSFError(void) const
692 SFUInt32
*SurfaceBase::editSFNumCurves(void)
694 editSField(NumCurvesFieldMask
);
696 return &_sfNumCurves
;
699 const SFUInt32
*SurfaceBase::getSFNumCurves(void) const
701 return &_sfNumCurves
;
705 MFUInt32
*SurfaceBase::editMFKnotLengths(void)
707 editMField(KnotLengthsFieldMask
, _mfKnotLengths
);
709 return &_mfKnotLengths
;
712 const MFUInt32
*SurfaceBase::getMFKnotLengths(void) const
714 return &_mfKnotLengths
;
718 MFUInt32
*SurfaceBase::editMFDimensions(void)
720 editMField(DimensionsFieldMask
, _mfDimensions
);
722 return &_mfDimensions
;
725 const MFUInt32
*SurfaceBase::getMFDimensions(void) const
727 return &_mfDimensions
;
731 MFPnt3f
*SurfaceBase::editMFCurveControlPoints(void)
733 editMField(CurveControlPointsFieldMask
, _mfCurveControlPoints
);
735 return &_mfCurveControlPoints
;
738 const MFPnt3f
*SurfaceBase::getMFCurveControlPoints(void) const
740 return &_mfCurveControlPoints
;
744 MFReal32
*SurfaceBase::editMFKnots(void)
746 editMField(KnotsFieldMask
, _mfKnots
);
751 const MFReal32
*SurfaceBase::getMFKnots(void) const
757 MFUInt32
*SurfaceBase::editMFCurvesPerLoop(void)
759 editMField(CurvesPerLoopFieldMask
, _mfCurvesPerLoop
);
761 return &_mfCurvesPerLoop
;
764 const MFUInt32
*SurfaceBase::getMFCurvesPerLoop(void) const
766 return &_mfCurvesPerLoop
;
770 SFBool
*SurfaceBase::editSFIsDelaunay(void)
772 editSField(IsDelaunayFieldMask
);
774 return &_sfIsDelaunay
;
777 const SFBool
*SurfaceBase::getSFIsDelaunay(void) const
779 return &_sfIsDelaunay
;
783 //! Get the Surface::_sfTextureControlPoints field.
784 const SFUnrecChildGeoVectorPropertyPtr
*SurfaceBase::getSFTextureControlPoints(void) const
786 return &_sfTextureControlPoints
;
789 SFUnrecChildGeoVectorPropertyPtr
*SurfaceBase::editSFTextureControlPoints(void)
791 editSField(TextureControlPointsFieldMask
);
793 return &_sfTextureControlPoints
;
796 //! Get the value of the Surface::_sfTextureControlPoints field.
797 GeoVectorProperty
* SurfaceBase::getTextureControlPoints(void) const
799 return _sfTextureControlPoints
.getValue();
802 //! Set the value of the Surface::_sfTextureControlPoints field.
803 void SurfaceBase::setTextureControlPoints(GeoVectorProperty
* const value
)
805 editSField(TextureControlPointsFieldMask
);
807 _sfTextureControlPoints
.setValue(value
);
811 SFUInt32
*SurfaceBase::editSFDirtyMask(void)
813 editSField(DirtyMaskFieldMask
);
815 return &_sfDirtyMask
;
818 const SFUInt32
*SurfaceBase::getSFDirtyMask(void) const
820 return &_sfDirtyMask
;
824 SFInt32
*SurfaceBase::editSFSurfaceGLId(void)
826 editSField(SurfaceGLIdFieldMask
);
828 return &_sfSurfaceGLId
;
831 const SFInt32
*SurfaceBase::getSFSurfaceGLId(void) const
833 return &_sfSurfaceGLId
;
841 /*------------------------------ access -----------------------------------*/
843 SizeT
SurfaceBase::getBinSize(ConstFieldMaskArg whichField
)
845 SizeT returnValue
= Inherited::getBinSize(whichField
);
847 if(FieldBits::NoField
!= (DimUFieldMask
& whichField
))
849 returnValue
+= _sfDimU
.getBinSize();
851 if(FieldBits::NoField
!= (DimVFieldMask
& whichField
))
853 returnValue
+= _sfDimV
.getBinSize();
855 if(FieldBits::NoField
!= (KnotsUFieldMask
& whichField
))
857 returnValue
+= _mfKnotsU
.getBinSize();
859 if(FieldBits::NoField
!= (KnotsVFieldMask
& whichField
))
861 returnValue
+= _mfKnotsV
.getBinSize();
863 if(FieldBits::NoField
!= (ControlPointsFieldMask
& whichField
))
865 returnValue
+= _sfControlPoints
.getBinSize();
867 if(FieldBits::NoField
!= (ErrorFieldMask
& whichField
))
869 returnValue
+= _sfError
.getBinSize();
871 if(FieldBits::NoField
!= (NumCurvesFieldMask
& whichField
))
873 returnValue
+= _sfNumCurves
.getBinSize();
875 if(FieldBits::NoField
!= (KnotLengthsFieldMask
& whichField
))
877 returnValue
+= _mfKnotLengths
.getBinSize();
879 if(FieldBits::NoField
!= (DimensionsFieldMask
& whichField
))
881 returnValue
+= _mfDimensions
.getBinSize();
883 if(FieldBits::NoField
!= (CurveControlPointsFieldMask
& whichField
))
885 returnValue
+= _mfCurveControlPoints
.getBinSize();
887 if(FieldBits::NoField
!= (KnotsFieldMask
& whichField
))
889 returnValue
+= _mfKnots
.getBinSize();
891 if(FieldBits::NoField
!= (CurvesPerLoopFieldMask
& whichField
))
893 returnValue
+= _mfCurvesPerLoop
.getBinSize();
895 if(FieldBits::NoField
!= (IsDelaunayFieldMask
& whichField
))
897 returnValue
+= _sfIsDelaunay
.getBinSize();
899 if(FieldBits::NoField
!= (TextureControlPointsFieldMask
& whichField
))
901 returnValue
+= _sfTextureControlPoints
.getBinSize();
903 if(FieldBits::NoField
!= (DirtyMaskFieldMask
& whichField
))
905 returnValue
+= _sfDirtyMask
.getBinSize();
907 if(FieldBits::NoField
!= (SurfaceGLIdFieldMask
& whichField
))
909 returnValue
+= _sfSurfaceGLId
.getBinSize();
915 void SurfaceBase::copyToBin(BinaryDataHandler
&pMem
,
916 ConstFieldMaskArg whichField
)
918 Inherited::copyToBin(pMem
, whichField
);
920 if(FieldBits::NoField
!= (DimUFieldMask
& whichField
))
922 _sfDimU
.copyToBin(pMem
);
924 if(FieldBits::NoField
!= (DimVFieldMask
& whichField
))
926 _sfDimV
.copyToBin(pMem
);
928 if(FieldBits::NoField
!= (KnotsUFieldMask
& whichField
))
930 _mfKnotsU
.copyToBin(pMem
);
932 if(FieldBits::NoField
!= (KnotsVFieldMask
& whichField
))
934 _mfKnotsV
.copyToBin(pMem
);
936 if(FieldBits::NoField
!= (ControlPointsFieldMask
& whichField
))
938 _sfControlPoints
.copyToBin(pMem
);
940 if(FieldBits::NoField
!= (ErrorFieldMask
& whichField
))
942 _sfError
.copyToBin(pMem
);
944 if(FieldBits::NoField
!= (NumCurvesFieldMask
& whichField
))
946 _sfNumCurves
.copyToBin(pMem
);
948 if(FieldBits::NoField
!= (KnotLengthsFieldMask
& whichField
))
950 _mfKnotLengths
.copyToBin(pMem
);
952 if(FieldBits::NoField
!= (DimensionsFieldMask
& whichField
))
954 _mfDimensions
.copyToBin(pMem
);
956 if(FieldBits::NoField
!= (CurveControlPointsFieldMask
& whichField
))
958 _mfCurveControlPoints
.copyToBin(pMem
);
960 if(FieldBits::NoField
!= (KnotsFieldMask
& whichField
))
962 _mfKnots
.copyToBin(pMem
);
964 if(FieldBits::NoField
!= (CurvesPerLoopFieldMask
& whichField
))
966 _mfCurvesPerLoop
.copyToBin(pMem
);
968 if(FieldBits::NoField
!= (IsDelaunayFieldMask
& whichField
))
970 _sfIsDelaunay
.copyToBin(pMem
);
972 if(FieldBits::NoField
!= (TextureControlPointsFieldMask
& whichField
))
974 _sfTextureControlPoints
.copyToBin(pMem
);
976 if(FieldBits::NoField
!= (DirtyMaskFieldMask
& whichField
))
978 _sfDirtyMask
.copyToBin(pMem
);
980 if(FieldBits::NoField
!= (SurfaceGLIdFieldMask
& whichField
))
982 _sfSurfaceGLId
.copyToBin(pMem
);
986 void SurfaceBase::copyFromBin(BinaryDataHandler
&pMem
,
987 ConstFieldMaskArg whichField
)
989 Inherited::copyFromBin(pMem
, whichField
);
991 if(FieldBits::NoField
!= (DimUFieldMask
& whichField
))
993 editSField(DimUFieldMask
);
994 _sfDimU
.copyFromBin(pMem
);
996 if(FieldBits::NoField
!= (DimVFieldMask
& whichField
))
998 editSField(DimVFieldMask
);
999 _sfDimV
.copyFromBin(pMem
);
1001 if(FieldBits::NoField
!= (KnotsUFieldMask
& whichField
))
1003 editMField(KnotsUFieldMask
, _mfKnotsU
);
1004 _mfKnotsU
.copyFromBin(pMem
);
1006 if(FieldBits::NoField
!= (KnotsVFieldMask
& whichField
))
1008 editMField(KnotsVFieldMask
, _mfKnotsV
);
1009 _mfKnotsV
.copyFromBin(pMem
);
1011 if(FieldBits::NoField
!= (ControlPointsFieldMask
& whichField
))
1013 editSField(ControlPointsFieldMask
);
1014 _sfControlPoints
.copyFromBin(pMem
);
1016 if(FieldBits::NoField
!= (ErrorFieldMask
& whichField
))
1018 editSField(ErrorFieldMask
);
1019 _sfError
.copyFromBin(pMem
);
1021 if(FieldBits::NoField
!= (NumCurvesFieldMask
& whichField
))
1023 editSField(NumCurvesFieldMask
);
1024 _sfNumCurves
.copyFromBin(pMem
);
1026 if(FieldBits::NoField
!= (KnotLengthsFieldMask
& whichField
))
1028 editMField(KnotLengthsFieldMask
, _mfKnotLengths
);
1029 _mfKnotLengths
.copyFromBin(pMem
);
1031 if(FieldBits::NoField
!= (DimensionsFieldMask
& whichField
))
1033 editMField(DimensionsFieldMask
, _mfDimensions
);
1034 _mfDimensions
.copyFromBin(pMem
);
1036 if(FieldBits::NoField
!= (CurveControlPointsFieldMask
& whichField
))
1038 editMField(CurveControlPointsFieldMask
, _mfCurveControlPoints
);
1039 _mfCurveControlPoints
.copyFromBin(pMem
);
1041 if(FieldBits::NoField
!= (KnotsFieldMask
& whichField
))
1043 editMField(KnotsFieldMask
, _mfKnots
);
1044 _mfKnots
.copyFromBin(pMem
);
1046 if(FieldBits::NoField
!= (CurvesPerLoopFieldMask
& whichField
))
1048 editMField(CurvesPerLoopFieldMask
, _mfCurvesPerLoop
);
1049 _mfCurvesPerLoop
.copyFromBin(pMem
);
1051 if(FieldBits::NoField
!= (IsDelaunayFieldMask
& whichField
))
1053 editSField(IsDelaunayFieldMask
);
1054 _sfIsDelaunay
.copyFromBin(pMem
);
1056 if(FieldBits::NoField
!= (TextureControlPointsFieldMask
& whichField
))
1058 editSField(TextureControlPointsFieldMask
);
1059 _sfTextureControlPoints
.copyFromBin(pMem
);
1061 if(FieldBits::NoField
!= (DirtyMaskFieldMask
& whichField
))
1063 editSField(DirtyMaskFieldMask
);
1064 _sfDirtyMask
.copyFromBin(pMem
);
1066 if(FieldBits::NoField
!= (SurfaceGLIdFieldMask
& whichField
))
1068 editSField(SurfaceGLIdFieldMask
);
1069 _sfSurfaceGLId
.copyFromBin(pMem
);
1073 //! create a new instance of the class
1074 SurfaceTransitPtr
SurfaceBase::createLocal(BitVector bFlags
)
1076 SurfaceTransitPtr fc
;
1078 if(getClassType().getPrototype() != NULL
)
1080 FieldContainerTransitPtr tmpPtr
=
1081 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
1083 fc
= dynamic_pointer_cast
<Surface
>(tmpPtr
);
1089 //! create a new instance of the class, copy the container flags
1090 SurfaceTransitPtr
SurfaceBase::createDependent(BitVector bFlags
)
1092 SurfaceTransitPtr fc
;
1094 if(getClassType().getPrototype() != NULL
)
1096 FieldContainerTransitPtr tmpPtr
=
1097 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
1099 fc
= dynamic_pointer_cast
<Surface
>(tmpPtr
);
1105 //! create a new instance of the class
1106 SurfaceTransitPtr
SurfaceBase::create(void)
1108 SurfaceTransitPtr fc
;
1110 if(getClassType().getPrototype() != NULL
)
1112 FieldContainerTransitPtr tmpPtr
=
1113 getClassType().getPrototype()-> shallowCopy();
1115 fc
= dynamic_pointer_cast
<Surface
>(tmpPtr
);
1121 Surface
*SurfaceBase::createEmptyLocal(BitVector bFlags
)
1123 Surface
*returnValue
;
1125 newPtr
<Surface
>(returnValue
, bFlags
);
1127 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
1132 //! create an empty new instance of the class, do not copy the prototype
1133 Surface
*SurfaceBase::createEmpty(void)
1135 Surface
*returnValue
;
1137 newPtr
<Surface
>(returnValue
, Thread::getCurrentLocalFlags());
1139 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
1140 ~Thread::getCurrentLocalFlags();
1146 FieldContainerTransitPtr
SurfaceBase::shallowCopyLocal(
1147 BitVector bFlags
) const
1151 newPtr(tmpPtr
, dynamic_cast<const Surface
*>(this), bFlags
);
1153 FieldContainerTransitPtr
returnValue(tmpPtr
);
1155 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
1160 FieldContainerTransitPtr
SurfaceBase::shallowCopyDependent(
1161 BitVector bFlags
) const
1165 newPtr(tmpPtr
, dynamic_cast<const Surface
*>(this), ~bFlags
);
1167 FieldContainerTransitPtr
returnValue(tmpPtr
);
1169 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
1174 FieldContainerTransitPtr
SurfaceBase::shallowCopy(void) const
1179 dynamic_cast<const Surface
*>(this),
1180 Thread::getCurrentLocalFlags());
1182 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
1184 FieldContainerTransitPtr
returnValue(tmpPtr
);
1192 /*------------------------- constructors ----------------------------------*/
1194 SurfaceBase::SurfaceBase(void) :
1196 _sfDimU (UInt32(0)),
1197 _sfDimV (UInt32(0)),
1200 _sfControlPoints (this,
1201 ControlPointsFieldId
,
1202 GeoVectorProperty::ParentsFieldId
),
1203 _sfError (Real32(0.5)),
1204 _sfNumCurves (UInt32(0)),
1207 _mfCurveControlPoints (),
1209 _mfCurvesPerLoop (),
1210 _sfIsDelaunay (bool(false)),
1211 _sfTextureControlPoints (this,
1212 TextureControlPointsFieldId
,
1213 GeoVectorProperty::ParentsFieldId
),
1214 _sfDirtyMask (UInt32(0)),
1215 _sfSurfaceGLId (Int32(0))
1219 SurfaceBase::SurfaceBase(const SurfaceBase
&source
) :
1221 _sfDimU (source
._sfDimU
),
1222 _sfDimV (source
._sfDimV
),
1223 _mfKnotsU (source
._mfKnotsU
),
1224 _mfKnotsV (source
._mfKnotsV
),
1225 _sfControlPoints (this,
1226 ControlPointsFieldId
,
1227 GeoVectorProperty::ParentsFieldId
),
1228 _sfError (source
._sfError
),
1229 _sfNumCurves (source
._sfNumCurves
),
1230 _mfKnotLengths (source
._mfKnotLengths
),
1231 _mfDimensions (source
._mfDimensions
),
1232 _mfCurveControlPoints (source
._mfCurveControlPoints
),
1233 _mfKnots (source
._mfKnots
),
1234 _mfCurvesPerLoop (source
._mfCurvesPerLoop
),
1235 _sfIsDelaunay (source
._sfIsDelaunay
),
1236 _sfTextureControlPoints (this,
1237 TextureControlPointsFieldId
,
1238 GeoVectorProperty::ParentsFieldId
),
1239 _sfDirtyMask (source
._sfDirtyMask
),
1240 _sfSurfaceGLId (source
._sfSurfaceGLId
)
1245 /*-------------------------- destructors ----------------------------------*/
1247 SurfaceBase::~SurfaceBase(void)
1251 /*-------------------------------------------------------------------------*/
1254 bool SurfaceBase::unlinkChild(
1255 FieldContainer
* const pChild
,
1256 UInt16
const childFieldId
)
1258 if(childFieldId
== ControlPointsFieldId
)
1260 GeoVectorProperty
* pTypedChild
=
1261 dynamic_cast<GeoVectorProperty
*>(pChild
);
1263 if(pTypedChild
!= NULL
)
1265 if(_sfControlPoints
.getValue() == pTypedChild
)
1267 editSField(ControlPointsFieldMask
);
1269 _sfControlPoints
.setValue(NULL
);
1274 SWARNING
<< "Parent ([" << this
1275 << "] id [" << this->getId()
1276 << "] type [" << this->getType().getCName()
1277 << "] childFieldId [" << childFieldId
1278 << "]) - Child ([" << pChild
1279 << "] id [" << pChild
->getId()
1280 << "] type [" << pChild
->getType().getCName()
1281 << "]): link inconsistent!"
1290 if(childFieldId
== TextureControlPointsFieldId
)
1292 GeoVectorProperty
* pTypedChild
=
1293 dynamic_cast<GeoVectorProperty
*>(pChild
);
1295 if(pTypedChild
!= NULL
)
1297 if(_sfTextureControlPoints
.getValue() == pTypedChild
)
1299 editSField(TextureControlPointsFieldMask
);
1301 _sfTextureControlPoints
.setValue(NULL
);
1306 SWARNING
<< "Parent ([" << this
1307 << "] id [" << this->getId()
1308 << "] type [" << this->getType().getCName()
1309 << "] childFieldId [" << childFieldId
1310 << "]) - Child ([" << pChild
1311 << "] id [" << pChild
->getId()
1312 << "] type [" << pChild
->getType().getCName()
1313 << "]): link inconsistent!"
1323 return Inherited::unlinkChild(pChild
, childFieldId
);
1326 void SurfaceBase::onCreate(const Surface
*source
)
1328 Inherited::onCreate(source
);
1332 Surface
*pThis
= static_cast<Surface
*>(this);
1334 pThis
->setControlPoints(source
->getControlPoints());
1336 pThis
->setTextureControlPoints(source
->getTextureControlPoints());
1340 GetFieldHandlePtr
SurfaceBase::getHandleDimU (void) const
1342 SFUInt32::GetHandlePtr
returnValue(
1343 new SFUInt32::GetHandle(
1345 this->getType().getFieldDesc(DimUFieldId
),
1346 const_cast<SurfaceBase
*>(this)));
1351 EditFieldHandlePtr
SurfaceBase::editHandleDimU (void)
1353 SFUInt32::EditHandlePtr
returnValue(
1354 new SFUInt32::EditHandle(
1356 this->getType().getFieldDesc(DimUFieldId
),
1360 editSField(DimUFieldMask
);
1365 GetFieldHandlePtr
SurfaceBase::getHandleDimV (void) const
1367 SFUInt32::GetHandlePtr
returnValue(
1368 new SFUInt32::GetHandle(
1370 this->getType().getFieldDesc(DimVFieldId
),
1371 const_cast<SurfaceBase
*>(this)));
1376 EditFieldHandlePtr
SurfaceBase::editHandleDimV (void)
1378 SFUInt32::EditHandlePtr
returnValue(
1379 new SFUInt32::EditHandle(
1381 this->getType().getFieldDesc(DimVFieldId
),
1385 editSField(DimVFieldMask
);
1390 GetFieldHandlePtr
SurfaceBase::getHandleKnotsU (void) const
1392 MFReal32::GetHandlePtr
returnValue(
1393 new MFReal32::GetHandle(
1395 this->getType().getFieldDesc(KnotsUFieldId
),
1396 const_cast<SurfaceBase
*>(this)));
1401 EditFieldHandlePtr
SurfaceBase::editHandleKnotsU (void)
1403 MFReal32::EditHandlePtr
returnValue(
1404 new MFReal32::EditHandle(
1406 this->getType().getFieldDesc(KnotsUFieldId
),
1410 editMField(KnotsUFieldMask
, _mfKnotsU
);
1415 GetFieldHandlePtr
SurfaceBase::getHandleKnotsV (void) const
1417 MFReal32::GetHandlePtr
returnValue(
1418 new MFReal32::GetHandle(
1420 this->getType().getFieldDesc(KnotsVFieldId
),
1421 const_cast<SurfaceBase
*>(this)));
1426 EditFieldHandlePtr
SurfaceBase::editHandleKnotsV (void)
1428 MFReal32::EditHandlePtr
returnValue(
1429 new MFReal32::EditHandle(
1431 this->getType().getFieldDesc(KnotsVFieldId
),
1435 editMField(KnotsVFieldMask
, _mfKnotsV
);
1440 GetFieldHandlePtr
SurfaceBase::getHandleControlPoints (void) const
1442 SFUnrecChildGeoVectorPropertyPtr::GetHandlePtr
returnValue(
1443 new SFUnrecChildGeoVectorPropertyPtr::GetHandle(
1445 this->getType().getFieldDesc(ControlPointsFieldId
),
1446 const_cast<SurfaceBase
*>(this)));
1451 EditFieldHandlePtr
SurfaceBase::editHandleControlPoints (void)
1453 SFUnrecChildGeoVectorPropertyPtr::EditHandlePtr
returnValue(
1454 new SFUnrecChildGeoVectorPropertyPtr::EditHandle(
1456 this->getType().getFieldDesc(ControlPointsFieldId
),
1459 returnValue
->setSetMethod(
1460 boost::bind(&Surface::setControlPoints
,
1461 static_cast<Surface
*>(this), _1
));
1463 editSField(ControlPointsFieldMask
);
1468 GetFieldHandlePtr
SurfaceBase::getHandleError (void) const
1470 SFReal32::GetHandlePtr
returnValue(
1471 new SFReal32::GetHandle(
1473 this->getType().getFieldDesc(ErrorFieldId
),
1474 const_cast<SurfaceBase
*>(this)));
1479 EditFieldHandlePtr
SurfaceBase::editHandleError (void)
1481 SFReal32::EditHandlePtr
returnValue(
1482 new SFReal32::EditHandle(
1484 this->getType().getFieldDesc(ErrorFieldId
),
1488 editSField(ErrorFieldMask
);
1493 GetFieldHandlePtr
SurfaceBase::getHandleNumCurves (void) const
1495 SFUInt32::GetHandlePtr
returnValue(
1496 new SFUInt32::GetHandle(
1498 this->getType().getFieldDesc(NumCurvesFieldId
),
1499 const_cast<SurfaceBase
*>(this)));
1504 EditFieldHandlePtr
SurfaceBase::editHandleNumCurves (void)
1506 SFUInt32::EditHandlePtr
returnValue(
1507 new SFUInt32::EditHandle(
1509 this->getType().getFieldDesc(NumCurvesFieldId
),
1513 editSField(NumCurvesFieldMask
);
1518 GetFieldHandlePtr
SurfaceBase::getHandleKnotLengths (void) const
1520 MFUInt32::GetHandlePtr
returnValue(
1521 new MFUInt32::GetHandle(
1523 this->getType().getFieldDesc(KnotLengthsFieldId
),
1524 const_cast<SurfaceBase
*>(this)));
1529 EditFieldHandlePtr
SurfaceBase::editHandleKnotLengths (void)
1531 MFUInt32::EditHandlePtr
returnValue(
1532 new MFUInt32::EditHandle(
1534 this->getType().getFieldDesc(KnotLengthsFieldId
),
1538 editMField(KnotLengthsFieldMask
, _mfKnotLengths
);
1543 GetFieldHandlePtr
SurfaceBase::getHandleDimensions (void) const
1545 MFUInt32::GetHandlePtr
returnValue(
1546 new MFUInt32::GetHandle(
1548 this->getType().getFieldDesc(DimensionsFieldId
),
1549 const_cast<SurfaceBase
*>(this)));
1554 EditFieldHandlePtr
SurfaceBase::editHandleDimensions (void)
1556 MFUInt32::EditHandlePtr
returnValue(
1557 new MFUInt32::EditHandle(
1559 this->getType().getFieldDesc(DimensionsFieldId
),
1563 editMField(DimensionsFieldMask
, _mfDimensions
);
1568 GetFieldHandlePtr
SurfaceBase::getHandleCurveControlPoints (void) const
1570 MFPnt3f::GetHandlePtr
returnValue(
1571 new MFPnt3f::GetHandle(
1572 &_mfCurveControlPoints
,
1573 this->getType().getFieldDesc(CurveControlPointsFieldId
),
1574 const_cast<SurfaceBase
*>(this)));
1579 EditFieldHandlePtr
SurfaceBase::editHandleCurveControlPoints(void)
1581 MFPnt3f::EditHandlePtr
returnValue(
1582 new MFPnt3f::EditHandle(
1583 &_mfCurveControlPoints
,
1584 this->getType().getFieldDesc(CurveControlPointsFieldId
),
1588 editMField(CurveControlPointsFieldMask
, _mfCurveControlPoints
);
1593 GetFieldHandlePtr
SurfaceBase::getHandleKnots (void) const
1595 MFReal32::GetHandlePtr
returnValue(
1596 new MFReal32::GetHandle(
1598 this->getType().getFieldDesc(KnotsFieldId
),
1599 const_cast<SurfaceBase
*>(this)));
1604 EditFieldHandlePtr
SurfaceBase::editHandleKnots (void)
1606 MFReal32::EditHandlePtr
returnValue(
1607 new MFReal32::EditHandle(
1609 this->getType().getFieldDesc(KnotsFieldId
),
1613 editMField(KnotsFieldMask
, _mfKnots
);
1618 GetFieldHandlePtr
SurfaceBase::getHandleCurvesPerLoop (void) const
1620 MFUInt32::GetHandlePtr
returnValue(
1621 new MFUInt32::GetHandle(
1623 this->getType().getFieldDesc(CurvesPerLoopFieldId
),
1624 const_cast<SurfaceBase
*>(this)));
1629 EditFieldHandlePtr
SurfaceBase::editHandleCurvesPerLoop (void)
1631 MFUInt32::EditHandlePtr
returnValue(
1632 new MFUInt32::EditHandle(
1634 this->getType().getFieldDesc(CurvesPerLoopFieldId
),
1638 editMField(CurvesPerLoopFieldMask
, _mfCurvesPerLoop
);
1643 GetFieldHandlePtr
SurfaceBase::getHandleIsDelaunay (void) const
1645 SFBool::GetHandlePtr
returnValue(
1646 new SFBool::GetHandle(
1648 this->getType().getFieldDesc(IsDelaunayFieldId
),
1649 const_cast<SurfaceBase
*>(this)));
1654 EditFieldHandlePtr
SurfaceBase::editHandleIsDelaunay (void)
1656 SFBool::EditHandlePtr
returnValue(
1657 new SFBool::EditHandle(
1659 this->getType().getFieldDesc(IsDelaunayFieldId
),
1663 editSField(IsDelaunayFieldMask
);
1668 GetFieldHandlePtr
SurfaceBase::getHandleTextureControlPoints (void) const
1670 SFUnrecChildGeoVectorPropertyPtr::GetHandlePtr
returnValue(
1671 new SFUnrecChildGeoVectorPropertyPtr::GetHandle(
1672 &_sfTextureControlPoints
,
1673 this->getType().getFieldDesc(TextureControlPointsFieldId
),
1674 const_cast<SurfaceBase
*>(this)));
1679 EditFieldHandlePtr
SurfaceBase::editHandleTextureControlPoints(void)
1681 SFUnrecChildGeoVectorPropertyPtr::EditHandlePtr
returnValue(
1682 new SFUnrecChildGeoVectorPropertyPtr::EditHandle(
1683 &_sfTextureControlPoints
,
1684 this->getType().getFieldDesc(TextureControlPointsFieldId
),
1687 returnValue
->setSetMethod(
1688 boost::bind(&Surface::setTextureControlPoints
,
1689 static_cast<Surface
*>(this), _1
));
1691 editSField(TextureControlPointsFieldMask
);
1696 GetFieldHandlePtr
SurfaceBase::getHandleDirtyMask (void) const
1698 SFUInt32::GetHandlePtr
returnValue(
1699 new SFUInt32::GetHandle(
1701 this->getType().getFieldDesc(DirtyMaskFieldId
),
1702 const_cast<SurfaceBase
*>(this)));
1707 EditFieldHandlePtr
SurfaceBase::editHandleDirtyMask (void)
1709 SFUInt32::EditHandlePtr
returnValue(
1710 new SFUInt32::EditHandle(
1712 this->getType().getFieldDesc(DirtyMaskFieldId
),
1716 editSField(DirtyMaskFieldMask
);
1721 GetFieldHandlePtr
SurfaceBase::getHandleSurfaceGLId (void) const
1723 SFInt32::GetHandlePtr
returnValue(
1724 new SFInt32::GetHandle(
1726 this->getType().getFieldDesc(SurfaceGLIdFieldId
),
1727 const_cast<SurfaceBase
*>(this)));
1732 EditFieldHandlePtr
SurfaceBase::editHandleSurfaceGLId (void)
1734 SFInt32::EditHandlePtr
returnValue(
1735 new SFInt32::EditHandle(
1737 this->getType().getFieldDesc(SurfaceGLIdFieldId
),
1741 editSField(SurfaceGLIdFieldMask
);
1747 #ifdef OSG_MT_CPTR_ASPECT
1748 void SurfaceBase::execSyncV( FieldContainer
&oFrom
,
1749 ConstFieldMaskArg whichField
,
1750 AspectOffsetStore
&oOffsets
,
1751 ConstFieldMaskArg syncMode
,
1752 const UInt32 uiSyncInfo
)
1754 Surface
*pThis
= static_cast<Surface
*>(this);
1756 pThis
->execSync(static_cast<Surface
*>(&oFrom
),
1765 #ifdef OSG_MT_CPTR_ASPECT
1766 FieldContainer
*SurfaceBase::createAspectCopy(
1767 const FieldContainer
*pRefAspect
) const
1769 Surface
*returnValue
;
1771 newAspectCopy(returnValue
,
1772 dynamic_cast<const Surface
*>(pRefAspect
),
1773 dynamic_cast<const Surface
*>(this));
1779 void SurfaceBase::resolveLinks(void)
1781 Inherited::resolveLinks();
1783 static_cast<Surface
*>(this)->setControlPoints(NULL
);
1785 static_cast<Surface
*>(this)->setTextureControlPoints(NULL
);
1787 #ifdef OSG_MT_CPTR_ASPECT
1788 AspectOffsetStore oOffsets
;
1790 _pAspectStore
->fillOffsetArray(oOffsets
, this);
1793 #ifdef OSG_MT_CPTR_ASPECT
1794 _mfKnotsU
.terminateShare(Thread::getCurrentAspect(),
1797 #ifdef OSG_MT_CPTR_ASPECT
1798 _mfKnotsV
.terminateShare(Thread::getCurrentAspect(),
1801 #ifdef OSG_MT_CPTR_ASPECT
1802 _mfKnotLengths
.terminateShare(Thread::getCurrentAspect(),
1805 #ifdef OSG_MT_CPTR_ASPECT
1806 _mfDimensions
.terminateShare(Thread::getCurrentAspect(),
1809 #ifdef OSG_MT_CPTR_ASPECT
1810 _mfCurveControlPoints
.terminateShare(Thread::getCurrentAspect(),
1813 #ifdef OSG_MT_CPTR_ASPECT
1814 _mfKnots
.terminateShare(Thread::getCurrentAspect(),
1817 #ifdef OSG_MT_CPTR_ASPECT
1818 _mfCurvesPerLoop
.terminateShare(Thread::getCurrentAspect(),