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 **
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"
65 #include "OSGViewport.h" // Port Class
66 #include "OSGRenderOptions.h" // RenderOptions Class
67 #include "OSGDrawTask.h" // DrawTasks Class
69 #include "OSGWindowBase.h"
70 #include "OSGWindow.h"
72 #include <boost/bind.hpp>
76 /***************************************************************************\
78 \***************************************************************************/
80 /*! \class OSG::Window
81 Window is the base class for all window management classes. See \ref
82 PageSystemWindowWindow for a description.
86 To create a new Window the methods that have to be overridden are
87 init(void), activate(void), deactivate(void) and swap(void).
92 /***************************************************************************\
93 * Field Documentation *
94 \***************************************************************************/
96 /*! \var UInt16 WindowBase::_sfWidth
100 /*! \var UInt16 WindowBase::_sfHeight
104 /*! \var Viewport * WindowBase::_mfPort
108 /*! \var UInt32 WindowBase::_sfGlObjectEventCounter
109 Counter for GL object events. Needed for multi-aspect updates.
110 Is used in glObjectLastRefresh and glObjectLastReinitialize.
113 /*! \var UInt32 WindowBase::_mfGlObjectLastRefresh
114 Indicates the last refresh for the GL object.
117 /*! \var UInt32 WindowBase::_mfGlObjectLastReinitialize
118 Indicates the last reinit for the GL object.
121 /*! \var Int32 WindowBase::_sfDrawerId
122 DrawerId to select window dependent elements (e.g. Distortion filter).
123 For cluster window this values equals the clusterId (shl chunk)
126 /*! \var Int32 WindowBase::_sfRequestMajor
130 /*! \var Int32 WindowBase::_sfRequestMinor
134 /*! \var Int32 WindowBase::_sfContextFlags
138 /*! \var RenderOptions * WindowBase::_sfRenderOptions
142 /*! \var bool WindowBase::_sfIgnoreAllExtensions
146 /*! \var UInt32 WindowBase::_sfDrawMode
150 /*! \var std::string WindowBase::_sfRendererInfo
154 /*! \var DrawTask * WindowBase::_mfDrawTasks
159 /***************************************************************************\
160 * FieldType/FieldTrait Instantiation *
161 \***************************************************************************/
163 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
164 PointerType FieldTraits
<Window
*, nsOSG
>::_type(
166 "HardwareContextPtr",
167 Window::getClassType(),
171 OSG_FIELDTRAITS_GETTYPE_NS(Window
*, nsOSG
)
173 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
177 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
181 /***************************************************************************\
182 * Field Description *
183 \***************************************************************************/
185 void WindowBase::classDescInserter(TypeObject
&oType
)
187 FieldDescriptionBase
*pDesc
= NULL
;
190 pDesc
= new SFUInt16::Description(
191 SFUInt16::getClassType(),
194 WidthFieldId
, WidthFieldMask
,
196 (Field::SFDefaultFlags
| Field::FStdAccess
),
197 static_cast<FieldEditMethodSig
>(&Window::editHandleWidth
),
198 static_cast<FieldGetMethodSig
>(&Window::getHandleWidth
));
200 oType
.addInitialDesc(pDesc
);
202 pDesc
= new SFUInt16::Description(
203 SFUInt16::getClassType(),
206 HeightFieldId
, HeightFieldMask
,
208 (Field::SFDefaultFlags
| Field::FStdAccess
),
209 static_cast<FieldEditMethodSig
>(&Window::editHandleHeight
),
210 static_cast<FieldGetMethodSig
>(&Window::getHandleHeight
));
212 oType
.addInitialDesc(pDesc
);
214 pDesc
= new MFUnrecChildViewportPtr::Description(
215 MFUnrecChildViewportPtr::getClassType(),
218 PortFieldId
, PortFieldMask
,
220 (Field::MFDefaultFlags
| Field::FNullCheckAccess
),
221 static_cast<FieldEditMethodSig
>(&Window::editHandlePort
),
222 static_cast<FieldGetMethodSig
>(&Window::getHandlePort
));
224 oType
.addInitialDesc(pDesc
);
226 pDesc
= new SFUInt32::Description(
227 SFUInt32::getClassType(),
228 "glObjectEventCounter",
229 "Counter for GL object events. Needed for multi-aspect updates.\n"
230 "Is used in glObjectLastRefresh and glObjectLastReinitialize.\n",
231 GlObjectEventCounterFieldId
, GlObjectEventCounterFieldMask
,
233 (Field::FClusterLocal
| Field::FThreadLocal
),
234 static_cast<FieldEditMethodSig
>(&Window::editHandleGlObjectEventCounter
),
235 static_cast<FieldGetMethodSig
>(&Window::getHandleGlObjectEventCounter
));
237 oType
.addInitialDesc(pDesc
);
239 pDesc
= new MFUInt32::Description(
240 MFUInt32::getClassType(),
241 "glObjectLastRefresh",
242 "Indicates the last refresh for the GL object.\n",
243 GlObjectLastRefreshFieldId
, GlObjectLastRefreshFieldMask
,
245 (Field::FClusterLocal
| Field::FThreadLocal
),
246 static_cast<FieldEditMethodSig
>(&Window::editHandleGlObjectLastRefresh
),
247 static_cast<FieldGetMethodSig
>(&Window::getHandleGlObjectLastRefresh
));
249 oType
.addInitialDesc(pDesc
);
251 pDesc
= new MFUInt32::Description(
252 MFUInt32::getClassType(),
253 "glObjectLastReinitialize",
254 "Indicates the last reinit for the GL object.\n",
255 GlObjectLastReinitializeFieldId
, GlObjectLastReinitializeFieldMask
,
257 (Field::FClusterLocal
| Field::FThreadLocal
),
258 static_cast<FieldEditMethodSig
>(&Window::editHandleGlObjectLastReinitialize
),
259 static_cast<FieldGetMethodSig
>(&Window::getHandleGlObjectLastReinitialize
));
261 oType
.addInitialDesc(pDesc
);
263 pDesc
= new SFInt32::Description(
264 SFInt32::getClassType(),
266 "DrawerId to select window dependent elements (e.g. Distortion filter).\n"
267 "For cluster window this values equals the clusterId (shl chunk)\n",
268 DrawerIdFieldId
, DrawerIdFieldMask
,
270 (Field::FClusterLocal
),
271 static_cast<FieldEditMethodSig
>(&Window::editHandleDrawerId
),
272 static_cast<FieldGetMethodSig
>(&Window::getHandleDrawerId
));
274 oType
.addInitialDesc(pDesc
);
276 pDesc
= new SFInt32::Description(
277 SFInt32::getClassType(),
280 RequestMajorFieldId
, RequestMajorFieldMask
,
282 (Field::SFDefaultFlags
| Field::FStdAccess
),
283 static_cast<FieldEditMethodSig
>(&Window::editHandleRequestMajor
),
284 static_cast<FieldGetMethodSig
>(&Window::getHandleRequestMajor
));
286 oType
.addInitialDesc(pDesc
);
288 pDesc
= new SFInt32::Description(
289 SFInt32::getClassType(),
292 RequestMinorFieldId
, RequestMinorFieldMask
,
294 (Field::SFDefaultFlags
| Field::FStdAccess
),
295 static_cast<FieldEditMethodSig
>(&Window::editHandleRequestMinor
),
296 static_cast<FieldGetMethodSig
>(&Window::getHandleRequestMinor
));
298 oType
.addInitialDesc(pDesc
);
300 pDesc
= new SFInt32::Description(
301 SFInt32::getClassType(),
304 ContextFlagsFieldId
, ContextFlagsFieldMask
,
306 (Field::SFDefaultFlags
| Field::FStdAccess
),
307 static_cast<FieldEditMethodSig
>(&Window::editHandleContextFlags
),
308 static_cast<FieldGetMethodSig
>(&Window::getHandleContextFlags
));
310 oType
.addInitialDesc(pDesc
);
312 pDesc
= new SFUnrecRenderOptionsPtr::Description(
313 SFUnrecRenderOptionsPtr::getClassType(),
316 RenderOptionsFieldId
, RenderOptionsFieldMask
,
318 (Field::SFDefaultFlags
| Field::FStdAccess
),
319 static_cast<FieldEditMethodSig
>(&Window::editHandleRenderOptions
),
320 static_cast<FieldGetMethodSig
>(&Window::getHandleRenderOptions
));
322 oType
.addInitialDesc(pDesc
);
324 pDesc
= new SFBool::Description(
325 SFBool::getClassType(),
326 "ignoreAllExtensions",
328 IgnoreAllExtensionsFieldId
, IgnoreAllExtensionsFieldMask
,
330 (Field::SFDefaultFlags
| Field::FStdAccess
),
331 static_cast<FieldEditMethodSig
>(&Window::editHandleIgnoreAllExtensions
),
332 static_cast<FieldGetMethodSig
>(&Window::getHandleIgnoreAllExtensions
));
334 oType
.addInitialDesc(pDesc
);
336 pDesc
= new SFUInt32::Description(
337 SFUInt32::getClassType(),
340 DrawModeFieldId
, DrawModeFieldMask
,
342 (Field::SFDefaultFlags
| Field::FStdAccess
),
343 static_cast<FieldEditMethodSig
>(&Window::editHandleDrawMode
),
344 static_cast<FieldGetMethodSig
>(&Window::getHandleDrawMode
));
346 oType
.addInitialDesc(pDesc
);
348 pDesc
= new SFString::Description(
349 SFString::getClassType(),
352 RendererInfoFieldId
, RendererInfoFieldMask
,
354 (Field::SFDefaultFlags
| Field::FStdAccess
),
355 static_cast<FieldEditMethodSig
>(&Window::editHandleRendererInfo
),
356 static_cast<FieldGetMethodSig
>(&Window::getHandleRendererInfo
));
358 oType
.addInitialDesc(pDesc
);
360 pDesc
= new MFDrawTask::Description(
361 MFDrawTask::getClassType(),
364 DrawTasksFieldId
, DrawTasksFieldMask
,
366 (Field::FCustomAccess
| Field::FClusterLocal
),
367 static_cast<FieldEditMethodSig
>(&Window::editHandleDrawTasks
),
368 static_cast<FieldGetMethodSig
>(&Window::getHandleDrawTasks
));
370 oType
.addInitialDesc(pDesc
);
374 WindowBase::TypeObject
WindowBase::_type(
375 WindowBase::getClassname(),
376 Inherited::getClassname(),
380 reinterpret_cast<InitContainerF
>(&Window::initMethod
),
381 reinterpret_cast<ExitContainerF
>(&Window::exitMethod
),
382 reinterpret_cast<InitalInsertDescFunc
>(
383 reinterpret_cast<void *>(&Window::classDescInserter
)),
386 "<?xml version=\"1.0\"?>\n"
390 " parent=\"HardwareContext\"\n"
391 " library=\"System\"\n"
392 " pointerfieldtypes=\"both\"\n"
393 " structure=\"abstract\"\n"
394 " systemcomponent=\"true\"\n"
395 " parentsystemcomponent=\"true\"\n"
396 " docGroupBase=\"GrpSystemWindow\"\n"
399 " Window is the base class for all window management classes. See \\ref\n"
400 " PageSystemWindowWindow for a description.\n"
404 " To create a new Window the methods that have to be overridden are \n"
405 " init(void), activate(void), deactivate(void) and swap(void).\n"
411 " cardinality=\"single\"\n"
412 " visibility=\"external\"\n"
413 " access=\"public\"\n"
419 " cardinality=\"single\"\n"
420 " visibility=\"external\"\n"
421 " access=\"public\"\n"
426 " type=\"Viewport\"\n"
427 " cardinality=\"multi\"\n"
428 " category=\"childpointer\"\n"
429 " childParentType=\"FieldContainer\"\n"
430 " visibility=\"external\"\n"
431 " access=\"public\"\n"
432 " pushToFieldAs=\"addPort\"\n"
433 " insertIntoMFieldAs=\"insertPort\"\n"
434 " replaceInMFieldIndexAs=\"replacePort\"\n"
435 " replaceInMFieldObjectAs=\"replacePortByObj\"\n"
436 " removeFromMFieldIndexAs=\"subPort\"\n"
437 " removeFromMFieldObjectAs=\"subPortByObj\"\n"
438 " clearFieldAs=\"clearPorts\" \n"
439 " ptrFieldAccess = \"nullCheck\"\n"
440 " linkParentField=\"Parent\"\n"
444 " name=\"glObjectEventCounter\"\n"
446 " cardinality=\"single\"\n"
447 " visibility=\"internal\"\n"
448 " defaultValue=\"1\"\n"
449 " access=\"protected\"\n"
450 " fieldFlags=\"FClusterLocal, FThreadLocal\"\n"
452 " Counter for GL object events. Needed for multi-aspect updates.\n"
453 " Is used in glObjectLastRefresh and glObjectLastReinitialize.\n"
456 " name=\"glObjectLastRefresh\"\n"
458 " cardinality=\"multi\"\n"
459 " visibility=\"internal\"\n"
460 " access=\"protected\"\n"
461 " fieldFlags=\"FClusterLocal, FThreadLocal\"\n"
463 " Indicates the last refresh for the GL object.\n"
466 " name=\"glObjectLastReinitialize\"\n"
468 " cardinality=\"multi\"\n"
469 " visibility=\"internal\"\n"
470 " access=\"protected\"\n"
471 " fieldFlags=\"FClusterLocal, FThreadLocal\"\n"
473 " Indicates the last reinit for the GL object.\n"
476 " name=\"drawerId\"\n"
478 " cardinality=\"single\"\n"
479 " visibility=\"internal\"\n"
480 " access=\"public\"\n"
481 " fieldFlags=\"FClusterLocal\"\n"
482 " defaultValue=\"-1\"\n"
484 " DrawerId to select window dependent elements (e.g. Distortion filter).\n"
485 " For cluster window this values equals the clusterId (shl chunk)\n"
488 " name=\"requestMajor\"\n"
490 " cardinality=\"single\"\n"
491 " visibility=\"internal\"\n"
492 " access=\"public\"\n"
494 " defaultValue=\"-1\"\n"
498 " name=\"requestMinor\"\n"
500 " cardinality=\"single\"\n"
501 " visibility=\"internal\"\n"
502 " access=\"public\"\n"
504 " defaultValue=\"0\"\n"
508 " name=\"contextFlags\"\n"
510 " cardinality=\"single\"\n"
511 " visibility=\"internal\"\n"
512 " access=\"public\"\n"
514 " defaultValue=\"0\"\n"
518 " name=\"renderOptions\"\n"
519 " type=\"RenderOptionsPtr\"\n"
520 " cardinality=\"single\"\n"
521 " visibility=\"external\"\n"
522 " access=\"public\"\n"
523 " defaultValue=\"NULL\"\n"
527 " name=\"ignoreAllExtensions\"\n"
529 " cardinality=\"single\"\n"
530 " visibility=\"internal\"\n"
531 " access=\"public\"\n"
532 " defaultValue=\"false\"\n"
536 " name=\"drawMode\"\n"
538 " cardinality=\"single\"\n"
539 " visibility=\"internal\"\n"
540 " access=\"public\"\n"
541 " defaultValue=\"(Window::SequentialPartitionDraw | Window::StdDrawer | Window::ActiveContext)\"\n"
545 " name=\"rendererInfo\"\n"
546 " type=\"std::string\"\n"
547 " cardinality=\"single\"\n"
548 " visibility=\"internal\"\n"
549 " access=\"public\"\n"
550 " defaultValue='\"unknown\"'\n"
554 " name=\"drawTasks\"\n"
555 " type=\"DrawTask\"\n"
556 " cardinality=\"multi\"\n"
557 " visibility=\"internal\"\n"
558 " access=\"protected\"\n"
559 " category=\"custompointer\"\n"
560 " ptrFieldAccess=\"custom\"\n"
561 " fieldHeader=\"OSGDrawTask.h\"\n"
562 " typeHeader=\"OSGDrawTask.h\"\n"
563 " fieldFlags=\"FCustomAccess, FClusterLocal\"\n"
567 "</FieldContainer>\n",
568 "Window is the base class for all window management classes. See \\ref\n"
569 "PageSystemWindowWindow for a description.\n"
573 "To create a new Window the methods that have to be overridden are \n"
574 "init(void), activate(void), deactivate(void) and swap(void).\n"
579 /*------------------------------ get -----------------------------------*/
581 FieldContainerType
&WindowBase::getType(void)
586 const FieldContainerType
&WindowBase::getType(void) const
591 UInt32
WindowBase::getContainerSize(void) const
593 return sizeof(Window
);
596 /*------------------------- decorator get ------------------------------*/
599 SFUInt16
*WindowBase::editSFWidth(void)
601 editSField(WidthFieldMask
);
606 const SFUInt16
*WindowBase::getSFWidth(void) const
612 SFUInt16
*WindowBase::editSFHeight(void)
614 editSField(HeightFieldMask
);
619 const SFUInt16
*WindowBase::getSFHeight(void) const
625 //! Get the Window::_mfPort field.
626 const MFUnrecChildViewportPtr
*WindowBase::getMFPort(void) const
630 Viewport
* WindowBase::getPort(const UInt32 index
) const
632 return _mfPort
[index
];
635 SFUInt32
*WindowBase::editSFGlObjectEventCounter(void)
637 editSField(GlObjectEventCounterFieldMask
);
639 return &_sfGlObjectEventCounter
;
642 const SFUInt32
*WindowBase::getSFGlObjectEventCounter(void) const
644 return &_sfGlObjectEventCounter
;
648 MFUInt32
*WindowBase::editMFGlObjectLastRefresh(void)
650 editMField(GlObjectLastRefreshFieldMask
, _mfGlObjectLastRefresh
);
652 return &_mfGlObjectLastRefresh
;
655 const MFUInt32
*WindowBase::getMFGlObjectLastRefresh(void) const
657 return &_mfGlObjectLastRefresh
;
661 MFUInt32
*WindowBase::editMFGlObjectLastReinitialize(void)
663 editMField(GlObjectLastReinitializeFieldMask
, _mfGlObjectLastReinitialize
);
665 return &_mfGlObjectLastReinitialize
;
668 const MFUInt32
*WindowBase::getMFGlObjectLastReinitialize(void) const
670 return &_mfGlObjectLastReinitialize
;
674 SFInt32
*WindowBase::editSFDrawerId(void)
676 editSField(DrawerIdFieldMask
);
681 const SFInt32
*WindowBase::getSFDrawerId(void) const
687 SFInt32
*WindowBase::editSFRequestMajor(void)
689 editSField(RequestMajorFieldMask
);
691 return &_sfRequestMajor
;
694 const SFInt32
*WindowBase::getSFRequestMajor(void) const
696 return &_sfRequestMajor
;
700 SFInt32
*WindowBase::editSFRequestMinor(void)
702 editSField(RequestMinorFieldMask
);
704 return &_sfRequestMinor
;
707 const SFInt32
*WindowBase::getSFRequestMinor(void) const
709 return &_sfRequestMinor
;
713 SFInt32
*WindowBase::editSFContextFlags(void)
715 editSField(ContextFlagsFieldMask
);
717 return &_sfContextFlags
;
720 const SFInt32
*WindowBase::getSFContextFlags(void) const
722 return &_sfContextFlags
;
726 //! Get the Window::_sfRenderOptions field.
727 const SFUnrecRenderOptionsPtr
*WindowBase::getSFRenderOptions(void) const
729 return &_sfRenderOptions
;
732 SFUnrecRenderOptionsPtr
*WindowBase::editSFRenderOptions (void)
734 editSField(RenderOptionsFieldMask
);
736 return &_sfRenderOptions
;
739 //! Get the value of the Window::_sfRenderOptions field.
740 RenderOptions
* WindowBase::getRenderOptions(void) const
742 return _sfRenderOptions
.getValue();
745 //! Set the value of the Window::_sfRenderOptions field.
746 void WindowBase::setRenderOptions(RenderOptions
* const value
)
748 editSField(RenderOptionsFieldMask
);
750 _sfRenderOptions
.setValue(value
);
754 SFBool
*WindowBase::editSFIgnoreAllExtensions(void)
756 editSField(IgnoreAllExtensionsFieldMask
);
758 return &_sfIgnoreAllExtensions
;
761 const SFBool
*WindowBase::getSFIgnoreAllExtensions(void) const
763 return &_sfIgnoreAllExtensions
;
767 SFUInt32
*WindowBase::editSFDrawMode(void)
769 editSField(DrawModeFieldMask
);
774 const SFUInt32
*WindowBase::getSFDrawMode(void) const
780 SFString
*WindowBase::editSFRendererInfo(void)
782 editSField(RendererInfoFieldMask
);
784 return &_sfRendererInfo
;
787 const SFString
*WindowBase::getSFRendererInfo(void) const
789 return &_sfRendererInfo
;
793 //! Get the Window::_mfDrawTasks field.
794 const MFDrawTask
*WindowBase::getMFDrawTasks(void) const
796 return &_mfDrawTasks
;
798 DrawTask
* WindowBase::getDrawTasks(const UInt32 index
) const
800 return _mfDrawTasks
[index
];
805 void WindowBase::addPort(Viewport
* const value
)
810 editMField(PortFieldMask
, _mfPort
);
812 _mfPort
.push_back(value
);
815 void WindowBase::assignPort (const MFUnrecChildViewportPtr
&value
)
817 MFUnrecChildViewportPtr::const_iterator elemIt
=
819 MFUnrecChildViewportPtr::const_iterator elemEnd
=
822 static_cast<Window
*>(this)->clearPorts();
824 while(elemIt
!= elemEnd
)
826 this->addPort(*elemIt
);
832 void WindowBase::insertPort(UInt32 uiIndex
,
833 Viewport
* const value
)
838 editMField(PortFieldMask
, _mfPort
);
840 MFUnrecChildViewportPtr::iterator fieldIt
= _mfPort
.begin_nc();
844 _mfPort
.insert(fieldIt
, value
);
847 void WindowBase::replacePort(UInt32 uiIndex
,
848 Viewport
* const value
)
853 if(uiIndex
>= _mfPort
.size())
856 editMField(PortFieldMask
, _mfPort
);
858 _mfPort
.replace(uiIndex
, value
);
861 void WindowBase::replacePortByObj(Viewport
* const pOldElem
,
862 Viewport
* const pNewElem
)
867 Int32 elemIdx
= _mfPort
.findIndex(pOldElem
);
871 editMField(PortFieldMask
, _mfPort
);
873 _mfPort
.replace(elemIdx
, pNewElem
);
877 void WindowBase::subPort(UInt32 uiIndex
)
879 if(uiIndex
< _mfPort
.size())
881 editMField(PortFieldMask
, _mfPort
);
883 _mfPort
.erase(uiIndex
);
887 void WindowBase::subPortByObj(Viewport
* const value
)
889 Int32 iElemIdx
= _mfPort
.findIndex(value
);
893 editMField(PortFieldMask
, _mfPort
);
895 _mfPort
.erase(iElemIdx
);
898 void WindowBase::clearPorts(void)
900 editMField(PortFieldMask
, _mfPort
);
909 /*------------------------------ access -----------------------------------*/
911 SizeT
WindowBase::getBinSize(ConstFieldMaskArg whichField
)
913 SizeT returnValue
= Inherited::getBinSize(whichField
);
915 if(FieldBits::NoField
!= (WidthFieldMask
& whichField
))
917 returnValue
+= _sfWidth
.getBinSize();
919 if(FieldBits::NoField
!= (HeightFieldMask
& whichField
))
921 returnValue
+= _sfHeight
.getBinSize();
923 if(FieldBits::NoField
!= (PortFieldMask
& whichField
))
925 returnValue
+= _mfPort
.getBinSize();
927 if(FieldBits::NoField
!= (GlObjectEventCounterFieldMask
& whichField
))
929 returnValue
+= _sfGlObjectEventCounter
.getBinSize();
931 if(FieldBits::NoField
!= (GlObjectLastRefreshFieldMask
& whichField
))
933 returnValue
+= _mfGlObjectLastRefresh
.getBinSize();
935 if(FieldBits::NoField
!= (GlObjectLastReinitializeFieldMask
& whichField
))
937 returnValue
+= _mfGlObjectLastReinitialize
.getBinSize();
939 if(FieldBits::NoField
!= (DrawerIdFieldMask
& whichField
))
941 returnValue
+= _sfDrawerId
.getBinSize();
943 if(FieldBits::NoField
!= (RequestMajorFieldMask
& whichField
))
945 returnValue
+= _sfRequestMajor
.getBinSize();
947 if(FieldBits::NoField
!= (RequestMinorFieldMask
& whichField
))
949 returnValue
+= _sfRequestMinor
.getBinSize();
951 if(FieldBits::NoField
!= (ContextFlagsFieldMask
& whichField
))
953 returnValue
+= _sfContextFlags
.getBinSize();
955 if(FieldBits::NoField
!= (RenderOptionsFieldMask
& whichField
))
957 returnValue
+= _sfRenderOptions
.getBinSize();
959 if(FieldBits::NoField
!= (IgnoreAllExtensionsFieldMask
& whichField
))
961 returnValue
+= _sfIgnoreAllExtensions
.getBinSize();
963 if(FieldBits::NoField
!= (DrawModeFieldMask
& whichField
))
965 returnValue
+= _sfDrawMode
.getBinSize();
967 if(FieldBits::NoField
!= (RendererInfoFieldMask
& whichField
))
969 returnValue
+= _sfRendererInfo
.getBinSize();
971 if(FieldBits::NoField
!= (DrawTasksFieldMask
& whichField
))
973 returnValue
+= _mfDrawTasks
.getBinSize();
979 void WindowBase::copyToBin(BinaryDataHandler
&pMem
,
980 ConstFieldMaskArg whichField
)
982 Inherited::copyToBin(pMem
, whichField
);
984 if(FieldBits::NoField
!= (WidthFieldMask
& whichField
))
986 _sfWidth
.copyToBin(pMem
);
988 if(FieldBits::NoField
!= (HeightFieldMask
& whichField
))
990 _sfHeight
.copyToBin(pMem
);
992 if(FieldBits::NoField
!= (PortFieldMask
& whichField
))
994 _mfPort
.copyToBin(pMem
);
996 if(FieldBits::NoField
!= (GlObjectEventCounterFieldMask
& whichField
))
998 _sfGlObjectEventCounter
.copyToBin(pMem
);
1000 if(FieldBits::NoField
!= (GlObjectLastRefreshFieldMask
& whichField
))
1002 _mfGlObjectLastRefresh
.copyToBin(pMem
);
1004 if(FieldBits::NoField
!= (GlObjectLastReinitializeFieldMask
& whichField
))
1006 _mfGlObjectLastReinitialize
.copyToBin(pMem
);
1008 if(FieldBits::NoField
!= (DrawerIdFieldMask
& whichField
))
1010 _sfDrawerId
.copyToBin(pMem
);
1012 if(FieldBits::NoField
!= (RequestMajorFieldMask
& whichField
))
1014 _sfRequestMajor
.copyToBin(pMem
);
1016 if(FieldBits::NoField
!= (RequestMinorFieldMask
& whichField
))
1018 _sfRequestMinor
.copyToBin(pMem
);
1020 if(FieldBits::NoField
!= (ContextFlagsFieldMask
& whichField
))
1022 _sfContextFlags
.copyToBin(pMem
);
1024 if(FieldBits::NoField
!= (RenderOptionsFieldMask
& whichField
))
1026 _sfRenderOptions
.copyToBin(pMem
);
1028 if(FieldBits::NoField
!= (IgnoreAllExtensionsFieldMask
& whichField
))
1030 _sfIgnoreAllExtensions
.copyToBin(pMem
);
1032 if(FieldBits::NoField
!= (DrawModeFieldMask
& whichField
))
1034 _sfDrawMode
.copyToBin(pMem
);
1036 if(FieldBits::NoField
!= (RendererInfoFieldMask
& whichField
))
1038 _sfRendererInfo
.copyToBin(pMem
);
1040 if(FieldBits::NoField
!= (DrawTasksFieldMask
& whichField
))
1042 _mfDrawTasks
.copyToBin(pMem
);
1046 void WindowBase::copyFromBin(BinaryDataHandler
&pMem
,
1047 ConstFieldMaskArg whichField
)
1049 Inherited::copyFromBin(pMem
, whichField
);
1051 if(FieldBits::NoField
!= (WidthFieldMask
& whichField
))
1053 editSField(WidthFieldMask
);
1054 _sfWidth
.copyFromBin(pMem
);
1056 if(FieldBits::NoField
!= (HeightFieldMask
& whichField
))
1058 editSField(HeightFieldMask
);
1059 _sfHeight
.copyFromBin(pMem
);
1061 if(FieldBits::NoField
!= (PortFieldMask
& whichField
))
1063 editMField(PortFieldMask
, _mfPort
);
1064 _mfPort
.copyFromBin(pMem
);
1066 if(FieldBits::NoField
!= (GlObjectEventCounterFieldMask
& whichField
))
1068 editSField(GlObjectEventCounterFieldMask
);
1069 _sfGlObjectEventCounter
.copyFromBin(pMem
);
1071 if(FieldBits::NoField
!= (GlObjectLastRefreshFieldMask
& whichField
))
1073 editMField(GlObjectLastRefreshFieldMask
, _mfGlObjectLastRefresh
);
1074 _mfGlObjectLastRefresh
.copyFromBin(pMem
);
1076 if(FieldBits::NoField
!= (GlObjectLastReinitializeFieldMask
& whichField
))
1078 editMField(GlObjectLastReinitializeFieldMask
, _mfGlObjectLastReinitialize
);
1079 _mfGlObjectLastReinitialize
.copyFromBin(pMem
);
1081 if(FieldBits::NoField
!= (DrawerIdFieldMask
& whichField
))
1083 editSField(DrawerIdFieldMask
);
1084 _sfDrawerId
.copyFromBin(pMem
);
1086 if(FieldBits::NoField
!= (RequestMajorFieldMask
& whichField
))
1088 editSField(RequestMajorFieldMask
);
1089 _sfRequestMajor
.copyFromBin(pMem
);
1091 if(FieldBits::NoField
!= (RequestMinorFieldMask
& whichField
))
1093 editSField(RequestMinorFieldMask
);
1094 _sfRequestMinor
.copyFromBin(pMem
);
1096 if(FieldBits::NoField
!= (ContextFlagsFieldMask
& whichField
))
1098 editSField(ContextFlagsFieldMask
);
1099 _sfContextFlags
.copyFromBin(pMem
);
1101 if(FieldBits::NoField
!= (RenderOptionsFieldMask
& whichField
))
1103 editSField(RenderOptionsFieldMask
);
1104 _sfRenderOptions
.copyFromBin(pMem
);
1106 if(FieldBits::NoField
!= (IgnoreAllExtensionsFieldMask
& whichField
))
1108 editSField(IgnoreAllExtensionsFieldMask
);
1109 _sfIgnoreAllExtensions
.copyFromBin(pMem
);
1111 if(FieldBits::NoField
!= (DrawModeFieldMask
& whichField
))
1113 editSField(DrawModeFieldMask
);
1114 _sfDrawMode
.copyFromBin(pMem
);
1116 if(FieldBits::NoField
!= (RendererInfoFieldMask
& whichField
))
1118 editSField(RendererInfoFieldMask
);
1119 _sfRendererInfo
.copyFromBin(pMem
);
1121 if(FieldBits::NoField
!= (DrawTasksFieldMask
& whichField
))
1123 editMField(DrawTasksFieldMask
, _mfDrawTasks
);
1124 _mfDrawTasks
.copyFromBin(pMem
);
1131 /*------------------------- constructors ----------------------------------*/
1133 WindowBase::WindowBase(void) :
1139 Viewport::ParentFieldId
),
1140 _sfGlObjectEventCounter (UInt32(1)),
1141 _mfGlObjectLastRefresh (),
1142 _mfGlObjectLastReinitialize(),
1143 _sfDrawerId (Int32(-1)),
1144 _sfRequestMajor (Int32(-1)),
1145 _sfRequestMinor (Int32(0)),
1146 _sfContextFlags (Int32(0)),
1147 _sfRenderOptions (NULL
),
1148 _sfIgnoreAllExtensions (bool(false)),
1149 _sfDrawMode (UInt32((Window::SequentialPartitionDraw
| Window::StdDrawer
| Window::ActiveContext
))),
1150 _sfRendererInfo (std::string("unknown")),
1155 WindowBase::WindowBase(const WindowBase
&source
) :
1157 _sfWidth (source
._sfWidth
),
1158 _sfHeight (source
._sfHeight
),
1161 Viewport::ParentFieldId
),
1162 _sfGlObjectEventCounter (source
._sfGlObjectEventCounter
),
1163 _mfGlObjectLastRefresh (source
._mfGlObjectLastRefresh
),
1164 _mfGlObjectLastReinitialize(source
._mfGlObjectLastReinitialize
),
1165 _sfDrawerId (source
._sfDrawerId
),
1166 _sfRequestMajor (source
._sfRequestMajor
),
1167 _sfRequestMinor (source
._sfRequestMinor
),
1168 _sfContextFlags (source
._sfContextFlags
),
1169 _sfRenderOptions (NULL
),
1170 _sfIgnoreAllExtensions (source
._sfIgnoreAllExtensions
),
1171 _sfDrawMode (source
._sfDrawMode
),
1172 _sfRendererInfo (source
._sfRendererInfo
),
1178 /*-------------------------- destructors ----------------------------------*/
1180 WindowBase::~WindowBase(void)
1184 /*-------------------------------------------------------------------------*/
1187 bool WindowBase::unlinkChild(
1188 FieldContainer
* const pChild
,
1189 UInt16
const childFieldId
)
1191 if(childFieldId
== PortFieldId
)
1193 Viewport
* pTypedChild
=
1194 dynamic_cast<Viewport
*>(pChild
);
1196 if(pTypedChild
!= NULL
)
1198 Int32 iChildIdx
= _mfPort
.findIndex(pTypedChild
);
1202 editMField(PortFieldMask
, _mfPort
);
1204 _mfPort
.erase(iChildIdx
);
1209 SWARNING
<< "Parent ([" << this
1210 << "] id [" << this->getId()
1211 << "] type [" << this->getType().getCName()
1212 << "] childFieldId [" << childFieldId
1213 << "]) - Child ([" << pChild
1214 << "] id [" << pChild
->getId()
1215 << "] type [" << pChild
->getType().getCName()
1216 << "]): link inconsistent!"
1226 return Inherited::unlinkChild(pChild
, childFieldId
);
1229 void WindowBase::onCreate(const Window
*source
)
1231 Inherited::onCreate(source
);
1235 Window
*pThis
= static_cast<Window
*>(this);
1237 MFUnrecChildViewportPtr::const_iterator PortIt
=
1238 source
->_mfPort
.begin();
1239 MFUnrecChildViewportPtr::const_iterator PortEnd
=
1240 source
->_mfPort
.end ();
1242 while(PortIt
!= PortEnd
)
1244 pThis
->addPort(*PortIt
);
1249 pThis
->setRenderOptions(source
->getRenderOptions());
1251 MFDrawTask::const_iterator DrawTasksIt
=
1252 source
->_mfDrawTasks
.begin();
1253 MFDrawTask::const_iterator DrawTasksEnd
=
1254 source
->_mfDrawTasks
.end ();
1256 while(DrawTasksIt
!= DrawTasksEnd
)
1258 pThis
->pushToDrawTasks(*DrawTasksIt
);
1265 GetFieldHandlePtr
WindowBase::getHandleWidth (void) const
1267 SFUInt16::GetHandlePtr
returnValue(
1268 new SFUInt16::GetHandle(
1270 this->getType().getFieldDesc(WidthFieldId
),
1271 const_cast<WindowBase
*>(this)));
1276 EditFieldHandlePtr
WindowBase::editHandleWidth (void)
1278 SFUInt16::EditHandlePtr
returnValue(
1279 new SFUInt16::EditHandle(
1281 this->getType().getFieldDesc(WidthFieldId
),
1285 editSField(WidthFieldMask
);
1290 GetFieldHandlePtr
WindowBase::getHandleHeight (void) const
1292 SFUInt16::GetHandlePtr
returnValue(
1293 new SFUInt16::GetHandle(
1295 this->getType().getFieldDesc(HeightFieldId
),
1296 const_cast<WindowBase
*>(this)));
1301 EditFieldHandlePtr
WindowBase::editHandleHeight (void)
1303 SFUInt16::EditHandlePtr
returnValue(
1304 new SFUInt16::EditHandle(
1306 this->getType().getFieldDesc(HeightFieldId
),
1310 editSField(HeightFieldMask
);
1315 GetFieldHandlePtr
WindowBase::getHandlePort (void) const
1317 MFUnrecChildViewportPtr::GetHandlePtr
returnValue(
1318 new MFUnrecChildViewportPtr::GetHandle(
1320 this->getType().getFieldDesc(PortFieldId
),
1321 const_cast<WindowBase
*>(this)));
1326 EditFieldHandlePtr
WindowBase::editHandlePort (void)
1328 MFUnrecChildViewportPtr::EditHandlePtr
returnValue(
1329 new MFUnrecChildViewportPtr::EditHandle(
1331 this->getType().getFieldDesc(PortFieldId
),
1334 returnValue
->setAddMethod(
1335 boost::bind(&Window::addPort
,
1336 static_cast<Window
*>(this), _1
));
1337 returnValue
->setInsertMethod(
1338 boost::bind(&Window::insertPort
,
1339 static_cast<Window
*>(this), _1
, _2
));
1340 returnValue
->setReplaceMethod(
1341 boost::bind(&Window::replacePort
,
1342 static_cast<Window
*>(this), _1
, _2
));
1343 returnValue
->setReplaceObjMethod(
1344 boost::bind(&Window::replacePortByObj
,
1345 static_cast<Window
*>(this), _1
, _2
));
1346 returnValue
->setRemoveMethod(
1347 boost::bind(&Window::subPort
,
1348 static_cast<Window
*>(this), _1
));
1349 returnValue
->setRemoveObjMethod(
1350 boost::bind(&Window::subPortByObj
,
1351 static_cast<Window
*>(this), _1
));
1352 returnValue
->setClearMethod(
1353 boost::bind(&Window::clearPorts
,
1354 static_cast<Window
*>(this)));
1356 editMField(PortFieldMask
, _mfPort
);
1361 GetFieldHandlePtr
WindowBase::getHandleGlObjectEventCounter (void) const
1363 SFUInt32::GetHandlePtr
returnValue(
1364 new SFUInt32::GetHandle(
1365 &_sfGlObjectEventCounter
,
1366 this->getType().getFieldDesc(GlObjectEventCounterFieldId
),
1367 const_cast<WindowBase
*>(this)));
1372 EditFieldHandlePtr
WindowBase::editHandleGlObjectEventCounter(void)
1374 SFUInt32::EditHandlePtr
returnValue(
1375 new SFUInt32::EditHandle(
1376 &_sfGlObjectEventCounter
,
1377 this->getType().getFieldDesc(GlObjectEventCounterFieldId
),
1381 editSField(GlObjectEventCounterFieldMask
);
1386 GetFieldHandlePtr
WindowBase::getHandleGlObjectLastRefresh (void) const
1388 MFUInt32::GetHandlePtr
returnValue(
1389 new MFUInt32::GetHandle(
1390 &_mfGlObjectLastRefresh
,
1391 this->getType().getFieldDesc(GlObjectLastRefreshFieldId
),
1392 const_cast<WindowBase
*>(this)));
1397 EditFieldHandlePtr
WindowBase::editHandleGlObjectLastRefresh(void)
1399 MFUInt32::EditHandlePtr
returnValue(
1400 new MFUInt32::EditHandle(
1401 &_mfGlObjectLastRefresh
,
1402 this->getType().getFieldDesc(GlObjectLastRefreshFieldId
),
1406 editMField(GlObjectLastRefreshFieldMask
, _mfGlObjectLastRefresh
);
1411 GetFieldHandlePtr
WindowBase::getHandleGlObjectLastReinitialize (void) const
1413 MFUInt32::GetHandlePtr
returnValue(
1414 new MFUInt32::GetHandle(
1415 &_mfGlObjectLastReinitialize
,
1416 this->getType().getFieldDesc(GlObjectLastReinitializeFieldId
),
1417 const_cast<WindowBase
*>(this)));
1422 EditFieldHandlePtr
WindowBase::editHandleGlObjectLastReinitialize(void)
1424 MFUInt32::EditHandlePtr
returnValue(
1425 new MFUInt32::EditHandle(
1426 &_mfGlObjectLastReinitialize
,
1427 this->getType().getFieldDesc(GlObjectLastReinitializeFieldId
),
1431 editMField(GlObjectLastReinitializeFieldMask
, _mfGlObjectLastReinitialize
);
1436 GetFieldHandlePtr
WindowBase::getHandleDrawerId (void) const
1438 SFInt32::GetHandlePtr
returnValue(
1439 new SFInt32::GetHandle(
1441 this->getType().getFieldDesc(DrawerIdFieldId
),
1442 const_cast<WindowBase
*>(this)));
1447 EditFieldHandlePtr
WindowBase::editHandleDrawerId (void)
1449 SFInt32::EditHandlePtr
returnValue(
1450 new SFInt32::EditHandle(
1452 this->getType().getFieldDesc(DrawerIdFieldId
),
1456 editSField(DrawerIdFieldMask
);
1461 GetFieldHandlePtr
WindowBase::getHandleRequestMajor (void) const
1463 SFInt32::GetHandlePtr
returnValue(
1464 new SFInt32::GetHandle(
1466 this->getType().getFieldDesc(RequestMajorFieldId
),
1467 const_cast<WindowBase
*>(this)));
1472 EditFieldHandlePtr
WindowBase::editHandleRequestMajor (void)
1474 SFInt32::EditHandlePtr
returnValue(
1475 new SFInt32::EditHandle(
1477 this->getType().getFieldDesc(RequestMajorFieldId
),
1481 editSField(RequestMajorFieldMask
);
1486 GetFieldHandlePtr
WindowBase::getHandleRequestMinor (void) const
1488 SFInt32::GetHandlePtr
returnValue(
1489 new SFInt32::GetHandle(
1491 this->getType().getFieldDesc(RequestMinorFieldId
),
1492 const_cast<WindowBase
*>(this)));
1497 EditFieldHandlePtr
WindowBase::editHandleRequestMinor (void)
1499 SFInt32::EditHandlePtr
returnValue(
1500 new SFInt32::EditHandle(
1502 this->getType().getFieldDesc(RequestMinorFieldId
),
1506 editSField(RequestMinorFieldMask
);
1511 GetFieldHandlePtr
WindowBase::getHandleContextFlags (void) const
1513 SFInt32::GetHandlePtr
returnValue(
1514 new SFInt32::GetHandle(
1516 this->getType().getFieldDesc(ContextFlagsFieldId
),
1517 const_cast<WindowBase
*>(this)));
1522 EditFieldHandlePtr
WindowBase::editHandleContextFlags (void)
1524 SFInt32::EditHandlePtr
returnValue(
1525 new SFInt32::EditHandle(
1527 this->getType().getFieldDesc(ContextFlagsFieldId
),
1531 editSField(ContextFlagsFieldMask
);
1536 GetFieldHandlePtr
WindowBase::getHandleRenderOptions (void) const
1538 SFUnrecRenderOptionsPtr::GetHandlePtr
returnValue(
1539 new SFUnrecRenderOptionsPtr::GetHandle(
1541 this->getType().getFieldDesc(RenderOptionsFieldId
),
1542 const_cast<WindowBase
*>(this)));
1547 EditFieldHandlePtr
WindowBase::editHandleRenderOptions (void)
1549 SFUnrecRenderOptionsPtr::EditHandlePtr
returnValue(
1550 new SFUnrecRenderOptionsPtr::EditHandle(
1552 this->getType().getFieldDesc(RenderOptionsFieldId
),
1555 returnValue
->setSetMethod(
1556 boost::bind(&Window::setRenderOptions
,
1557 static_cast<Window
*>(this), _1
));
1559 editSField(RenderOptionsFieldMask
);
1564 GetFieldHandlePtr
WindowBase::getHandleIgnoreAllExtensions (void) const
1566 SFBool::GetHandlePtr
returnValue(
1567 new SFBool::GetHandle(
1568 &_sfIgnoreAllExtensions
,
1569 this->getType().getFieldDesc(IgnoreAllExtensionsFieldId
),
1570 const_cast<WindowBase
*>(this)));
1575 EditFieldHandlePtr
WindowBase::editHandleIgnoreAllExtensions(void)
1577 SFBool::EditHandlePtr
returnValue(
1578 new SFBool::EditHandle(
1579 &_sfIgnoreAllExtensions
,
1580 this->getType().getFieldDesc(IgnoreAllExtensionsFieldId
),
1584 editSField(IgnoreAllExtensionsFieldMask
);
1589 GetFieldHandlePtr
WindowBase::getHandleDrawMode (void) const
1591 SFUInt32::GetHandlePtr
returnValue(
1592 new SFUInt32::GetHandle(
1594 this->getType().getFieldDesc(DrawModeFieldId
),
1595 const_cast<WindowBase
*>(this)));
1600 EditFieldHandlePtr
WindowBase::editHandleDrawMode (void)
1602 SFUInt32::EditHandlePtr
returnValue(
1603 new SFUInt32::EditHandle(
1605 this->getType().getFieldDesc(DrawModeFieldId
),
1609 editSField(DrawModeFieldMask
);
1614 GetFieldHandlePtr
WindowBase::getHandleRendererInfo (void) const
1616 SFString::GetHandlePtr
returnValue(
1617 new SFString::GetHandle(
1619 this->getType().getFieldDesc(RendererInfoFieldId
),
1620 const_cast<WindowBase
*>(this)));
1625 EditFieldHandlePtr
WindowBase::editHandleRendererInfo (void)
1627 SFString::EditHandlePtr
returnValue(
1628 new SFString::EditHandle(
1630 this->getType().getFieldDesc(RendererInfoFieldId
),
1634 editSField(RendererInfoFieldMask
);
1639 GetFieldHandlePtr
WindowBase::getHandleDrawTasks (void) const
1641 MFDrawTask::GetHandlePtr
returnValue(
1642 new MFDrawTask::GetHandle(
1644 this->getType().getFieldDesc(DrawTasksFieldId
),
1645 const_cast<WindowBase
*>(this)));
1650 EditFieldHandlePtr
WindowBase::editHandleDrawTasks (void)
1652 MFDrawTask::EditHandlePtr
returnValue(
1653 new MFDrawTask::EditHandle(
1655 this->getType().getFieldDesc(DrawTasksFieldId
),
1659 editMField(DrawTasksFieldMask
, _mfDrawTasks
);
1665 #ifdef OSG_MT_CPTR_ASPECT
1666 void WindowBase::execSyncV( FieldContainer
&oFrom
,
1667 ConstFieldMaskArg whichField
,
1668 AspectOffsetStore
&oOffsets
,
1669 ConstFieldMaskArg syncMode
,
1670 const UInt32 uiSyncInfo
)
1672 Window
*pThis
= static_cast<Window
*>(this);
1674 pThis
->execSync(static_cast<Window
*>(&oFrom
),
1684 void WindowBase::resolveLinks(void)
1686 Inherited::resolveLinks();
1688 static_cast<Window
*>(this)->clearPorts();
1690 static_cast<Window
*>(this)->setRenderOptions(NULL
);
1692 static_cast<Window
*>(this)->clearDrawTasks();
1694 #ifdef OSG_MT_CPTR_ASPECT
1695 AspectOffsetStore oOffsets
;
1697 _pAspectStore
->fillOffsetArray(oOffsets
, this);
1700 #ifdef OSG_MT_CPTR_ASPECT
1701 _mfGlObjectLastRefresh
.terminateShare(Thread::getCurrentAspect(),
1704 #ifdef OSG_MT_CPTR_ASPECT
1705 _mfGlObjectLastReinitialize
.terminateShare(Thread::getCurrentAspect(),