changed: gcc8 base update
[opensg.git] / Source / System / Statistics / Foregrounds / OSGPerfMonitorForegroundBase.cpp
blob56aa0914d88fb2259aafc7fc9d2bf1b3f78c9610
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 PerfMonitorForeground!
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"
66 #include "OSGPerfMonitorForegroundBase.h"
67 #include "OSGPerfMonitorForeground.h"
69 #include <boost/bind.hpp>
71 OSG_BEGIN_NAMESPACE
73 /***************************************************************************\
74 * Description *
75 \***************************************************************************/
77 /*! \class OSG::PerfMonitorForeground
78 PerfMonitorForeground displays statistics collected from the performance
79 monitor code.
81 It is meant to be used as a debugging tool for tracking down performance
82 issues in the system.
85 /***************************************************************************\
86 * Field Documentation *
87 \***************************************************************************/
89 /*! \var UInt32 PerfMonitorForegroundBase::_sfMode
90 The display mode to use. See OSG::PerfMonitorForeground for more details.
93 /*! \var Real32 PerfMonitorForegroundBase::_sfMaxSize
94 The maximum height of any line in pixels.
97 /*! \var Color4f PerfMonitorForegroundBase::_sfColor
98 Color of the text.
101 /*! \var Color4f PerfMonitorForegroundBase::_sfBgColor
102 Color of the background.
105 /*! \var std::string PerfMonitorForegroundBase::_sfFamily
106 The font family to be used, e.g. "SANS", default if unset.
109 /*! \var Color4f PerfMonitorForegroundBase::_sfBorderColor
110 Color of the border.
113 /*! \var Vec2f PerfMonitorForegroundBase::_sfBorderOffset
114 Offset of the border in pixels.
117 /*! \var Vec2f PerfMonitorForegroundBase::_sfTextMargin
118 Text margin in pixels.
122 /***************************************************************************\
123 * FieldType/FieldTrait Instantiation *
124 \***************************************************************************/
126 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
127 PointerType FieldTraits<PerfMonitorForeground *, nsOSG>::_type(
128 "PerfMonitorForegroundPtr",
129 "ForegroundPtr",
130 PerfMonitorForeground::getClassType(),
131 nsOSG);
132 #endif
134 OSG_FIELDTRAITS_GETTYPE_NS(PerfMonitorForeground *, nsOSG)
136 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
137 PerfMonitorForeground *,
138 nsOSG)
140 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
141 PerfMonitorForeground *,
142 nsOSG)
144 /***************************************************************************\
145 * Field Description *
146 \***************************************************************************/
148 void PerfMonitorForegroundBase::classDescInserter(TypeObject &oType)
150 FieldDescriptionBase *pDesc = NULL;
153 pDesc = new SFUInt32::Description(
154 SFUInt32::getClassType(),
155 "mode",
156 "The display mode to use. See OSG::PerfMonitorForeground for more details.\n",
157 ModeFieldId, ModeFieldMask,
158 false,
159 (Field::SFDefaultFlags | Field::FStdAccess),
160 static_cast<FieldEditMethodSig>(&PerfMonitorForeground::editHandleMode),
161 static_cast<FieldGetMethodSig >(&PerfMonitorForeground::getHandleMode));
163 oType.addInitialDesc(pDesc);
165 pDesc = new SFReal32::Description(
166 SFReal32::getClassType(),
167 "maxSize",
168 "The maximum height of any line in pixels.\n",
169 MaxSizeFieldId, MaxSizeFieldMask,
170 false,
171 (Field::SFDefaultFlags | Field::FStdAccess),
172 static_cast<FieldEditMethodSig>(&PerfMonitorForeground::editHandleMaxSize),
173 static_cast<FieldGetMethodSig >(&PerfMonitorForeground::getHandleMaxSize));
175 oType.addInitialDesc(pDesc);
177 pDesc = new SFColor4f::Description(
178 SFColor4f::getClassType(),
179 "color",
180 "Color of the text.\n",
181 ColorFieldId, ColorFieldMask,
182 false,
183 (Field::SFDefaultFlags | Field::FStdAccess),
184 static_cast<FieldEditMethodSig>(&PerfMonitorForeground::editHandleColor),
185 static_cast<FieldGetMethodSig >(&PerfMonitorForeground::getHandleColor));
187 oType.addInitialDesc(pDesc);
189 pDesc = new SFColor4f::Description(
190 SFColor4f::getClassType(),
191 "bgColor",
192 "Color of the background.\n",
193 BgColorFieldId, BgColorFieldMask,
194 false,
195 (Field::SFDefaultFlags | Field::FStdAccess),
196 static_cast<FieldEditMethodSig>(&PerfMonitorForeground::editHandleBgColor),
197 static_cast<FieldGetMethodSig >(&PerfMonitorForeground::getHandleBgColor));
199 oType.addInitialDesc(pDesc);
201 pDesc = new SFString::Description(
202 SFString::getClassType(),
203 "family",
204 "The font family to be used, e.g. \"SANS\", default if unset.\n",
205 FamilyFieldId, FamilyFieldMask,
206 false,
207 (Field::SFDefaultFlags | Field::FStdAccess),
208 static_cast<FieldEditMethodSig>(&PerfMonitorForeground::editHandleFamily),
209 static_cast<FieldGetMethodSig >(&PerfMonitorForeground::getHandleFamily));
211 oType.addInitialDesc(pDesc);
213 pDesc = new SFColor4f::Description(
214 SFColor4f::getClassType(),
215 "borderColor",
216 "Color of the border.\n",
217 BorderColorFieldId, BorderColorFieldMask,
218 false,
219 (Field::SFDefaultFlags | Field::FStdAccess),
220 static_cast<FieldEditMethodSig>(&PerfMonitorForeground::editHandleBorderColor),
221 static_cast<FieldGetMethodSig >(&PerfMonitorForeground::getHandleBorderColor));
223 oType.addInitialDesc(pDesc);
225 pDesc = new SFVec2f::Description(
226 SFVec2f::getClassType(),
227 "borderOffset",
228 "Offset of the border in pixels.\n",
229 BorderOffsetFieldId, BorderOffsetFieldMask,
230 false,
231 (Field::SFDefaultFlags | Field::FStdAccess),
232 static_cast<FieldEditMethodSig>(&PerfMonitorForeground::editHandleBorderOffset),
233 static_cast<FieldGetMethodSig >(&PerfMonitorForeground::getHandleBorderOffset));
235 oType.addInitialDesc(pDesc);
237 pDesc = new SFVec2f::Description(
238 SFVec2f::getClassType(),
239 "textMargin",
240 "Text margin in pixels.\n",
241 TextMarginFieldId, TextMarginFieldMask,
242 false,
243 (Field::SFDefaultFlags | Field::FStdAccess),
244 static_cast<FieldEditMethodSig>(&PerfMonitorForeground::editHandleTextMargin),
245 static_cast<FieldGetMethodSig >(&PerfMonitorForeground::getHandleTextMargin));
247 oType.addInitialDesc(pDesc);
251 PerfMonitorForegroundBase::TypeObject PerfMonitorForegroundBase::_type(
252 PerfMonitorForegroundBase::getClassname(),
253 Inherited::getClassname(),
254 "NULL",
255 nsOSG, //Namespace
256 reinterpret_cast<PrototypeCreateF>(&PerfMonitorForegroundBase::createEmptyLocal),
257 reinterpret_cast<InitContainerF>(&PerfMonitorForeground::initMethod),
258 reinterpret_cast<ExitContainerF>(&PerfMonitorForeground::exitMethod),
259 reinterpret_cast<InitalInsertDescFunc>(
260 reinterpret_cast<void *>(&PerfMonitorForeground::classDescInserter)),
261 false,
263 "<?xml version=\"1.0\"?>\n"
264 "\n"
265 "<FieldContainer\n"
266 " name=\"PerfMonitorForeground\"\n"
267 " parent=\"Foreground\"\n"
268 " library=\"Util\"\n"
269 " pointerfieldtypes=\"both\"\n"
270 " structure=\"concrete\"\n"
271 " systemcomponent=\"true\"\n"
272 " parentsystemcomponent=\"true\"\n"
273 " decoratable=\"false\"\n"
274 " docGroupBase=\"GrpUtilStatistics\"\n"
275 " >\n"
276 " PerfMonitorForeground displays statistics collected from the performance\n"
277 " monitor code. \n"
278 "\n"
279 " It is meant to be used as a debugging tool for tracking down performance\n"
280 " issues in the system.\n"
281 " <Field\n"
282 "\t name=\"mode\"\n"
283 "\t type=\"UInt32\"\n"
284 "\t cardinality=\"single\"\n"
285 "\t visibility=\"external\"\n"
286 "\t defaultValue=\"0\"\n"
287 "\t access=\"public\"\n"
288 "\t >\n"
289 "\tThe display mode to use. See OSG::PerfMonitorForeground for more details.\n"
290 " </Field>\t\n"
291 " <Field\n"
292 "\t name=\"maxSize\"\n"
293 "\t type=\"Real32\"\n"
294 "\t cardinality=\"single\"\n"
295 "\t visibility=\"external\"\n"
296 "\t defaultValue=\"16\"\n"
297 "\t access=\"public\"\n"
298 "\t >\n"
299 "\tThe maximum height of any line in pixels.\n"
300 " </Field>\n"
301 " <Field\n"
302 "\t name=\"color\"\n"
303 "\t type=\"Color4f\"\n"
304 "\t cardinality=\"single\"\n"
305 "\t visibility=\"external\"\n"
306 "\t defaultValue=\"1,1,1,1\"\n"
307 "\t access=\"public\"\n"
308 "\t >\n"
309 "\tColor of the text.\n"
310 " </Field>\n"
311 " <Field\n"
312 "\t name=\"bgColor\"\n"
313 "\t type=\"Color4f\"\n"
314 "\t cardinality=\"single\"\n"
315 "\t visibility=\"external\"\n"
316 "\t defaultValue=\"0.2f,0.2f,0.2f,0.65f\"\n"
317 "\t access=\"public\"\n"
318 "\t >\n"
319 "\tColor of the background.\n"
320 " </Field>\n"
321 " <Field\n"
322 "\t name=\"family\"\n"
323 "\t type=\"std::string\"\n"
324 "\t cardinality=\"single\"\n"
325 "\t visibility=\"external\"\n"
326 "\t access=\"public\"\n"
327 "\t >\n"
328 "\tThe font family to be used, e.g. \"SANS\", default if unset.\n"
329 " </Field>\n"
330 " <Field\n"
331 "\t name=\"borderColor\"\n"
332 "\t type=\"Color4f\"\n"
333 "\t cardinality=\"single\"\n"
334 "\t visibility=\"external\"\n"
335 "\t defaultValue=\"0.8f,0.8f,0.0f,0.7f\"\n"
336 "\t access=\"public\"\n"
337 "\t >\n"
338 "\tColor of the border.\n"
339 " </Field>\n"
340 " <Field\n"
341 "\t name=\"borderOffset\"\n"
342 "\t type=\"Vec2f\"\n"
343 "\t cardinality=\"single\"\n"
344 "\t visibility=\"external\"\n"
345 "\t defaultValue=\"4,4\"\n"
346 "\t access=\"public\"\n"
347 "\t >\n"
348 "\tOffset of the border in pixels.\n"
349 " </Field>\n"
350 " <Field\n"
351 "\t name=\"textMargin\"\n"
352 "\t type=\"Vec2f\"\n"
353 "\t cardinality=\"single\"\n"
354 "\t visibility=\"external\"\n"
355 "\t defaultValue=\"5,5\"\n"
356 "\t access=\"public\"\n"
357 "\t >\n"
358 "\tText margin in pixels.\n"
359 " </Field>\n"
360 "</FieldContainer>\n",
361 "PerfMonitorForeground displays statistics collected from the performance\n"
362 "monitor code. \n"
363 "\n"
364 "It is meant to be used as a debugging tool for tracking down performance\n"
365 "issues in the system.\n"
368 /*------------------------------ get -----------------------------------*/
370 FieldContainerType &PerfMonitorForegroundBase::getType(void)
372 return _type;
375 const FieldContainerType &PerfMonitorForegroundBase::getType(void) const
377 return _type;
380 UInt32 PerfMonitorForegroundBase::getContainerSize(void) const
382 return sizeof(PerfMonitorForeground);
385 /*------------------------- decorator get ------------------------------*/
388 SFUInt32 *PerfMonitorForegroundBase::editSFMode(void)
390 editSField(ModeFieldMask);
392 return &_sfMode;
395 const SFUInt32 *PerfMonitorForegroundBase::getSFMode(void) const
397 return &_sfMode;
401 SFReal32 *PerfMonitorForegroundBase::editSFMaxSize(void)
403 editSField(MaxSizeFieldMask);
405 return &_sfMaxSize;
408 const SFReal32 *PerfMonitorForegroundBase::getSFMaxSize(void) const
410 return &_sfMaxSize;
414 SFColor4f *PerfMonitorForegroundBase::editSFColor(void)
416 editSField(ColorFieldMask);
418 return &_sfColor;
421 const SFColor4f *PerfMonitorForegroundBase::getSFColor(void) const
423 return &_sfColor;
427 SFColor4f *PerfMonitorForegroundBase::editSFBgColor(void)
429 editSField(BgColorFieldMask);
431 return &_sfBgColor;
434 const SFColor4f *PerfMonitorForegroundBase::getSFBgColor(void) const
436 return &_sfBgColor;
440 SFString *PerfMonitorForegroundBase::editSFFamily(void)
442 editSField(FamilyFieldMask);
444 return &_sfFamily;
447 const SFString *PerfMonitorForegroundBase::getSFFamily(void) const
449 return &_sfFamily;
453 SFColor4f *PerfMonitorForegroundBase::editSFBorderColor(void)
455 editSField(BorderColorFieldMask);
457 return &_sfBorderColor;
460 const SFColor4f *PerfMonitorForegroundBase::getSFBorderColor(void) const
462 return &_sfBorderColor;
466 SFVec2f *PerfMonitorForegroundBase::editSFBorderOffset(void)
468 editSField(BorderOffsetFieldMask);
470 return &_sfBorderOffset;
473 const SFVec2f *PerfMonitorForegroundBase::getSFBorderOffset(void) const
475 return &_sfBorderOffset;
479 SFVec2f *PerfMonitorForegroundBase::editSFTextMargin(void)
481 editSField(TextMarginFieldMask);
483 return &_sfTextMargin;
486 const SFVec2f *PerfMonitorForegroundBase::getSFTextMargin(void) const
488 return &_sfTextMargin;
496 /*------------------------------ access -----------------------------------*/
498 SizeT PerfMonitorForegroundBase::getBinSize(ConstFieldMaskArg whichField)
500 SizeT returnValue = Inherited::getBinSize(whichField);
502 if(FieldBits::NoField != (ModeFieldMask & whichField))
504 returnValue += _sfMode.getBinSize();
506 if(FieldBits::NoField != (MaxSizeFieldMask & whichField))
508 returnValue += _sfMaxSize.getBinSize();
510 if(FieldBits::NoField != (ColorFieldMask & whichField))
512 returnValue += _sfColor.getBinSize();
514 if(FieldBits::NoField != (BgColorFieldMask & whichField))
516 returnValue += _sfBgColor.getBinSize();
518 if(FieldBits::NoField != (FamilyFieldMask & whichField))
520 returnValue += _sfFamily.getBinSize();
522 if(FieldBits::NoField != (BorderColorFieldMask & whichField))
524 returnValue += _sfBorderColor.getBinSize();
526 if(FieldBits::NoField != (BorderOffsetFieldMask & whichField))
528 returnValue += _sfBorderOffset.getBinSize();
530 if(FieldBits::NoField != (TextMarginFieldMask & whichField))
532 returnValue += _sfTextMargin.getBinSize();
535 return returnValue;
538 void PerfMonitorForegroundBase::copyToBin(BinaryDataHandler &pMem,
539 ConstFieldMaskArg whichField)
541 Inherited::copyToBin(pMem, whichField);
543 if(FieldBits::NoField != (ModeFieldMask & whichField))
545 _sfMode.copyToBin(pMem);
547 if(FieldBits::NoField != (MaxSizeFieldMask & whichField))
549 _sfMaxSize.copyToBin(pMem);
551 if(FieldBits::NoField != (ColorFieldMask & whichField))
553 _sfColor.copyToBin(pMem);
555 if(FieldBits::NoField != (BgColorFieldMask & whichField))
557 _sfBgColor.copyToBin(pMem);
559 if(FieldBits::NoField != (FamilyFieldMask & whichField))
561 _sfFamily.copyToBin(pMem);
563 if(FieldBits::NoField != (BorderColorFieldMask & whichField))
565 _sfBorderColor.copyToBin(pMem);
567 if(FieldBits::NoField != (BorderOffsetFieldMask & whichField))
569 _sfBorderOffset.copyToBin(pMem);
571 if(FieldBits::NoField != (TextMarginFieldMask & whichField))
573 _sfTextMargin.copyToBin(pMem);
577 void PerfMonitorForegroundBase::copyFromBin(BinaryDataHandler &pMem,
578 ConstFieldMaskArg whichField)
580 Inherited::copyFromBin(pMem, whichField);
582 if(FieldBits::NoField != (ModeFieldMask & whichField))
584 editSField(ModeFieldMask);
585 _sfMode.copyFromBin(pMem);
587 if(FieldBits::NoField != (MaxSizeFieldMask & whichField))
589 editSField(MaxSizeFieldMask);
590 _sfMaxSize.copyFromBin(pMem);
592 if(FieldBits::NoField != (ColorFieldMask & whichField))
594 editSField(ColorFieldMask);
595 _sfColor.copyFromBin(pMem);
597 if(FieldBits::NoField != (BgColorFieldMask & whichField))
599 editSField(BgColorFieldMask);
600 _sfBgColor.copyFromBin(pMem);
602 if(FieldBits::NoField != (FamilyFieldMask & whichField))
604 editSField(FamilyFieldMask);
605 _sfFamily.copyFromBin(pMem);
607 if(FieldBits::NoField != (BorderColorFieldMask & whichField))
609 editSField(BorderColorFieldMask);
610 _sfBorderColor.copyFromBin(pMem);
612 if(FieldBits::NoField != (BorderOffsetFieldMask & whichField))
614 editSField(BorderOffsetFieldMask);
615 _sfBorderOffset.copyFromBin(pMem);
617 if(FieldBits::NoField != (TextMarginFieldMask & whichField))
619 editSField(TextMarginFieldMask);
620 _sfTextMargin.copyFromBin(pMem);
624 //! create a new instance of the class
625 PerfMonitorForegroundTransitPtr PerfMonitorForegroundBase::createLocal(BitVector bFlags)
627 PerfMonitorForegroundTransitPtr fc;
629 if(getClassType().getPrototype() != NULL)
631 FieldContainerTransitPtr tmpPtr =
632 getClassType().getPrototype()-> shallowCopyLocal(bFlags);
634 fc = dynamic_pointer_cast<PerfMonitorForeground>(tmpPtr);
637 return fc;
640 //! create a new instance of the class, copy the container flags
641 PerfMonitorForegroundTransitPtr PerfMonitorForegroundBase::createDependent(BitVector bFlags)
643 PerfMonitorForegroundTransitPtr fc;
645 if(getClassType().getPrototype() != NULL)
647 FieldContainerTransitPtr tmpPtr =
648 getClassType().getPrototype()-> shallowCopyDependent(bFlags);
650 fc = dynamic_pointer_cast<PerfMonitorForeground>(tmpPtr);
653 return fc;
656 //! create a new instance of the class
657 PerfMonitorForegroundTransitPtr PerfMonitorForegroundBase::create(void)
659 PerfMonitorForegroundTransitPtr fc;
661 if(getClassType().getPrototype() != NULL)
663 FieldContainerTransitPtr tmpPtr =
664 getClassType().getPrototype()-> shallowCopy();
666 fc = dynamic_pointer_cast<PerfMonitorForeground>(tmpPtr);
669 return fc;
672 PerfMonitorForeground *PerfMonitorForegroundBase::createEmptyLocal(BitVector bFlags)
674 PerfMonitorForeground *returnValue;
676 newPtr<PerfMonitorForeground>(returnValue, bFlags);
678 returnValue->_pFieldFlags->_bNamespaceMask &= ~bFlags;
680 return returnValue;
683 //! create an empty new instance of the class, do not copy the prototype
684 PerfMonitorForeground *PerfMonitorForegroundBase::createEmpty(void)
686 PerfMonitorForeground *returnValue;
688 newPtr<PerfMonitorForeground>(returnValue, Thread::getCurrentLocalFlags());
690 returnValue->_pFieldFlags->_bNamespaceMask &=
691 ~Thread::getCurrentLocalFlags();
693 return returnValue;
697 FieldContainerTransitPtr PerfMonitorForegroundBase::shallowCopyLocal(
698 BitVector bFlags) const
700 PerfMonitorForeground *tmpPtr;
702 newPtr(tmpPtr, dynamic_cast<const PerfMonitorForeground *>(this), bFlags);
704 FieldContainerTransitPtr returnValue(tmpPtr);
706 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~bFlags;
708 return returnValue;
711 FieldContainerTransitPtr PerfMonitorForegroundBase::shallowCopyDependent(
712 BitVector bFlags) const
714 PerfMonitorForeground *tmpPtr;
716 newPtr(tmpPtr, dynamic_cast<const PerfMonitorForeground *>(this), ~bFlags);
718 FieldContainerTransitPtr returnValue(tmpPtr);
720 tmpPtr->_pFieldFlags->_bNamespaceMask = bFlags;
722 return returnValue;
725 FieldContainerTransitPtr PerfMonitorForegroundBase::shallowCopy(void) const
727 PerfMonitorForeground *tmpPtr;
729 newPtr(tmpPtr,
730 dynamic_cast<const PerfMonitorForeground *>(this),
731 Thread::getCurrentLocalFlags());
733 tmpPtr->_pFieldFlags->_bNamespaceMask &= ~Thread::getCurrentLocalFlags();
735 FieldContainerTransitPtr returnValue(tmpPtr);
737 return returnValue;
743 /*------------------------- constructors ----------------------------------*/
745 PerfMonitorForegroundBase::PerfMonitorForegroundBase(void) :
746 Inherited(),
747 _sfMode (UInt32(0)),
748 _sfMaxSize (Real32(16)),
749 _sfColor (Color4f(1,1,1,1)),
750 _sfBgColor (Color4f(0.2f,0.2f,0.2f,0.65f)),
751 _sfFamily (),
752 _sfBorderColor (Color4f(0.8f,0.8f,0.0f,0.7f)),
753 _sfBorderOffset (Vec2f(4,4)),
754 _sfTextMargin (Vec2f(5,5))
758 PerfMonitorForegroundBase::PerfMonitorForegroundBase(const PerfMonitorForegroundBase &source) :
759 Inherited(source),
760 _sfMode (source._sfMode ),
761 _sfMaxSize (source._sfMaxSize ),
762 _sfColor (source._sfColor ),
763 _sfBgColor (source._sfBgColor ),
764 _sfFamily (source._sfFamily ),
765 _sfBorderColor (source._sfBorderColor ),
766 _sfBorderOffset (source._sfBorderOffset ),
767 _sfTextMargin (source._sfTextMargin )
772 /*-------------------------- destructors ----------------------------------*/
774 PerfMonitorForegroundBase::~PerfMonitorForegroundBase(void)
779 GetFieldHandlePtr PerfMonitorForegroundBase::getHandleMode (void) const
781 SFUInt32::GetHandlePtr returnValue(
782 new SFUInt32::GetHandle(
783 &_sfMode,
784 this->getType().getFieldDesc(ModeFieldId),
785 const_cast<PerfMonitorForegroundBase *>(this)));
787 return returnValue;
790 EditFieldHandlePtr PerfMonitorForegroundBase::editHandleMode (void)
792 SFUInt32::EditHandlePtr returnValue(
793 new SFUInt32::EditHandle(
794 &_sfMode,
795 this->getType().getFieldDesc(ModeFieldId),
796 this));
799 editSField(ModeFieldMask);
801 return returnValue;
804 GetFieldHandlePtr PerfMonitorForegroundBase::getHandleMaxSize (void) const
806 SFReal32::GetHandlePtr returnValue(
807 new SFReal32::GetHandle(
808 &_sfMaxSize,
809 this->getType().getFieldDesc(MaxSizeFieldId),
810 const_cast<PerfMonitorForegroundBase *>(this)));
812 return returnValue;
815 EditFieldHandlePtr PerfMonitorForegroundBase::editHandleMaxSize (void)
817 SFReal32::EditHandlePtr returnValue(
818 new SFReal32::EditHandle(
819 &_sfMaxSize,
820 this->getType().getFieldDesc(MaxSizeFieldId),
821 this));
824 editSField(MaxSizeFieldMask);
826 return returnValue;
829 GetFieldHandlePtr PerfMonitorForegroundBase::getHandleColor (void) const
831 SFColor4f::GetHandlePtr returnValue(
832 new SFColor4f::GetHandle(
833 &_sfColor,
834 this->getType().getFieldDesc(ColorFieldId),
835 const_cast<PerfMonitorForegroundBase *>(this)));
837 return returnValue;
840 EditFieldHandlePtr PerfMonitorForegroundBase::editHandleColor (void)
842 SFColor4f::EditHandlePtr returnValue(
843 new SFColor4f::EditHandle(
844 &_sfColor,
845 this->getType().getFieldDesc(ColorFieldId),
846 this));
849 editSField(ColorFieldMask);
851 return returnValue;
854 GetFieldHandlePtr PerfMonitorForegroundBase::getHandleBgColor (void) const
856 SFColor4f::GetHandlePtr returnValue(
857 new SFColor4f::GetHandle(
858 &_sfBgColor,
859 this->getType().getFieldDesc(BgColorFieldId),
860 const_cast<PerfMonitorForegroundBase *>(this)));
862 return returnValue;
865 EditFieldHandlePtr PerfMonitorForegroundBase::editHandleBgColor (void)
867 SFColor4f::EditHandlePtr returnValue(
868 new SFColor4f::EditHandle(
869 &_sfBgColor,
870 this->getType().getFieldDesc(BgColorFieldId),
871 this));
874 editSField(BgColorFieldMask);
876 return returnValue;
879 GetFieldHandlePtr PerfMonitorForegroundBase::getHandleFamily (void) const
881 SFString::GetHandlePtr returnValue(
882 new SFString::GetHandle(
883 &_sfFamily,
884 this->getType().getFieldDesc(FamilyFieldId),
885 const_cast<PerfMonitorForegroundBase *>(this)));
887 return returnValue;
890 EditFieldHandlePtr PerfMonitorForegroundBase::editHandleFamily (void)
892 SFString::EditHandlePtr returnValue(
893 new SFString::EditHandle(
894 &_sfFamily,
895 this->getType().getFieldDesc(FamilyFieldId),
896 this));
899 editSField(FamilyFieldMask);
901 return returnValue;
904 GetFieldHandlePtr PerfMonitorForegroundBase::getHandleBorderColor (void) const
906 SFColor4f::GetHandlePtr returnValue(
907 new SFColor4f::GetHandle(
908 &_sfBorderColor,
909 this->getType().getFieldDesc(BorderColorFieldId),
910 const_cast<PerfMonitorForegroundBase *>(this)));
912 return returnValue;
915 EditFieldHandlePtr PerfMonitorForegroundBase::editHandleBorderColor (void)
917 SFColor4f::EditHandlePtr returnValue(
918 new SFColor4f::EditHandle(
919 &_sfBorderColor,
920 this->getType().getFieldDesc(BorderColorFieldId),
921 this));
924 editSField(BorderColorFieldMask);
926 return returnValue;
929 GetFieldHandlePtr PerfMonitorForegroundBase::getHandleBorderOffset (void) const
931 SFVec2f::GetHandlePtr returnValue(
932 new SFVec2f::GetHandle(
933 &_sfBorderOffset,
934 this->getType().getFieldDesc(BorderOffsetFieldId),
935 const_cast<PerfMonitorForegroundBase *>(this)));
937 return returnValue;
940 EditFieldHandlePtr PerfMonitorForegroundBase::editHandleBorderOffset (void)
942 SFVec2f::EditHandlePtr returnValue(
943 new SFVec2f::EditHandle(
944 &_sfBorderOffset,
945 this->getType().getFieldDesc(BorderOffsetFieldId),
946 this));
949 editSField(BorderOffsetFieldMask);
951 return returnValue;
954 GetFieldHandlePtr PerfMonitorForegroundBase::getHandleTextMargin (void) const
956 SFVec2f::GetHandlePtr returnValue(
957 new SFVec2f::GetHandle(
958 &_sfTextMargin,
959 this->getType().getFieldDesc(TextMarginFieldId),
960 const_cast<PerfMonitorForegroundBase *>(this)));
962 return returnValue;
965 EditFieldHandlePtr PerfMonitorForegroundBase::editHandleTextMargin (void)
967 SFVec2f::EditHandlePtr returnValue(
968 new SFVec2f::EditHandle(
969 &_sfTextMargin,
970 this->getType().getFieldDesc(TextMarginFieldId),
971 this));
974 editSField(TextMarginFieldMask);
976 return returnValue;
980 #ifdef OSG_MT_CPTR_ASPECT
981 void PerfMonitorForegroundBase::execSyncV( FieldContainer &oFrom,
982 ConstFieldMaskArg whichField,
983 AspectOffsetStore &oOffsets,
984 ConstFieldMaskArg syncMode,
985 const UInt32 uiSyncInfo)
987 PerfMonitorForeground *pThis = static_cast<PerfMonitorForeground *>(this);
989 pThis->execSync(static_cast<PerfMonitorForeground *>(&oFrom),
990 whichField,
991 oOffsets,
992 syncMode,
993 uiSyncInfo);
995 #endif
998 #ifdef OSG_MT_CPTR_ASPECT
999 FieldContainer *PerfMonitorForegroundBase::createAspectCopy(
1000 const FieldContainer *pRefAspect) const
1002 PerfMonitorForeground *returnValue;
1004 newAspectCopy(returnValue,
1005 dynamic_cast<const PerfMonitorForeground *>(pRefAspect),
1006 dynamic_cast<const PerfMonitorForeground *>(this));
1008 return returnValue;
1010 #endif
1012 void PerfMonitorForegroundBase::resolveLinks(void)
1014 Inherited::resolveLinks();
1020 OSG_END_NAMESPACE