1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
48 ** class DrawableStatsAttachment!
50 *****************************************************************************
51 \*****************************************************************************/
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
61 #include "OSGConfig.h"
66 #include "OSGDrawableStatsAttachmentBase.h"
67 #include "OSGDrawableStatsAttachment.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::DrawableStatsAttachment
78 The base class for drawable statistics.
80 It is designed as an attachment so that it can be kept inside the graph. It
81 can also be used to keep aggregated information about subtrees, by adding up
82 the contributions of the underlying nodes. It can invalidate itself by using
83 changed callbacks, so that no manual bookkeeping is necessary.
85 \warning To use the automatic update you have to use the
86 OSG::GeoStatsAttachment::addTo() or OSG::GeoStatsAttachment::attachTo()
87 methods! Otherwise the necessary callbacks are not set!
89 \warning Before accessing the data OSG::GeoStatsAttachment::validate() needs
90 to be called to calculate and aggregate the results.
93 /***************************************************************************\
94 * Field Documentation *
95 \***************************************************************************/
97 /*! \var UInt32 DrawableStatsAttachmentBase::_sfVertices
98 The number of vertices in the subtree.
101 /*! \var UInt32 DrawableStatsAttachmentBase::_sfPoints
102 The number of points in the subtree.
105 /*! \var UInt32 DrawableStatsAttachmentBase::_sfLines
106 The number of lines in the subtree.
109 /*! \var UInt32 DrawableStatsAttachmentBase::_sfTriangles
110 The number of triangles in the subtree.
113 /*! \var UInt32 DrawableStatsAttachmentBase::_sfPatches
114 The number of lines in the subtree.
117 /*! \var UInt32 DrawableStatsAttachmentBase::_sfProcessedAttributeBytes
118 The number of bytes in vertex attribute data that are processed while rendering.
121 /*! \var UInt32 DrawableStatsAttachmentBase::_sfStoredAttributeBytes
122 The number of bytes in vertex attribute data that are stored.
125 /*! \var bool DrawableStatsAttachmentBase::_sfValid
126 Flags whether the data is valid or needs to be updated.
130 /***************************************************************************\
131 * FieldType/FieldTrait Instantiation *
132 \***************************************************************************/
134 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
135 PointerType FieldTraits
<DrawableStatsAttachment
*, nsOSG
>::_type(
136 "DrawableStatsAttachmentPtr",
137 "StatsAttachmentPtr",
138 DrawableStatsAttachment::getClassType(),
142 OSG_FIELDTRAITS_GETTYPE_NS(DrawableStatsAttachment
*, nsOSG
)
144 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
145 DrawableStatsAttachment
*,
148 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
149 DrawableStatsAttachment
*,
152 /***************************************************************************\
153 * Field Description *
154 \***************************************************************************/
156 void DrawableStatsAttachmentBase::classDescInserter(TypeObject
&oType
)
158 FieldDescriptionBase
*pDesc
= NULL
;
161 pDesc
= new SFUInt32::Description(
162 SFUInt32::getClassType(),
164 "The number of vertices in the subtree.\n",
165 VerticesFieldId
, VerticesFieldMask
,
167 (Field::SFDefaultFlags
| Field::FStdAccess
),
168 static_cast<FieldEditMethodSig
>(&DrawableStatsAttachment::editHandleVertices
),
169 static_cast<FieldGetMethodSig
>(&DrawableStatsAttachment::getHandleVertices
));
171 oType
.addInitialDesc(pDesc
);
173 pDesc
= new SFUInt32::Description(
174 SFUInt32::getClassType(),
176 "The number of points in the subtree.\n",
177 PointsFieldId
, PointsFieldMask
,
179 (Field::SFDefaultFlags
| Field::FStdAccess
),
180 static_cast<FieldEditMethodSig
>(&DrawableStatsAttachment::editHandlePoints
),
181 static_cast<FieldGetMethodSig
>(&DrawableStatsAttachment::getHandlePoints
));
183 oType
.addInitialDesc(pDesc
);
185 pDesc
= new SFUInt32::Description(
186 SFUInt32::getClassType(),
188 "The number of lines in the subtree.\n",
189 LinesFieldId
, LinesFieldMask
,
191 (Field::SFDefaultFlags
| Field::FStdAccess
),
192 static_cast<FieldEditMethodSig
>(&DrawableStatsAttachment::editHandleLines
),
193 static_cast<FieldGetMethodSig
>(&DrawableStatsAttachment::getHandleLines
));
195 oType
.addInitialDesc(pDesc
);
197 pDesc
= new SFUInt32::Description(
198 SFUInt32::getClassType(),
200 "The number of triangles in the subtree.\n",
201 TrianglesFieldId
, TrianglesFieldMask
,
203 (Field::SFDefaultFlags
| Field::FStdAccess
),
204 static_cast<FieldEditMethodSig
>(&DrawableStatsAttachment::editHandleTriangles
),
205 static_cast<FieldGetMethodSig
>(&DrawableStatsAttachment::getHandleTriangles
));
207 oType
.addInitialDesc(pDesc
);
209 pDesc
= new SFUInt32::Description(
210 SFUInt32::getClassType(),
212 "The number of lines in the subtree.\n",
213 PatchesFieldId
, PatchesFieldMask
,
215 (Field::SFDefaultFlags
| Field::FStdAccess
),
216 static_cast<FieldEditMethodSig
>(&DrawableStatsAttachment::editHandlePatches
),
217 static_cast<FieldGetMethodSig
>(&DrawableStatsAttachment::getHandlePatches
));
219 oType
.addInitialDesc(pDesc
);
221 pDesc
= new SFUInt32::Description(
222 SFUInt32::getClassType(),
223 "processedAttributeBytes",
224 "The number of bytes in vertex attribute data that are processed while rendering.\n",
225 ProcessedAttributeBytesFieldId
, ProcessedAttributeBytesFieldMask
,
227 (Field::SFDefaultFlags
| Field::FStdAccess
),
228 static_cast<FieldEditMethodSig
>(&DrawableStatsAttachment::editHandleProcessedAttributeBytes
),
229 static_cast<FieldGetMethodSig
>(&DrawableStatsAttachment::getHandleProcessedAttributeBytes
));
231 oType
.addInitialDesc(pDesc
);
233 pDesc
= new SFUInt32::Description(
234 SFUInt32::getClassType(),
235 "storedAttributeBytes",
236 "The number of bytes in vertex attribute data that are stored.\n",
237 StoredAttributeBytesFieldId
, StoredAttributeBytesFieldMask
,
239 (Field::SFDefaultFlags
| Field::FStdAccess
),
240 static_cast<FieldEditMethodSig
>(&DrawableStatsAttachment::editHandleStoredAttributeBytes
),
241 static_cast<FieldGetMethodSig
>(&DrawableStatsAttachment::getHandleStoredAttributeBytes
));
243 oType
.addInitialDesc(pDesc
);
245 pDesc
= new SFBool::Description(
246 SFBool::getClassType(),
248 "Flags whether the data is valid or needs to be updated.\n",
249 ValidFieldId
, ValidFieldMask
,
251 (Field::SFDefaultFlags
| Field::FStdAccess
),
252 static_cast<FieldEditMethodSig
>(&DrawableStatsAttachment::editHandleValid
),
253 static_cast<FieldGetMethodSig
>(&DrawableStatsAttachment::getHandleValid
));
255 oType
.addInitialDesc(pDesc
);
259 DrawableStatsAttachmentBase::TypeObject
DrawableStatsAttachmentBase::_type(
260 DrawableStatsAttachmentBase::getClassname(),
261 Inherited::getClassname(),
262 "DrawableStatsAttachment",
264 reinterpret_cast<PrototypeCreateF
>(&DrawableStatsAttachmentBase::createEmptyLocal
),
265 reinterpret_cast<InitContainerF
>(&DrawableStatsAttachment::initMethod
),
266 reinterpret_cast<ExitContainerF
>(&DrawableStatsAttachment::exitMethod
),
267 reinterpret_cast<InitalInsertDescFunc
>(
268 reinterpret_cast<void *>(&DrawableStatsAttachment::classDescInserter
)),
271 "<?xml version=\"1.0\"?>\n"
274 " name=\"DrawableStatsAttachment\"\n"
275 " parent=\"StatsAttachment\"\n"
276 " library=\"System\"\n"
277 " pointerfieldtypes=\"both\"\n"
278 " structure=\"concrete\"\n"
279 " systemcomponent=\"true\"\n"
280 " parentsystemcomponent=\"true\"\n"
281 " decoratable=\"false\"\n"
282 " docGroupBase=\"GrpSystemNodeCoreDrawables\"\n"
285 " The base class for drawable statistics.\n"
287 " It is designed as an attachment so that it can be kept inside the graph. It\n"
288 " can also be used to keep aggregated information about subtrees, by adding up\n"
289 " the contributions of the underlying nodes. It can invalidate itself by using\n"
290 " changed callbacks, so that no manual bookkeeping is necessary.\n"
292 " \\warning To use the automatic update you have to use the\n"
293 " OSG::GeoStatsAttachment::addTo() or OSG::GeoStatsAttachment::attachTo()\n"
294 " methods! Otherwise the necessary callbacks are not set!\n"
296 " \\warning Before accessing the data OSG::GeoStatsAttachment::validate() needs\n"
297 " to be called to calculate and aggregate the results.\n"
300 "\t name=\"vertices\"\n"
301 "\t type=\"UInt32\"\n"
302 "\t cardinality=\"single\"\n"
303 "\t visibility=\"external\"\n"
304 "\t access=\"public\"\n"
306 " The number of vertices in the subtree.\n"
309 "\t name=\"points\"\n"
310 "\t type=\"UInt32\"\n"
311 "\t cardinality=\"single\"\n"
312 "\t visibility=\"external\"\n"
313 "\t access=\"public\"\n"
315 " The number of points in the subtree.\n"
318 "\t name=\"lines\"\n"
319 "\t type=\"UInt32\"\n"
320 "\t cardinality=\"single\"\n"
321 "\t visibility=\"external\"\n"
322 "\t access=\"public\"\n"
324 " The number of lines in the subtree.\n"
327 "\t name=\"triangles\"\n"
328 "\t type=\"UInt32\"\n"
329 "\t cardinality=\"single\"\n"
330 "\t visibility=\"external\"\n"
331 "\t access=\"public\"\n"
333 " The number of triangles in the subtree.\n"
336 "\t name=\"patches\"\n"
337 "\t type=\"UInt32\"\n"
338 "\t cardinality=\"single\"\n"
339 "\t visibility=\"external\"\n"
340 "\t access=\"public\"\n"
342 " The number of lines in the subtree.\n"
345 "\t name=\"processedAttributeBytes\"\n"
346 "\t type=\"UInt32\"\n"
347 "\t cardinality=\"single\"\n"
348 "\t visibility=\"external\"\n"
349 "\t access=\"public\"\n"
351 " The number of bytes in vertex attribute data that are processed while rendering.\n"
354 "\t name=\"storedAttributeBytes\"\n"
355 "\t type=\"UInt32\"\n"
356 "\t cardinality=\"single\"\n"
357 "\t visibility=\"external\"\n"
358 "\t access=\"public\"\n"
360 " The number of bytes in vertex attribute data that are stored.\n"
363 "\t name=\"valid\"\n"
365 "\t cardinality=\"single\"\n"
366 "\t visibility=\"internal\"\n"
367 "\t access=\"public\"\n"
368 " defaultValue=\"false\"\n"
370 " Flags whether the data is valid or needs to be updated.\n"
372 "</FieldContainer>\n",
373 "The base class for drawable statistics.\n"
375 "It is designed as an attachment so that it can be kept inside the graph. It\n"
376 "can also be used to keep aggregated information about subtrees, by adding up\n"
377 "the contributions of the underlying nodes. It can invalidate itself by using\n"
378 "changed callbacks, so that no manual bookkeeping is necessary.\n"
380 "\\warning To use the automatic update you have to use the\n"
381 "OSG::GeoStatsAttachment::addTo() or OSG::GeoStatsAttachment::attachTo()\n"
382 "methods! Otherwise the necessary callbacks are not set!\n"
384 "\\warning Before accessing the data OSG::GeoStatsAttachment::validate() needs\n"
385 "to be called to calculate and aggregate the results.\n"
388 /*------------------------------ get -----------------------------------*/
390 FieldContainerType
&DrawableStatsAttachmentBase::getType(void)
395 const FieldContainerType
&DrawableStatsAttachmentBase::getType(void) const
400 UInt32
DrawableStatsAttachmentBase::getContainerSize(void) const
402 return sizeof(DrawableStatsAttachment
);
405 /*------------------------- decorator get ------------------------------*/
408 SFUInt32
*DrawableStatsAttachmentBase::editSFVertices(void)
410 editSField(VerticesFieldMask
);
415 const SFUInt32
*DrawableStatsAttachmentBase::getSFVertices(void) const
421 SFUInt32
*DrawableStatsAttachmentBase::editSFPoints(void)
423 editSField(PointsFieldMask
);
428 const SFUInt32
*DrawableStatsAttachmentBase::getSFPoints(void) const
434 SFUInt32
*DrawableStatsAttachmentBase::editSFLines(void)
436 editSField(LinesFieldMask
);
441 const SFUInt32
*DrawableStatsAttachmentBase::getSFLines(void) const
447 SFUInt32
*DrawableStatsAttachmentBase::editSFTriangles(void)
449 editSField(TrianglesFieldMask
);
451 return &_sfTriangles
;
454 const SFUInt32
*DrawableStatsAttachmentBase::getSFTriangles(void) const
456 return &_sfTriangles
;
460 SFUInt32
*DrawableStatsAttachmentBase::editSFPatches(void)
462 editSField(PatchesFieldMask
);
467 const SFUInt32
*DrawableStatsAttachmentBase::getSFPatches(void) const
473 SFUInt32
*DrawableStatsAttachmentBase::editSFProcessedAttributeBytes(void)
475 editSField(ProcessedAttributeBytesFieldMask
);
477 return &_sfProcessedAttributeBytes
;
480 const SFUInt32
*DrawableStatsAttachmentBase::getSFProcessedAttributeBytes(void) const
482 return &_sfProcessedAttributeBytes
;
486 SFUInt32
*DrawableStatsAttachmentBase::editSFStoredAttributeBytes(void)
488 editSField(StoredAttributeBytesFieldMask
);
490 return &_sfStoredAttributeBytes
;
493 const SFUInt32
*DrawableStatsAttachmentBase::getSFStoredAttributeBytes(void) const
495 return &_sfStoredAttributeBytes
;
499 SFBool
*DrawableStatsAttachmentBase::editSFValid(void)
501 editSField(ValidFieldMask
);
506 const SFBool
*DrawableStatsAttachmentBase::getSFValid(void) const
516 /*------------------------------ access -----------------------------------*/
518 SizeT
DrawableStatsAttachmentBase::getBinSize(ConstFieldMaskArg whichField
)
520 SizeT returnValue
= Inherited::getBinSize(whichField
);
522 if(FieldBits::NoField
!= (VerticesFieldMask
& whichField
))
524 returnValue
+= _sfVertices
.getBinSize();
526 if(FieldBits::NoField
!= (PointsFieldMask
& whichField
))
528 returnValue
+= _sfPoints
.getBinSize();
530 if(FieldBits::NoField
!= (LinesFieldMask
& whichField
))
532 returnValue
+= _sfLines
.getBinSize();
534 if(FieldBits::NoField
!= (TrianglesFieldMask
& whichField
))
536 returnValue
+= _sfTriangles
.getBinSize();
538 if(FieldBits::NoField
!= (PatchesFieldMask
& whichField
))
540 returnValue
+= _sfPatches
.getBinSize();
542 if(FieldBits::NoField
!= (ProcessedAttributeBytesFieldMask
& whichField
))
544 returnValue
+= _sfProcessedAttributeBytes
.getBinSize();
546 if(FieldBits::NoField
!= (StoredAttributeBytesFieldMask
& whichField
))
548 returnValue
+= _sfStoredAttributeBytes
.getBinSize();
550 if(FieldBits::NoField
!= (ValidFieldMask
& whichField
))
552 returnValue
+= _sfValid
.getBinSize();
558 void DrawableStatsAttachmentBase::copyToBin(BinaryDataHandler
&pMem
,
559 ConstFieldMaskArg whichField
)
561 Inherited::copyToBin(pMem
, whichField
);
563 if(FieldBits::NoField
!= (VerticesFieldMask
& whichField
))
565 _sfVertices
.copyToBin(pMem
);
567 if(FieldBits::NoField
!= (PointsFieldMask
& whichField
))
569 _sfPoints
.copyToBin(pMem
);
571 if(FieldBits::NoField
!= (LinesFieldMask
& whichField
))
573 _sfLines
.copyToBin(pMem
);
575 if(FieldBits::NoField
!= (TrianglesFieldMask
& whichField
))
577 _sfTriangles
.copyToBin(pMem
);
579 if(FieldBits::NoField
!= (PatchesFieldMask
& whichField
))
581 _sfPatches
.copyToBin(pMem
);
583 if(FieldBits::NoField
!= (ProcessedAttributeBytesFieldMask
& whichField
))
585 _sfProcessedAttributeBytes
.copyToBin(pMem
);
587 if(FieldBits::NoField
!= (StoredAttributeBytesFieldMask
& whichField
))
589 _sfStoredAttributeBytes
.copyToBin(pMem
);
591 if(FieldBits::NoField
!= (ValidFieldMask
& whichField
))
593 _sfValid
.copyToBin(pMem
);
597 void DrawableStatsAttachmentBase::copyFromBin(BinaryDataHandler
&pMem
,
598 ConstFieldMaskArg whichField
)
600 Inherited::copyFromBin(pMem
, whichField
);
602 if(FieldBits::NoField
!= (VerticesFieldMask
& whichField
))
604 editSField(VerticesFieldMask
);
605 _sfVertices
.copyFromBin(pMem
);
607 if(FieldBits::NoField
!= (PointsFieldMask
& whichField
))
609 editSField(PointsFieldMask
);
610 _sfPoints
.copyFromBin(pMem
);
612 if(FieldBits::NoField
!= (LinesFieldMask
& whichField
))
614 editSField(LinesFieldMask
);
615 _sfLines
.copyFromBin(pMem
);
617 if(FieldBits::NoField
!= (TrianglesFieldMask
& whichField
))
619 editSField(TrianglesFieldMask
);
620 _sfTriangles
.copyFromBin(pMem
);
622 if(FieldBits::NoField
!= (PatchesFieldMask
& whichField
))
624 editSField(PatchesFieldMask
);
625 _sfPatches
.copyFromBin(pMem
);
627 if(FieldBits::NoField
!= (ProcessedAttributeBytesFieldMask
& whichField
))
629 editSField(ProcessedAttributeBytesFieldMask
);
630 _sfProcessedAttributeBytes
.copyFromBin(pMem
);
632 if(FieldBits::NoField
!= (StoredAttributeBytesFieldMask
& whichField
))
634 editSField(StoredAttributeBytesFieldMask
);
635 _sfStoredAttributeBytes
.copyFromBin(pMem
);
637 if(FieldBits::NoField
!= (ValidFieldMask
& whichField
))
639 editSField(ValidFieldMask
);
640 _sfValid
.copyFromBin(pMem
);
644 //! create a new instance of the class
645 DrawableStatsAttachmentTransitPtr
DrawableStatsAttachmentBase::createLocal(BitVector bFlags
)
647 DrawableStatsAttachmentTransitPtr fc
;
649 if(getClassType().getPrototype() != NULL
)
651 FieldContainerTransitPtr tmpPtr
=
652 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
654 fc
= dynamic_pointer_cast
<DrawableStatsAttachment
>(tmpPtr
);
660 //! create a new instance of the class, copy the container flags
661 DrawableStatsAttachmentTransitPtr
DrawableStatsAttachmentBase::createDependent(BitVector bFlags
)
663 DrawableStatsAttachmentTransitPtr fc
;
665 if(getClassType().getPrototype() != NULL
)
667 FieldContainerTransitPtr tmpPtr
=
668 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
670 fc
= dynamic_pointer_cast
<DrawableStatsAttachment
>(tmpPtr
);
676 //! create a new instance of the class
677 DrawableStatsAttachmentTransitPtr
DrawableStatsAttachmentBase::create(void)
679 DrawableStatsAttachmentTransitPtr fc
;
681 if(getClassType().getPrototype() != NULL
)
683 FieldContainerTransitPtr tmpPtr
=
684 getClassType().getPrototype()-> shallowCopy();
686 fc
= dynamic_pointer_cast
<DrawableStatsAttachment
>(tmpPtr
);
692 DrawableStatsAttachment
*DrawableStatsAttachmentBase::createEmptyLocal(BitVector bFlags
)
694 DrawableStatsAttachment
*returnValue
;
696 newPtr
<DrawableStatsAttachment
>(returnValue
, bFlags
);
698 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
703 //! create an empty new instance of the class, do not copy the prototype
704 DrawableStatsAttachment
*DrawableStatsAttachmentBase::createEmpty(void)
706 DrawableStatsAttachment
*returnValue
;
708 newPtr
<DrawableStatsAttachment
>(returnValue
, Thread::getCurrentLocalFlags());
710 returnValue
->_pFieldFlags
->_bNamespaceMask
&=
711 ~Thread::getCurrentLocalFlags();
717 FieldContainerTransitPtr
DrawableStatsAttachmentBase::shallowCopyLocal(
718 BitVector bFlags
) const
720 DrawableStatsAttachment
*tmpPtr
;
722 newPtr(tmpPtr
, dynamic_cast<const DrawableStatsAttachment
*>(this), bFlags
);
724 FieldContainerTransitPtr
returnValue(tmpPtr
);
726 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
731 FieldContainerTransitPtr
DrawableStatsAttachmentBase::shallowCopyDependent(
732 BitVector bFlags
) const
734 DrawableStatsAttachment
*tmpPtr
;
736 newPtr(tmpPtr
, dynamic_cast<const DrawableStatsAttachment
*>(this), ~bFlags
);
738 FieldContainerTransitPtr
returnValue(tmpPtr
);
740 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
745 FieldContainerTransitPtr
DrawableStatsAttachmentBase::shallowCopy(void) const
747 DrawableStatsAttachment
*tmpPtr
;
750 dynamic_cast<const DrawableStatsAttachment
*>(this),
751 Thread::getCurrentLocalFlags());
753 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~Thread::getCurrentLocalFlags();
755 FieldContainerTransitPtr
returnValue(tmpPtr
);
763 /*------------------------- constructors ----------------------------------*/
765 DrawableStatsAttachmentBase::DrawableStatsAttachmentBase(void) :
772 _sfProcessedAttributeBytes(),
773 _sfStoredAttributeBytes (),
774 _sfValid (bool(false))
778 DrawableStatsAttachmentBase::DrawableStatsAttachmentBase(const DrawableStatsAttachmentBase
&source
) :
780 _sfVertices (source
._sfVertices
),
781 _sfPoints (source
._sfPoints
),
782 _sfLines (source
._sfLines
),
783 _sfTriangles (source
._sfTriangles
),
784 _sfPatches (source
._sfPatches
),
785 _sfProcessedAttributeBytes(source
._sfProcessedAttributeBytes
),
786 _sfStoredAttributeBytes (source
._sfStoredAttributeBytes
),
787 _sfValid (source
._sfValid
)
792 /*-------------------------- destructors ----------------------------------*/
794 DrawableStatsAttachmentBase::~DrawableStatsAttachmentBase(void)
799 GetFieldHandlePtr
DrawableStatsAttachmentBase::getHandleVertices (void) const
801 SFUInt32::GetHandlePtr
returnValue(
802 new SFUInt32::GetHandle(
804 this->getType().getFieldDesc(VerticesFieldId
),
805 const_cast<DrawableStatsAttachmentBase
*>(this)));
810 EditFieldHandlePtr
DrawableStatsAttachmentBase::editHandleVertices (void)
812 SFUInt32::EditHandlePtr
returnValue(
813 new SFUInt32::EditHandle(
815 this->getType().getFieldDesc(VerticesFieldId
),
819 editSField(VerticesFieldMask
);
824 GetFieldHandlePtr
DrawableStatsAttachmentBase::getHandlePoints (void) const
826 SFUInt32::GetHandlePtr
returnValue(
827 new SFUInt32::GetHandle(
829 this->getType().getFieldDesc(PointsFieldId
),
830 const_cast<DrawableStatsAttachmentBase
*>(this)));
835 EditFieldHandlePtr
DrawableStatsAttachmentBase::editHandlePoints (void)
837 SFUInt32::EditHandlePtr
returnValue(
838 new SFUInt32::EditHandle(
840 this->getType().getFieldDesc(PointsFieldId
),
844 editSField(PointsFieldMask
);
849 GetFieldHandlePtr
DrawableStatsAttachmentBase::getHandleLines (void) const
851 SFUInt32::GetHandlePtr
returnValue(
852 new SFUInt32::GetHandle(
854 this->getType().getFieldDesc(LinesFieldId
),
855 const_cast<DrawableStatsAttachmentBase
*>(this)));
860 EditFieldHandlePtr
DrawableStatsAttachmentBase::editHandleLines (void)
862 SFUInt32::EditHandlePtr
returnValue(
863 new SFUInt32::EditHandle(
865 this->getType().getFieldDesc(LinesFieldId
),
869 editSField(LinesFieldMask
);
874 GetFieldHandlePtr
DrawableStatsAttachmentBase::getHandleTriangles (void) const
876 SFUInt32::GetHandlePtr
returnValue(
877 new SFUInt32::GetHandle(
879 this->getType().getFieldDesc(TrianglesFieldId
),
880 const_cast<DrawableStatsAttachmentBase
*>(this)));
885 EditFieldHandlePtr
DrawableStatsAttachmentBase::editHandleTriangles (void)
887 SFUInt32::EditHandlePtr
returnValue(
888 new SFUInt32::EditHandle(
890 this->getType().getFieldDesc(TrianglesFieldId
),
894 editSField(TrianglesFieldMask
);
899 GetFieldHandlePtr
DrawableStatsAttachmentBase::getHandlePatches (void) const
901 SFUInt32::GetHandlePtr
returnValue(
902 new SFUInt32::GetHandle(
904 this->getType().getFieldDesc(PatchesFieldId
),
905 const_cast<DrawableStatsAttachmentBase
*>(this)));
910 EditFieldHandlePtr
DrawableStatsAttachmentBase::editHandlePatches (void)
912 SFUInt32::EditHandlePtr
returnValue(
913 new SFUInt32::EditHandle(
915 this->getType().getFieldDesc(PatchesFieldId
),
919 editSField(PatchesFieldMask
);
924 GetFieldHandlePtr
DrawableStatsAttachmentBase::getHandleProcessedAttributeBytes (void) const
926 SFUInt32::GetHandlePtr
returnValue(
927 new SFUInt32::GetHandle(
928 &_sfProcessedAttributeBytes
,
929 this->getType().getFieldDesc(ProcessedAttributeBytesFieldId
),
930 const_cast<DrawableStatsAttachmentBase
*>(this)));
935 EditFieldHandlePtr
DrawableStatsAttachmentBase::editHandleProcessedAttributeBytes(void)
937 SFUInt32::EditHandlePtr
returnValue(
938 new SFUInt32::EditHandle(
939 &_sfProcessedAttributeBytes
,
940 this->getType().getFieldDesc(ProcessedAttributeBytesFieldId
),
944 editSField(ProcessedAttributeBytesFieldMask
);
949 GetFieldHandlePtr
DrawableStatsAttachmentBase::getHandleStoredAttributeBytes (void) const
951 SFUInt32::GetHandlePtr
returnValue(
952 new SFUInt32::GetHandle(
953 &_sfStoredAttributeBytes
,
954 this->getType().getFieldDesc(StoredAttributeBytesFieldId
),
955 const_cast<DrawableStatsAttachmentBase
*>(this)));
960 EditFieldHandlePtr
DrawableStatsAttachmentBase::editHandleStoredAttributeBytes(void)
962 SFUInt32::EditHandlePtr
returnValue(
963 new SFUInt32::EditHandle(
964 &_sfStoredAttributeBytes
,
965 this->getType().getFieldDesc(StoredAttributeBytesFieldId
),
969 editSField(StoredAttributeBytesFieldMask
);
974 GetFieldHandlePtr
DrawableStatsAttachmentBase::getHandleValid (void) const
976 SFBool::GetHandlePtr
returnValue(
977 new SFBool::GetHandle(
979 this->getType().getFieldDesc(ValidFieldId
),
980 const_cast<DrawableStatsAttachmentBase
*>(this)));
985 EditFieldHandlePtr
DrawableStatsAttachmentBase::editHandleValid (void)
987 SFBool::EditHandlePtr
returnValue(
988 new SFBool::EditHandle(
990 this->getType().getFieldDesc(ValidFieldId
),
994 editSField(ValidFieldMask
);
1000 #ifdef OSG_MT_CPTR_ASPECT
1001 void DrawableStatsAttachmentBase::execSyncV( FieldContainer
&oFrom
,
1002 ConstFieldMaskArg whichField
,
1003 AspectOffsetStore
&oOffsets
,
1004 ConstFieldMaskArg syncMode
,
1005 const UInt32 uiSyncInfo
)
1007 DrawableStatsAttachment
*pThis
= static_cast<DrawableStatsAttachment
*>(this);
1009 pThis
->execSync(static_cast<DrawableStatsAttachment
*>(&oFrom
),
1018 #ifdef OSG_MT_CPTR_ASPECT
1019 FieldContainer
*DrawableStatsAttachmentBase::createAspectCopy(
1020 const FieldContainer
*pRefAspect
) const
1022 DrawableStatsAttachment
*returnValue
;
1024 newAspectCopy(returnValue
,
1025 dynamic_cast<const DrawableStatsAttachment
*>(pRefAspect
),
1026 dynamic_cast<const DrawableStatsAttachment
*>(this));
1032 void DrawableStatsAttachmentBase::resolveLinks(void)
1034 Inherited::resolveLinks();