changed: gcc8 base update
[opensg.git] / Source / System / NodeCores / Drawables / Geometry / Base / OSGGeometryBase.cpp
blob9afa1eea35d250aec13ed53fc486231ceb6a3b33
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 Geometry!
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 "OSGGeoIntegralProperty.h" // Types Class
66 #include "OSGGeoVectorProperty.h" // Properties Class
68 #include "OSGGeometryBase.h"
69 #include "OSGGeometry.h"
71 #include <boost/bind.hpp>
73 OSG_BEGIN_NAMESPACE
75 /***************************************************************************\
76 * Description *
77 \***************************************************************************/
79 /*! \class OSG::Geometry
83 /***************************************************************************\
84 * Field Documentation *
85 \***************************************************************************/
87 /*! \var GeoIntegralProperty * GeometryBase::_sfTypes
88 The types property contains the primitive's types. Legal values are
89 everything that can be passed to glBegin(). There have to be as many
90 types as lengths.
93 /*! \var GeoIntegralProperty * GeometryBase::_sfLengths
94 The lengths property contains the number of vertices to use for the
95 corresponding primitive. There have to be as many lengths as types.
98 /*! \var GeoVectorProperty * GeometryBase::_mfProperties
99 The attributes used to render the geometry. The order is based on the
100 the one given in ARB_vertex_program.
103 /*! \var GeoIntegralProperty * GeometryBase::_mfPropIndices
104 The indices property contains the index data. See \ref
105 PageSystemGeoIndexing for a description of the indexing options.
108 /*! \var UInt32 GeometryBase::_sfPatchVertices
109 if primitives are patches set the number of vertices per patch. Evaluated
110 if value != 0.
113 /*! \var bool GeometryBase::_sfDlistCache
114 Flag to activate caching the geometry inside a display list.
117 /*! \var bool GeometryBase::_sfUseVAO
118 Flag to activate caching the geometry inside a VAO.
121 /*! \var bool GeometryBase::_sfUseAttribCalls
122 Flag to activate caching the geometry inside a VAO.
125 /*! \var Int32 GeometryBase::_sfClassicGLId
126 The dlist id for the classic rendering mode, if used.
129 /*! \var Int32 GeometryBase::_sfAttGLId
130 The dlist id for the attribute-based rendering mode, if used.
133 /*! \var Int32 GeometryBase::_sfClassicVaoGLId
134 The vao gl id for the attribute-based rendering mode, if used.
137 /*! \var Int32 GeometryBase::_sfAttribVaoGLId
138 The vao gl id for the attribute-based rendering mode, if used.
142 /***************************************************************************\
143 * FieldType/FieldTrait Instantiation *
144 \***************************************************************************/
146 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
147 PointerType FieldTraits<Geometry *, nsOSG>::_type(
148 "GeometryPtr",
149 "MaterialDrawablePtr",
150 Geometry::getClassType(),
151 nsOSG);
152 #endif
154 OSG_FIELDTRAITS_GETTYPE_NS(Geometry *, nsOSG)
156 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
157 Geometry *,
158 nsOSG)
160 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
161 Geometry *,
162 nsOSG)
164 DataType &FieldTraits< Geometry *, nsOSG + 1 >::getType(void)
166 return FieldTraits<Geometry *, nsOSG>::getType();
170 OSG_EXPORT_PTR_SFIELD(ChildPointerSField,
171 Geometry *,
172 UnrecordedRefCountPolicy,
173 nsOSG + 1)
176 OSG_EXPORT_PTR_MFIELD(ChildPointerMField,
177 Geometry *,
178 UnrecordedRefCountPolicy,
179 nsOSG + 1)
182 /***************************************************************************\
183 * Field Description *
184 \***************************************************************************/
186 void GeometryBase::classDescInserter(TypeObject &oType)
188 FieldDescriptionBase *pDesc = NULL;
191 pDesc = new SFUnrecChildGeoIntegralPropertyPtr::Description(
192 SFUnrecChildGeoIntegralPropertyPtr::getClassType(),
193 "types",
194 "The types property contains the primitive's types. Legal values are \n"
195 "everything that can be passed to glBegin(). There have to be as many \n"
196 "types as lengths.\n",
197 TypesFieldId, TypesFieldMask,
198 false,
199 (Field::SFDefaultFlags | Field::FStdAccess),
200 static_cast<FieldEditMethodSig>(&Geometry::editHandleTypes),
201 static_cast<FieldGetMethodSig >(&Geometry::getHandleTypes));
203 oType.addInitialDesc(pDesc);
205 pDesc = new SFUnrecChildGeoIntegralPropertyPtr::Description(
206 SFUnrecChildGeoIntegralPropertyPtr::getClassType(),
207 "lengths",
208 "The lengths property contains the number of vertices to use for the \n"
209 "corresponding primitive. There have to be as many lengths as types.\n",
210 LengthsFieldId, LengthsFieldMask,
211 false,
212 (Field::SFDefaultFlags | Field::FStdAccess),
213 static_cast<FieldEditMethodSig>(&Geometry::editHandleLengths),
214 static_cast<FieldGetMethodSig >(&Geometry::getHandleLengths));
216 oType.addInitialDesc(pDesc);
218 pDesc = new MFUnrecChildGeoVectorPropertyPtr::Description(
219 MFUnrecChildGeoVectorPropertyPtr::getClassType(),
220 "properties",
221 "The attributes used to render the geometry. The order is based on the \n"
222 "the one given in ARB_vertex_program.\n",
223 PropertiesFieldId, PropertiesFieldMask,
224 false,
225 (Field::MFDefaultFlags | Field::FStdAccess),
226 static_cast<FieldEditMethodSig>(&Geometry::editHandleProperties),
227 static_cast<FieldGetMethodSig >(&Geometry::getHandleProperties));
229 oType.addInitialDesc(pDesc);
231 pDesc = new MFUnrecChildGeoIntegralPropertyPtr::Description(
232 MFUnrecChildGeoIntegralPropertyPtr::getClassType(),
233 "propIndices",
234 "The indices property contains the index data. See \\ref \n"
235 "PageSystemGeoIndexing for a description of the indexing options.\n",
236 PropIndicesFieldId, PropIndicesFieldMask,
237 false,
238 (Field::MFDefaultFlags | Field::FStdAccess),
239 static_cast<FieldEditMethodSig>(&Geometry::editHandlePropIndices),
240 static_cast<FieldGetMethodSig >(&Geometry::getHandlePropIndices));
242 oType.addInitialDesc(pDesc);
244 pDesc = new SFUInt32::Description(
245 SFUInt32::getClassType(),
246 "patchVertices",
247 "if primitives are patches set the number of vertices per patch. Evaluated\n"
248 "if value != 0.\n",
249 PatchVerticesFieldId, PatchVerticesFieldMask,
250 false,
251 (Field::SFDefaultFlags | Field::FStdAccess),
252 static_cast<FieldEditMethodSig>(&Geometry::editHandlePatchVertices),
253 static_cast<FieldGetMethodSig >(&Geometry::getHandlePatchVertices));
255 oType.addInitialDesc(pDesc);
257 pDesc = new SFBool::Description(
258 SFBool::getClassType(),
259 "dlistCache",
260 "Flag to activate caching the geometry inside a display list.\n",
261 DlistCacheFieldId, DlistCacheFieldMask,
262 false,
263 (Field::SFDefaultFlags | Field::FStdAccess),
264 static_cast<FieldEditMethodSig>(&Geometry::editHandleDlistCache),
265 static_cast<FieldGetMethodSig >(&Geometry::getHandleDlistCache));
267 oType.addInitialDesc(pDesc);
269 pDesc = new SFBool::Description(
270 SFBool::getClassType(),
271 "useVAO",
272 "Flag to activate caching the geometry inside a VAO.\n",
273 UseVAOFieldId, UseVAOFieldMask,
274 false,
275 (Field::SFDefaultFlags | Field::FStdAccess),
276 static_cast<FieldEditMethodSig>(&Geometry::editHandleUseVAO),
277 static_cast<FieldGetMethodSig >(&Geometry::getHandleUseVAO));
279 oType.addInitialDesc(pDesc);
281 pDesc = new SFBool::Description(
282 SFBool::getClassType(),
283 "useAttribCalls",
284 "Flag to activate caching the geometry inside a VAO.\n",
285 UseAttribCallsFieldId, UseAttribCallsFieldMask,
286 false,
287 (Field::SFDefaultFlags | Field::FStdAccess),
288 static_cast<FieldEditMethodSig>(&Geometry::editHandleUseAttribCalls),
289 static_cast<FieldGetMethodSig >(&Geometry::getHandleUseAttribCalls));
291 oType.addInitialDesc(pDesc);
293 pDesc = new SFInt32::Description(
294 SFInt32::getClassType(),
295 "classicGLId",
296 "The dlist id for the classic rendering mode, if used.\n",
297 ClassicGLIdFieldId, ClassicGLIdFieldMask,
298 true,
299 (Field::FClusterLocal),
300 static_cast<FieldEditMethodSig>(&Geometry::editHandleClassicGLId),
301 static_cast<FieldGetMethodSig >(&Geometry::getHandleClassicGLId));
303 oType.addInitialDesc(pDesc);
305 pDesc = new SFInt32::Description(
306 SFInt32::getClassType(),
307 "attGLId",
308 "The dlist id for the attribute-based rendering mode, if used.\n",
309 AttGLIdFieldId, AttGLIdFieldMask,
310 true,
311 (Field::FClusterLocal),
312 static_cast<FieldEditMethodSig>(&Geometry::editHandleAttGLId),
313 static_cast<FieldGetMethodSig >(&Geometry::getHandleAttGLId));
315 oType.addInitialDesc(pDesc);
317 pDesc = new SFInt32::Description(
318 SFInt32::getClassType(),
319 "classicVaoGLId",
320 "The vao gl id for the attribute-based rendering mode, if used.\n",
321 ClassicVaoGLIdFieldId, ClassicVaoGLIdFieldMask,
322 true,
323 (Field::FClusterLocal),
324 static_cast<FieldEditMethodSig>(&Geometry::editHandleClassicVaoGLId),
325 static_cast<FieldGetMethodSig >(&Geometry::getHandleClassicVaoGLId));
327 oType.addInitialDesc(pDesc);
329 pDesc = new SFInt32::Description(
330 SFInt32::getClassType(),
331 "attribVaoGLId",
332 "The vao gl id for the attribute-based rendering mode, if used.\n",
333 AttribVaoGLIdFieldId, AttribVaoGLIdFieldMask,
334 true,
335 (Field::FClusterLocal),
336 static_cast<FieldEditMethodSig>(&Geometry::editHandleAttribVaoGLId),
337 static_cast<FieldGetMethodSig >(&Geometry::getHandleAttribVaoGLId));
339 oType.addInitialDesc(pDesc);
343 GeometryBase::TypeObject GeometryBase::_type(
344 GeometryBase::getClassname(),
345 Inherited::getClassname(),
346 "NULL",
347 nsOSG, //Namespace
348 reinterpret_cast<PrototypeCreateF>(&GeometryBase::createEmptyLocal),
349 reinterpret_cast<InitContainerF>(&Geometry::initMethod),
350 reinterpret_cast<ExitContainerF>(&Geometry::exitMethod),
351 reinterpret_cast<InitalInsertDescFunc>(
352 reinterpret_cast<void *>(&Geometry::classDescInserter)),
353 false,
355 "<?xml version=\"1.0\"?>\n"
356 "\n"
357 "<FieldContainer\n"
358 " name=\"Geometry\"\n"
359 " parent=\"MaterialDrawable\"\n"
360 " library=\"Drawable\"\n"
361 " pointerfieldtypes=\"both\"\n"
362 " structure=\"concrete\"\n"
363 " systemcomponent=\"true\"\n"
364 " parentsystemcomponent=\"true\"\n"
365 " childFields=\"both\"\n"
366 " decoratable=\"false\"\n"
367 " isNodeCore=\"true\"\n"
368 " docGroupBase=\"GrpDrawablesGeometry\"\n"
369 " >\n"
370 " <Field\n"
371 " name=\"types\"\n"
372 " type=\"GeoIntegralProperty\"\n"
373 " cardinality=\"single\"\n"
374 " visibility=\"external\"\n"
375 " access=\"public\"\n"
376 " category=\"childpointer\"\n"
377 " childParentType=\"FieldContainer\"\n"
378 " linkParentField=\"Parents\"\n"
379 " >\n"
380 " The types property contains the primitive's types. Legal values are \n"
381 " everything that can be passed to glBegin(). There have to be as many \n"
382 " types as lengths.\n"
383 " </Field>\n"
384 " <Field\n"
385 " name=\"lengths\"\n"
386 " type=\"GeoIntegralProperty\"\n"
387 " cardinality=\"single\"\n"
388 " visibility=\"external\"\n"
389 " access=\"public\"\n"
390 " category=\"childpointer\"\n"
391 " childParentType=\"FieldContainer\"\n"
392 " linkParentField=\"Parents\"\n"
393 " >\n"
394 " The lengths property contains the number of vertices to use for the \n"
395 " corresponding primitive. There have to be as many lengths as types.\n"
396 " </Field>\n"
397 " <Field\n"
398 " name=\"properties\"\n"
399 " type=\"GeoVectorProperty\"\n"
400 " cardinality=\"multi\"\n"
401 " visibility=\"external\"\n"
402 " access=\"public\"\n"
403 " category=\"childpointer\"\n"
404 " childParentType=\"FieldContainer\"\n"
405 " linkParentField=\"Parents\"\n"
406 " >\n"
407 " The attributes used to render the geometry. The order is based on the \n"
408 " the one given in ARB_vertex_program.\n"
409 " </Field>\n"
410 " <Field\n"
411 " name=\"propIndices\"\n"
412 " type=\"GeoIntegralProperty\"\n"
413 " cardinality=\"multi\"\n"
414 " visibility=\"external\"\n"
415 " access=\"public\"\n"
416 " category=\"childpointer\"\n"
417 " childParentType=\"FieldContainer\"\n"
418 " linkParentField=\"Parents\"\n"
419 " >\n"
420 " The indices property contains the index data. See \\ref \n"
421 " PageSystemGeoIndexing for a description of the indexing options.\n"
422 " </Field>\n"
423 " <Field\n"
424 " name=\"patchVertices\"\n"
425 " type=\"UInt32\"\n"
426 " cardinality=\"single\"\n"
427 " visibility=\"external\"\n"
428 " defaultValue=\"0\"\n"
429 " access=\"public\"\n"
430 " >\n"
431 "\tif primitives are patches set the number of vertices per patch. Evaluated\n"
432 " if value != 0.\n"
433 " </Field>\n"
434 " <Field\n"
435 " name=\"dlistCache\"\n"
436 " type=\"bool\"\n"
437 " cardinality=\"single\"\n"
438 " visibility=\"external\"\n"
439 " defaultValue=\"true\"\n"
440 " access=\"public\"\n"
441 " >\n"
442 "\tFlag to activate caching the geometry inside a display list.\n"
443 " </Field>\n"
444 " <Field\n"
445 " name=\"useVAO\"\n"
446 " type=\"bool\"\n"
447 " cardinality=\"single\"\n"
448 " visibility=\"external\"\n"
449 " defaultValue=\"true\"\n"
450 " access=\"public\"\n"
451 " >\n"
452 "\tFlag to activate caching the geometry inside a VAO.\n"
453 " </Field>\n"
454 " <Field\n"
455 " name=\"useAttribCalls\"\n"
456 " type=\"bool\"\n"
457 " cardinality=\"single\"\n"
458 " visibility=\"external\"\n"
459 " defaultValue=\"false\"\n"
460 " access=\"public\"\n"
461 " >\n"
462 "\tFlag to activate caching the geometry inside a VAO.\n"
463 " </Field>\n"
464 " <Field\n"
465 " name=\"classicGLId\"\n"
466 " type=\"Int32\"\n"
467 " cardinality=\"single\"\n"
468 " visibility=\"internal\"\n"
469 " defaultValue=\"0\"\n"
470 " access=\"protected\"\n"
471 " fieldFlags=\"FClusterLocal\"\n"
472 " >\n"
473 "\tThe dlist id for the classic rendering mode, if used.\n"
474 " </Field>\n"
475 " <Field\n"
476 " name=\"attGLId\"\n"
477 " type=\"Int32\"\n"
478 " cardinality=\"single\"\n"
479 " visibility=\"internal\"\n"
480 " defaultValue=\"0\"\n"
481 " access=\"protected\"\n"
482 " fieldFlags=\"FClusterLocal\"\n"
483 " >\n"
484 "\tThe dlist id for the attribute-based rendering mode, if used.\n"
485 " </Field>\n"
486 " <Field\n"
487 " name=\"classicVaoGLId\"\n"
488 " type=\"Int32\"\n"
489 " cardinality=\"single\"\n"
490 " visibility=\"internal\"\n"
491 " defaultValue=\"0\"\n"
492 " access=\"protected\"\n"
493 " fieldFlags=\"FClusterLocal\"\n"
494 " >\n"
495 "\tThe vao gl id for the attribute-based rendering mode, if used.\n"
496 " </Field>\n"
497 " <Field\n"
498 " name=\"attribVaoGLId\"\n"
499 " type=\"Int32\"\n"
500 " cardinality=\"single\"\n"
501 " visibility=\"internal\"\n"
502 " defaultValue=\"0\"\n"
503 " access=\"protected\"\n"
504 " fieldFlags=\"FClusterLocal\"\n"
505 " >\n"
506 "\tThe vao gl id for the attribute-based rendering mode, if used.\n"
507 " </Field>\n"
508 "</FieldContainer>\n",
512 /*------------------------------ get -----------------------------------*/
514 FieldContainerType &GeometryBase::getType(void)
516 return _type;
519 const FieldContainerType &GeometryBase::getType(void) const
521 return _type;
524 UInt32 GeometryBase::getContainerSize(void) const
526 return sizeof(Geometry);
529 /*------------------------- decorator get ------------------------------*/
532 //! Get the Geometry::_sfTypes field.
533 const SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::getSFTypes(void) const
535 return &_sfTypes;
538 SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::editSFTypes (void)
540 editSField(TypesFieldMask);
542 return &_sfTypes;
545 //! Get the value of the Geometry::_sfTypes field.
546 GeoIntegralProperty * GeometryBase::getTypes(void) const
548 return _sfTypes.getValue();
551 //! Set the value of the Geometry::_sfTypes field.
552 void GeometryBase::setTypes(GeoIntegralProperty * const value)
554 editSField(TypesFieldMask);
556 _sfTypes.setValue(value);
560 //! Get the Geometry::_sfLengths field.
561 const SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::getSFLengths(void) const
563 return &_sfLengths;
566 SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::editSFLengths (void)
568 editSField(LengthsFieldMask);
570 return &_sfLengths;
573 //! Get the value of the Geometry::_sfLengths field.
574 GeoIntegralProperty * GeometryBase::getLengths(void) const
576 return _sfLengths.getValue();
579 //! Set the value of the Geometry::_sfLengths field.
580 void GeometryBase::setLengths(GeoIntegralProperty * const value)
582 editSField(LengthsFieldMask);
584 _sfLengths.setValue(value);
588 //! Get the Geometry::_mfProperties field.
589 const MFUnrecChildGeoVectorPropertyPtr *GeometryBase::getMFProperties(void) const
591 return &_mfProperties;
594 MFUnrecChildGeoVectorPropertyPtr *GeometryBase::editMFProperties (void)
596 editMField(PropertiesFieldMask, _mfProperties);
598 return &_mfProperties;
600 GeoVectorProperty * GeometryBase::getProperties(const UInt32 index) const
602 return _mfProperties[index];
605 //! Get the Geometry::_mfPropIndices field.
606 const MFUnrecChildGeoIntegralPropertyPtr *GeometryBase::getMFPropIndices(void) const
608 return &_mfPropIndices;
611 MFUnrecChildGeoIntegralPropertyPtr *GeometryBase::editMFPropIndices (void)
613 editMField(PropIndicesFieldMask, _mfPropIndices);
615 return &_mfPropIndices;
617 GeoIntegralProperty * GeometryBase::getPropIndices(const UInt32 index) const
619 return _mfPropIndices[index];
622 SFUInt32 *GeometryBase::editSFPatchVertices(void)
624 editSField(PatchVerticesFieldMask);
626 return &_sfPatchVertices;
629 const SFUInt32 *GeometryBase::getSFPatchVertices(void) const
631 return &_sfPatchVertices;
635 SFBool *GeometryBase::editSFDlistCache(void)
637 editSField(DlistCacheFieldMask);
639 return &_sfDlistCache;
642 const SFBool *GeometryBase::getSFDlistCache(void) const
644 return &_sfDlistCache;
648 SFBool *GeometryBase::editSFUseVAO(void)
650 editSField(UseVAOFieldMask);
652 return &_sfUseVAO;
655 const SFBool *GeometryBase::getSFUseVAO(void) const
657 return &_sfUseVAO;
661 SFBool *GeometryBase::editSFUseAttribCalls(void)
663 editSField(UseAttribCallsFieldMask);
665 return &_sfUseAttribCalls;
668 const SFBool *GeometryBase::getSFUseAttribCalls(void) const
670 return &_sfUseAttribCalls;
674 SFInt32 *GeometryBase::editSFClassicGLId(void)
676 editSField(ClassicGLIdFieldMask);
678 return &_sfClassicGLId;
681 const SFInt32 *GeometryBase::getSFClassicGLId(void) const
683 return &_sfClassicGLId;
687 SFInt32 *GeometryBase::editSFAttGLId(void)
689 editSField(AttGLIdFieldMask);
691 return &_sfAttGLId;
694 const SFInt32 *GeometryBase::getSFAttGLId(void) const
696 return &_sfAttGLId;
700 SFInt32 *GeometryBase::editSFClassicVaoGLId(void)
702 editSField(ClassicVaoGLIdFieldMask);
704 return &_sfClassicVaoGLId;
707 const SFInt32 *GeometryBase::getSFClassicVaoGLId(void) const
709 return &_sfClassicVaoGLId;
713 SFInt32 *GeometryBase::editSFAttribVaoGLId(void)
715 editSField(AttribVaoGLIdFieldMask);
717 return &_sfAttribVaoGLId;
720 const SFInt32 *GeometryBase::getSFAttribVaoGLId(void) const
722 return &_sfAttribVaoGLId;
728 void GeometryBase::pushToProperties(GeoVectorProperty * const value)
730 editMField(PropertiesFieldMask, _mfProperties);
732 _mfProperties.push_back(value);
735 void GeometryBase::assignProperties(const MFUnrecChildGeoVectorPropertyPtr &value)
737 MFUnrecChildGeoVectorPropertyPtr::const_iterator elemIt =
738 value.begin();
739 MFUnrecChildGeoVectorPropertyPtr::const_iterator elemEnd =
740 value.end ();
742 static_cast<Geometry *>(this)->clearProperties();
744 while(elemIt != elemEnd)
746 this->pushToProperties(*elemIt);
748 ++elemIt;
752 void GeometryBase::removeFromProperties(UInt32 uiIndex)
754 if(uiIndex < _mfProperties.size())
756 editMField(PropertiesFieldMask, _mfProperties);
758 _mfProperties.erase(uiIndex);
762 void GeometryBase::removeObjFromProperties(GeoVectorProperty * const value)
764 Int32 iElemIdx = _mfProperties.findIndex(value);
766 if(iElemIdx != -1)
768 editMField(PropertiesFieldMask, _mfProperties);
770 _mfProperties.erase(iElemIdx);
773 void GeometryBase::clearProperties(void)
775 editMField(PropertiesFieldMask, _mfProperties);
778 _mfProperties.clear();
781 void GeometryBase::pushToPropIndices(GeoIntegralProperty * const value)
783 editMField(PropIndicesFieldMask, _mfPropIndices);
785 _mfPropIndices.push_back(value);
788 void GeometryBase::assignPropIndices(const MFUnrecChildGeoIntegralPropertyPtr &value)
790 MFUnrecChildGeoIntegralPropertyPtr::const_iterator elemIt =
791 value.begin();
792 MFUnrecChildGeoIntegralPropertyPtr::const_iterator elemEnd =
793 value.end ();
795 static_cast<Geometry *>(this)->clearPropIndices();
797 while(elemIt != elemEnd)
799 this->pushToPropIndices(*elemIt);
801 ++elemIt;
805 void GeometryBase::removeFromPropIndices(UInt32 uiIndex)
807 if(uiIndex < _mfPropIndices.size())
809 editMField(PropIndicesFieldMask, _mfPropIndices);
811 _mfPropIndices.erase(uiIndex);
815 void GeometryBase::removeObjFromPropIndices(GeoIntegralProperty * const value)
817 Int32 iElemIdx = _mfPropIndices.findIndex(value);
819 if(iElemIdx != -1)
821 editMField(PropIndicesFieldMask, _mfPropIndices);
823 _mfPropIndices.erase(iElemIdx);
826 void GeometryBase::clearPropIndices(void)
828 editMField(PropIndicesFieldMask, _mfPropIndices);
831 _mfPropIndices.clear();
836 /*------------------------------ access -----------------------------------*/
838 SizeT GeometryBase::getBinSize(ConstFieldMaskArg whichField)
840 SizeT returnValue = Inherited::getBinSize(whichField);
842 if(FieldBits::NoField != (TypesFieldMask & whichField))
844 returnValue += _sfTypes.getBinSize();
846 if(FieldBits::NoField != (LengthsFieldMask & whichField))
848 returnValue += _sfLengths.getBinSize();
850 if(FieldBits::NoField != (PropertiesFieldMask & whichField))
852 returnValue += _mfProperties.getBinSize();
854 if(FieldBits::NoField != (PropIndicesFieldMask & whichField))
856 returnValue += _mfPropIndices.getBinSize();
858 if(FieldBits::NoField != (PatchVerticesFieldMask & whichField))
860 returnValue += _sfPatchVertices.getBinSize();
862 if(FieldBits::NoField != (DlistCacheFieldMask & whichField))
864 returnValue += _sfDlistCache.getBinSize();
866 if(FieldBits::NoField != (UseVAOFieldMask & whichField))
868 returnValue += _sfUseVAO.getBinSize();
870 if(FieldBits::NoField != (UseAttribCallsFieldMask & whichField))
872 returnValue += _sfUseAttribCalls.getBinSize();
874 if(FieldBits::NoField != (ClassicGLIdFieldMask & whichField))
876 returnValue += _sfClassicGLId.getBinSize();
878 if(FieldBits::NoField != (AttGLIdFieldMask & whichField))
880 returnValue += _sfAttGLId.getBinSize();
882 if(FieldBits::NoField != (ClassicVaoGLIdFieldMask & whichField))
884 returnValue += _sfClassicVaoGLId.getBinSize();
886 if(FieldBits::NoField != (AttribVaoGLIdFieldMask & whichField))
888 returnValue += _sfAttribVaoGLId.getBinSize();
891 return returnValue;
894 void GeometryBase::copyToBin(BinaryDataHandler &pMem,
895 ConstFieldMaskArg whichField)
897 Inherited::copyToBin(pMem, whichField);
899 if(FieldBits::NoField != (TypesFieldMask & whichField))
901 _sfTypes.copyToBin(pMem);
903 if(FieldBits::NoField != (LengthsFieldMask & whichField))
905 _sfLengths.copyToBin(pMem);
907 if(FieldBits::NoField != (PropertiesFieldMask & whichField))
909 _mfProperties.copyToBin(pMem);
911 if(FieldBits::NoField != (PropIndicesFieldMask & whichField))
913 _mfPropIndices.copyToBin(pMem);
915 if(FieldBits::NoField != (PatchVerticesFieldMask & whichField))
917 _sfPatchVertices.copyToBin(pMem);
919 if(FieldBits::NoField != (DlistCacheFieldMask & whichField))
921 _sfDlistCache.copyToBin(pMem);
923 if(FieldBits::NoField != (UseVAOFieldMask & whichField))
925 _sfUseVAO.copyToBin(pMem);
927 if(FieldBits::NoField != (UseAttribCallsFieldMask & whichField))
929 _sfUseAttribCalls.copyToBin(pMem);
931 if(FieldBits::NoField != (ClassicGLIdFieldMask & whichField))
933 _sfClassicGLId.copyToBin(pMem);
935 if(FieldBits::NoField != (AttGLIdFieldMask & whichField))
937 _sfAttGLId.copyToBin(pMem);
939 if(FieldBits::NoField != (ClassicVaoGLIdFieldMask & whichField))
941 _sfClassicVaoGLId.copyToBin(pMem);
943 if(FieldBits::NoField != (AttribVaoGLIdFieldMask & whichField))
945 _sfAttribVaoGLId.copyToBin(pMem);
949 void GeometryBase::copyFromBin(BinaryDataHandler &pMem,
950 ConstFieldMaskArg whichField)
952 Inherited::copyFromBin(pMem, whichField);
954 if(FieldBits::NoField != (TypesFieldMask & whichField))
956 editSField(TypesFieldMask);
957 _sfTypes.copyFromBin(pMem);
959 if(FieldBits::NoField != (LengthsFieldMask & whichField))
961 editSField(LengthsFieldMask);
962 _sfLengths.copyFromBin(pMem);
964 if(FieldBits::NoField != (PropertiesFieldMask & whichField))
966 editMField(PropertiesFieldMask, _mfProperties);
967 _mfProperties.copyFromBin(pMem);
969 if(FieldBits::NoField != (PropIndicesFieldMask & whichField))
971 editMField(PropIndicesFieldMask, _mfPropIndices);
972 _mfPropIndices.copyFromBin(pMem);
974 if(FieldBits::NoField != (PatchVerticesFieldMask & whichField))
976 editSField(PatchVerticesFieldMask);
977 _sfPatchVertices.copyFromBin(pMem);
979 if(FieldBits::NoField != (DlistCacheFieldMask & whichField))
981 editSField(DlistCacheFieldMask);
982 _sfDlistCache.copyFromBin(pMem);
984 if(FieldBits::NoField != (UseVAOFieldMask & whichField))
986 editSField(UseVAOFieldMask);
987 _sfUseVAO.copyFromBin(pMem);
989 if(FieldBits::NoField != (UseAttribCallsFieldMask & whichField))
991 editSField(UseAttribCallsFieldMask);
992 _sfUseAttribCalls.copyFromBin(pMem);
994 if(FieldBits::NoField != (ClassicGLIdFieldMask & whichField))
996 editSField(ClassicGLIdFieldMask);
997 _sfClassicGLId.copyFromBin(pMem);
999 if(FieldBits::NoField != (AttGLIdFieldMask & whichField))
1001 editSField(AttGLIdFieldMask);
1002 _sfAttGLId.copyFromBin(pMem);
1004 if(FieldBits::NoField != (ClassicVaoGLIdFieldMask & whichField))
1006 editSField(ClassicVaoGLIdFieldMask);
1007 _sfClassicVaoGLId.copyFromBin(pMem);
1009 if(FieldBits::NoField != (AttribVaoGLIdFieldMask & whichField))
1011 editSField(AttribVaoGLIdFieldMask);
1012 _sfAttribVaoGLId.copyFromBin(pMem);
1016 //! create a new instance of the class
1017 GeometryTransitPtr GeometryBase::createLocal(BitVector bFlags)
1019 GeometryTransitPtr fc;
1021 if(getClassType().getPrototype() != NULL)
1023 FieldContainerTransitPtr tmpPtr =
1024 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
1026 fc = dynamic_pointer_cast<Geometry>(tmpPtr);
1029 return fc;
1032 //! create a new instance of the class, copy the container flags
1033 GeometryTransitPtr GeometryBase::createDependent(BitVector bFlags)
1035 GeometryTransitPtr fc;
1037 if(getClassType().getPrototype() != NULL)
1039 FieldContainerTransitPtr tmpPtr =
1040 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
1042 fc = dynamic_pointer_cast<Geometry>(tmpPtr);
1045 return fc;
1048 //! create a new instance of the class
1049 GeometryTransitPtr GeometryBase::create(void)
1051 GeometryTransitPtr fc;
1053 if(getClassType().getPrototype() != NULL)
1055 FieldContainerTransitPtr tmpPtr =
1056 getClassType().getPrototype()-> shallowCopy();
1058 fc = dynamic_pointer_cast<Geometry>(tmpPtr);
1061 return fc;
1064 Geometry *GeometryBase::createEmptyLocal(BitVector bFlags)
1066 Geometry *returnValue;
1068 newPtr<Geometry>(returnValue, bFlags);
1070 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
1072 return returnValue;
1075 //! create an empty new instance of the class, do not copy the prototype
1076 Geometry *GeometryBase::createEmpty(void)
1078 Geometry *returnValue;
1080 newPtr<Geometry>(returnValue, Thread::getCurrentLocalFlags());
1082 returnValue->_pFieldFlags->_bNamespaceMask &=
1083 ~Thread::getCurrentLocalFlags();
1085 return returnValue;
1089 FieldContainerTransitPtr GeometryBase::shallowCopyLocal(
1090 BitVector bFlags) const
1092 Geometry *tmpPtr;
1094 newPtr(tmpPtr, dynamic_cast<const Geometry *>(this), bFlags);
1096 FieldContainerTransitPtr returnValue(tmpPtr);
1098 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
1100 return returnValue;
1103 FieldContainerTransitPtr GeometryBase::shallowCopyDependent(
1104 BitVector bFlags) const
1106 Geometry *tmpPtr;
1108 newPtr(tmpPtr, dynamic_cast<const Geometry *>(this), ~bFlags);
1110 FieldContainerTransitPtr returnValue(tmpPtr);
1112 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
1114 return returnValue;
1117 FieldContainerTransitPtr GeometryBase::shallowCopy(void) const
1119 Geometry *tmpPtr;
1121 newPtr(tmpPtr,
1122 dynamic_cast<const Geometry *>(this),
1123 Thread::getCurrentLocalFlags());
1125 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
1127 FieldContainerTransitPtr returnValue(tmpPtr);
1129 return returnValue;
1135 /*------------------------- constructors ----------------------------------*/
1137 GeometryBase::GeometryBase(void) :
1138 Inherited(),
1139 _sfTypes (this,
1140 TypesFieldId,
1141 GeoIntegralProperty::ParentsFieldId),
1142 _sfLengths (this,
1143 LengthsFieldId,
1144 GeoIntegralProperty::ParentsFieldId),
1145 _mfProperties (this,
1146 PropertiesFieldId,
1147 GeoVectorProperty::ParentsFieldId),
1148 _mfPropIndices (this,
1149 PropIndicesFieldId,
1150 GeoIntegralProperty::ParentsFieldId),
1151 _sfPatchVertices (UInt32(0)),
1152 _sfDlistCache (bool(true)),
1153 _sfUseVAO (bool(true)),
1154 _sfUseAttribCalls (bool(false)),
1155 _sfClassicGLId (Int32(0)),
1156 _sfAttGLId (Int32(0)),
1157 _sfClassicVaoGLId (Int32(0)),
1158 _sfAttribVaoGLId (Int32(0))
1162 GeometryBase::GeometryBase(const GeometryBase &source) :
1163 Inherited(source),
1164 _sfTypes (this,
1165 TypesFieldId,
1166 GeoIntegralProperty::ParentsFieldId),
1167 _sfLengths (this,
1168 LengthsFieldId,
1169 GeoIntegralProperty::ParentsFieldId),
1170 _mfProperties (this,
1171 PropertiesFieldId,
1172 GeoVectorProperty::ParentsFieldId),
1173 _mfPropIndices (this,
1174 PropIndicesFieldId,
1175 GeoIntegralProperty::ParentsFieldId),
1176 _sfPatchVertices (source._sfPatchVertices ),
1177 _sfDlistCache (source._sfDlistCache ),
1178 _sfUseVAO (source._sfUseVAO ),
1179 _sfUseAttribCalls (source._sfUseAttribCalls ),
1180 _sfClassicGLId (source._sfClassicGLId ),
1181 _sfAttGLId (source._sfAttGLId ),
1182 _sfClassicVaoGLId (source._sfClassicVaoGLId ),
1183 _sfAttribVaoGLId (source._sfAttribVaoGLId )
1188 /*-------------------------- destructors ----------------------------------*/
1190 GeometryBase::~GeometryBase(void)
1194 /*-------------------------------------------------------------------------*/
1195 /* Child linking */
1197 bool GeometryBase::unlinkChild(
1198 FieldContainer * const pChild,
1199 UInt16 const childFieldId)
1201 if(childFieldId == TypesFieldId)
1203 GeoIntegralProperty * pTypedChild =
1204 dynamic_cast<GeoIntegralProperty *>(pChild);
1206 if(pTypedChild != NULL)
1208 if(_sfTypes.getValue() == pTypedChild)
1210 editSField(TypesFieldMask);
1212 _sfTypes.setValue(NULL);
1214 return true;
1217 SWARNING << "Parent ([" << this
1218 << "] id [" << this->getId()
1219 << "] type [" << this->getType().getCName()
1220 << "] childFieldId [" << childFieldId
1221 << "]) - Child ([" << pChild
1222 << "] id [" << pChild->getId()
1223 << "] type [" << pChild->getType().getCName()
1224 << "]): link inconsistent!"
1225 << std::endl;
1227 return false;
1230 return false;
1233 if(childFieldId == LengthsFieldId)
1235 GeoIntegralProperty * pTypedChild =
1236 dynamic_cast<GeoIntegralProperty *>(pChild);
1238 if(pTypedChild != NULL)
1240 if(_sfLengths.getValue() == pTypedChild)
1242 editSField(LengthsFieldMask);
1244 _sfLengths.setValue(NULL);
1246 return true;
1249 SWARNING << "Parent ([" << this
1250 << "] id [" << this->getId()
1251 << "] type [" << this->getType().getCName()
1252 << "] childFieldId [" << childFieldId
1253 << "]) - Child ([" << pChild
1254 << "] id [" << pChild->getId()
1255 << "] type [" << pChild->getType().getCName()
1256 << "]): link inconsistent!"
1257 << std::endl;
1259 return false;
1262 return false;
1265 if(childFieldId == PropertiesFieldId)
1267 GeoVectorProperty * pTypedChild =
1268 dynamic_cast<GeoVectorProperty *>(pChild);
1270 if(pTypedChild != NULL)
1272 Int32 iChildIdx = _mfProperties.findIndex(pTypedChild);
1274 if(iChildIdx != -1)
1276 editMField(PropertiesFieldMask, _mfProperties);
1278 _mfProperties.erase(iChildIdx);
1280 return true;
1283 SWARNING << "Parent ([" << this
1284 << "] id [" << this->getId()
1285 << "] type [" << this->getType().getCName()
1286 << "] childFieldId [" << childFieldId
1287 << "]) - Child ([" << pChild
1288 << "] id [" << pChild->getId()
1289 << "] type [" << pChild->getType().getCName()
1290 << "]): link inconsistent!"
1291 << std::endl;
1293 return false;
1296 return false;
1299 if(childFieldId == PropIndicesFieldId)
1301 GeoIntegralProperty * pTypedChild =
1302 dynamic_cast<GeoIntegralProperty *>(pChild);
1304 if(pTypedChild != NULL)
1306 Int32 iChildIdx = _mfPropIndices.findIndex(pTypedChild);
1308 if(iChildIdx != -1)
1310 editMField(PropIndicesFieldMask, _mfPropIndices);
1312 _mfPropIndices.erase(iChildIdx);
1314 return true;
1317 SWARNING << "Parent ([" << this
1318 << "] id [" << this->getId()
1319 << "] type [" << this->getType().getCName()
1320 << "] childFieldId [" << childFieldId
1321 << "]) - Child ([" << pChild
1322 << "] id [" << pChild->getId()
1323 << "] type [" << pChild->getType().getCName()
1324 << "]): link inconsistent!"
1325 << std::endl;
1327 return false;
1330 return false;
1334 return Inherited::unlinkChild(pChild, childFieldId);
1337 void GeometryBase::onCreate(const Geometry *source)
1339 Inherited::onCreate(source);
1341 if(source != NULL)
1343 Geometry *pThis = static_cast<Geometry *>(this);
1345 pThis->setTypes(source->getTypes());
1347 pThis->setLengths(source->getLengths());
1349 MFUnrecChildGeoVectorPropertyPtr::const_iterator PropertiesIt =
1350 source->_mfProperties.begin();
1351 MFUnrecChildGeoVectorPropertyPtr::const_iterator PropertiesEnd =
1352 source->_mfProperties.end ();
1354 while(PropertiesIt != PropertiesEnd)
1356 pThis->pushToProperties(*PropertiesIt);
1358 ++PropertiesIt;
1361 MFUnrecChildGeoIntegralPropertyPtr::const_iterator PropIndicesIt =
1362 source->_mfPropIndices.begin();
1363 MFUnrecChildGeoIntegralPropertyPtr::const_iterator PropIndicesEnd =
1364 source->_mfPropIndices.end ();
1366 while(PropIndicesIt != PropIndicesEnd)
1368 pThis->pushToPropIndices(*PropIndicesIt);
1370 ++PropIndicesIt;
1375 GetFieldHandlePtr GeometryBase::getHandleTypes (void) const
1377 SFUnrecChildGeoIntegralPropertyPtr::GetHandlePtr returnValue(
1378 new SFUnrecChildGeoIntegralPropertyPtr::GetHandle(
1379 &_sfTypes,
1380 this->getType().getFieldDesc(TypesFieldId),
1381 const_cast<GeometryBase *>(this)));
1383 return returnValue;
1386 EditFieldHandlePtr GeometryBase::editHandleTypes (void)
1388 SFUnrecChildGeoIntegralPropertyPtr::EditHandlePtr returnValue(
1389 new SFUnrecChildGeoIntegralPropertyPtr::EditHandle(
1390 &_sfTypes,
1391 this->getType().getFieldDesc(TypesFieldId),
1392 this));
1394 returnValue->setSetMethod(
1395 boost::bind(&Geometry::setTypes,
1396 static_cast<Geometry *>(this), _1));
1398 editSField(TypesFieldMask);
1400 return returnValue;
1403 GetFieldHandlePtr GeometryBase::getHandleLengths (void) const
1405 SFUnrecChildGeoIntegralPropertyPtr::GetHandlePtr returnValue(
1406 new SFUnrecChildGeoIntegralPropertyPtr::GetHandle(
1407 &_sfLengths,
1408 this->getType().getFieldDesc(LengthsFieldId),
1409 const_cast<GeometryBase *>(this)));
1411 return returnValue;
1414 EditFieldHandlePtr GeometryBase::editHandleLengths (void)
1416 SFUnrecChildGeoIntegralPropertyPtr::EditHandlePtr returnValue(
1417 new SFUnrecChildGeoIntegralPropertyPtr::EditHandle(
1418 &_sfLengths,
1419 this->getType().getFieldDesc(LengthsFieldId),
1420 this));
1422 returnValue->setSetMethod(
1423 boost::bind(&Geometry::setLengths,
1424 static_cast<Geometry *>(this), _1));
1426 editSField(LengthsFieldMask);
1428 return returnValue;
1431 GetFieldHandlePtr GeometryBase::getHandleProperties (void) const
1433 MFUnrecChildGeoVectorPropertyPtr::GetHandlePtr returnValue(
1434 new MFUnrecChildGeoVectorPropertyPtr::GetHandle(
1435 &_mfProperties,
1436 this->getType().getFieldDesc(PropertiesFieldId),
1437 const_cast<GeometryBase *>(this)));
1439 return returnValue;
1442 EditFieldHandlePtr GeometryBase::editHandleProperties (void)
1444 MFUnrecChildGeoVectorPropertyPtr::EditHandlePtr returnValue(
1445 new MFUnrecChildGeoVectorPropertyPtr::EditHandle(
1446 &_mfProperties,
1447 this->getType().getFieldDesc(PropertiesFieldId),
1448 this));
1450 returnValue->setAddMethod(
1451 boost::bind(&Geometry::pushToProperties,
1452 static_cast<Geometry *>(this), _1));
1453 returnValue->setRemoveMethod(
1454 boost::bind(&Geometry::removeFromProperties,
1455 static_cast<Geometry *>(this), _1));
1456 returnValue->setRemoveObjMethod(
1457 boost::bind(&Geometry::removeObjFromProperties,
1458 static_cast<Geometry *>(this), _1));
1459 returnValue->setClearMethod(
1460 boost::bind(&Geometry::clearProperties,
1461 static_cast<Geometry *>(this)));
1463 editMField(PropertiesFieldMask, _mfProperties);
1465 return returnValue;
1468 GetFieldHandlePtr GeometryBase::getHandlePropIndices (void) const
1470 MFUnrecChildGeoIntegralPropertyPtr::GetHandlePtr returnValue(
1471 new MFUnrecChildGeoIntegralPropertyPtr::GetHandle(
1472 &_mfPropIndices,
1473 this->getType().getFieldDesc(PropIndicesFieldId),
1474 const_cast<GeometryBase *>(this)));
1476 return returnValue;
1479 EditFieldHandlePtr GeometryBase::editHandlePropIndices (void)
1481 MFUnrecChildGeoIntegralPropertyPtr::EditHandlePtr returnValue(
1482 new MFUnrecChildGeoIntegralPropertyPtr::EditHandle(
1483 &_mfPropIndices,
1484 this->getType().getFieldDesc(PropIndicesFieldId),
1485 this));
1487 returnValue->setAddMethod(
1488 boost::bind(&Geometry::pushToPropIndices,
1489 static_cast<Geometry *>(this), _1));
1490 returnValue->setRemoveMethod(
1491 boost::bind(&Geometry::removeFromPropIndices,
1492 static_cast<Geometry *>(this), _1));
1493 returnValue->setRemoveObjMethod(
1494 boost::bind(&Geometry::removeObjFromPropIndices,
1495 static_cast<Geometry *>(this), _1));
1496 returnValue->setClearMethod(
1497 boost::bind(&Geometry::clearPropIndices,
1498 static_cast<Geometry *>(this)));
1500 editMField(PropIndicesFieldMask, _mfPropIndices);
1502 return returnValue;
1505 GetFieldHandlePtr GeometryBase::getHandlePatchVertices (void) const
1507 SFUInt32::GetHandlePtr returnValue(
1508 new SFUInt32::GetHandle(
1509 &_sfPatchVertices,
1510 this->getType().getFieldDesc(PatchVerticesFieldId),
1511 const_cast<GeometryBase *>(this)));
1513 return returnValue;
1516 EditFieldHandlePtr GeometryBase::editHandlePatchVertices (void)
1518 SFUInt32::EditHandlePtr returnValue(
1519 new SFUInt32::EditHandle(
1520 &_sfPatchVertices,
1521 this->getType().getFieldDesc(PatchVerticesFieldId),
1522 this));
1525 editSField(PatchVerticesFieldMask);
1527 return returnValue;
1530 GetFieldHandlePtr GeometryBase::getHandleDlistCache (void) const
1532 SFBool::GetHandlePtr returnValue(
1533 new SFBool::GetHandle(
1534 &_sfDlistCache,
1535 this->getType().getFieldDesc(DlistCacheFieldId),
1536 const_cast<GeometryBase *>(this)));
1538 return returnValue;
1541 EditFieldHandlePtr GeometryBase::editHandleDlistCache (void)
1543 SFBool::EditHandlePtr returnValue(
1544 new SFBool::EditHandle(
1545 &_sfDlistCache,
1546 this->getType().getFieldDesc(DlistCacheFieldId),
1547 this));
1550 editSField(DlistCacheFieldMask);
1552 return returnValue;
1555 GetFieldHandlePtr GeometryBase::getHandleUseVAO (void) const
1557 SFBool::GetHandlePtr returnValue(
1558 new SFBool::GetHandle(
1559 &_sfUseVAO,
1560 this->getType().getFieldDesc(UseVAOFieldId),
1561 const_cast<GeometryBase *>(this)));
1563 return returnValue;
1566 EditFieldHandlePtr GeometryBase::editHandleUseVAO (void)
1568 SFBool::EditHandlePtr returnValue(
1569 new SFBool::EditHandle(
1570 &_sfUseVAO,
1571 this->getType().getFieldDesc(UseVAOFieldId),
1572 this));
1575 editSField(UseVAOFieldMask);
1577 return returnValue;
1580 GetFieldHandlePtr GeometryBase::getHandleUseAttribCalls (void) const
1582 SFBool::GetHandlePtr returnValue(
1583 new SFBool::GetHandle(
1584 &_sfUseAttribCalls,
1585 this->getType().getFieldDesc(UseAttribCallsFieldId),
1586 const_cast<GeometryBase *>(this)));
1588 return returnValue;
1591 EditFieldHandlePtr GeometryBase::editHandleUseAttribCalls (void)
1593 SFBool::EditHandlePtr returnValue(
1594 new SFBool::EditHandle(
1595 &_sfUseAttribCalls,
1596 this->getType().getFieldDesc(UseAttribCallsFieldId),
1597 this));
1600 editSField(UseAttribCallsFieldMask);
1602 return returnValue;
1605 GetFieldHandlePtr GeometryBase::getHandleClassicGLId (void) const
1607 SFInt32::GetHandlePtr returnValue(
1608 new SFInt32::GetHandle(
1609 &_sfClassicGLId,
1610 this->getType().getFieldDesc(ClassicGLIdFieldId),
1611 const_cast<GeometryBase *>(this)));
1613 return returnValue;
1616 EditFieldHandlePtr GeometryBase::editHandleClassicGLId (void)
1618 SFInt32::EditHandlePtr returnValue(
1619 new SFInt32::EditHandle(
1620 &_sfClassicGLId,
1621 this->getType().getFieldDesc(ClassicGLIdFieldId),
1622 this));
1625 editSField(ClassicGLIdFieldMask);
1627 return returnValue;
1630 GetFieldHandlePtr GeometryBase::getHandleAttGLId (void) const
1632 SFInt32::GetHandlePtr returnValue(
1633 new SFInt32::GetHandle(
1634 &_sfAttGLId,
1635 this->getType().getFieldDesc(AttGLIdFieldId),
1636 const_cast<GeometryBase *>(this)));
1638 return returnValue;
1641 EditFieldHandlePtr GeometryBase::editHandleAttGLId (void)
1643 SFInt32::EditHandlePtr returnValue(
1644 new SFInt32::EditHandle(
1645 &_sfAttGLId,
1646 this->getType().getFieldDesc(AttGLIdFieldId),
1647 this));
1650 editSField(AttGLIdFieldMask);
1652 return returnValue;
1655 GetFieldHandlePtr GeometryBase::getHandleClassicVaoGLId (void) const
1657 SFInt32::GetHandlePtr returnValue(
1658 new SFInt32::GetHandle(
1659 &_sfClassicVaoGLId,
1660 this->getType().getFieldDesc(ClassicVaoGLIdFieldId),
1661 const_cast<GeometryBase *>(this)));
1663 return returnValue;
1666 EditFieldHandlePtr GeometryBase::editHandleClassicVaoGLId (void)
1668 SFInt32::EditHandlePtr returnValue(
1669 new SFInt32::EditHandle(
1670 &_sfClassicVaoGLId,
1671 this->getType().getFieldDesc(ClassicVaoGLIdFieldId),
1672 this));
1675 editSField(ClassicVaoGLIdFieldMask);
1677 return returnValue;
1680 GetFieldHandlePtr GeometryBase::getHandleAttribVaoGLId (void) const
1682 SFInt32::GetHandlePtr returnValue(
1683 new SFInt32::GetHandle(
1684 &_sfAttribVaoGLId,
1685 this->getType().getFieldDesc(AttribVaoGLIdFieldId),
1686 const_cast<GeometryBase *>(this)));
1688 return returnValue;
1691 EditFieldHandlePtr GeometryBase::editHandleAttribVaoGLId (void)
1693 SFInt32::EditHandlePtr returnValue(
1694 new SFInt32::EditHandle(
1695 &_sfAttribVaoGLId,
1696 this->getType().getFieldDesc(AttribVaoGLIdFieldId),
1697 this));
1700 editSField(AttribVaoGLIdFieldMask);
1702 return returnValue;
1706 #ifdef OSG_MT_CPTR_ASPECT
1707 void GeometryBase::execSyncV( FieldContainer &oFrom,
1708 ConstFieldMaskArg whichField,
1709 AspectOffsetStore &oOffsets,
1710 ConstFieldMaskArg syncMode,
1711 const UInt32 uiSyncInfo)
1713 Geometry *pThis = static_cast<Geometry *>(this);
1715 pThis->execSync(static_cast<Geometry *>(&oFrom),
1716 whichField,
1717 oOffsets,
1718 syncMode,
1719 uiSyncInfo);
1721 #endif
1724 #ifdef OSG_MT_CPTR_ASPECT
1725 FieldContainer *GeometryBase::createAspectCopy(
1726 const FieldContainer *pRefAspect) const
1728 Geometry *returnValue;
1730 newAspectCopy(returnValue,
1731 dynamic_cast<const Geometry *>(pRefAspect),
1732 dynamic_cast<const Geometry *>(this));
1734 return returnValue;
1736 #endif
1738 void GeometryBase::resolveLinks(void)
1740 Inherited::resolveLinks();
1742 static_cast<Geometry *>(this)->setTypes(NULL);
1744 static_cast<Geometry *>(this)->setLengths(NULL);
1746 static_cast<Geometry *>(this)->clearProperties();
1748 static_cast<Geometry *>(this)->clearPropIndices();
1754 OSG_END_NAMESPACE