changed: gcc8 base update
[opensg.git] / Source / Contrib / ComplexSceneManager / OSGCSMWindowBase.cpp
blobe7e80e1409b8364bbb27f455691a4eb7fc1ef799
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 CSMWindow!
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 "OSGFieldContainer.h" // Parent Class
66 #include "OSGCSMViewport.h" // Viewports Class
67 #include "OSGRenderOptions.h" // RenderOptions Class
69 #include "OSGCSMWindowBase.h"
70 #include "OSGCSMWindow.h"
72 #include <boost/bind.hpp>
74 OSG_BEGIN_NAMESPACE
76 /***************************************************************************\
77 * Description *
78 \***************************************************************************/
80 /*! \class OSG::CSMWindow
84 /***************************************************************************\
85 * Field Documentation *
86 \***************************************************************************/
88 /*! \var FieldContainer * CSMWindowBase::_sfParent
92 /*! \var CSMViewport * CSMWindowBase::_mfViewports
96 /*! \var MouseData CSMWindowBase::_sfMouseData
100 /*! \var MTouchData CSMWindowBase::_sfMTouchData
104 /*! \var MTouchData CSMWindowBase::_sfMTouchDataWC
105 MTouchData in local window coordinates
108 /*! \var GestureData CSMWindowBase::_sfGestureData
112 /*! \var bool CSMWindowBase::_sfMouseAsMTouch
116 /*! \var Vec2f CSMWindowBase::_sfSize
120 /*! \var Vec2f CSMWindowBase::_sfPosition
124 /*! \var bool CSMWindowBase::_sfDecorEnabled
128 /*! \var Int32 CSMWindowBase::_sfRequestMajor
132 /*! \var Int32 CSMWindowBase::_sfRequestMinor
136 /*! \var bool CSMWindowBase::_sfEnableForwardCompatContext
140 /*! \var bool CSMWindowBase::_sfEnableDebugContext
144 /*! \var std::string CSMWindowBase::_mfIgnoreExtensions
148 /*! \var bool CSMWindowBase::_sfIgnoreAllExtensions
152 /*! \var UInt32 CSMWindowBase::_sfRequestSamples
156 /*! \var bool CSMWindowBase::_sfEnableFSAA
160 /*! \var UInt32 CSMWindowBase::_sfFsaaHint
164 /*! \var RenderOptions * CSMWindowBase::_sfRenderOptions
168 /*! \var UInt32 CSMWindowBase::_sfPartitionDrawMode
172 /*! \var bool CSMWindowBase::_sfRegisterMainLoop
176 /*! \var bool CSMWindowBase::_sfDumpContainer
180 /*! \var Int32 CSMWindowBase::_sfWindowState
185 /***************************************************************************\
186 * FieldType/FieldTrait Instantiation *
187 \***************************************************************************/
189 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
190 PointerType FieldTraits<CSMWindow *, nsOSG>::_type(
191 "CSMWindowPtr",
192 "AttachmentContainerPtr",
193 CSMWindow::getClassType(),
194 nsOSG);
195 #endif
197 OSG_FIELDTRAITS_GETTYPE_NS(CSMWindow *, nsOSG)
199 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField,
200 CSMWindow *,
201 nsOSG)
203 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField,
204 CSMWindow *,
205 nsOSG)
207 DataType &FieldTraits< CSMWindow *, nsOSG + 1 >::getType(void)
209 return FieldTraits<CSMWindow *, nsOSG>::getType();
213 OSG_EXPORT_PTR_SFIELD(ChildPointerSField,
214 CSMWindow *,
215 UnrecordedRefCountPolicy,
216 nsOSG + 1)
219 OSG_EXPORT_PTR_MFIELD(ChildPointerMField,
220 CSMWindow *,
221 UnrecordedRefCountPolicy,
222 nsOSG + 1)
225 /***************************************************************************\
226 * Field Description *
227 \***************************************************************************/
229 void CSMWindowBase::classDescInserter(TypeObject &oType)
231 FieldDescriptionBase *pDesc = NULL;
234 pDesc = new SFParentFieldContainerPtr::Description(
235 SFParentFieldContainerPtr::getClassType(),
236 "parent",
238 ParentFieldId, ParentFieldMask,
239 true,
240 (Field::SFDefaultFlags | Field::FStdAccess),
241 static_cast <FieldEditMethodSig>(&CSMWindow::invalidEditField),
242 static_cast <FieldGetMethodSig >(&CSMWindow::invalidGetField));
244 oType.addInitialDesc(pDesc);
246 pDesc = new MFUnrecCSMViewportPtr::Description(
247 MFUnrecCSMViewportPtr::getClassType(),
248 "viewports",
250 ViewportsFieldId, ViewportsFieldMask,
251 false,
252 (Field::MFDefaultFlags | Field::FStdAccess),
253 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleViewports),
254 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleViewports));
256 oType.addInitialDesc(pDesc);
258 pDesc = new SFMouseData::Description(
259 SFMouseData::getClassType(),
260 "mouseData",
262 MouseDataFieldId, MouseDataFieldMask,
263 true,
264 (Field::SFDefaultFlags | Field::FStdAccess),
265 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleMouseData),
266 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleMouseData));
268 oType.addInitialDesc(pDesc);
270 pDesc = new SFMTouchData::Description(
271 SFMTouchData::getClassType(),
272 "MTouchData",
274 MTouchDataFieldId, MTouchDataFieldMask,
275 true,
276 (Field::SFDefaultFlags | Field::FStdAccess),
277 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleMTouchData),
278 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleMTouchData));
280 oType.addInitialDesc(pDesc);
282 pDesc = new SFMTouchData::Description(
283 SFMTouchData::getClassType(),
284 "MTouchDataWC",
285 "MTouchData in local window coordinates\n",
286 MTouchDataWCFieldId, MTouchDataWCFieldMask,
287 true,
288 (Field::SFDefaultFlags | Field::FStdAccess),
289 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleMTouchDataWC),
290 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleMTouchDataWC));
292 oType.addInitialDesc(pDesc);
294 pDesc = new SFGestureData::Description(
295 SFGestureData::getClassType(),
296 "GestureData",
298 GestureDataFieldId, GestureDataFieldMask,
299 true,
300 (Field::SFDefaultFlags | Field::FStdAccess),
301 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleGestureData),
302 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleGestureData));
304 oType.addInitialDesc(pDesc);
306 pDesc = new SFBool::Description(
307 SFBool::getClassType(),
308 "mouseAsMTouch",
310 MouseAsMTouchFieldId, MouseAsMTouchFieldMask,
311 true,
312 (Field::SFDefaultFlags | Field::FStdAccess),
313 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleMouseAsMTouch),
314 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleMouseAsMTouch));
316 oType.addInitialDesc(pDesc);
318 pDesc = new SFVec2f::Description(
319 SFVec2f::getClassType(),
320 "size",
322 SizeFieldId, SizeFieldMask,
323 true,
324 (Field::SFDefaultFlags | Field::FStdAccess),
325 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleSize),
326 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleSize));
328 oType.addInitialDesc(pDesc);
330 pDesc = new SFVec2f::Description(
331 SFVec2f::getClassType(),
332 "position",
334 PositionFieldId, PositionFieldMask,
335 true,
336 (Field::SFDefaultFlags | Field::FStdAccess),
337 static_cast<FieldEditMethodSig>(&CSMWindow::editHandlePosition),
338 static_cast<FieldGetMethodSig >(&CSMWindow::getHandlePosition));
340 oType.addInitialDesc(pDesc);
342 pDesc = new SFBool::Description(
343 SFBool::getClassType(),
344 "decorEnabled",
346 DecorEnabledFieldId, DecorEnabledFieldMask,
347 true,
348 (Field::SFDefaultFlags | Field::FStdAccess),
349 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleDecorEnabled),
350 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleDecorEnabled));
352 oType.addInitialDesc(pDesc);
354 pDesc = new SFInt32::Description(
355 SFInt32::getClassType(),
356 "requestMajor",
358 RequestMajorFieldId, RequestMajorFieldMask,
359 true,
360 (Field::SFDefaultFlags | Field::FStdAccess),
361 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleRequestMajor),
362 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleRequestMajor));
364 oType.addInitialDesc(pDesc);
366 pDesc = new SFInt32::Description(
367 SFInt32::getClassType(),
368 "requestMinor",
370 RequestMinorFieldId, RequestMinorFieldMask,
371 true,
372 (Field::SFDefaultFlags | Field::FStdAccess),
373 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleRequestMinor),
374 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleRequestMinor));
376 oType.addInitialDesc(pDesc);
378 pDesc = new SFBool::Description(
379 SFBool::getClassType(),
380 "enableForwardCompatContext",
382 EnableForwardCompatContextFieldId, EnableForwardCompatContextFieldMask,
383 true,
384 (Field::SFDefaultFlags | Field::FStdAccess),
385 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleEnableForwardCompatContext),
386 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleEnableForwardCompatContext));
388 oType.addInitialDesc(pDesc);
390 pDesc = new SFBool::Description(
391 SFBool::getClassType(),
392 "enableDebugContext",
394 EnableDebugContextFieldId, EnableDebugContextFieldMask,
395 true,
396 (Field::SFDefaultFlags | Field::FStdAccess),
397 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleEnableDebugContext),
398 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleEnableDebugContext));
400 oType.addInitialDesc(pDesc);
402 pDesc = new MFString::Description(
403 MFString::getClassType(),
404 "ignoreExtensions",
406 IgnoreExtensionsFieldId, IgnoreExtensionsFieldMask,
407 true,
408 (Field::MFDefaultFlags | Field::FStdAccess),
409 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleIgnoreExtensions),
410 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleIgnoreExtensions));
412 oType.addInitialDesc(pDesc);
414 pDesc = new SFBool::Description(
415 SFBool::getClassType(),
416 "ignoreAllExtensions",
418 IgnoreAllExtensionsFieldId, IgnoreAllExtensionsFieldMask,
419 true,
420 (Field::SFDefaultFlags | Field::FStdAccess),
421 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleIgnoreAllExtensions),
422 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleIgnoreAllExtensions));
424 oType.addInitialDesc(pDesc);
426 pDesc = new SFUInt32::Description(
427 SFUInt32::getClassType(),
428 "requestSamples",
430 RequestSamplesFieldId, RequestSamplesFieldMask,
431 true,
432 (Field::SFDefaultFlags | Field::FStdAccess),
433 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleRequestSamples),
434 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleRequestSamples));
436 oType.addInitialDesc(pDesc);
438 pDesc = new SFBool::Description(
439 SFBool::getClassType(),
440 "enableFSAA",
442 EnableFSAAFieldId, EnableFSAAFieldMask,
443 true,
444 (Field::SFDefaultFlags | Field::FStdAccess),
445 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleEnableFSAA),
446 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleEnableFSAA));
448 oType.addInitialDesc(pDesc);
450 pDesc = new SFUInt32::Description(
451 SFUInt32::getClassType(),
452 "fsaaHint",
454 FsaaHintFieldId, FsaaHintFieldMask,
455 true,
456 (Field::SFDefaultFlags | Field::FStdAccess),
457 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleFsaaHint),
458 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleFsaaHint));
460 oType.addInitialDesc(pDesc);
462 pDesc = new SFUnrecRenderOptionsPtr::Description(
463 SFUnrecRenderOptionsPtr::getClassType(),
464 "renderOptions",
466 RenderOptionsFieldId, RenderOptionsFieldMask,
467 true,
468 (Field::SFDefaultFlags | Field::FStdAccess),
469 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleRenderOptions),
470 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleRenderOptions));
472 oType.addInitialDesc(pDesc);
474 pDesc = new SFUInt32::Description(
475 SFUInt32::getClassType(),
476 "partitionDrawMode",
478 PartitionDrawModeFieldId, PartitionDrawModeFieldMask,
479 true,
480 (Field::SFDefaultFlags | Field::FStdAccess),
481 static_cast<FieldEditMethodSig>(&CSMWindow::editHandlePartitionDrawMode),
482 static_cast<FieldGetMethodSig >(&CSMWindow::getHandlePartitionDrawMode));
484 oType.addInitialDesc(pDesc);
486 pDesc = new SFBool::Description(
487 SFBool::getClassType(),
488 "registerMainLoop",
490 RegisterMainLoopFieldId, RegisterMainLoopFieldMask,
491 true,
492 (Field::SFDefaultFlags | Field::FStdAccess),
493 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleRegisterMainLoop),
494 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleRegisterMainLoop));
496 oType.addInitialDesc(pDesc);
498 pDesc = new SFBool::Description(
499 SFBool::getClassType(),
500 "dumpContainer",
502 DumpContainerFieldId, DumpContainerFieldMask,
503 true,
504 (Field::SFDefaultFlags | Field::FStdAccess),
505 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleDumpContainer),
506 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleDumpContainer));
508 oType.addInitialDesc(pDesc);
510 pDesc = new SFInt32::Description(
511 SFInt32::getClassType(),
512 "windowState",
514 WindowStateFieldId, WindowStateFieldMask,
515 true,
516 (Field::SFDefaultFlags | Field::FStdAccess),
517 static_cast<FieldEditMethodSig>(&CSMWindow::editHandleWindowState),
518 static_cast<FieldGetMethodSig >(&CSMWindow::getHandleWindowState));
520 oType.addInitialDesc(pDesc);
524 CSMWindowBase::TypeObject CSMWindowBase::_type(
525 CSMWindowBase::getClassname(),
526 Inherited::getClassname(),
527 "NULL",
528 nsOSG, //Namespace
529 NULL,
530 reinterpret_cast<InitContainerF>(&CSMWindow::initMethod),
531 reinterpret_cast<ExitContainerF>(&CSMWindow::exitMethod),
532 reinterpret_cast<InitalInsertDescFunc>(
533 reinterpret_cast<void *>(&CSMWindow::classDescInserter)),
534 false,
536 "<?xml version=\"1.0\"?>\n"
537 "\n"
538 "<FieldContainer\n"
539 " name=\"CSMWindow\"\n"
540 " parent=\"AttachmentContainer\"\n"
541 " library=\"ContribCSM\"\n"
542 " pointerfieldtypes=\"both\"\n"
543 " structure=\"abstract\"\n"
544 " systemcomponent=\"true\"\n"
545 " parentsystemcomponent=\"true\"\n"
546 " decoratable=\"false\"\n"
547 " useLocalIncludes=\"false\"\n"
548 " isNodeCore=\"false\"\n"
549 " isBundle=\"true\"\n"
550 " childFields=\"both\"\n"
551 " >\n"
552 " <Field\n"
553 " name=\"parent\"\n"
554 " type=\"FieldContainer\"\n"
555 " cardinality=\"single\"\n"
556 " visibility=\"internal\"\n"
557 " access=\"none\"\n"
558 " category=\"parentpointer\"\n"
559 " >\n"
560 " </Field>\n"
561 " <Field\n"
562 " name=\"viewports\"\n"
563 " type=\"CSMViewport\"\n"
564 " cardinality=\"multi\"\n"
565 " visibility=\"external\"\n"
566 " access=\"public\"\n"
567 " category=\"pointer\"\n"
568 " >\n"
569 " </Field>\n"
570 " <Field\n"
571 " name=\"mouseData\"\n"
572 " type=\"MouseData\"\n"
573 " cardinality=\"single\"\n"
574 " visibility=\"internal\"\n"
575 " access=\"public\"\n"
576 " >\n"
577 " </Field>\n"
578 " <Field\n"
579 " name=\"MTouchData\"\n"
580 " type=\"MTouchData\"\n"
581 " cardinality=\"single\"\n"
582 " visibility=\"internal\"\n"
583 " access=\"public\"\n"
584 " >\n"
585 " </Field>\n"
586 " <Field\n"
587 " name=\"MTouchDataWC\"\n"
588 " type=\"MTouchData\"\n"
589 " cardinality=\"single\"\n"
590 " visibility=\"internal\"\n"
591 " access=\"public\"\n"
592 " >\n"
593 " MTouchData in local window coordinates\n"
594 " </Field>\n"
595 " <Field\n"
596 " name=\"GestureData\"\n"
597 " type=\"GestureData\"\n"
598 " cardinality=\"single\"\n"
599 " visibility=\"internal\"\n"
600 " access=\"public\"\n"
601 " >\n"
602 " </Field>\n"
603 " <Field\n"
604 " name=\"mouseAsMTouch\"\n"
605 " type=\"bool\"\n"
606 " cardinality=\"single\"\n"
607 " visibility=\"internal\"\n"
608 " access=\"public\"\n"
609 " defaultValue=\"false\"\n"
610 " >\n"
611 " </Field>\n"
612 " <Field\n"
613 " name=\"size\"\n"
614 " type=\"Vec2f\"\n"
615 " cardinality=\"single\"\n"
616 " visibility=\"internal\"\n"
617 " access=\"public\"\n"
618 " defaultValue=\"300, 300\"\n"
619 " >\n"
620 " </Field>\n"
621 " <Field\n"
622 " name=\"position\"\n"
623 " type=\"Vec2f\"\n"
624 " cardinality=\"single\"\n"
625 " visibility=\"internal\"\n"
626 " access=\"public\"\n"
627 " defaultValue=\"100, 100\"\n"
628 " >\n"
629 " </Field>\n"
630 " <Field\n"
631 " name=\"decorEnabled\"\n"
632 " type=\"bool\"\n"
633 " cardinality=\"single\"\n"
634 " visibility=\"internal\"\n"
635 " access=\"public\"\n"
636 " defaultValue=\"true\"\n"
637 " >\n"
638 " </Field>\n"
639 " <Field\n"
640 " name=\"requestMajor\"\n"
641 " type=\"Int32\"\n"
642 " cardinality=\"single\"\n"
643 " visibility=\"internal\"\n"
644 " access=\"public\"\n"
645 " fieldFlags=\"\"\n"
646 " defaultValue=\"-1\"\n"
647 " >\n"
648 " </Field>\n"
649 " <Field\n"
650 " name=\"requestMinor\"\n"
651 " type=\"Int32\"\n"
652 " cardinality=\"single\"\n"
653 " visibility=\"internal\"\n"
654 " access=\"public\"\n"
655 " fieldFlags=\"\"\n"
656 " defaultValue=\"0\"\n"
657 " >\n"
658 " </Field>\n"
659 " <Field\n"
660 " name=\"enableForwardCompatContext\"\n"
661 " type=\"bool\"\n"
662 " cardinality=\"single\"\n"
663 " visibility=\"internal\"\n"
664 " access=\"public\"\n"
665 " fieldFlags=\"\"\n"
666 " defaultValue=\"false\"\n"
667 " >\n"
668 " </Field>\n"
669 " <Field\n"
670 " name=\"enableDebugContext\"\n"
671 " type=\"bool\"\n"
672 " cardinality=\"single\"\n"
673 " visibility=\"internal\"\n"
674 " access=\"public\"\n"
675 " fieldFlags=\"\"\n"
676 " defaultValue=\"false\"\n"
677 " >\n"
678 " </Field>\n"
679 " <Field\n"
680 " name=\"ignoreExtensions\"\n"
681 " type=\"std::string\"\n"
682 " cardinality=\"multi\"\n"
683 " visibility=\"internal\"\n"
684 " access=\"public\"\n"
685 " fieldFlags=\"\"\n"
686 " >\n"
687 " </Field>\n"
688 " <Field\n"
689 " name=\"ignoreAllExtensions\"\n"
690 " type=\"bool\"\n"
691 " cardinality=\"single\"\n"
692 " visibility=\"internal\"\n"
693 " access=\"public\"\n"
694 " fieldFlags=\"\"\n"
695 " defaultValue=\"false\"\n"
696 " >\n"
697 " </Field>\n"
698 " <Field\n"
699 " name=\"requestSamples\"\n"
700 " type=\"UInt32\"\n"
701 " cardinality=\"single\"\n"
702 " visibility=\"internal\"\n"
703 " access=\"public\"\n"
704 " fieldFlags=\"\"\n"
705 " defaultValue=\"0\"\n"
706 " >\n"
707 " </Field>\n"
708 "\n"
709 " <Field\n"
710 " name=\"enableFSAA\"\n"
711 " type=\"bool\"\n"
712 " cardinality=\"single\"\n"
713 " visibility=\"internal\"\n"
714 " access=\"public\"\n"
715 " fieldFlags=\"\"\n"
716 " defaultValue=\"false\"\n"
717 " >\n"
718 " </Field>\n"
719 " <Field\n"
720 " name=\"fsaaHint\"\n"
721 " type=\"UInt32\"\n"
722 " cardinality=\"single\"\n"
723 " visibility=\"internal\"\n"
724 " access=\"public\"\n"
725 " fieldFlags=\"\"\n"
726 " defaultValue=\"GL_FASTEST\"\n"
727 " >\n"
728 " </Field>\n"
729 " <Field\n"
730 " name=\"renderOptions\"\n"
731 " type=\"RenderOptionsPtr\"\n"
732 " cardinality=\"single\"\n"
733 " visibility=\"internal\"\n"
734 " access=\"public\"\n"
735 " defaultValue=\"NULL\"\n"
736 " >\n"
737 " </Field>\n"
738 " <Field\n"
739 " name=\"partitionDrawMode\"\n"
740 " type=\"UInt32\"\n"
741 " cardinality=\"single\"\n"
742 " visibility=\"internal\"\n"
743 " access=\"public\"\n"
744 " fieldFlags=\"\"\n"
745 " defaultValue=\"Window::SequentialPartitionDraw\"\n"
746 " >\n"
747 " </Field>\n"
748 " <Field\n"
749 " name=\"registerMainLoop\"\n"
750 " type=\"bool\"\n"
751 " cardinality=\"single\"\n"
752 " visibility=\"internal\"\n"
753 " access=\"public\"\n"
754 " fieldFlags=\"\"\n"
755 " defaultValue=\"true\"\n"
756 " >\n"
757 " </Field>\n"
758 " <Field\n"
759 " name=\"dumpContainer\"\n"
760 " type=\"bool\"\n"
761 " cardinality=\"single\"\n"
762 " visibility=\"internal\"\n"
763 " access=\"public\"\n"
764 " fieldFlags=\"\"\n"
765 " defaultValue=\"false\"\n"
766 " >\n"
767 " </Field>\n"
768 " <Field\n"
769 " name=\"windowState\"\n"
770 " type=\"Int32\"\n"
771 " cardinality=\"single\"\n"
772 " visibility=\"internal\"\n"
773 " access=\"public\"\n"
774 " fieldFlags=\"\"\n"
775 " defaultValue=\"0\"\n"
776 " >\n"
777 " </Field>\n"
778 "</FieldContainer>\n",
782 /*------------------------------ get -----------------------------------*/
784 FieldContainerType &CSMWindowBase::getType(void)
786 return _type;
789 const FieldContainerType &CSMWindowBase::getType(void) const
791 return _type;
794 UInt32 CSMWindowBase::getContainerSize(void) const
796 return sizeof(CSMWindow);
799 /*------------------------- decorator get ------------------------------*/
803 //! Get the CSMWindow::_mfViewports field.
804 const MFUnrecCSMViewportPtr *CSMWindowBase::getMFViewports(void) const
806 return &_mfViewports;
809 MFUnrecCSMViewportPtr *CSMWindowBase::editMFViewports (void)
811 editMField(ViewportsFieldMask, _mfViewports);
813 return &_mfViewports;
815 CSMViewport * CSMWindowBase::getViewports(const UInt32 index) const
817 return _mfViewports[index];
820 SFMouseData *CSMWindowBase::editSFMouseData(void)
822 editSField(MouseDataFieldMask);
824 return &_sfMouseData;
827 const SFMouseData *CSMWindowBase::getSFMouseData(void) const
829 return &_sfMouseData;
833 SFMTouchData *CSMWindowBase::editSFMTouchData(void)
835 editSField(MTouchDataFieldMask);
837 return &_sfMTouchData;
840 const SFMTouchData *CSMWindowBase::getSFMTouchData(void) const
842 return &_sfMTouchData;
846 SFMTouchData *CSMWindowBase::editSFMTouchDataWC(void)
848 editSField(MTouchDataWCFieldMask);
850 return &_sfMTouchDataWC;
853 const SFMTouchData *CSMWindowBase::getSFMTouchDataWC(void) const
855 return &_sfMTouchDataWC;
859 SFGestureData *CSMWindowBase::editSFGestureData(void)
861 editSField(GestureDataFieldMask);
863 return &_sfGestureData;
866 const SFGestureData *CSMWindowBase::getSFGestureData(void) const
868 return &_sfGestureData;
872 SFBool *CSMWindowBase::editSFMouseAsMTouch(void)
874 editSField(MouseAsMTouchFieldMask);
876 return &_sfMouseAsMTouch;
879 const SFBool *CSMWindowBase::getSFMouseAsMTouch(void) const
881 return &_sfMouseAsMTouch;
885 SFVec2f *CSMWindowBase::editSFSize(void)
887 editSField(SizeFieldMask);
889 return &_sfSize;
892 const SFVec2f *CSMWindowBase::getSFSize(void) const
894 return &_sfSize;
898 SFVec2f *CSMWindowBase::editSFPosition(void)
900 editSField(PositionFieldMask);
902 return &_sfPosition;
905 const SFVec2f *CSMWindowBase::getSFPosition(void) const
907 return &_sfPosition;
911 SFBool *CSMWindowBase::editSFDecorEnabled(void)
913 editSField(DecorEnabledFieldMask);
915 return &_sfDecorEnabled;
918 const SFBool *CSMWindowBase::getSFDecorEnabled(void) const
920 return &_sfDecorEnabled;
924 SFInt32 *CSMWindowBase::editSFRequestMajor(void)
926 editSField(RequestMajorFieldMask);
928 return &_sfRequestMajor;
931 const SFInt32 *CSMWindowBase::getSFRequestMajor(void) const
933 return &_sfRequestMajor;
937 SFInt32 *CSMWindowBase::editSFRequestMinor(void)
939 editSField(RequestMinorFieldMask);
941 return &_sfRequestMinor;
944 const SFInt32 *CSMWindowBase::getSFRequestMinor(void) const
946 return &_sfRequestMinor;
950 SFBool *CSMWindowBase::editSFEnableForwardCompatContext(void)
952 editSField(EnableForwardCompatContextFieldMask);
954 return &_sfEnableForwardCompatContext;
957 const SFBool *CSMWindowBase::getSFEnableForwardCompatContext(void) const
959 return &_sfEnableForwardCompatContext;
963 SFBool *CSMWindowBase::editSFEnableDebugContext(void)
965 editSField(EnableDebugContextFieldMask);
967 return &_sfEnableDebugContext;
970 const SFBool *CSMWindowBase::getSFEnableDebugContext(void) const
972 return &_sfEnableDebugContext;
976 MFString *CSMWindowBase::editMFIgnoreExtensions(void)
978 editMField(IgnoreExtensionsFieldMask, _mfIgnoreExtensions);
980 return &_mfIgnoreExtensions;
983 const MFString *CSMWindowBase::getMFIgnoreExtensions(void) const
985 return &_mfIgnoreExtensions;
989 SFBool *CSMWindowBase::editSFIgnoreAllExtensions(void)
991 editSField(IgnoreAllExtensionsFieldMask);
993 return &_sfIgnoreAllExtensions;
996 const SFBool *CSMWindowBase::getSFIgnoreAllExtensions(void) const
998 return &_sfIgnoreAllExtensions;
1002 SFUInt32 *CSMWindowBase::editSFRequestSamples(void)
1004 editSField(RequestSamplesFieldMask);
1006 return &_sfRequestSamples;
1009 const SFUInt32 *CSMWindowBase::getSFRequestSamples(void) const
1011 return &_sfRequestSamples;
1015 SFBool *CSMWindowBase::editSFEnableFSAA(void)
1017 editSField(EnableFSAAFieldMask);
1019 return &_sfEnableFSAA;
1022 const SFBool *CSMWindowBase::getSFEnableFSAA(void) const
1024 return &_sfEnableFSAA;
1028 SFUInt32 *CSMWindowBase::editSFFsaaHint(void)
1030 editSField(FsaaHintFieldMask);
1032 return &_sfFsaaHint;
1035 const SFUInt32 *CSMWindowBase::getSFFsaaHint(void) const
1037 return &_sfFsaaHint;
1041 //! Get the CSMWindow::_sfRenderOptions field.
1042 const SFUnrecRenderOptionsPtr *CSMWindowBase::getSFRenderOptions(void) const
1044 return &_sfRenderOptions;
1047 SFUnrecRenderOptionsPtr *CSMWindowBase::editSFRenderOptions (void)
1049 editSField(RenderOptionsFieldMask);
1051 return &_sfRenderOptions;
1054 //! Get the value of the CSMWindow::_sfRenderOptions field.
1055 RenderOptions * CSMWindowBase::getRenderOptions(void) const
1057 return _sfRenderOptions.getValue();
1060 //! Set the value of the CSMWindow::_sfRenderOptions field.
1061 void CSMWindowBase::setRenderOptions(RenderOptions * const value)
1063 editSField(RenderOptionsFieldMask);
1065 _sfRenderOptions.setValue(value);
1069 SFUInt32 *CSMWindowBase::editSFPartitionDrawMode(void)
1071 editSField(PartitionDrawModeFieldMask);
1073 return &_sfPartitionDrawMode;
1076 const SFUInt32 *CSMWindowBase::getSFPartitionDrawMode(void) const
1078 return &_sfPartitionDrawMode;
1082 SFBool *CSMWindowBase::editSFRegisterMainLoop(void)
1084 editSField(RegisterMainLoopFieldMask);
1086 return &_sfRegisterMainLoop;
1089 const SFBool *CSMWindowBase::getSFRegisterMainLoop(void) const
1091 return &_sfRegisterMainLoop;
1095 SFBool *CSMWindowBase::editSFDumpContainer(void)
1097 editSField(DumpContainerFieldMask);
1099 return &_sfDumpContainer;
1102 const SFBool *CSMWindowBase::getSFDumpContainer(void) const
1104 return &_sfDumpContainer;
1108 SFInt32 *CSMWindowBase::editSFWindowState(void)
1110 editSField(WindowStateFieldMask);
1112 return &_sfWindowState;
1115 const SFInt32 *CSMWindowBase::getSFWindowState(void) const
1117 return &_sfWindowState;
1123 void CSMWindowBase::pushToViewports(CSMViewport * const value)
1125 editMField(ViewportsFieldMask, _mfViewports);
1127 _mfViewports.push_back(value);
1130 void CSMWindowBase::assignViewports(const MFUnrecCSMViewportPtr &value)
1132 MFUnrecCSMViewportPtr::const_iterator elemIt =
1133 value.begin();
1134 MFUnrecCSMViewportPtr::const_iterator elemEnd =
1135 value.end ();
1137 static_cast<CSMWindow *>(this)->clearViewports();
1139 while(elemIt != elemEnd)
1141 this->pushToViewports(*elemIt);
1143 ++elemIt;
1147 void CSMWindowBase::removeFromViewports(UInt32 uiIndex)
1149 if(uiIndex < _mfViewports.size())
1151 editMField(ViewportsFieldMask, _mfViewports);
1153 _mfViewports.erase(uiIndex);
1157 void CSMWindowBase::removeObjFromViewports(CSMViewport * const value)
1159 Int32 iElemIdx = _mfViewports.findIndex(value);
1161 if(iElemIdx != -1)
1163 editMField(ViewportsFieldMask, _mfViewports);
1165 _mfViewports.erase(iElemIdx);
1168 void CSMWindowBase::clearViewports(void)
1170 editMField(ViewportsFieldMask, _mfViewports);
1173 _mfViewports.clear();
1178 /*------------------------------ access -----------------------------------*/
1180 SizeT CSMWindowBase::getBinSize(ConstFieldMaskArg whichField)
1182 SizeT returnValue = Inherited::getBinSize(whichField);
1184 if(FieldBits::NoField != (ParentFieldMask & whichField))
1186 returnValue += _sfParent.getBinSize();
1188 if(FieldBits::NoField != (ViewportsFieldMask & whichField))
1190 returnValue += _mfViewports.getBinSize();
1192 if(FieldBits::NoField != (MouseDataFieldMask & whichField))
1194 returnValue += _sfMouseData.getBinSize();
1196 if(FieldBits::NoField != (MTouchDataFieldMask & whichField))
1198 returnValue += _sfMTouchData.getBinSize();
1200 if(FieldBits::NoField != (MTouchDataWCFieldMask & whichField))
1202 returnValue += _sfMTouchDataWC.getBinSize();
1204 if(FieldBits::NoField != (GestureDataFieldMask & whichField))
1206 returnValue += _sfGestureData.getBinSize();
1208 if(FieldBits::NoField != (MouseAsMTouchFieldMask & whichField))
1210 returnValue += _sfMouseAsMTouch.getBinSize();
1212 if(FieldBits::NoField != (SizeFieldMask & whichField))
1214 returnValue += _sfSize.getBinSize();
1216 if(FieldBits::NoField != (PositionFieldMask & whichField))
1218 returnValue += _sfPosition.getBinSize();
1220 if(FieldBits::NoField != (DecorEnabledFieldMask & whichField))
1222 returnValue += _sfDecorEnabled.getBinSize();
1224 if(FieldBits::NoField != (RequestMajorFieldMask & whichField))
1226 returnValue += _sfRequestMajor.getBinSize();
1228 if(FieldBits::NoField != (RequestMinorFieldMask & whichField))
1230 returnValue += _sfRequestMinor.getBinSize();
1232 if(FieldBits::NoField != (EnableForwardCompatContextFieldMask & whichField))
1234 returnValue += _sfEnableForwardCompatContext.getBinSize();
1236 if(FieldBits::NoField != (EnableDebugContextFieldMask & whichField))
1238 returnValue += _sfEnableDebugContext.getBinSize();
1240 if(FieldBits::NoField != (IgnoreExtensionsFieldMask & whichField))
1242 returnValue += _mfIgnoreExtensions.getBinSize();
1244 if(FieldBits::NoField != (IgnoreAllExtensionsFieldMask & whichField))
1246 returnValue += _sfIgnoreAllExtensions.getBinSize();
1248 if(FieldBits::NoField != (RequestSamplesFieldMask & whichField))
1250 returnValue += _sfRequestSamples.getBinSize();
1252 if(FieldBits::NoField != (EnableFSAAFieldMask & whichField))
1254 returnValue += _sfEnableFSAA.getBinSize();
1256 if(FieldBits::NoField != (FsaaHintFieldMask & whichField))
1258 returnValue += _sfFsaaHint.getBinSize();
1260 if(FieldBits::NoField != (RenderOptionsFieldMask & whichField))
1262 returnValue += _sfRenderOptions.getBinSize();
1264 if(FieldBits::NoField != (PartitionDrawModeFieldMask & whichField))
1266 returnValue += _sfPartitionDrawMode.getBinSize();
1268 if(FieldBits::NoField != (RegisterMainLoopFieldMask & whichField))
1270 returnValue += _sfRegisterMainLoop.getBinSize();
1272 if(FieldBits::NoField != (DumpContainerFieldMask & whichField))
1274 returnValue += _sfDumpContainer.getBinSize();
1276 if(FieldBits::NoField != (WindowStateFieldMask & whichField))
1278 returnValue += _sfWindowState.getBinSize();
1281 return returnValue;
1284 void CSMWindowBase::copyToBin(BinaryDataHandler &pMem,
1285 ConstFieldMaskArg whichField)
1287 Inherited::copyToBin(pMem, whichField);
1289 if(FieldBits::NoField != (ParentFieldMask & whichField))
1291 _sfParent.copyToBin(pMem);
1293 if(FieldBits::NoField != (ViewportsFieldMask & whichField))
1295 _mfViewports.copyToBin(pMem);
1297 if(FieldBits::NoField != (MouseDataFieldMask & whichField))
1299 _sfMouseData.copyToBin(pMem);
1301 if(FieldBits::NoField != (MTouchDataFieldMask & whichField))
1303 _sfMTouchData.copyToBin(pMem);
1305 if(FieldBits::NoField != (MTouchDataWCFieldMask & whichField))
1307 _sfMTouchDataWC.copyToBin(pMem);
1309 if(FieldBits::NoField != (GestureDataFieldMask & whichField))
1311 _sfGestureData.copyToBin(pMem);
1313 if(FieldBits::NoField != (MouseAsMTouchFieldMask & whichField))
1315 _sfMouseAsMTouch.copyToBin(pMem);
1317 if(FieldBits::NoField != (SizeFieldMask & whichField))
1319 _sfSize.copyToBin(pMem);
1321 if(FieldBits::NoField != (PositionFieldMask & whichField))
1323 _sfPosition.copyToBin(pMem);
1325 if(FieldBits::NoField != (DecorEnabledFieldMask & whichField))
1327 _sfDecorEnabled.copyToBin(pMem);
1329 if(FieldBits::NoField != (RequestMajorFieldMask & whichField))
1331 _sfRequestMajor.copyToBin(pMem);
1333 if(FieldBits::NoField != (RequestMinorFieldMask & whichField))
1335 _sfRequestMinor.copyToBin(pMem);
1337 if(FieldBits::NoField != (EnableForwardCompatContextFieldMask & whichField))
1339 _sfEnableForwardCompatContext.copyToBin(pMem);
1341 if(FieldBits::NoField != (EnableDebugContextFieldMask & whichField))
1343 _sfEnableDebugContext.copyToBin(pMem);
1345 if(FieldBits::NoField != (IgnoreExtensionsFieldMask & whichField))
1347 _mfIgnoreExtensions.copyToBin(pMem);
1349 if(FieldBits::NoField != (IgnoreAllExtensionsFieldMask & whichField))
1351 _sfIgnoreAllExtensions.copyToBin(pMem);
1353 if(FieldBits::NoField != (RequestSamplesFieldMask & whichField))
1355 _sfRequestSamples.copyToBin(pMem);
1357 if(FieldBits::NoField != (EnableFSAAFieldMask & whichField))
1359 _sfEnableFSAA.copyToBin(pMem);
1361 if(FieldBits::NoField != (FsaaHintFieldMask & whichField))
1363 _sfFsaaHint.copyToBin(pMem);
1365 if(FieldBits::NoField != (RenderOptionsFieldMask & whichField))
1367 _sfRenderOptions.copyToBin(pMem);
1369 if(FieldBits::NoField != (PartitionDrawModeFieldMask & whichField))
1371 _sfPartitionDrawMode.copyToBin(pMem);
1373 if(FieldBits::NoField != (RegisterMainLoopFieldMask & whichField))
1375 _sfRegisterMainLoop.copyToBin(pMem);
1377 if(FieldBits::NoField != (DumpContainerFieldMask & whichField))
1379 _sfDumpContainer.copyToBin(pMem);
1381 if(FieldBits::NoField != (WindowStateFieldMask & whichField))
1383 _sfWindowState.copyToBin(pMem);
1387 void CSMWindowBase::copyFromBin(BinaryDataHandler &pMem,
1388 ConstFieldMaskArg whichField)
1390 Inherited::copyFromBin(pMem, whichField);
1392 if(FieldBits::NoField != (ParentFieldMask & whichField))
1394 editSField(ParentFieldMask);
1395 _sfParent.copyFromBin(pMem);
1397 if(FieldBits::NoField != (ViewportsFieldMask & whichField))
1399 editMField(ViewportsFieldMask, _mfViewports);
1400 _mfViewports.copyFromBin(pMem);
1402 if(FieldBits::NoField != (MouseDataFieldMask & whichField))
1404 editSField(MouseDataFieldMask);
1405 _sfMouseData.copyFromBin(pMem);
1407 if(FieldBits::NoField != (MTouchDataFieldMask & whichField))
1409 editSField(MTouchDataFieldMask);
1410 _sfMTouchData.copyFromBin(pMem);
1412 if(FieldBits::NoField != (MTouchDataWCFieldMask & whichField))
1414 editSField(MTouchDataWCFieldMask);
1415 _sfMTouchDataWC.copyFromBin(pMem);
1417 if(FieldBits::NoField != (GestureDataFieldMask & whichField))
1419 editSField(GestureDataFieldMask);
1420 _sfGestureData.copyFromBin(pMem);
1422 if(FieldBits::NoField != (MouseAsMTouchFieldMask & whichField))
1424 editSField(MouseAsMTouchFieldMask);
1425 _sfMouseAsMTouch.copyFromBin(pMem);
1427 if(FieldBits::NoField != (SizeFieldMask & whichField))
1429 editSField(SizeFieldMask);
1430 _sfSize.copyFromBin(pMem);
1432 if(FieldBits::NoField != (PositionFieldMask & whichField))
1434 editSField(PositionFieldMask);
1435 _sfPosition.copyFromBin(pMem);
1437 if(FieldBits::NoField != (DecorEnabledFieldMask & whichField))
1439 editSField(DecorEnabledFieldMask);
1440 _sfDecorEnabled.copyFromBin(pMem);
1442 if(FieldBits::NoField != (RequestMajorFieldMask & whichField))
1444 editSField(RequestMajorFieldMask);
1445 _sfRequestMajor.copyFromBin(pMem);
1447 if(FieldBits::NoField != (RequestMinorFieldMask & whichField))
1449 editSField(RequestMinorFieldMask);
1450 _sfRequestMinor.copyFromBin(pMem);
1452 if(FieldBits::NoField != (EnableForwardCompatContextFieldMask & whichField))
1454 editSField(EnableForwardCompatContextFieldMask);
1455 _sfEnableForwardCompatContext.copyFromBin(pMem);
1457 if(FieldBits::NoField != (EnableDebugContextFieldMask & whichField))
1459 editSField(EnableDebugContextFieldMask);
1460 _sfEnableDebugContext.copyFromBin(pMem);
1462 if(FieldBits::NoField != (IgnoreExtensionsFieldMask & whichField))
1464 editMField(IgnoreExtensionsFieldMask, _mfIgnoreExtensions);
1465 _mfIgnoreExtensions.copyFromBin(pMem);
1467 if(FieldBits::NoField != (IgnoreAllExtensionsFieldMask & whichField))
1469 editSField(IgnoreAllExtensionsFieldMask);
1470 _sfIgnoreAllExtensions.copyFromBin(pMem);
1472 if(FieldBits::NoField != (RequestSamplesFieldMask & whichField))
1474 editSField(RequestSamplesFieldMask);
1475 _sfRequestSamples.copyFromBin(pMem);
1477 if(FieldBits::NoField != (EnableFSAAFieldMask & whichField))
1479 editSField(EnableFSAAFieldMask);
1480 _sfEnableFSAA.copyFromBin(pMem);
1482 if(FieldBits::NoField != (FsaaHintFieldMask & whichField))
1484 editSField(FsaaHintFieldMask);
1485 _sfFsaaHint.copyFromBin(pMem);
1487 if(FieldBits::NoField != (RenderOptionsFieldMask & whichField))
1489 editSField(RenderOptionsFieldMask);
1490 _sfRenderOptions.copyFromBin(pMem);
1492 if(FieldBits::NoField != (PartitionDrawModeFieldMask & whichField))
1494 editSField(PartitionDrawModeFieldMask);
1495 _sfPartitionDrawMode.copyFromBin(pMem);
1497 if(FieldBits::NoField != (RegisterMainLoopFieldMask & whichField))
1499 editSField(RegisterMainLoopFieldMask);
1500 _sfRegisterMainLoop.copyFromBin(pMem);
1502 if(FieldBits::NoField != (DumpContainerFieldMask & whichField))
1504 editSField(DumpContainerFieldMask);
1505 _sfDumpContainer.copyFromBin(pMem);
1507 if(FieldBits::NoField != (WindowStateFieldMask & whichField))
1509 editSField(WindowStateFieldMask);
1510 _sfWindowState.copyFromBin(pMem);
1517 /*------------------------- constructors ----------------------------------*/
1519 CSMWindowBase::CSMWindowBase(void) :
1520 Inherited(),
1521 _sfParent (NULL),
1522 _mfViewports (),
1523 _sfMouseData (),
1524 _sfMTouchData (),
1525 _sfMTouchDataWC (),
1526 _sfGestureData (),
1527 _sfMouseAsMTouch (bool(false)),
1528 _sfSize (Vec2f(300, 300)),
1529 _sfPosition (Vec2f(100, 100)),
1530 _sfDecorEnabled (bool(true)),
1531 _sfRequestMajor (Int32(-1)),
1532 _sfRequestMinor (Int32(0)),
1533 _sfEnableForwardCompatContext(bool(false)),
1534 _sfEnableDebugContext (bool(false)),
1535 _mfIgnoreExtensions (),
1536 _sfIgnoreAllExtensions (bool(false)),
1537 _sfRequestSamples (UInt32(0)),
1538 _sfEnableFSAA (bool(false)),
1539 _sfFsaaHint (UInt32(GL_FASTEST)),
1540 _sfRenderOptions (NULL),
1541 _sfPartitionDrawMode (UInt32(Window::SequentialPartitionDraw)),
1542 _sfRegisterMainLoop (bool(true)),
1543 _sfDumpContainer (bool(false)),
1544 _sfWindowState (Int32(0))
1548 CSMWindowBase::CSMWindowBase(const CSMWindowBase &source) :
1549 Inherited(source),
1550 _sfParent (NULL),
1551 _mfViewports (),
1552 _sfMouseData (source._sfMouseData ),
1553 _sfMTouchData (source._sfMTouchData ),
1554 _sfMTouchDataWC (source._sfMTouchDataWC ),
1555 _sfGestureData (source._sfGestureData ),
1556 _sfMouseAsMTouch (source._sfMouseAsMTouch ),
1557 _sfSize (source._sfSize ),
1558 _sfPosition (source._sfPosition ),
1559 _sfDecorEnabled (source._sfDecorEnabled ),
1560 _sfRequestMajor (source._sfRequestMajor ),
1561 _sfRequestMinor (source._sfRequestMinor ),
1562 _sfEnableForwardCompatContext(source._sfEnableForwardCompatContext),
1563 _sfEnableDebugContext (source._sfEnableDebugContext ),
1564 _mfIgnoreExtensions (source._mfIgnoreExtensions ),
1565 _sfIgnoreAllExtensions (source._sfIgnoreAllExtensions ),
1566 _sfRequestSamples (source._sfRequestSamples ),
1567 _sfEnableFSAA (source._sfEnableFSAA ),
1568 _sfFsaaHint (source._sfFsaaHint ),
1569 _sfRenderOptions (NULL),
1570 _sfPartitionDrawMode (source._sfPartitionDrawMode ),
1571 _sfRegisterMainLoop (source._sfRegisterMainLoop ),
1572 _sfDumpContainer (source._sfDumpContainer ),
1573 _sfWindowState (source._sfWindowState )
1578 /*-------------------------- destructors ----------------------------------*/
1580 CSMWindowBase::~CSMWindowBase(void)
1583 /*-------------------------------------------------------------------------*/
1584 /* Parent linking */
1586 bool CSMWindowBase::linkParent(
1587 FieldContainer * const pParent,
1588 UInt16 const childFieldId,
1589 UInt16 const parentFieldId )
1591 if(parentFieldId == ParentFieldId)
1593 FieldContainer * pTypedParent =
1594 dynamic_cast< FieldContainer * >(pParent);
1596 if(pTypedParent != NULL)
1598 FieldContainer *pOldParent =
1599 _sfParent.getValue ();
1601 UInt16 oldChildFieldId =
1602 _sfParent.getParentFieldPos();
1604 if(pOldParent != NULL)
1606 pOldParent->unlinkChild(this, oldChildFieldId);
1609 editSField(ParentFieldMask);
1611 _sfParent.setValue(static_cast<FieldContainer *>(pParent), childFieldId);
1613 return true;
1616 return false;
1619 return Inherited::linkParent(pParent, childFieldId, parentFieldId);
1622 bool CSMWindowBase::unlinkParent(
1623 FieldContainer * const pParent,
1624 UInt16 const parentFieldId)
1626 if(parentFieldId == ParentFieldId)
1628 FieldContainer * pTypedParent =
1629 dynamic_cast< FieldContainer * >(pParent);
1631 if(pTypedParent != NULL)
1633 if(_sfParent.getValue() == pTypedParent)
1635 editSField(ParentFieldMask);
1637 _sfParent.setValue(NULL, 0xFFFF);
1639 return true;
1642 SWARNING << "Child ([" << this
1643 << "] id [" << this->getId()
1644 << "] type [" << this->getType().getCName()
1645 << "] parentFieldId [" << parentFieldId
1646 << "]) - Parent ([" << pParent
1647 << "] id [" << pParent->getId()
1648 << "] type [" << pParent->getType().getCName()
1649 << "]): link inconsistent!"
1650 << std::endl;
1652 return false;
1655 return false;
1658 return Inherited::unlinkParent(pParent, parentFieldId);
1662 void CSMWindowBase::onCreate(const CSMWindow *source)
1664 Inherited::onCreate(source);
1666 if(source != NULL)
1668 CSMWindow *pThis = static_cast<CSMWindow *>(this);
1670 MFUnrecCSMViewportPtr::const_iterator ViewportsIt =
1671 source->_mfViewports.begin();
1672 MFUnrecCSMViewportPtr::const_iterator ViewportsEnd =
1673 source->_mfViewports.end ();
1675 while(ViewportsIt != ViewportsEnd)
1677 pThis->pushToViewports(*ViewportsIt);
1679 ++ViewportsIt;
1682 pThis->setRenderOptions(source->getRenderOptions());
1686 GetFieldHandlePtr CSMWindowBase::getHandleParent (void) const
1688 SFParentFieldContainerPtr::GetHandlePtr returnValue;
1690 return returnValue;
1693 EditFieldHandlePtr CSMWindowBase::editHandleParent (void)
1695 EditFieldHandlePtr returnValue;
1697 return returnValue;
1700 GetFieldHandlePtr CSMWindowBase::getHandleViewports (void) const
1702 MFUnrecCSMViewportPtr::GetHandlePtr returnValue(
1703 new MFUnrecCSMViewportPtr::GetHandle(
1704 &_mfViewports,
1705 this->getType().getFieldDesc(ViewportsFieldId),
1706 const_cast<CSMWindowBase *>(this)));
1708 return returnValue;
1711 EditFieldHandlePtr CSMWindowBase::editHandleViewports (void)
1713 MFUnrecCSMViewportPtr::EditHandlePtr returnValue(
1714 new MFUnrecCSMViewportPtr::EditHandle(
1715 &_mfViewports,
1716 this->getType().getFieldDesc(ViewportsFieldId),
1717 this));
1719 returnValue->setAddMethod(
1720 boost::bind(&CSMWindow::pushToViewports,
1721 static_cast<CSMWindow *>(this), _1));
1722 returnValue->setRemoveMethod(
1723 boost::bind(&CSMWindow::removeFromViewports,
1724 static_cast<CSMWindow *>(this), _1));
1725 returnValue->setRemoveObjMethod(
1726 boost::bind(&CSMWindow::removeObjFromViewports,
1727 static_cast<CSMWindow *>(this), _1));
1728 returnValue->setClearMethod(
1729 boost::bind(&CSMWindow::clearViewports,
1730 static_cast<CSMWindow *>(this)));
1732 editMField(ViewportsFieldMask, _mfViewports);
1734 return returnValue;
1737 GetFieldHandlePtr CSMWindowBase::getHandleMouseData (void) const
1739 SFMouseData::GetHandlePtr returnValue(
1740 new SFMouseData::GetHandle(
1741 &_sfMouseData,
1742 this->getType().getFieldDesc(MouseDataFieldId),
1743 const_cast<CSMWindowBase *>(this)));
1745 return returnValue;
1748 EditFieldHandlePtr CSMWindowBase::editHandleMouseData (void)
1750 SFMouseData::EditHandlePtr returnValue(
1751 new SFMouseData::EditHandle(
1752 &_sfMouseData,
1753 this->getType().getFieldDesc(MouseDataFieldId),
1754 this));
1757 editSField(MouseDataFieldMask);
1759 return returnValue;
1762 GetFieldHandlePtr CSMWindowBase::getHandleMTouchData (void) const
1764 SFMTouchData::GetHandlePtr returnValue(
1765 new SFMTouchData::GetHandle(
1766 &_sfMTouchData,
1767 this->getType().getFieldDesc(MTouchDataFieldId),
1768 const_cast<CSMWindowBase *>(this)));
1770 return returnValue;
1773 EditFieldHandlePtr CSMWindowBase::editHandleMTouchData (void)
1775 SFMTouchData::EditHandlePtr returnValue(
1776 new SFMTouchData::EditHandle(
1777 &_sfMTouchData,
1778 this->getType().getFieldDesc(MTouchDataFieldId),
1779 this));
1782 editSField(MTouchDataFieldMask);
1784 return returnValue;
1787 GetFieldHandlePtr CSMWindowBase::getHandleMTouchDataWC (void) const
1789 SFMTouchData::GetHandlePtr returnValue(
1790 new SFMTouchData::GetHandle(
1791 &_sfMTouchDataWC,
1792 this->getType().getFieldDesc(MTouchDataWCFieldId),
1793 const_cast<CSMWindowBase *>(this)));
1795 return returnValue;
1798 EditFieldHandlePtr CSMWindowBase::editHandleMTouchDataWC (void)
1800 SFMTouchData::EditHandlePtr returnValue(
1801 new SFMTouchData::EditHandle(
1802 &_sfMTouchDataWC,
1803 this->getType().getFieldDesc(MTouchDataWCFieldId),
1804 this));
1807 editSField(MTouchDataWCFieldMask);
1809 return returnValue;
1812 GetFieldHandlePtr CSMWindowBase::getHandleGestureData (void) const
1814 SFGestureData::GetHandlePtr returnValue(
1815 new SFGestureData::GetHandle(
1816 &_sfGestureData,
1817 this->getType().getFieldDesc(GestureDataFieldId),
1818 const_cast<CSMWindowBase *>(this)));
1820 return returnValue;
1823 EditFieldHandlePtr CSMWindowBase::editHandleGestureData (void)
1825 SFGestureData::EditHandlePtr returnValue(
1826 new SFGestureData::EditHandle(
1827 &_sfGestureData,
1828 this->getType().getFieldDesc(GestureDataFieldId),
1829 this));
1832 editSField(GestureDataFieldMask);
1834 return returnValue;
1837 GetFieldHandlePtr CSMWindowBase::getHandleMouseAsMTouch (void) const
1839 SFBool::GetHandlePtr returnValue(
1840 new SFBool::GetHandle(
1841 &_sfMouseAsMTouch,
1842 this->getType().getFieldDesc(MouseAsMTouchFieldId),
1843 const_cast<CSMWindowBase *>(this)));
1845 return returnValue;
1848 EditFieldHandlePtr CSMWindowBase::editHandleMouseAsMTouch (void)
1850 SFBool::EditHandlePtr returnValue(
1851 new SFBool::EditHandle(
1852 &_sfMouseAsMTouch,
1853 this->getType().getFieldDesc(MouseAsMTouchFieldId),
1854 this));
1857 editSField(MouseAsMTouchFieldMask);
1859 return returnValue;
1862 GetFieldHandlePtr CSMWindowBase::getHandleSize (void) const
1864 SFVec2f::GetHandlePtr returnValue(
1865 new SFVec2f::GetHandle(
1866 &_sfSize,
1867 this->getType().getFieldDesc(SizeFieldId),
1868 const_cast<CSMWindowBase *>(this)));
1870 return returnValue;
1873 EditFieldHandlePtr CSMWindowBase::editHandleSize (void)
1875 SFVec2f::EditHandlePtr returnValue(
1876 new SFVec2f::EditHandle(
1877 &_sfSize,
1878 this->getType().getFieldDesc(SizeFieldId),
1879 this));
1882 editSField(SizeFieldMask);
1884 return returnValue;
1887 GetFieldHandlePtr CSMWindowBase::getHandlePosition (void) const
1889 SFVec2f::GetHandlePtr returnValue(
1890 new SFVec2f::GetHandle(
1891 &_sfPosition,
1892 this->getType().getFieldDesc(PositionFieldId),
1893 const_cast<CSMWindowBase *>(this)));
1895 return returnValue;
1898 EditFieldHandlePtr CSMWindowBase::editHandlePosition (void)
1900 SFVec2f::EditHandlePtr returnValue(
1901 new SFVec2f::EditHandle(
1902 &_sfPosition,
1903 this->getType().getFieldDesc(PositionFieldId),
1904 this));
1907 editSField(PositionFieldMask);
1909 return returnValue;
1912 GetFieldHandlePtr CSMWindowBase::getHandleDecorEnabled (void) const
1914 SFBool::GetHandlePtr returnValue(
1915 new SFBool::GetHandle(
1916 &_sfDecorEnabled,
1917 this->getType().getFieldDesc(DecorEnabledFieldId),
1918 const_cast<CSMWindowBase *>(this)));
1920 return returnValue;
1923 EditFieldHandlePtr CSMWindowBase::editHandleDecorEnabled (void)
1925 SFBool::EditHandlePtr returnValue(
1926 new SFBool::EditHandle(
1927 &_sfDecorEnabled,
1928 this->getType().getFieldDesc(DecorEnabledFieldId),
1929 this));
1932 editSField(DecorEnabledFieldMask);
1934 return returnValue;
1937 GetFieldHandlePtr CSMWindowBase::getHandleRequestMajor (void) const
1939 SFInt32::GetHandlePtr returnValue(
1940 new SFInt32::GetHandle(
1941 &_sfRequestMajor,
1942 this->getType().getFieldDesc(RequestMajorFieldId),
1943 const_cast<CSMWindowBase *>(this)));
1945 return returnValue;
1948 EditFieldHandlePtr CSMWindowBase::editHandleRequestMajor (void)
1950 SFInt32::EditHandlePtr returnValue(
1951 new SFInt32::EditHandle(
1952 &_sfRequestMajor,
1953 this->getType().getFieldDesc(RequestMajorFieldId),
1954 this));
1957 editSField(RequestMajorFieldMask);
1959 return returnValue;
1962 GetFieldHandlePtr CSMWindowBase::getHandleRequestMinor (void) const
1964 SFInt32::GetHandlePtr returnValue(
1965 new SFInt32::GetHandle(
1966 &_sfRequestMinor,
1967 this->getType().getFieldDesc(RequestMinorFieldId),
1968 const_cast<CSMWindowBase *>(this)));
1970 return returnValue;
1973 EditFieldHandlePtr CSMWindowBase::editHandleRequestMinor (void)
1975 SFInt32::EditHandlePtr returnValue(
1976 new SFInt32::EditHandle(
1977 &_sfRequestMinor,
1978 this->getType().getFieldDesc(RequestMinorFieldId),
1979 this));
1982 editSField(RequestMinorFieldMask);
1984 return returnValue;
1987 GetFieldHandlePtr CSMWindowBase::getHandleEnableForwardCompatContext (void) const
1989 SFBool::GetHandlePtr returnValue(
1990 new SFBool::GetHandle(
1991 &_sfEnableForwardCompatContext,
1992 this->getType().getFieldDesc(EnableForwardCompatContextFieldId),
1993 const_cast<CSMWindowBase *>(this)));
1995 return returnValue;
1998 EditFieldHandlePtr CSMWindowBase::editHandleEnableForwardCompatContext(void)
2000 SFBool::EditHandlePtr returnValue(
2001 new SFBool::EditHandle(
2002 &_sfEnableForwardCompatContext,
2003 this->getType().getFieldDesc(EnableForwardCompatContextFieldId),
2004 this));
2007 editSField(EnableForwardCompatContextFieldMask);
2009 return returnValue;
2012 GetFieldHandlePtr CSMWindowBase::getHandleEnableDebugContext (void) const
2014 SFBool::GetHandlePtr returnValue(
2015 new SFBool::GetHandle(
2016 &_sfEnableDebugContext,
2017 this->getType().getFieldDesc(EnableDebugContextFieldId),
2018 const_cast<CSMWindowBase *>(this)));
2020 return returnValue;
2023 EditFieldHandlePtr CSMWindowBase::editHandleEnableDebugContext(void)
2025 SFBool::EditHandlePtr returnValue(
2026 new SFBool::EditHandle(
2027 &_sfEnableDebugContext,
2028 this->getType().getFieldDesc(EnableDebugContextFieldId),
2029 this));
2032 editSField(EnableDebugContextFieldMask);
2034 return returnValue;
2037 GetFieldHandlePtr CSMWindowBase::getHandleIgnoreExtensions (void) const
2039 MFString::GetHandlePtr returnValue(
2040 new MFString::GetHandle(
2041 &_mfIgnoreExtensions,
2042 this->getType().getFieldDesc(IgnoreExtensionsFieldId),
2043 const_cast<CSMWindowBase *>(this)));
2045 return returnValue;
2048 EditFieldHandlePtr CSMWindowBase::editHandleIgnoreExtensions(void)
2050 MFString::EditHandlePtr returnValue(
2051 new MFString::EditHandle(
2052 &_mfIgnoreExtensions,
2053 this->getType().getFieldDesc(IgnoreExtensionsFieldId),
2054 this));
2057 editMField(IgnoreExtensionsFieldMask, _mfIgnoreExtensions);
2059 return returnValue;
2062 GetFieldHandlePtr CSMWindowBase::getHandleIgnoreAllExtensions (void) const
2064 SFBool::GetHandlePtr returnValue(
2065 new SFBool::GetHandle(
2066 &_sfIgnoreAllExtensions,
2067 this->getType().getFieldDesc(IgnoreAllExtensionsFieldId),
2068 const_cast<CSMWindowBase *>(this)));
2070 return returnValue;
2073 EditFieldHandlePtr CSMWindowBase::editHandleIgnoreAllExtensions(void)
2075 SFBool::EditHandlePtr returnValue(
2076 new SFBool::EditHandle(
2077 &_sfIgnoreAllExtensions,
2078 this->getType().getFieldDesc(IgnoreAllExtensionsFieldId),
2079 this));
2082 editSField(IgnoreAllExtensionsFieldMask);
2084 return returnValue;
2087 GetFieldHandlePtr CSMWindowBase::getHandleRequestSamples (void) const
2089 SFUInt32::GetHandlePtr returnValue(
2090 new SFUInt32::GetHandle(
2091 &_sfRequestSamples,
2092 this->getType().getFieldDesc(RequestSamplesFieldId),
2093 const_cast<CSMWindowBase *>(this)));
2095 return returnValue;
2098 EditFieldHandlePtr CSMWindowBase::editHandleRequestSamples (void)
2100 SFUInt32::EditHandlePtr returnValue(
2101 new SFUInt32::EditHandle(
2102 &_sfRequestSamples,
2103 this->getType().getFieldDesc(RequestSamplesFieldId),
2104 this));
2107 editSField(RequestSamplesFieldMask);
2109 return returnValue;
2112 GetFieldHandlePtr CSMWindowBase::getHandleEnableFSAA (void) const
2114 SFBool::GetHandlePtr returnValue(
2115 new SFBool::GetHandle(
2116 &_sfEnableFSAA,
2117 this->getType().getFieldDesc(EnableFSAAFieldId),
2118 const_cast<CSMWindowBase *>(this)));
2120 return returnValue;
2123 EditFieldHandlePtr CSMWindowBase::editHandleEnableFSAA (void)
2125 SFBool::EditHandlePtr returnValue(
2126 new SFBool::EditHandle(
2127 &_sfEnableFSAA,
2128 this->getType().getFieldDesc(EnableFSAAFieldId),
2129 this));
2132 editSField(EnableFSAAFieldMask);
2134 return returnValue;
2137 GetFieldHandlePtr CSMWindowBase::getHandleFsaaHint (void) const
2139 SFUInt32::GetHandlePtr returnValue(
2140 new SFUInt32::GetHandle(
2141 &_sfFsaaHint,
2142 this->getType().getFieldDesc(FsaaHintFieldId),
2143 const_cast<CSMWindowBase *>(this)));
2145 return returnValue;
2148 EditFieldHandlePtr CSMWindowBase::editHandleFsaaHint (void)
2150 SFUInt32::EditHandlePtr returnValue(
2151 new SFUInt32::EditHandle(
2152 &_sfFsaaHint,
2153 this->getType().getFieldDesc(FsaaHintFieldId),
2154 this));
2157 editSField(FsaaHintFieldMask);
2159 return returnValue;
2162 GetFieldHandlePtr CSMWindowBase::getHandleRenderOptions (void) const
2164 SFUnrecRenderOptionsPtr::GetHandlePtr returnValue(
2165 new SFUnrecRenderOptionsPtr::GetHandle(
2166 &_sfRenderOptions,
2167 this->getType().getFieldDesc(RenderOptionsFieldId),
2168 const_cast<CSMWindowBase *>(this)));
2170 return returnValue;
2173 EditFieldHandlePtr CSMWindowBase::editHandleRenderOptions (void)
2175 SFUnrecRenderOptionsPtr::EditHandlePtr returnValue(
2176 new SFUnrecRenderOptionsPtr::EditHandle(
2177 &_sfRenderOptions,
2178 this->getType().getFieldDesc(RenderOptionsFieldId),
2179 this));
2181 returnValue->setSetMethod(
2182 boost::bind(&CSMWindow::setRenderOptions,
2183 static_cast<CSMWindow *>(this), _1));
2185 editSField(RenderOptionsFieldMask);
2187 return returnValue;
2190 GetFieldHandlePtr CSMWindowBase::getHandlePartitionDrawMode (void) const
2192 SFUInt32::GetHandlePtr returnValue(
2193 new SFUInt32::GetHandle(
2194 &_sfPartitionDrawMode,
2195 this->getType().getFieldDesc(PartitionDrawModeFieldId),
2196 const_cast<CSMWindowBase *>(this)));
2198 return returnValue;
2201 EditFieldHandlePtr CSMWindowBase::editHandlePartitionDrawMode(void)
2203 SFUInt32::EditHandlePtr returnValue(
2204 new SFUInt32::EditHandle(
2205 &_sfPartitionDrawMode,
2206 this->getType().getFieldDesc(PartitionDrawModeFieldId),
2207 this));
2210 editSField(PartitionDrawModeFieldMask);
2212 return returnValue;
2215 GetFieldHandlePtr CSMWindowBase::getHandleRegisterMainLoop (void) const
2217 SFBool::GetHandlePtr returnValue(
2218 new SFBool::GetHandle(
2219 &_sfRegisterMainLoop,
2220 this->getType().getFieldDesc(RegisterMainLoopFieldId),
2221 const_cast<CSMWindowBase *>(this)));
2223 return returnValue;
2226 EditFieldHandlePtr CSMWindowBase::editHandleRegisterMainLoop(void)
2228 SFBool::EditHandlePtr returnValue(
2229 new SFBool::EditHandle(
2230 &_sfRegisterMainLoop,
2231 this->getType().getFieldDesc(RegisterMainLoopFieldId),
2232 this));
2235 editSField(RegisterMainLoopFieldMask);
2237 return returnValue;
2240 GetFieldHandlePtr CSMWindowBase::getHandleDumpContainer (void) const
2242 SFBool::GetHandlePtr returnValue(
2243 new SFBool::GetHandle(
2244 &_sfDumpContainer,
2245 this->getType().getFieldDesc(DumpContainerFieldId),
2246 const_cast<CSMWindowBase *>(this)));
2248 return returnValue;
2251 EditFieldHandlePtr CSMWindowBase::editHandleDumpContainer (void)
2253 SFBool::EditHandlePtr returnValue(
2254 new SFBool::EditHandle(
2255 &_sfDumpContainer,
2256 this->getType().getFieldDesc(DumpContainerFieldId),
2257 this));
2260 editSField(DumpContainerFieldMask);
2262 return returnValue;
2265 GetFieldHandlePtr CSMWindowBase::getHandleWindowState (void) const
2267 SFInt32::GetHandlePtr returnValue(
2268 new SFInt32::GetHandle(
2269 &_sfWindowState,
2270 this->getType().getFieldDesc(WindowStateFieldId),
2271 const_cast<CSMWindowBase *>(this)));
2273 return returnValue;
2276 EditFieldHandlePtr CSMWindowBase::editHandleWindowState (void)
2278 SFInt32::EditHandlePtr returnValue(
2279 new SFInt32::EditHandle(
2280 &_sfWindowState,
2281 this->getType().getFieldDesc(WindowStateFieldId),
2282 this));
2285 editSField(WindowStateFieldMask);
2287 return returnValue;
2291 #ifdef OSG_MT_CPTR_ASPECT
2292 void CSMWindowBase::execSyncV( FieldContainer &oFrom,
2293 ConstFieldMaskArg whichField,
2294 AspectOffsetStore &oOffsets,
2295 ConstFieldMaskArg syncMode,
2296 const UInt32 uiSyncInfo)
2298 CSMWindow *pThis = static_cast<CSMWindow *>(this);
2300 pThis->execSync(static_cast<CSMWindow *>(&oFrom),
2301 whichField,
2302 oOffsets,
2303 syncMode,
2304 uiSyncInfo);
2306 #endif
2310 void CSMWindowBase::resolveLinks(void)
2312 Inherited::resolveLinks();
2314 static_cast<CSMWindow *>(this)->clearViewports();
2316 static_cast<CSMWindow *>(this)->setRenderOptions(NULL);
2318 #ifdef OSG_MT_CPTR_ASPECT
2319 AspectOffsetStore oOffsets;
2321 _pAspectStore->fillOffsetArray(oOffsets, this);
2322 #endif
2324 #ifdef OSG_MT_CPTR_ASPECT
2325 _mfIgnoreExtensions.terminateShare(Thread::getCurrentAspect(),
2326 oOffsets);
2327 #endif
2331 OSG_END_NAMESPACE