changed: gcc8 base update
[opensg.git] / Source / System / Window / Base / OSGWindowBase.cpp
blob0317ea30f8f88ed9394d15e0d389843b64d7de88
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 Window!
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
53 #include <cstdlib>
54 #include <cstdio>
56 #ifdef WIN32
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
59 #endif
61 #include "OSGConfig.h"
65 #include "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>
74 OSG_BEGIN_NAMESPACE
76 /***************************************************************************\
77 * Description *
78 \***************************************************************************/
80 /*! \class OSG::Window
81 Window is the base class for all window management classes. See \ref
82 PageSystemWindowWindow for a description.
84 \ext
86 To create a new Window the methods that have to be overridden are
87 init(void), activate(void), deactivate(void) and swap(void).
89 \endext
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(
165 "WindowPtr",
166 "HardwareContextPtr",
167 Window::getClassType(),
168 nsOSG);
169 #endif
171 OSG_FIELDTRAITS_GETTYPE_NS(Window *, nsOSG)
173 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
174 Window *,
175 nsOSG)
177 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
178 Window *,
179 nsOSG)
181 /***************************************************************************\
182 * Field Description *
183 \***************************************************************************/
185 void WindowBase::classDescInserter(TypeObject &oType)
187 FieldDescriptionBase *pDesc = NULL;
190 pDesc = new SFUInt16::Description(
191 SFUInt16::getClassType(),
192 "width",
194 WidthFieldId, WidthFieldMask,
195 false,
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(),
204 "height",
206 HeightFieldId, HeightFieldMask,
207 false,
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(),
216 "port",
218 PortFieldId, PortFieldMask,
219 false,
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,
232 true,
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,
244 true,
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,
256 true,
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(),
265 "drawerId",
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,
269 true,
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(),
278 "requestMajor",
280 RequestMajorFieldId, RequestMajorFieldMask,
281 true,
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(),
290 "requestMinor",
292 RequestMinorFieldId, RequestMinorFieldMask,
293 true,
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(),
302 "contextFlags",
304 ContextFlagsFieldId, ContextFlagsFieldMask,
305 true,
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(),
314 "renderOptions",
316 RenderOptionsFieldId, RenderOptionsFieldMask,
317 false,
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,
329 true,
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(),
338 "drawMode",
340 DrawModeFieldId, DrawModeFieldMask,
341 true,
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(),
350 "rendererInfo",
352 RendererInfoFieldId, RendererInfoFieldMask,
353 true,
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(),
362 "drawTasks",
364 DrawTasksFieldId, DrawTasksFieldMask,
365 true,
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(),
377 "NULL",
378 nsOSG, //Namespace
379 NULL,
380 reinterpret_cast<InitContainerF>(&Window::initMethod),
381 reinterpret_cast<ExitContainerF>(&Window::exitMethod),
382 reinterpret_cast<InitalInsertDescFunc>(
383 reinterpret_cast<void *>(&Window::classDescInserter)),
384 false,
386 "<?xml version=\"1.0\"?>\n"
387 "\n"
388 "<FieldContainer\n"
389 " name=\"Window\"\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"
397 " >\n"
398 "\n"
399 " Window is the base class for all window management classes. See \\ref\n"
400 " PageSystemWindowWindow for a description.\n"
401 "\n"
402 " \\ext\n"
403 "\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"
406 "\n"
407 " \\endext\n"
408 " <Field\n"
409 " name=\"width\"\n"
410 " type=\"UInt16\"\n"
411 " cardinality=\"single\"\n"
412 " visibility=\"external\"\n"
413 " access=\"public\"\n"
414 " >\n"
415 " </Field>\n"
416 " <Field\n"
417 " name=\"height\"\n"
418 " type=\"UInt16\"\n"
419 " cardinality=\"single\"\n"
420 " visibility=\"external\"\n"
421 " access=\"public\"\n"
422 " >\n"
423 " </Field>\n"
424 " <Field\n"
425 " name=\"port\"\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"
441 " >\n"
442 " </Field>\n"
443 " <Field\n"
444 " name=\"glObjectEventCounter\"\n"
445 " type=\"UInt32\"\n"
446 " cardinality=\"single\"\n"
447 " visibility=\"internal\"\n"
448 " defaultValue=\"1\"\n"
449 " access=\"protected\"\n"
450 " fieldFlags=\"FClusterLocal, FThreadLocal\"\n"
451 " >\n"
452 " Counter for GL object events. Needed for multi-aspect updates.\n"
453 " Is used in glObjectLastRefresh and glObjectLastReinitialize.\n"
454 " </Field>\n"
455 " <Field\n"
456 " name=\"glObjectLastRefresh\"\n"
457 " type=\"UInt32\"\n"
458 " cardinality=\"multi\"\n"
459 " visibility=\"internal\"\n"
460 " access=\"protected\"\n"
461 " fieldFlags=\"FClusterLocal, FThreadLocal\"\n"
462 " >\n"
463 " Indicates the last refresh for the GL object.\n"
464 " </Field>\n"
465 " <Field\n"
466 " name=\"glObjectLastReinitialize\"\n"
467 " type=\"UInt32\"\n"
468 " cardinality=\"multi\"\n"
469 " visibility=\"internal\"\n"
470 " access=\"protected\"\n"
471 " fieldFlags=\"FClusterLocal, FThreadLocal\"\n"
472 " >\n"
473 " Indicates the last reinit for the GL object.\n"
474 " </Field>\n"
475 " <Field\n"
476 " name=\"drawerId\"\n"
477 " type=\"Int32\"\n"
478 " cardinality=\"single\"\n"
479 " visibility=\"internal\"\n"
480 " access=\"public\"\n"
481 " fieldFlags=\"FClusterLocal\"\n"
482 " defaultValue=\"-1\"\n"
483 " >\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"
486 " </Field>\n"
487 " <Field\n"
488 " name=\"requestMajor\"\n"
489 " type=\"Int32\"\n"
490 " cardinality=\"single\"\n"
491 " visibility=\"internal\"\n"
492 " access=\"public\"\n"
493 " fieldFlags=\"\"\n"
494 " defaultValue=\"-1\"\n"
495 " >\n"
496 " </Field>\n"
497 " <Field\n"
498 " name=\"requestMinor\"\n"
499 " type=\"Int32\"\n"
500 " cardinality=\"single\"\n"
501 " visibility=\"internal\"\n"
502 " access=\"public\"\n"
503 " fieldFlags=\"\"\n"
504 " defaultValue=\"0\"\n"
505 " >\n"
506 " </Field>\n"
507 " <Field\n"
508 " name=\"contextFlags\"\n"
509 " type=\"Int32\"\n"
510 " cardinality=\"single\"\n"
511 " visibility=\"internal\"\n"
512 " access=\"public\"\n"
513 " fieldFlags=\"\"\n"
514 " defaultValue=\"0\"\n"
515 " >\n"
516 " </Field>\n"
517 " <Field\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"
524 " >\n"
525 " </Field>\n"
526 " <Field\n"
527 " name=\"ignoreAllExtensions\"\n"
528 " type=\"bool\"\n"
529 " cardinality=\"single\"\n"
530 " visibility=\"internal\"\n"
531 " access=\"public\"\n"
532 " defaultValue=\"false\"\n"
533 " >\n"
534 " </Field>\n"
535 " <Field\n"
536 " name=\"drawMode\"\n"
537 " type=\"UInt32\"\n"
538 " cardinality=\"single\"\n"
539 " visibility=\"internal\"\n"
540 " access=\"public\"\n"
541 " defaultValue=\"(Window::SequentialPartitionDraw | Window::StdDrawer | Window::ActiveContext)\"\n"
542 " >\n"
543 " </Field>\n"
544 " <Field\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"
551 " >\n"
552 " </Field>\n"
553 " <Field\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"
564 " >\n"
565 " </Field>\n"
566 " \n"
567 "</FieldContainer>\n",
568 "Window is the base class for all window management classes. See \\ref\n"
569 "PageSystemWindowWindow for a description.\n"
570 "\n"
571 "\\ext\n"
572 "\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"
575 "\n"
576 "\\endext\n"
579 /*------------------------------ get -----------------------------------*/
581 FieldContainerType &WindowBase::getType(void)
583 return _type;
586 const FieldContainerType &WindowBase::getType(void) const
588 return _type;
591 UInt32 WindowBase::getContainerSize(void) const
593 return sizeof(Window);
596 /*------------------------- decorator get ------------------------------*/
599 SFUInt16 *WindowBase::editSFWidth(void)
601 editSField(WidthFieldMask);
603 return &_sfWidth;
606 const SFUInt16 *WindowBase::getSFWidth(void) const
608 return &_sfWidth;
612 SFUInt16 *WindowBase::editSFHeight(void)
614 editSField(HeightFieldMask);
616 return &_sfHeight;
619 const SFUInt16 *WindowBase::getSFHeight(void) const
621 return &_sfHeight;
625 //! Get the Window::_mfPort field.
626 const MFUnrecChildViewportPtr *WindowBase::getMFPort(void) const
628 return &_mfPort;
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);
678 return &_sfDrawerId;
681 const SFInt32 *WindowBase::getSFDrawerId(void) const
683 return &_sfDrawerId;
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);
771 return &_sfDrawMode;
774 const SFUInt32 *WindowBase::getSFDrawMode(void) const
776 return &_sfDrawMode;
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)
807 if(value == NULL)
808 return;
810 editMField(PortFieldMask, _mfPort);
812 _mfPort.push_back(value);
815 void WindowBase::assignPort (const MFUnrecChildViewportPtr &value)
817 MFUnrecChildViewportPtr::const_iterator elemIt =
818 value.begin();
819 MFUnrecChildViewportPtr::const_iterator elemEnd =
820 value.end ();
822 static_cast<Window *>(this)->clearPorts();
824 while(elemIt != elemEnd)
826 this->addPort(*elemIt);
828 ++elemIt;
832 void WindowBase::insertPort(UInt32 uiIndex,
833 Viewport * const value )
835 if(value == NULL)
836 return;
838 editMField(PortFieldMask, _mfPort);
840 MFUnrecChildViewportPtr::iterator fieldIt = _mfPort.begin_nc();
842 fieldIt += uiIndex;
844 _mfPort.insert(fieldIt, value);
847 void WindowBase::replacePort(UInt32 uiIndex,
848 Viewport * const value )
850 if(value == NULL)
851 return;
853 if(uiIndex >= _mfPort.size())
854 return;
856 editMField(PortFieldMask, _mfPort);
858 _mfPort.replace(uiIndex, value);
861 void WindowBase::replacePortByObj(Viewport * const pOldElem,
862 Viewport * const pNewElem)
864 if(pNewElem == NULL)
865 return;
867 Int32 elemIdx = _mfPort.findIndex(pOldElem);
869 if(elemIdx != -1)
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);
891 if(iElemIdx != -1)
893 editMField(PortFieldMask, _mfPort);
895 _mfPort.erase(iElemIdx);
898 void WindowBase::clearPorts(void)
900 editMField(PortFieldMask, _mfPort);
903 _mfPort.clear();
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();
976 return returnValue;
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) :
1134 Inherited(),
1135 _sfWidth (),
1136 _sfHeight (),
1137 _mfPort (this,
1138 PortFieldId,
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")),
1151 _mfDrawTasks ()
1155 WindowBase::WindowBase(const WindowBase &source) :
1156 Inherited(source),
1157 _sfWidth (source._sfWidth ),
1158 _sfHeight (source._sfHeight ),
1159 _mfPort (this,
1160 PortFieldId,
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 ),
1173 _mfDrawTasks ()
1178 /*-------------------------- destructors ----------------------------------*/
1180 WindowBase::~WindowBase(void)
1184 /*-------------------------------------------------------------------------*/
1185 /* Child linking */
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);
1200 if(iChildIdx != -1)
1202 editMField(PortFieldMask, _mfPort);
1204 _mfPort.erase(iChildIdx);
1206 return true;
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!"
1217 << std::endl;
1219 return false;
1222 return false;
1226 return Inherited::unlinkChild(pChild, childFieldId);
1229 void WindowBase::onCreate(const Window *source)
1231 Inherited::onCreate(source);
1233 if(source != NULL)
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);
1246 ++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);
1260 ++DrawTasksIt;
1265 GetFieldHandlePtr WindowBase::getHandleWidth (void) const
1267 SFUInt16::GetHandlePtr returnValue(
1268 new SFUInt16::GetHandle(
1269 &_sfWidth,
1270 this->getType().getFieldDesc(WidthFieldId),
1271 const_cast<WindowBase *>(this)));
1273 return returnValue;
1276 EditFieldHandlePtr WindowBase::editHandleWidth (void)
1278 SFUInt16::EditHandlePtr returnValue(
1279 new SFUInt16::EditHandle(
1280 &_sfWidth,
1281 this->getType().getFieldDesc(WidthFieldId),
1282 this));
1285 editSField(WidthFieldMask);
1287 return returnValue;
1290 GetFieldHandlePtr WindowBase::getHandleHeight (void) const
1292 SFUInt16::GetHandlePtr returnValue(
1293 new SFUInt16::GetHandle(
1294 &_sfHeight,
1295 this->getType().getFieldDesc(HeightFieldId),
1296 const_cast<WindowBase *>(this)));
1298 return returnValue;
1301 EditFieldHandlePtr WindowBase::editHandleHeight (void)
1303 SFUInt16::EditHandlePtr returnValue(
1304 new SFUInt16::EditHandle(
1305 &_sfHeight,
1306 this->getType().getFieldDesc(HeightFieldId),
1307 this));
1310 editSField(HeightFieldMask);
1312 return returnValue;
1315 GetFieldHandlePtr WindowBase::getHandlePort (void) const
1317 MFUnrecChildViewportPtr::GetHandlePtr returnValue(
1318 new MFUnrecChildViewportPtr::GetHandle(
1319 &_mfPort,
1320 this->getType().getFieldDesc(PortFieldId),
1321 const_cast<WindowBase *>(this)));
1323 return returnValue;
1326 EditFieldHandlePtr WindowBase::editHandlePort (void)
1328 MFUnrecChildViewportPtr::EditHandlePtr returnValue(
1329 new MFUnrecChildViewportPtr::EditHandle(
1330 &_mfPort,
1331 this->getType().getFieldDesc(PortFieldId),
1332 this));
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);
1358 return returnValue;
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)));
1369 return returnValue;
1372 EditFieldHandlePtr WindowBase::editHandleGlObjectEventCounter(void)
1374 SFUInt32::EditHandlePtr returnValue(
1375 new SFUInt32::EditHandle(
1376 &_sfGlObjectEventCounter,
1377 this->getType().getFieldDesc(GlObjectEventCounterFieldId),
1378 this));
1381 editSField(GlObjectEventCounterFieldMask);
1383 return returnValue;
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)));
1394 return returnValue;
1397 EditFieldHandlePtr WindowBase::editHandleGlObjectLastRefresh(void)
1399 MFUInt32::EditHandlePtr returnValue(
1400 new MFUInt32::EditHandle(
1401 &_mfGlObjectLastRefresh,
1402 this->getType().getFieldDesc(GlObjectLastRefreshFieldId),
1403 this));
1406 editMField(GlObjectLastRefreshFieldMask, _mfGlObjectLastRefresh);
1408 return returnValue;
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)));
1419 return returnValue;
1422 EditFieldHandlePtr WindowBase::editHandleGlObjectLastReinitialize(void)
1424 MFUInt32::EditHandlePtr returnValue(
1425 new MFUInt32::EditHandle(
1426 &_mfGlObjectLastReinitialize,
1427 this->getType().getFieldDesc(GlObjectLastReinitializeFieldId),
1428 this));
1431 editMField(GlObjectLastReinitializeFieldMask, _mfGlObjectLastReinitialize);
1433 return returnValue;
1436 GetFieldHandlePtr WindowBase::getHandleDrawerId (void) const
1438 SFInt32::GetHandlePtr returnValue(
1439 new SFInt32::GetHandle(
1440 &_sfDrawerId,
1441 this->getType().getFieldDesc(DrawerIdFieldId),
1442 const_cast<WindowBase *>(this)));
1444 return returnValue;
1447 EditFieldHandlePtr WindowBase::editHandleDrawerId (void)
1449 SFInt32::EditHandlePtr returnValue(
1450 new SFInt32::EditHandle(
1451 &_sfDrawerId,
1452 this->getType().getFieldDesc(DrawerIdFieldId),
1453 this));
1456 editSField(DrawerIdFieldMask);
1458 return returnValue;
1461 GetFieldHandlePtr WindowBase::getHandleRequestMajor (void) const
1463 SFInt32::GetHandlePtr returnValue(
1464 new SFInt32::GetHandle(
1465 &_sfRequestMajor,
1466 this->getType().getFieldDesc(RequestMajorFieldId),
1467 const_cast<WindowBase *>(this)));
1469 return returnValue;
1472 EditFieldHandlePtr WindowBase::editHandleRequestMajor (void)
1474 SFInt32::EditHandlePtr returnValue(
1475 new SFInt32::EditHandle(
1476 &_sfRequestMajor,
1477 this->getType().getFieldDesc(RequestMajorFieldId),
1478 this));
1481 editSField(RequestMajorFieldMask);
1483 return returnValue;
1486 GetFieldHandlePtr WindowBase::getHandleRequestMinor (void) const
1488 SFInt32::GetHandlePtr returnValue(
1489 new SFInt32::GetHandle(
1490 &_sfRequestMinor,
1491 this->getType().getFieldDesc(RequestMinorFieldId),
1492 const_cast<WindowBase *>(this)));
1494 return returnValue;
1497 EditFieldHandlePtr WindowBase::editHandleRequestMinor (void)
1499 SFInt32::EditHandlePtr returnValue(
1500 new SFInt32::EditHandle(
1501 &_sfRequestMinor,
1502 this->getType().getFieldDesc(RequestMinorFieldId),
1503 this));
1506 editSField(RequestMinorFieldMask);
1508 return returnValue;
1511 GetFieldHandlePtr WindowBase::getHandleContextFlags (void) const
1513 SFInt32::GetHandlePtr returnValue(
1514 new SFInt32::GetHandle(
1515 &_sfContextFlags,
1516 this->getType().getFieldDesc(ContextFlagsFieldId),
1517 const_cast<WindowBase *>(this)));
1519 return returnValue;
1522 EditFieldHandlePtr WindowBase::editHandleContextFlags (void)
1524 SFInt32::EditHandlePtr returnValue(
1525 new SFInt32::EditHandle(
1526 &_sfContextFlags,
1527 this->getType().getFieldDesc(ContextFlagsFieldId),
1528 this));
1531 editSField(ContextFlagsFieldMask);
1533 return returnValue;
1536 GetFieldHandlePtr WindowBase::getHandleRenderOptions (void) const
1538 SFUnrecRenderOptionsPtr::GetHandlePtr returnValue(
1539 new SFUnrecRenderOptionsPtr::GetHandle(
1540 &_sfRenderOptions,
1541 this->getType().getFieldDesc(RenderOptionsFieldId),
1542 const_cast<WindowBase *>(this)));
1544 return returnValue;
1547 EditFieldHandlePtr WindowBase::editHandleRenderOptions (void)
1549 SFUnrecRenderOptionsPtr::EditHandlePtr returnValue(
1550 new SFUnrecRenderOptionsPtr::EditHandle(
1551 &_sfRenderOptions,
1552 this->getType().getFieldDesc(RenderOptionsFieldId),
1553 this));
1555 returnValue->setSetMethod(
1556 boost::bind(&Window::setRenderOptions,
1557 static_cast<Window *>(this), _1));
1559 editSField(RenderOptionsFieldMask);
1561 return returnValue;
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)));
1572 return returnValue;
1575 EditFieldHandlePtr WindowBase::editHandleIgnoreAllExtensions(void)
1577 SFBool::EditHandlePtr returnValue(
1578 new SFBool::EditHandle(
1579 &_sfIgnoreAllExtensions,
1580 this->getType().getFieldDesc(IgnoreAllExtensionsFieldId),
1581 this));
1584 editSField(IgnoreAllExtensionsFieldMask);
1586 return returnValue;
1589 GetFieldHandlePtr WindowBase::getHandleDrawMode (void) const
1591 SFUInt32::GetHandlePtr returnValue(
1592 new SFUInt32::GetHandle(
1593 &_sfDrawMode,
1594 this->getType().getFieldDesc(DrawModeFieldId),
1595 const_cast<WindowBase *>(this)));
1597 return returnValue;
1600 EditFieldHandlePtr WindowBase::editHandleDrawMode (void)
1602 SFUInt32::EditHandlePtr returnValue(
1603 new SFUInt32::EditHandle(
1604 &_sfDrawMode,
1605 this->getType().getFieldDesc(DrawModeFieldId),
1606 this));
1609 editSField(DrawModeFieldMask);
1611 return returnValue;
1614 GetFieldHandlePtr WindowBase::getHandleRendererInfo (void) const
1616 SFString::GetHandlePtr returnValue(
1617 new SFString::GetHandle(
1618 &_sfRendererInfo,
1619 this->getType().getFieldDesc(RendererInfoFieldId),
1620 const_cast<WindowBase *>(this)));
1622 return returnValue;
1625 EditFieldHandlePtr WindowBase::editHandleRendererInfo (void)
1627 SFString::EditHandlePtr returnValue(
1628 new SFString::EditHandle(
1629 &_sfRendererInfo,
1630 this->getType().getFieldDesc(RendererInfoFieldId),
1631 this));
1634 editSField(RendererInfoFieldMask);
1636 return returnValue;
1639 GetFieldHandlePtr WindowBase::getHandleDrawTasks (void) const
1641 MFDrawTask::GetHandlePtr returnValue(
1642 new MFDrawTask::GetHandle(
1643 &_mfDrawTasks,
1644 this->getType().getFieldDesc(DrawTasksFieldId),
1645 const_cast<WindowBase *>(this)));
1647 return returnValue;
1650 EditFieldHandlePtr WindowBase::editHandleDrawTasks (void)
1652 MFDrawTask::EditHandlePtr returnValue(
1653 new MFDrawTask::EditHandle(
1654 &_mfDrawTasks,
1655 this->getType().getFieldDesc(DrawTasksFieldId),
1656 this));
1659 editMField(DrawTasksFieldMask, _mfDrawTasks);
1661 return returnValue;
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),
1675 whichField,
1676 oOffsets,
1677 syncMode,
1678 uiSyncInfo);
1680 #endif
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);
1698 #endif
1700 #ifdef OSG_MT_CPTR_ASPECT
1701 _mfGlObjectLastRefresh.terminateShare(Thread::getCurrentAspect(),
1702 oOffsets);
1703 #endif
1704 #ifdef OSG_MT_CPTR_ASPECT
1705 _mfGlObjectLastReinitialize.terminateShare(Thread::getCurrentAspect(),
1706 oOffsets);
1707 #endif
1711 OSG_END_NAMESPACE