changed: gcc8 base update
[opensg.git] / Source / System / NodeCores / Drawables / Nurbs / OSGSurfaceBase.cpp
blob270b3704125c82b606e059af944c37e0e66ec04c
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 Surface!
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #ifdef WIN32
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
59 #endif
61 #include "OSGConfig.h"
65 #include "OSGGeoVectorProperty.h" // ControlPoints Class
67 #include "OSGSurfaceBase.h"
68 #include "OSGSurface.h"
70 #include <boost/bind.hpp>
72 OSG_BEGIN_NAMESPACE
74 /***************************************************************************\
75 * Description *
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(
162 "SurfacePtr",
163 "GeometryPtr",
164 Surface::getClassType(),
165 nsOSG);
166 #endif
168 OSG_FIELDTRAITS_GETTYPE_NS(Surface *, nsOSG)
170 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
171 Surface *,
172 nsOSG)
174 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
175 Surface *,
176 nsOSG)
178 /***************************************************************************\
179 * Field Description *
180 \***************************************************************************/
182 void SurfaceBase::classDescInserter(TypeObject &oType)
184 FieldDescriptionBase *pDesc = NULL;
187 pDesc = new SFUInt32::Description(
188 SFUInt32::getClassType(),
189 "dimU",
190 "The surface dimension in U\n",
191 DimUFieldId, DimUFieldMask,
192 false,
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(),
201 "dimV",
202 "The surface dimension in V\n",
203 DimVFieldId, DimVFieldMask,
204 false,
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(),
213 "knotsU",
214 "The surface knots in U direction\n",
215 KnotsUFieldId, KnotsUFieldMask,
216 false,
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(),
225 "knotsV",
226 "The surface knots in V direction\n",
227 KnotsVFieldId, KnotsVFieldMask,
228 false,
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(),
237 "controlPoints",
238 "The control points for the surface\n",
239 ControlPointsFieldId, ControlPointsFieldMask,
240 false,
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(),
249 "error",
250 "The approximation error for the tessellation\n",
251 ErrorFieldId, ErrorFieldMask,
252 false,
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(),
261 "numCurves",
262 "The number of trimming curves\n",
263 NumCurvesFieldId, NumCurvesFieldMask,
264 false,
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(),
273 "knotLengths",
274 "The knotlengths for the trimming curves\n",
275 KnotLengthsFieldId, KnotLengthsFieldMask,
276 false,
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(),
285 "dimensions",
286 "The dimensions for the trimming curves\n",
287 DimensionsFieldId, DimensionsFieldMask,
288 false,
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,
300 false,
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(),
309 "knots",
310 "The knotvectors for the trimming curves\n",
311 KnotsFieldId, KnotsFieldMask,
312 false,
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(),
321 "curvesPerLoop",
322 "Specifies the number of trimming curves in each trimming curve loop\n",
323 CurvesPerLoopFieldId, CurvesPerLoopFieldMask,
324 false,
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(),
333 "isDelaunay",
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,
339 false,
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,
351 false,
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(),
360 "dirtyMask",
362 DirtyMaskFieldId, DirtyMaskFieldMask,
363 false,
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(),
372 "surfaceGLId",
373 "Surface GL Id, internal use.\n",
374 SurfaceGLIdFieldId, SurfaceGLIdFieldMask,
375 true,
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(),
387 "NULL",
388 nsOSG, //Namespace
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)),
394 false,
396 "<?xml version=\"1.0\"?>\n"
397 "\n"
398 "<FieldContainer\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"
409 " >\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"
413 " <Field\n"
414 " name=\"dimU\"\n"
415 " type=\"UInt32\"\n"
416 " cardinality=\"single\"\n"
417 " visibility=\"external\"\n"
418 " defaultValue=\"0\"\n"
419 " access=\"public\"\n"
420 " >\n"
421 " The surface dimension in U\n"
422 " </Field>\n"
423 " <Field\n"
424 " name=\"dimV\"\n"
425 " type=\"UInt32\"\n"
426 " cardinality=\"single\"\n"
427 " visibility=\"external\"\n"
428 " defaultValue=\"0\"\n"
429 " access=\"public\"\n"
430 " >\n"
431 " The surface dimension in V\n"
432 " </Field>\n"
433 " <Field\n"
434 " name=\"knotsU\"\n"
435 " type=\"Real32\"\n"
436 " cardinality=\"multi\"\n"
437 " visibility=\"external\"\n"
438 " access=\"public\"\n"
439 " >\n"
440 " The surface knots in U direction\n"
441 " </Field>\n"
442 " <Field\n"
443 " name=\"knotsV\"\n"
444 " type=\"Real32\"\n"
445 " cardinality=\"multi\"\n"
446 " visibility=\"external\"\n"
447 " access=\"public\"\n"
448 " >\n"
449 " The surface knots in V direction\n"
450 " </Field>\n"
451 " <Field\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"
460 " >\n"
461 " The control points for the surface\n"
462 " </Field>\n"
463 " <Field\n"
464 " name=\"error\"\n"
465 " type=\"Real32\"\n"
466 " cardinality=\"single\"\n"
467 " visibility=\"external\"\n"
468 " defaultValue=\"0.5\"\n"
469 " access=\"public\"\n"
470 " >\n"
471 " The approximation error for the tessellation\n"
472 " </Field>\n"
473 " <Field\n"
474 " name=\"numCurves\"\n"
475 " type=\"UInt32\"\n"
476 " cardinality=\"single\"\n"
477 " visibility=\"external\"\n"
478 " defaultValue=\"0\"\n"
479 " access=\"protected\"\n"
480 " >\n"
481 " The number of trimming curves\n"
482 " </Field>\n"
483 " <Field\n"
484 " name=\"knotLengths\"\n"
485 " type=\"UInt32\"\n"
486 " cardinality=\"multi\"\n"
487 " visibility=\"external\"\n"
488 " access=\"protected\"\n"
489 " >\n"
490 " The knotlengths for the trimming curves\n"
491 " </Field>\n"
492 " <Field\n"
493 " name=\"dimensions\"\n"
494 " type=\"UInt32\"\n"
495 " cardinality=\"multi\"\n"
496 " visibility=\"external\"\n"
497 " access=\"protected\"\n"
498 " >\n"
499 " The dimensions for the trimming curves\n"
500 " </Field>\n"
501 " <Field\n"
502 " name=\"curveControlPoints\"\n"
503 " type=\"Pnt3f\"\n"
504 " cardinality=\"multi\"\n"
505 " visibility=\"external\"\n"
506 " access=\"protected\"\n"
507 " >\n"
508 " The control points for the trimming curves\n"
509 " </Field>\n"
510 " <Field\n"
511 " name=\"knots\"\n"
512 " type=\"Real32\"\n"
513 " cardinality=\"multi\"\n"
514 " visibility=\"external\"\n"
515 " access=\"protected\"\n"
516 " >\n"
517 " The knotvectors for the trimming curves\n"
518 " </Field>\n"
519 " <Field\n"
520 " name=\"curvesPerLoop\"\n"
521 " type=\"UInt32\"\n"
522 " cardinality=\"multi\"\n"
523 " visibility=\"external\"\n"
524 " access=\"protected\"\n"
525 " >\n"
526 " Specifies the number of trimming curves in each trimming curve loop\n"
527 " </Field>\n"
528 " <Field\n"
529 " name=\"isDelaunay\"\n"
530 " type=\"bool\"\n"
531 " cardinality=\"single\"\n"
532 " visibility=\"external\"\n"
533 " defaultValue=\"false\"\n"
534 " access=\"public\"\n"
535 " >\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"
540 " </Field>\n"
541 " <Field\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"
550 " >\n"
551 " The control points for textures (always 2D)\n"
552 " </Field>\n"
553 " <Field\n"
554 " name=\"dirtyMask\"\n"
555 " type=\"UInt32\"\n"
556 " cardinality=\"single\"\n"
557 " visibility=\"external\"\n"
558 " defaultValue=\"0\"\n"
559 " access=\"protected\"\n"
560 " >\n"
561 " </Field>\n"
562 " <Field\n"
563 " name=\"surfaceGLId\"\n"
564 " type=\"Int32\"\n"
565 " cardinality=\"single\"\n"
566 " visibility=\"internal\"\n"
567 " defaultValue=\"0\"\n"
568 " access=\"protected\"\n"
569 " fieldFlags=\"FClusterLocal\"\n"
570 " >\n"
571 " Surface GL Id, internal use.\n"
572 " </Field>\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)
583 return _type;
586 const FieldContainerType &SurfaceBase::getType(void) const
588 return _type;
591 UInt32 SurfaceBase::getContainerSize(void) const
593 return sizeof(Surface);
596 /*------------------------- decorator get ------------------------------*/
599 SFUInt32 *SurfaceBase::editSFDimU(void)
601 editSField(DimUFieldMask);
603 return &_sfDimU;
606 const SFUInt32 *SurfaceBase::getSFDimU(void) const
608 return &_sfDimU;
612 SFUInt32 *SurfaceBase::editSFDimV(void)
614 editSField(DimVFieldMask);
616 return &_sfDimV;
619 const SFUInt32 *SurfaceBase::getSFDimV(void) const
621 return &_sfDimV;
625 MFReal32 *SurfaceBase::editMFKnotsU(void)
627 editMField(KnotsUFieldMask, _mfKnotsU);
629 return &_mfKnotsU;
632 const MFReal32 *SurfaceBase::getMFKnotsU(void) const
634 return &_mfKnotsU;
638 MFReal32 *SurfaceBase::editMFKnotsV(void)
640 editMField(KnotsVFieldMask, _mfKnotsV);
642 return &_mfKnotsV;
645 const MFReal32 *SurfaceBase::getMFKnotsV(void) const
647 return &_mfKnotsV;
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);
683 return &_sfError;
686 const SFReal32 *SurfaceBase::getSFError(void) const
688 return &_sfError;
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);
748 return &_mfKnots;
751 const MFReal32 *SurfaceBase::getMFKnots(void) const
753 return &_mfKnots;
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();
912 return returnValue;
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);
1086 return fc;
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);
1102 return fc;
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);
1118 return fc;
1121 Surface *SurfaceBase::createEmptyLocal(BitVector bFlags)
1123 Surface *returnValue;
1125 newPtr<Surface>(returnValue, bFlags);
1127 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
1129 return returnValue;
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();
1142 return returnValue;
1146 FieldContainerTransitPtr SurfaceBase::shallowCopyLocal(
1147 BitVector bFlags) const
1149 Surface *tmpPtr;
1151 newPtr(tmpPtr, dynamic_cast<const Surface *>(this), bFlags);
1153 FieldContainerTransitPtr returnValue(tmpPtr);
1155 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
1157 return returnValue;
1160 FieldContainerTransitPtr SurfaceBase::shallowCopyDependent(
1161 BitVector bFlags) const
1163 Surface *tmpPtr;
1165 newPtr(tmpPtr, dynamic_cast<const Surface *>(this), ~bFlags);
1167 FieldContainerTransitPtr returnValue(tmpPtr);
1169 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
1171 return returnValue;
1174 FieldContainerTransitPtr SurfaceBase::shallowCopy(void) const
1176 Surface *tmpPtr;
1178 newPtr(tmpPtr,
1179 dynamic_cast<const Surface *>(this),
1180 Thread::getCurrentLocalFlags());
1182 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
1184 FieldContainerTransitPtr returnValue(tmpPtr);
1186 return returnValue;
1192 /*------------------------- constructors ----------------------------------*/
1194 SurfaceBase::SurfaceBase(void) :
1195 Inherited(),
1196 _sfDimU (UInt32(0)),
1197 _sfDimV (UInt32(0)),
1198 _mfKnotsU (),
1199 _mfKnotsV (),
1200 _sfControlPoints (this,
1201 ControlPointsFieldId,
1202 GeoVectorProperty::ParentsFieldId),
1203 _sfError (Real32(0.5)),
1204 _sfNumCurves (UInt32(0)),
1205 _mfKnotLengths (),
1206 _mfDimensions (),
1207 _mfCurveControlPoints (),
1208 _mfKnots (),
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) :
1220 Inherited(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 /*-------------------------------------------------------------------------*/
1252 /* Child linking */
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);
1271 return true;
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!"
1282 << std::endl;
1284 return false;
1287 return false;
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);
1303 return true;
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!"
1314 << std::endl;
1316 return false;
1319 return false;
1323 return Inherited::unlinkChild(pChild, childFieldId);
1326 void SurfaceBase::onCreate(const Surface *source)
1328 Inherited::onCreate(source);
1330 if(source != NULL)
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(
1344 &_sfDimU,
1345 this->getType().getFieldDesc(DimUFieldId),
1346 const_cast<SurfaceBase *>(this)));
1348 return returnValue;
1351 EditFieldHandlePtr SurfaceBase::editHandleDimU (void)
1353 SFUInt32::EditHandlePtr returnValue(
1354 new SFUInt32::EditHandle(
1355 &_sfDimU,
1356 this->getType().getFieldDesc(DimUFieldId),
1357 this));
1360 editSField(DimUFieldMask);
1362 return returnValue;
1365 GetFieldHandlePtr SurfaceBase::getHandleDimV (void) const
1367 SFUInt32::GetHandlePtr returnValue(
1368 new SFUInt32::GetHandle(
1369 &_sfDimV,
1370 this->getType().getFieldDesc(DimVFieldId),
1371 const_cast<SurfaceBase *>(this)));
1373 return returnValue;
1376 EditFieldHandlePtr SurfaceBase::editHandleDimV (void)
1378 SFUInt32::EditHandlePtr returnValue(
1379 new SFUInt32::EditHandle(
1380 &_sfDimV,
1381 this->getType().getFieldDesc(DimVFieldId),
1382 this));
1385 editSField(DimVFieldMask);
1387 return returnValue;
1390 GetFieldHandlePtr SurfaceBase::getHandleKnotsU (void) const
1392 MFReal32::GetHandlePtr returnValue(
1393 new MFReal32::GetHandle(
1394 &_mfKnotsU,
1395 this->getType().getFieldDesc(KnotsUFieldId),
1396 const_cast<SurfaceBase *>(this)));
1398 return returnValue;
1401 EditFieldHandlePtr SurfaceBase::editHandleKnotsU (void)
1403 MFReal32::EditHandlePtr returnValue(
1404 new MFReal32::EditHandle(
1405 &_mfKnotsU,
1406 this->getType().getFieldDesc(KnotsUFieldId),
1407 this));
1410 editMField(KnotsUFieldMask, _mfKnotsU);
1412 return returnValue;
1415 GetFieldHandlePtr SurfaceBase::getHandleKnotsV (void) const
1417 MFReal32::GetHandlePtr returnValue(
1418 new MFReal32::GetHandle(
1419 &_mfKnotsV,
1420 this->getType().getFieldDesc(KnotsVFieldId),
1421 const_cast<SurfaceBase *>(this)));
1423 return returnValue;
1426 EditFieldHandlePtr SurfaceBase::editHandleKnotsV (void)
1428 MFReal32::EditHandlePtr returnValue(
1429 new MFReal32::EditHandle(
1430 &_mfKnotsV,
1431 this->getType().getFieldDesc(KnotsVFieldId),
1432 this));
1435 editMField(KnotsVFieldMask, _mfKnotsV);
1437 return returnValue;
1440 GetFieldHandlePtr SurfaceBase::getHandleControlPoints (void) const
1442 SFUnrecChildGeoVectorPropertyPtr::GetHandlePtr returnValue(
1443 new SFUnrecChildGeoVectorPropertyPtr::GetHandle(
1444 &_sfControlPoints,
1445 this->getType().getFieldDesc(ControlPointsFieldId),
1446 const_cast<SurfaceBase *>(this)));
1448 return returnValue;
1451 EditFieldHandlePtr SurfaceBase::editHandleControlPoints (void)
1453 SFUnrecChildGeoVectorPropertyPtr::EditHandlePtr returnValue(
1454 new SFUnrecChildGeoVectorPropertyPtr::EditHandle(
1455 &_sfControlPoints,
1456 this->getType().getFieldDesc(ControlPointsFieldId),
1457 this));
1459 returnValue->setSetMethod(
1460 boost::bind(&Surface::setControlPoints,
1461 static_cast<Surface *>(this), _1));
1463 editSField(ControlPointsFieldMask);
1465 return returnValue;
1468 GetFieldHandlePtr SurfaceBase::getHandleError (void) const
1470 SFReal32::GetHandlePtr returnValue(
1471 new SFReal32::GetHandle(
1472 &_sfError,
1473 this->getType().getFieldDesc(ErrorFieldId),
1474 const_cast<SurfaceBase *>(this)));
1476 return returnValue;
1479 EditFieldHandlePtr SurfaceBase::editHandleError (void)
1481 SFReal32::EditHandlePtr returnValue(
1482 new SFReal32::EditHandle(
1483 &_sfError,
1484 this->getType().getFieldDesc(ErrorFieldId),
1485 this));
1488 editSField(ErrorFieldMask);
1490 return returnValue;
1493 GetFieldHandlePtr SurfaceBase::getHandleNumCurves (void) const
1495 SFUInt32::GetHandlePtr returnValue(
1496 new SFUInt32::GetHandle(
1497 &_sfNumCurves,
1498 this->getType().getFieldDesc(NumCurvesFieldId),
1499 const_cast<SurfaceBase *>(this)));
1501 return returnValue;
1504 EditFieldHandlePtr SurfaceBase::editHandleNumCurves (void)
1506 SFUInt32::EditHandlePtr returnValue(
1507 new SFUInt32::EditHandle(
1508 &_sfNumCurves,
1509 this->getType().getFieldDesc(NumCurvesFieldId),
1510 this));
1513 editSField(NumCurvesFieldMask);
1515 return returnValue;
1518 GetFieldHandlePtr SurfaceBase::getHandleKnotLengths (void) const
1520 MFUInt32::GetHandlePtr returnValue(
1521 new MFUInt32::GetHandle(
1522 &_mfKnotLengths,
1523 this->getType().getFieldDesc(KnotLengthsFieldId),
1524 const_cast<SurfaceBase *>(this)));
1526 return returnValue;
1529 EditFieldHandlePtr SurfaceBase::editHandleKnotLengths (void)
1531 MFUInt32::EditHandlePtr returnValue(
1532 new MFUInt32::EditHandle(
1533 &_mfKnotLengths,
1534 this->getType().getFieldDesc(KnotLengthsFieldId),
1535 this));
1538 editMField(KnotLengthsFieldMask, _mfKnotLengths);
1540 return returnValue;
1543 GetFieldHandlePtr SurfaceBase::getHandleDimensions (void) const
1545 MFUInt32::GetHandlePtr returnValue(
1546 new MFUInt32::GetHandle(
1547 &_mfDimensions,
1548 this->getType().getFieldDesc(DimensionsFieldId),
1549 const_cast<SurfaceBase *>(this)));
1551 return returnValue;
1554 EditFieldHandlePtr SurfaceBase::editHandleDimensions (void)
1556 MFUInt32::EditHandlePtr returnValue(
1557 new MFUInt32::EditHandle(
1558 &_mfDimensions,
1559 this->getType().getFieldDesc(DimensionsFieldId),
1560 this));
1563 editMField(DimensionsFieldMask, _mfDimensions);
1565 return returnValue;
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)));
1576 return returnValue;
1579 EditFieldHandlePtr SurfaceBase::editHandleCurveControlPoints(void)
1581 MFPnt3f::EditHandlePtr returnValue(
1582 new MFPnt3f::EditHandle(
1583 &_mfCurveControlPoints,
1584 this->getType().getFieldDesc(CurveControlPointsFieldId),
1585 this));
1588 editMField(CurveControlPointsFieldMask, _mfCurveControlPoints);
1590 return returnValue;
1593 GetFieldHandlePtr SurfaceBase::getHandleKnots (void) const
1595 MFReal32::GetHandlePtr returnValue(
1596 new MFReal32::GetHandle(
1597 &_mfKnots,
1598 this->getType().getFieldDesc(KnotsFieldId),
1599 const_cast<SurfaceBase *>(this)));
1601 return returnValue;
1604 EditFieldHandlePtr SurfaceBase::editHandleKnots (void)
1606 MFReal32::EditHandlePtr returnValue(
1607 new MFReal32::EditHandle(
1608 &_mfKnots,
1609 this->getType().getFieldDesc(KnotsFieldId),
1610 this));
1613 editMField(KnotsFieldMask, _mfKnots);
1615 return returnValue;
1618 GetFieldHandlePtr SurfaceBase::getHandleCurvesPerLoop (void) const
1620 MFUInt32::GetHandlePtr returnValue(
1621 new MFUInt32::GetHandle(
1622 &_mfCurvesPerLoop,
1623 this->getType().getFieldDesc(CurvesPerLoopFieldId),
1624 const_cast<SurfaceBase *>(this)));
1626 return returnValue;
1629 EditFieldHandlePtr SurfaceBase::editHandleCurvesPerLoop (void)
1631 MFUInt32::EditHandlePtr returnValue(
1632 new MFUInt32::EditHandle(
1633 &_mfCurvesPerLoop,
1634 this->getType().getFieldDesc(CurvesPerLoopFieldId),
1635 this));
1638 editMField(CurvesPerLoopFieldMask, _mfCurvesPerLoop);
1640 return returnValue;
1643 GetFieldHandlePtr SurfaceBase::getHandleIsDelaunay (void) const
1645 SFBool::GetHandlePtr returnValue(
1646 new SFBool::GetHandle(
1647 &_sfIsDelaunay,
1648 this->getType().getFieldDesc(IsDelaunayFieldId),
1649 const_cast<SurfaceBase *>(this)));
1651 return returnValue;
1654 EditFieldHandlePtr SurfaceBase::editHandleIsDelaunay (void)
1656 SFBool::EditHandlePtr returnValue(
1657 new SFBool::EditHandle(
1658 &_sfIsDelaunay,
1659 this->getType().getFieldDesc(IsDelaunayFieldId),
1660 this));
1663 editSField(IsDelaunayFieldMask);
1665 return returnValue;
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)));
1676 return returnValue;
1679 EditFieldHandlePtr SurfaceBase::editHandleTextureControlPoints(void)
1681 SFUnrecChildGeoVectorPropertyPtr::EditHandlePtr returnValue(
1682 new SFUnrecChildGeoVectorPropertyPtr::EditHandle(
1683 &_sfTextureControlPoints,
1684 this->getType().getFieldDesc(TextureControlPointsFieldId),
1685 this));
1687 returnValue->setSetMethod(
1688 boost::bind(&Surface::setTextureControlPoints,
1689 static_cast<Surface *>(this), _1));
1691 editSField(TextureControlPointsFieldMask);
1693 return returnValue;
1696 GetFieldHandlePtr SurfaceBase::getHandleDirtyMask (void) const
1698 SFUInt32::GetHandlePtr returnValue(
1699 new SFUInt32::GetHandle(
1700 &_sfDirtyMask,
1701 this->getType().getFieldDesc(DirtyMaskFieldId),
1702 const_cast<SurfaceBase *>(this)));
1704 return returnValue;
1707 EditFieldHandlePtr SurfaceBase::editHandleDirtyMask (void)
1709 SFUInt32::EditHandlePtr returnValue(
1710 new SFUInt32::EditHandle(
1711 &_sfDirtyMask,
1712 this->getType().getFieldDesc(DirtyMaskFieldId),
1713 this));
1716 editSField(DirtyMaskFieldMask);
1718 return returnValue;
1721 GetFieldHandlePtr SurfaceBase::getHandleSurfaceGLId (void) const
1723 SFInt32::GetHandlePtr returnValue(
1724 new SFInt32::GetHandle(
1725 &_sfSurfaceGLId,
1726 this->getType().getFieldDesc(SurfaceGLIdFieldId),
1727 const_cast<SurfaceBase *>(this)));
1729 return returnValue;
1732 EditFieldHandlePtr SurfaceBase::editHandleSurfaceGLId (void)
1734 SFInt32::EditHandlePtr returnValue(
1735 new SFInt32::EditHandle(
1736 &_sfSurfaceGLId,
1737 this->getType().getFieldDesc(SurfaceGLIdFieldId),
1738 this));
1741 editSField(SurfaceGLIdFieldMask);
1743 return returnValue;
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),
1757 whichField,
1758 oOffsets,
1759 syncMode,
1760 uiSyncInfo);
1762 #endif
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));
1775 return returnValue;
1777 #endif
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);
1791 #endif
1793 #ifdef OSG_MT_CPTR_ASPECT
1794 _mfKnotsU.terminateShare(Thread::getCurrentAspect(),
1795 oOffsets);
1796 #endif
1797 #ifdef OSG_MT_CPTR_ASPECT
1798 _mfKnotsV.terminateShare(Thread::getCurrentAspect(),
1799 oOffsets);
1800 #endif
1801 #ifdef OSG_MT_CPTR_ASPECT
1802 _mfKnotLengths.terminateShare(Thread::getCurrentAspect(),
1803 oOffsets);
1804 #endif
1805 #ifdef OSG_MT_CPTR_ASPECT
1806 _mfDimensions.terminateShare(Thread::getCurrentAspect(),
1807 oOffsets);
1808 #endif
1809 #ifdef OSG_MT_CPTR_ASPECT
1810 _mfCurveControlPoints.terminateShare(Thread::getCurrentAspect(),
1811 oOffsets);
1812 #endif
1813 #ifdef OSG_MT_CPTR_ASPECT
1814 _mfKnots.terminateShare(Thread::getCurrentAspect(),
1815 oOffsets);
1816 #endif
1817 #ifdef OSG_MT_CPTR_ASPECT
1818 _mfCurvesPerLoop.terminateShare(Thread::getCurrentAspect(),
1819 oOffsets);
1820 #endif
1824 OSG_END_NAMESPACE