fixed: gcc8 compile issues
[opensg.git] / Source / System / NodeCores / Drawables / Geometry / Base / OSGGeometryBase.cpp
blob8b9a30aca3dcc6b05e85255d9cd87e958dffa34b
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>(&Geometry::classDescInserter),
352 false,
354 "<?xml version=\"1.0\"?>\n"
355 "\n"
356 "<FieldContainer\n"
357 " name=\"Geometry\"\n"
358 " parent=\"MaterialDrawable\"\n"
359 " library=\"Drawable\"\n"
360 " pointerfieldtypes=\"both\"\n"
361 " structure=\"concrete\"\n"
362 " systemcomponent=\"true\"\n"
363 " parentsystemcomponent=\"true\"\n"
364 " childFields=\"both\"\n"
365 " decoratable=\"false\"\n"
366 " isNodeCore=\"true\"\n"
367 " docGroupBase=\"GrpDrawablesGeometry\"\n"
368 " >\n"
369 " <Field\n"
370 " name=\"types\"\n"
371 " type=\"GeoIntegralProperty\"\n"
372 " cardinality=\"single\"\n"
373 " visibility=\"external\"\n"
374 " access=\"public\"\n"
375 " category=\"childpointer\"\n"
376 " childParentType=\"FieldContainer\"\n"
377 " linkParentField=\"Parents\"\n"
378 " >\n"
379 " The types property contains the primitive's types. Legal values are \n"
380 " everything that can be passed to glBegin(). There have to be as many \n"
381 " types as lengths.\n"
382 " </Field>\n"
383 " <Field\n"
384 " name=\"lengths\"\n"
385 " type=\"GeoIntegralProperty\"\n"
386 " cardinality=\"single\"\n"
387 " visibility=\"external\"\n"
388 " access=\"public\"\n"
389 " category=\"childpointer\"\n"
390 " childParentType=\"FieldContainer\"\n"
391 " linkParentField=\"Parents\"\n"
392 " >\n"
393 " The lengths property contains the number of vertices to use for the \n"
394 " corresponding primitive. There have to be as many lengths as types.\n"
395 " </Field>\n"
396 " <Field\n"
397 " name=\"properties\"\n"
398 " type=\"GeoVectorProperty\"\n"
399 " cardinality=\"multi\"\n"
400 " visibility=\"external\"\n"
401 " access=\"public\"\n"
402 " category=\"childpointer\"\n"
403 " childParentType=\"FieldContainer\"\n"
404 " linkParentField=\"Parents\"\n"
405 " >\n"
406 " The attributes used to render the geometry. The order is based on the \n"
407 " the one given in ARB_vertex_program.\n"
408 " </Field>\n"
409 " <Field\n"
410 " name=\"propIndices\"\n"
411 " type=\"GeoIntegralProperty\"\n"
412 " cardinality=\"multi\"\n"
413 " visibility=\"external\"\n"
414 " access=\"public\"\n"
415 " category=\"childpointer\"\n"
416 " childParentType=\"FieldContainer\"\n"
417 " linkParentField=\"Parents\"\n"
418 " >\n"
419 " The indices property contains the index data. See \\ref \n"
420 " PageSystemGeoIndexing for a description of the indexing options.\n"
421 " </Field>\n"
422 " <Field\n"
423 " name=\"patchVertices\"\n"
424 " type=\"UInt32\"\n"
425 " cardinality=\"single\"\n"
426 " visibility=\"external\"\n"
427 " defaultValue=\"0\"\n"
428 " access=\"public\"\n"
429 " >\n"
430 "\tif primitives are patches set the number of vertices per patch. Evaluated\n"
431 " if value != 0.\n"
432 " </Field>\n"
433 " <Field\n"
434 " name=\"dlistCache\"\n"
435 " type=\"bool\"\n"
436 " cardinality=\"single\"\n"
437 " visibility=\"external\"\n"
438 " defaultValue=\"true\"\n"
439 " access=\"public\"\n"
440 " >\n"
441 "\tFlag to activate caching the geometry inside a display list.\n"
442 " </Field>\n"
443 " <Field\n"
444 " name=\"useVAO\"\n"
445 " type=\"bool\"\n"
446 " cardinality=\"single\"\n"
447 " visibility=\"external\"\n"
448 " defaultValue=\"true\"\n"
449 " access=\"public\"\n"
450 " >\n"
451 "\tFlag to activate caching the geometry inside a VAO.\n"
452 " </Field>\n"
453 " <Field\n"
454 " name=\"useAttribCalls\"\n"
455 " type=\"bool\"\n"
456 " cardinality=\"single\"\n"
457 " visibility=\"external\"\n"
458 " defaultValue=\"false\"\n"
459 " access=\"public\"\n"
460 " >\n"
461 "\tFlag to activate caching the geometry inside a VAO.\n"
462 " </Field>\n"
463 " <Field\n"
464 " name=\"classicGLId\"\n"
465 " type=\"Int32\"\n"
466 " cardinality=\"single\"\n"
467 " visibility=\"internal\"\n"
468 " defaultValue=\"0\"\n"
469 " access=\"protected\"\n"
470 " fieldFlags=\"FClusterLocal\"\n"
471 " >\n"
472 "\tThe dlist id for the classic rendering mode, if used.\n"
473 " </Field>\n"
474 " <Field\n"
475 " name=\"attGLId\"\n"
476 " type=\"Int32\"\n"
477 " cardinality=\"single\"\n"
478 " visibility=\"internal\"\n"
479 " defaultValue=\"0\"\n"
480 " access=\"protected\"\n"
481 " fieldFlags=\"FClusterLocal\"\n"
482 " >\n"
483 "\tThe dlist id for the attribute-based rendering mode, if used.\n"
484 " </Field>\n"
485 " <Field\n"
486 " name=\"classicVaoGLId\"\n"
487 " type=\"Int32\"\n"
488 " cardinality=\"single\"\n"
489 " visibility=\"internal\"\n"
490 " defaultValue=\"0\"\n"
491 " access=\"protected\"\n"
492 " fieldFlags=\"FClusterLocal\"\n"
493 " >\n"
494 "\tThe vao gl id for the attribute-based rendering mode, if used.\n"
495 " </Field>\n"
496 " <Field\n"
497 " name=\"attribVaoGLId\"\n"
498 " type=\"Int32\"\n"
499 " cardinality=\"single\"\n"
500 " visibility=\"internal\"\n"
501 " defaultValue=\"0\"\n"
502 " access=\"protected\"\n"
503 " fieldFlags=\"FClusterLocal\"\n"
504 " >\n"
505 "\tThe vao gl id for the attribute-based rendering mode, if used.\n"
506 " </Field>\n"
507 "</FieldContainer>\n",
511 /*------------------------------ get -----------------------------------*/
513 FieldContainerType &GeometryBase::getType(void)
515 return _type;
518 const FieldContainerType &GeometryBase::getType(void) const
520 return _type;
523 UInt32 GeometryBase::getContainerSize(void) const
525 return sizeof(Geometry);
528 /*------------------------- decorator get ------------------------------*/
531 //! Get the Geometry::_sfTypes field.
532 const SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::getSFTypes(void) const
534 return &_sfTypes;
537 SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::editSFTypes (void)
539 editSField(TypesFieldMask);
541 return &_sfTypes;
544 //! Get the value of the Geometry::_sfTypes field.
545 GeoIntegralProperty * GeometryBase::getTypes(void) const
547 return _sfTypes.getValue();
550 //! Set the value of the Geometry::_sfTypes field.
551 void GeometryBase::setTypes(GeoIntegralProperty * const value)
553 editSField(TypesFieldMask);
555 _sfTypes.setValue(value);
559 //! Get the Geometry::_sfLengths field.
560 const SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::getSFLengths(void) const
562 return &_sfLengths;
565 SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::editSFLengths (void)
567 editSField(LengthsFieldMask);
569 return &_sfLengths;
572 //! Get the value of the Geometry::_sfLengths field.
573 GeoIntegralProperty * GeometryBase::getLengths(void) const
575 return _sfLengths.getValue();
578 //! Set the value of the Geometry::_sfLengths field.
579 void GeometryBase::setLengths(GeoIntegralProperty * const value)
581 editSField(LengthsFieldMask);
583 _sfLengths.setValue(value);
587 //! Get the Geometry::_mfProperties field.
588 const MFUnrecChildGeoVectorPropertyPtr *GeometryBase::getMFProperties(void) const
590 return &_mfProperties;
593 MFUnrecChildGeoVectorPropertyPtr *GeometryBase::editMFProperties (void)
595 editMField(PropertiesFieldMask, _mfProperties);
597 return &_mfProperties;
599 GeoVectorProperty * GeometryBase::getProperties(const UInt32 index) const
601 return _mfProperties[index];
604 //! Get the Geometry::_mfPropIndices field.
605 const MFUnrecChildGeoIntegralPropertyPtr *GeometryBase::getMFPropIndices(void) const
607 return &_mfPropIndices;
610 MFUnrecChildGeoIntegralPropertyPtr *GeometryBase::editMFPropIndices (void)
612 editMField(PropIndicesFieldMask, _mfPropIndices);
614 return &_mfPropIndices;
616 GeoIntegralProperty * GeometryBase::getPropIndices(const UInt32 index) const
618 return _mfPropIndices[index];
621 SFUInt32 *GeometryBase::editSFPatchVertices(void)
623 editSField(PatchVerticesFieldMask);
625 return &_sfPatchVertices;
628 const SFUInt32 *GeometryBase::getSFPatchVertices(void) const
630 return &_sfPatchVertices;
634 SFBool *GeometryBase::editSFDlistCache(void)
636 editSField(DlistCacheFieldMask);
638 return &_sfDlistCache;
641 const SFBool *GeometryBase::getSFDlistCache(void) const
643 return &_sfDlistCache;
647 SFBool *GeometryBase::editSFUseVAO(void)
649 editSField(UseVAOFieldMask);
651 return &_sfUseVAO;
654 const SFBool *GeometryBase::getSFUseVAO(void) const
656 return &_sfUseVAO;
660 SFBool *GeometryBase::editSFUseAttribCalls(void)
662 editSField(UseAttribCallsFieldMask);
664 return &_sfUseAttribCalls;
667 const SFBool *GeometryBase::getSFUseAttribCalls(void) const
669 return &_sfUseAttribCalls;
673 SFInt32 *GeometryBase::editSFClassicGLId(void)
675 editSField(ClassicGLIdFieldMask);
677 return &_sfClassicGLId;
680 const SFInt32 *GeometryBase::getSFClassicGLId(void) const
682 return &_sfClassicGLId;
686 SFInt32 *GeometryBase::editSFAttGLId(void)
688 editSField(AttGLIdFieldMask);
690 return &_sfAttGLId;
693 const SFInt32 *GeometryBase::getSFAttGLId(void) const
695 return &_sfAttGLId;
699 SFInt32 *GeometryBase::editSFClassicVaoGLId(void)
701 editSField(ClassicVaoGLIdFieldMask);
703 return &_sfClassicVaoGLId;
706 const SFInt32 *GeometryBase::getSFClassicVaoGLId(void) const
708 return &_sfClassicVaoGLId;
712 SFInt32 *GeometryBase::editSFAttribVaoGLId(void)
714 editSField(AttribVaoGLIdFieldMask);
716 return &_sfAttribVaoGLId;
719 const SFInt32 *GeometryBase::getSFAttribVaoGLId(void) const
721 return &_sfAttribVaoGLId;
727 void GeometryBase::pushToProperties(GeoVectorProperty * const value)
729 editMField(PropertiesFieldMask, _mfProperties);
731 _mfProperties.push_back(value);
734 void GeometryBase::assignProperties(const MFUnrecChildGeoVectorPropertyPtr &value)
736 MFUnrecChildGeoVectorPropertyPtr::const_iterator elemIt =
737 value.begin();
738 MFUnrecChildGeoVectorPropertyPtr::const_iterator elemEnd =
739 value.end ();
741 static_cast<Geometry *>(this)->clearProperties();
743 while(elemIt != elemEnd)
745 this->pushToProperties(*elemIt);
747 ++elemIt;
751 void GeometryBase::removeFromProperties(UInt32 uiIndex)
753 if(uiIndex < _mfProperties.size())
755 editMField(PropertiesFieldMask, _mfProperties);
757 _mfProperties.erase(uiIndex);
761 void GeometryBase::removeObjFromProperties(GeoVectorProperty * const value)
763 Int32 iElemIdx = _mfProperties.findIndex(value);
765 if(iElemIdx != -1)
767 editMField(PropertiesFieldMask, _mfProperties);
769 _mfProperties.erase(iElemIdx);
772 void GeometryBase::clearProperties(void)
774 editMField(PropertiesFieldMask, _mfProperties);
777 _mfProperties.clear();
780 void GeometryBase::pushToPropIndices(GeoIntegralProperty * const value)
782 editMField(PropIndicesFieldMask, _mfPropIndices);
784 _mfPropIndices.push_back(value);
787 void GeometryBase::assignPropIndices(const MFUnrecChildGeoIntegralPropertyPtr &value)
789 MFUnrecChildGeoIntegralPropertyPtr::const_iterator elemIt =
790 value.begin();
791 MFUnrecChildGeoIntegralPropertyPtr::const_iterator elemEnd =
792 value.end ();
794 static_cast<Geometry *>(this)->clearPropIndices();
796 while(elemIt != elemEnd)
798 this->pushToPropIndices(*elemIt);
800 ++elemIt;
804 void GeometryBase::removeFromPropIndices(UInt32 uiIndex)
806 if(uiIndex < _mfPropIndices.size())
808 editMField(PropIndicesFieldMask, _mfPropIndices);
810 _mfPropIndices.erase(uiIndex);
814 void GeometryBase::removeObjFromPropIndices(GeoIntegralProperty * const value)
816 Int32 iElemIdx = _mfPropIndices.findIndex(value);
818 if(iElemIdx != -1)
820 editMField(PropIndicesFieldMask, _mfPropIndices);
822 _mfPropIndices.erase(iElemIdx);
825 void GeometryBase::clearPropIndices(void)
827 editMField(PropIndicesFieldMask, _mfPropIndices);
830 _mfPropIndices.clear();
835 /*------------------------------ access -----------------------------------*/
837 SizeT GeometryBase::getBinSize(ConstFieldMaskArg whichField)
839 SizeT returnValue = Inherited::getBinSize(whichField);
841 if(FieldBits::NoField != (TypesFieldMask & whichField))
843 returnValue += _sfTypes.getBinSize();
845 if(FieldBits::NoField != (LengthsFieldMask & whichField))
847 returnValue += _sfLengths.getBinSize();
849 if(FieldBits::NoField != (PropertiesFieldMask & whichField))
851 returnValue += _mfProperties.getBinSize();
853 if(FieldBits::NoField != (PropIndicesFieldMask & whichField))
855 returnValue += _mfPropIndices.getBinSize();
857 if(FieldBits::NoField != (PatchVerticesFieldMask & whichField))
859 returnValue += _sfPatchVertices.getBinSize();
861 if(FieldBits::NoField != (DlistCacheFieldMask & whichField))
863 returnValue += _sfDlistCache.getBinSize();
865 if(FieldBits::NoField != (UseVAOFieldMask & whichField))
867 returnValue += _sfUseVAO.getBinSize();
869 if(FieldBits::NoField != (UseAttribCallsFieldMask & whichField))
871 returnValue += _sfUseAttribCalls.getBinSize();
873 if(FieldBits::NoField != (ClassicGLIdFieldMask & whichField))
875 returnValue += _sfClassicGLId.getBinSize();
877 if(FieldBits::NoField != (AttGLIdFieldMask & whichField))
879 returnValue += _sfAttGLId.getBinSize();
881 if(FieldBits::NoField != (ClassicVaoGLIdFieldMask & whichField))
883 returnValue += _sfClassicVaoGLId.getBinSize();
885 if(FieldBits::NoField != (AttribVaoGLIdFieldMask & whichField))
887 returnValue += _sfAttribVaoGLId.getBinSize();
890 return returnValue;
893 void GeometryBase::copyToBin(BinaryDataHandler &pMem,
894 ConstFieldMaskArg whichField)
896 Inherited::copyToBin(pMem, whichField);
898 if(FieldBits::NoField != (TypesFieldMask & whichField))
900 _sfTypes.copyToBin(pMem);
902 if(FieldBits::NoField != (LengthsFieldMask & whichField))
904 _sfLengths.copyToBin(pMem);
906 if(FieldBits::NoField != (PropertiesFieldMask & whichField))
908 _mfProperties.copyToBin(pMem);
910 if(FieldBits::NoField != (PropIndicesFieldMask & whichField))
912 _mfPropIndices.copyToBin(pMem);
914 if(FieldBits::NoField != (PatchVerticesFieldMask & whichField))
916 _sfPatchVertices.copyToBin(pMem);
918 if(FieldBits::NoField != (DlistCacheFieldMask & whichField))
920 _sfDlistCache.copyToBin(pMem);
922 if(FieldBits::NoField != (UseVAOFieldMask & whichField))
924 _sfUseVAO.copyToBin(pMem);
926 if(FieldBits::NoField != (UseAttribCallsFieldMask & whichField))
928 _sfUseAttribCalls.copyToBin(pMem);
930 if(FieldBits::NoField != (ClassicGLIdFieldMask & whichField))
932 _sfClassicGLId.copyToBin(pMem);
934 if(FieldBits::NoField != (AttGLIdFieldMask & whichField))
936 _sfAttGLId.copyToBin(pMem);
938 if(FieldBits::NoField != (ClassicVaoGLIdFieldMask & whichField))
940 _sfClassicVaoGLId.copyToBin(pMem);
942 if(FieldBits::NoField != (AttribVaoGLIdFieldMask & whichField))
944 _sfAttribVaoGLId.copyToBin(pMem);
948 void GeometryBase::copyFromBin(BinaryDataHandler &pMem,
949 ConstFieldMaskArg whichField)
951 Inherited::copyFromBin(pMem, whichField);
953 if(FieldBits::NoField != (TypesFieldMask & whichField))
955 editSField(TypesFieldMask);
956 _sfTypes.copyFromBin(pMem);
958 if(FieldBits::NoField != (LengthsFieldMask & whichField))
960 editSField(LengthsFieldMask);
961 _sfLengths.copyFromBin(pMem);
963 if(FieldBits::NoField != (PropertiesFieldMask & whichField))
965 editMField(PropertiesFieldMask, _mfProperties);
966 _mfProperties.copyFromBin(pMem);
968 if(FieldBits::NoField != (PropIndicesFieldMask & whichField))
970 editMField(PropIndicesFieldMask, _mfPropIndices);
971 _mfPropIndices.copyFromBin(pMem);
973 if(FieldBits::NoField != (PatchVerticesFieldMask & whichField))
975 editSField(PatchVerticesFieldMask);
976 _sfPatchVertices.copyFromBin(pMem);
978 if(FieldBits::NoField != (DlistCacheFieldMask & whichField))
980 editSField(DlistCacheFieldMask);
981 _sfDlistCache.copyFromBin(pMem);
983 if(FieldBits::NoField != (UseVAOFieldMask & whichField))
985 editSField(UseVAOFieldMask);
986 _sfUseVAO.copyFromBin(pMem);
988 if(FieldBits::NoField != (UseAttribCallsFieldMask & whichField))
990 editSField(UseAttribCallsFieldMask);
991 _sfUseAttribCalls.copyFromBin(pMem);
993 if(FieldBits::NoField != (ClassicGLIdFieldMask & whichField))
995 editSField(ClassicGLIdFieldMask);
996 _sfClassicGLId.copyFromBin(pMem);
998 if(FieldBits::NoField != (AttGLIdFieldMask & whichField))
1000 editSField(AttGLIdFieldMask);
1001 _sfAttGLId.copyFromBin(pMem);
1003 if(FieldBits::NoField != (ClassicVaoGLIdFieldMask & whichField))
1005 editSField(ClassicVaoGLIdFieldMask);
1006 _sfClassicVaoGLId.copyFromBin(pMem);
1008 if(FieldBits::NoField != (AttribVaoGLIdFieldMask & whichField))
1010 editSField(AttribVaoGLIdFieldMask);
1011 _sfAttribVaoGLId.copyFromBin(pMem);
1015 //! create a new instance of the class
1016 GeometryTransitPtr GeometryBase::createLocal(BitVector bFlags)
1018 GeometryTransitPtr fc;
1020 if(getClassType().getPrototype() != NULL)
1022 FieldContainerTransitPtr tmpPtr =
1023 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
1025 fc = dynamic_pointer_cast<Geometry>(tmpPtr);
1028 return fc;
1031 //! create a new instance of the class, copy the container flags
1032 GeometryTransitPtr GeometryBase::createDependent(BitVector bFlags)
1034 GeometryTransitPtr fc;
1036 if(getClassType().getPrototype() != NULL)
1038 FieldContainerTransitPtr tmpPtr =
1039 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
1041 fc = dynamic_pointer_cast<Geometry>(tmpPtr);
1044 return fc;
1047 //! create a new instance of the class
1048 GeometryTransitPtr GeometryBase::create(void)
1050 GeometryTransitPtr fc;
1052 if(getClassType().getPrototype() != NULL)
1054 FieldContainerTransitPtr tmpPtr =
1055 getClassType().getPrototype()-> shallowCopy();
1057 fc = dynamic_pointer_cast<Geometry>(tmpPtr);
1060 return fc;
1063 Geometry *GeometryBase::createEmptyLocal(BitVector bFlags)
1065 Geometry *returnValue;
1067 newPtr<Geometry>(returnValue, bFlags);
1069 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
1071 return returnValue;
1074 //! create an empty new instance of the class, do not copy the prototype
1075 Geometry *GeometryBase::createEmpty(void)
1077 Geometry *returnValue;
1079 newPtr<Geometry>(returnValue, Thread::getCurrentLocalFlags());
1081 returnValue->_pFieldFlags->_bNamespaceMask &=
1082 ~Thread::getCurrentLocalFlags();
1084 return returnValue;
1088 FieldContainerTransitPtr GeometryBase::shallowCopyLocal(
1089 BitVector bFlags) const
1091 Geometry *tmpPtr;
1093 newPtr(tmpPtr, dynamic_cast<const Geometry *>(this), bFlags);
1095 FieldContainerTransitPtr returnValue(tmpPtr);
1097 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
1099 return returnValue;
1102 FieldContainerTransitPtr GeometryBase::shallowCopyDependent(
1103 BitVector bFlags) const
1105 Geometry *tmpPtr;
1107 newPtr(tmpPtr, dynamic_cast<const Geometry *>(this), ~bFlags);
1109 FieldContainerTransitPtr returnValue(tmpPtr);
1111 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
1113 return returnValue;
1116 FieldContainerTransitPtr GeometryBase::shallowCopy(void) const
1118 Geometry *tmpPtr;
1120 newPtr(tmpPtr,
1121 dynamic_cast<const Geometry *>(this),
1122 Thread::getCurrentLocalFlags());
1124 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
1126 FieldContainerTransitPtr returnValue(tmpPtr);
1128 return returnValue;
1134 /*------------------------- constructors ----------------------------------*/
1136 GeometryBase::GeometryBase(void) :
1137 Inherited(),
1138 _sfTypes (this,
1139 TypesFieldId,
1140 GeoIntegralProperty::ParentsFieldId),
1141 _sfLengths (this,
1142 LengthsFieldId,
1143 GeoIntegralProperty::ParentsFieldId),
1144 _mfProperties (this,
1145 PropertiesFieldId,
1146 GeoVectorProperty::ParentsFieldId),
1147 _mfPropIndices (this,
1148 PropIndicesFieldId,
1149 GeoIntegralProperty::ParentsFieldId),
1150 _sfPatchVertices (UInt32(0)),
1151 _sfDlistCache (bool(true)),
1152 _sfUseVAO (bool(true)),
1153 _sfUseAttribCalls (bool(false)),
1154 _sfClassicGLId (Int32(0)),
1155 _sfAttGLId (Int32(0)),
1156 _sfClassicVaoGLId (Int32(0)),
1157 _sfAttribVaoGLId (Int32(0))
1161 GeometryBase::GeometryBase(const GeometryBase &source) :
1162 Inherited(source),
1163 _sfTypes (this,
1164 TypesFieldId,
1165 GeoIntegralProperty::ParentsFieldId),
1166 _sfLengths (this,
1167 LengthsFieldId,
1168 GeoIntegralProperty::ParentsFieldId),
1169 _mfProperties (this,
1170 PropertiesFieldId,
1171 GeoVectorProperty::ParentsFieldId),
1172 _mfPropIndices (this,
1173 PropIndicesFieldId,
1174 GeoIntegralProperty::ParentsFieldId),
1175 _sfPatchVertices (source._sfPatchVertices ),
1176 _sfDlistCache (source._sfDlistCache ),
1177 _sfUseVAO (source._sfUseVAO ),
1178 _sfUseAttribCalls (source._sfUseAttribCalls ),
1179 _sfClassicGLId (source._sfClassicGLId ),
1180 _sfAttGLId (source._sfAttGLId ),
1181 _sfClassicVaoGLId (source._sfClassicVaoGLId ),
1182 _sfAttribVaoGLId (source._sfAttribVaoGLId )
1187 /*-------------------------- destructors ----------------------------------*/
1189 GeometryBase::~GeometryBase(void)
1193 /*-------------------------------------------------------------------------*/
1194 /* Child linking */
1196 bool GeometryBase::unlinkChild(
1197 FieldContainer * const pChild,
1198 UInt16 const childFieldId)
1200 if(childFieldId == TypesFieldId)
1202 GeoIntegralProperty * pTypedChild =
1203 dynamic_cast<GeoIntegralProperty *>(pChild);
1205 if(pTypedChild != NULL)
1207 if(_sfTypes.getValue() == pTypedChild)
1209 editSField(TypesFieldMask);
1211 _sfTypes.setValue(NULL);
1213 return true;
1216 SWARNING << "Parent ([" << this
1217 << "] id [" << this->getId()
1218 << "] type [" << this->getType().getCName()
1219 << "] childFieldId [" << childFieldId
1220 << "]) - Child ([" << pChild
1221 << "] id [" << pChild->getId()
1222 << "] type [" << pChild->getType().getCName()
1223 << "]): link inconsistent!"
1224 << std::endl;
1226 return false;
1229 return false;
1232 if(childFieldId == LengthsFieldId)
1234 GeoIntegralProperty * pTypedChild =
1235 dynamic_cast<GeoIntegralProperty *>(pChild);
1237 if(pTypedChild != NULL)
1239 if(_sfLengths.getValue() == pTypedChild)
1241 editSField(LengthsFieldMask);
1243 _sfLengths.setValue(NULL);
1245 return true;
1248 SWARNING << "Parent ([" << this
1249 << "] id [" << this->getId()
1250 << "] type [" << this->getType().getCName()
1251 << "] childFieldId [" << childFieldId
1252 << "]) - Child ([" << pChild
1253 << "] id [" << pChild->getId()
1254 << "] type [" << pChild->getType().getCName()
1255 << "]): link inconsistent!"
1256 << std::endl;
1258 return false;
1261 return false;
1264 if(childFieldId == PropertiesFieldId)
1266 GeoVectorProperty * pTypedChild =
1267 dynamic_cast<GeoVectorProperty *>(pChild);
1269 if(pTypedChild != NULL)
1271 Int32 iChildIdx = _mfProperties.findIndex(pTypedChild);
1273 if(iChildIdx != -1)
1275 editMField(PropertiesFieldMask, _mfProperties);
1277 _mfProperties.erase(iChildIdx);
1279 return true;
1282 SWARNING << "Parent ([" << this
1283 << "] id [" << this->getId()
1284 << "] type [" << this->getType().getCName()
1285 << "] childFieldId [" << childFieldId
1286 << "]) - Child ([" << pChild
1287 << "] id [" << pChild->getId()
1288 << "] type [" << pChild->getType().getCName()
1289 << "]): link inconsistent!"
1290 << std::endl;
1292 return false;
1295 return false;
1298 if(childFieldId == PropIndicesFieldId)
1300 GeoIntegralProperty * pTypedChild =
1301 dynamic_cast<GeoIntegralProperty *>(pChild);
1303 if(pTypedChild != NULL)
1305 Int32 iChildIdx = _mfPropIndices.findIndex(pTypedChild);
1307 if(iChildIdx != -1)
1309 editMField(PropIndicesFieldMask, _mfPropIndices);
1311 _mfPropIndices.erase(iChildIdx);
1313 return true;
1316 SWARNING << "Parent ([" << this
1317 << "] id [" << this->getId()
1318 << "] type [" << this->getType().getCName()
1319 << "] childFieldId [" << childFieldId
1320 << "]) - Child ([" << pChild
1321 << "] id [" << pChild->getId()
1322 << "] type [" << pChild->getType().getCName()
1323 << "]): link inconsistent!"
1324 << std::endl;
1326 return false;
1329 return false;
1333 return Inherited::unlinkChild(pChild, childFieldId);
1336 void GeometryBase::onCreate(const Geometry *source)
1338 Inherited::onCreate(source);
1340 if(source != NULL)
1342 Geometry *pThis = static_cast<Geometry *>(this);
1344 pThis->setTypes(source->getTypes());
1346 pThis->setLengths(source->getLengths());
1348 MFUnrecChildGeoVectorPropertyPtr::const_iterator PropertiesIt =
1349 source->_mfProperties.begin();
1350 MFUnrecChildGeoVectorPropertyPtr::const_iterator PropertiesEnd =
1351 source->_mfProperties.end ();
1353 while(PropertiesIt != PropertiesEnd)
1355 pThis->pushToProperties(*PropertiesIt);
1357 ++PropertiesIt;
1360 MFUnrecChildGeoIntegralPropertyPtr::const_iterator PropIndicesIt =
1361 source->_mfPropIndices.begin();
1362 MFUnrecChildGeoIntegralPropertyPtr::const_iterator PropIndicesEnd =
1363 source->_mfPropIndices.end ();
1365 while(PropIndicesIt != PropIndicesEnd)
1367 pThis->pushToPropIndices(*PropIndicesIt);
1369 ++PropIndicesIt;
1374 GetFieldHandlePtr GeometryBase::getHandleTypes (void) const
1376 SFUnrecChildGeoIntegralPropertyPtr::GetHandlePtr returnValue(
1377 new SFUnrecChildGeoIntegralPropertyPtr::GetHandle(
1378 &_sfTypes,
1379 this->getType().getFieldDesc(TypesFieldId),
1380 const_cast<GeometryBase *>(this)));
1382 return returnValue;
1385 EditFieldHandlePtr GeometryBase::editHandleTypes (void)
1387 SFUnrecChildGeoIntegralPropertyPtr::EditHandlePtr returnValue(
1388 new SFUnrecChildGeoIntegralPropertyPtr::EditHandle(
1389 &_sfTypes,
1390 this->getType().getFieldDesc(TypesFieldId),
1391 this));
1393 returnValue->setSetMethod(
1394 boost::bind(&Geometry::setTypes,
1395 static_cast<Geometry *>(this), _1));
1397 editSField(TypesFieldMask);
1399 return returnValue;
1402 GetFieldHandlePtr GeometryBase::getHandleLengths (void) const
1404 SFUnrecChildGeoIntegralPropertyPtr::GetHandlePtr returnValue(
1405 new SFUnrecChildGeoIntegralPropertyPtr::GetHandle(
1406 &_sfLengths,
1407 this->getType().getFieldDesc(LengthsFieldId),
1408 const_cast<GeometryBase *>(this)));
1410 return returnValue;
1413 EditFieldHandlePtr GeometryBase::editHandleLengths (void)
1415 SFUnrecChildGeoIntegralPropertyPtr::EditHandlePtr returnValue(
1416 new SFUnrecChildGeoIntegralPropertyPtr::EditHandle(
1417 &_sfLengths,
1418 this->getType().getFieldDesc(LengthsFieldId),
1419 this));
1421 returnValue->setSetMethod(
1422 boost::bind(&Geometry::setLengths,
1423 static_cast<Geometry *>(this), _1));
1425 editSField(LengthsFieldMask);
1427 return returnValue;
1430 GetFieldHandlePtr GeometryBase::getHandleProperties (void) const
1432 MFUnrecChildGeoVectorPropertyPtr::GetHandlePtr returnValue(
1433 new MFUnrecChildGeoVectorPropertyPtr::GetHandle(
1434 &_mfProperties,
1435 this->getType().getFieldDesc(PropertiesFieldId),
1436 const_cast<GeometryBase *>(this)));
1438 return returnValue;
1441 EditFieldHandlePtr GeometryBase::editHandleProperties (void)
1443 MFUnrecChildGeoVectorPropertyPtr::EditHandlePtr returnValue(
1444 new MFUnrecChildGeoVectorPropertyPtr::EditHandle(
1445 &_mfProperties,
1446 this->getType().getFieldDesc(PropertiesFieldId),
1447 this));
1449 returnValue->setAddMethod(
1450 boost::bind(&Geometry::pushToProperties,
1451 static_cast<Geometry *>(this), _1));
1452 returnValue->setRemoveMethod(
1453 boost::bind(&Geometry::removeFromProperties,
1454 static_cast<Geometry *>(this), _1));
1455 returnValue->setRemoveObjMethod(
1456 boost::bind(&Geometry::removeObjFromProperties,
1457 static_cast<Geometry *>(this), _1));
1458 returnValue->setClearMethod(
1459 boost::bind(&Geometry::clearProperties,
1460 static_cast<Geometry *>(this)));
1462 editMField(PropertiesFieldMask, _mfProperties);
1464 return returnValue;
1467 GetFieldHandlePtr GeometryBase::getHandlePropIndices (void) const
1469 MFUnrecChildGeoIntegralPropertyPtr::GetHandlePtr returnValue(
1470 new MFUnrecChildGeoIntegralPropertyPtr::GetHandle(
1471 &_mfPropIndices,
1472 this->getType().getFieldDesc(PropIndicesFieldId),
1473 const_cast<GeometryBase *>(this)));
1475 return returnValue;
1478 EditFieldHandlePtr GeometryBase::editHandlePropIndices (void)
1480 MFUnrecChildGeoIntegralPropertyPtr::EditHandlePtr returnValue(
1481 new MFUnrecChildGeoIntegralPropertyPtr::EditHandle(
1482 &_mfPropIndices,
1483 this->getType().getFieldDesc(PropIndicesFieldId),
1484 this));
1486 returnValue->setAddMethod(
1487 boost::bind(&Geometry::pushToPropIndices,
1488 static_cast<Geometry *>(this), _1));
1489 returnValue->setRemoveMethod(
1490 boost::bind(&Geometry::removeFromPropIndices,
1491 static_cast<Geometry *>(this), _1));
1492 returnValue->setRemoveObjMethod(
1493 boost::bind(&Geometry::removeObjFromPropIndices,
1494 static_cast<Geometry *>(this), _1));
1495 returnValue->setClearMethod(
1496 boost::bind(&Geometry::clearPropIndices,
1497 static_cast<Geometry *>(this)));
1499 editMField(PropIndicesFieldMask, _mfPropIndices);
1501 return returnValue;
1504 GetFieldHandlePtr GeometryBase::getHandlePatchVertices (void) const
1506 SFUInt32::GetHandlePtr returnValue(
1507 new SFUInt32::GetHandle(
1508 &_sfPatchVertices,
1509 this->getType().getFieldDesc(PatchVerticesFieldId),
1510 const_cast<GeometryBase *>(this)));
1512 return returnValue;
1515 EditFieldHandlePtr GeometryBase::editHandlePatchVertices (void)
1517 SFUInt32::EditHandlePtr returnValue(
1518 new SFUInt32::EditHandle(
1519 &_sfPatchVertices,
1520 this->getType().getFieldDesc(PatchVerticesFieldId),
1521 this));
1524 editSField(PatchVerticesFieldMask);
1526 return returnValue;
1529 GetFieldHandlePtr GeometryBase::getHandleDlistCache (void) const
1531 SFBool::GetHandlePtr returnValue(
1532 new SFBool::GetHandle(
1533 &_sfDlistCache,
1534 this->getType().getFieldDesc(DlistCacheFieldId),
1535 const_cast<GeometryBase *>(this)));
1537 return returnValue;
1540 EditFieldHandlePtr GeometryBase::editHandleDlistCache (void)
1542 SFBool::EditHandlePtr returnValue(
1543 new SFBool::EditHandle(
1544 &_sfDlistCache,
1545 this->getType().getFieldDesc(DlistCacheFieldId),
1546 this));
1549 editSField(DlistCacheFieldMask);
1551 return returnValue;
1554 GetFieldHandlePtr GeometryBase::getHandleUseVAO (void) const
1556 SFBool::GetHandlePtr returnValue(
1557 new SFBool::GetHandle(
1558 &_sfUseVAO,
1559 this->getType().getFieldDesc(UseVAOFieldId),
1560 const_cast<GeometryBase *>(this)));
1562 return returnValue;
1565 EditFieldHandlePtr GeometryBase::editHandleUseVAO (void)
1567 SFBool::EditHandlePtr returnValue(
1568 new SFBool::EditHandle(
1569 &_sfUseVAO,
1570 this->getType().getFieldDesc(UseVAOFieldId),
1571 this));
1574 editSField(UseVAOFieldMask);
1576 return returnValue;
1579 GetFieldHandlePtr GeometryBase::getHandleUseAttribCalls (void) const
1581 SFBool::GetHandlePtr returnValue(
1582 new SFBool::GetHandle(
1583 &_sfUseAttribCalls,
1584 this->getType().getFieldDesc(UseAttribCallsFieldId),
1585 const_cast<GeometryBase *>(this)));
1587 return returnValue;
1590 EditFieldHandlePtr GeometryBase::editHandleUseAttribCalls (void)
1592 SFBool::EditHandlePtr returnValue(
1593 new SFBool::EditHandle(
1594 &_sfUseAttribCalls,
1595 this->getType().getFieldDesc(UseAttribCallsFieldId),
1596 this));
1599 editSField(UseAttribCallsFieldMask);
1601 return returnValue;
1604 GetFieldHandlePtr GeometryBase::getHandleClassicGLId (void) const
1606 SFInt32::GetHandlePtr returnValue(
1607 new SFInt32::GetHandle(
1608 &_sfClassicGLId,
1609 this->getType().getFieldDesc(ClassicGLIdFieldId),
1610 const_cast<GeometryBase *>(this)));
1612 return returnValue;
1615 EditFieldHandlePtr GeometryBase::editHandleClassicGLId (void)
1617 SFInt32::EditHandlePtr returnValue(
1618 new SFInt32::EditHandle(
1619 &_sfClassicGLId,
1620 this->getType().getFieldDesc(ClassicGLIdFieldId),
1621 this));
1624 editSField(ClassicGLIdFieldMask);
1626 return returnValue;
1629 GetFieldHandlePtr GeometryBase::getHandleAttGLId (void) const
1631 SFInt32::GetHandlePtr returnValue(
1632 new SFInt32::GetHandle(
1633 &_sfAttGLId,
1634 this->getType().getFieldDesc(AttGLIdFieldId),
1635 const_cast<GeometryBase *>(this)));
1637 return returnValue;
1640 EditFieldHandlePtr GeometryBase::editHandleAttGLId (void)
1642 SFInt32::EditHandlePtr returnValue(
1643 new SFInt32::EditHandle(
1644 &_sfAttGLId,
1645 this->getType().getFieldDesc(AttGLIdFieldId),
1646 this));
1649 editSField(AttGLIdFieldMask);
1651 return returnValue;
1654 GetFieldHandlePtr GeometryBase::getHandleClassicVaoGLId (void) const
1656 SFInt32::GetHandlePtr returnValue(
1657 new SFInt32::GetHandle(
1658 &_sfClassicVaoGLId,
1659 this->getType().getFieldDesc(ClassicVaoGLIdFieldId),
1660 const_cast<GeometryBase *>(this)));
1662 return returnValue;
1665 EditFieldHandlePtr GeometryBase::editHandleClassicVaoGLId (void)
1667 SFInt32::EditHandlePtr returnValue(
1668 new SFInt32::EditHandle(
1669 &_sfClassicVaoGLId,
1670 this->getType().getFieldDesc(ClassicVaoGLIdFieldId),
1671 this));
1674 editSField(ClassicVaoGLIdFieldMask);
1676 return returnValue;
1679 GetFieldHandlePtr GeometryBase::getHandleAttribVaoGLId (void) const
1681 SFInt32::GetHandlePtr returnValue(
1682 new SFInt32::GetHandle(
1683 &_sfAttribVaoGLId,
1684 this->getType().getFieldDesc(AttribVaoGLIdFieldId),
1685 const_cast<GeometryBase *>(this)));
1687 return returnValue;
1690 EditFieldHandlePtr GeometryBase::editHandleAttribVaoGLId (void)
1692 SFInt32::EditHandlePtr returnValue(
1693 new SFInt32::EditHandle(
1694 &_sfAttribVaoGLId,
1695 this->getType().getFieldDesc(AttribVaoGLIdFieldId),
1696 this));
1699 editSField(AttribVaoGLIdFieldMask);
1701 return returnValue;
1705 #ifdef OSG_MT_CPTR_ASPECT
1706 void GeometryBase::execSyncV( FieldContainer &oFrom,
1707 ConstFieldMaskArg whichField,
1708 AspectOffsetStore &oOffsets,
1709 ConstFieldMaskArg syncMode,
1710 const UInt32 uiSyncInfo)
1712 Geometry *pThis = static_cast<Geometry *>(this);
1714 pThis->execSync(static_cast<Geometry *>(&oFrom),
1715 whichField,
1716 oOffsets,
1717 syncMode,
1718 uiSyncInfo);
1720 #endif
1723 #ifdef OSG_MT_CPTR_ASPECT
1724 FieldContainer *GeometryBase::createAspectCopy(
1725 const FieldContainer *pRefAspect) const
1727 Geometry *returnValue;
1729 newAspectCopy(returnValue,
1730 dynamic_cast<const Geometry *>(pRefAspect),
1731 dynamic_cast<const Geometry *>(this));
1733 return returnValue;
1735 #endif
1737 void GeometryBase::resolveLinks(void)
1739 Inherited::resolveLinks();
1741 static_cast<Geometry *>(this)->setTypes(NULL);
1743 static_cast<Geometry *>(this)->setLengths(NULL);
1745 static_cast<Geometry *>(this)->clearProperties();
1747 static_cast<Geometry *>(this)->clearPropIndices();
1753 OSG_END_NAMESPACE