1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
48 ** class CSMTrackball!
50 *****************************************************************************
51 \*****************************************************************************/
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
61 #include "OSGConfig.h"
66 #include "OSGCSMTrackballBase.h"
67 #include "OSGCSMTrackball.h"
69 #include <boost/bind.hpp>
73 /***************************************************************************\
75 \***************************************************************************/
77 /*! \class OSG::CSMTrackball
81 /***************************************************************************\
82 * Field Documentation *
83 \***************************************************************************/
85 /*! \var UInt32 CSMTrackballBase::_sfModifierMask
89 /*! \var UInt32 CSMTrackballBase::_sfProcessing
93 /*! \var Real32 CSMTrackballBase::_sfTranslationScaleFactor
97 /*! \var Matrix CSMTrackballBase::_sfMatrixResult
101 /*! \var Matrix CSMTrackballBase::_sfRotationMatrixResult
105 /*! \var Pnt3f CSMTrackballBase::_sfReferencePosition
109 /*! \var Matrix CSMTrackballBase::_sfReferenceMatrix
113 /*! \var Pnt3f CSMTrackballBase::_sfTransformCenter
117 /*! \var Vec3f CSMTrackballBase::_sfWorldDiag
121 /*! \var MouseData CSMTrackballBase::_sfMouseData
125 /*! \var OSGAny CSMTrackballBase::_sfReset
130 /***************************************************************************\
131 * FieldType/FieldTrait Instantiation *
132 \***************************************************************************/
134 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
135 PointerType FieldTraits
<CSMTrackball
*, nsOSG
>::_type(
137 "AttachmentContainerPtr",
138 CSMTrackball::getClassType(),
142 OSG_FIELDTRAITS_GETTYPE_NS(CSMTrackball
*, nsOSG
)
144 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
148 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
152 /***************************************************************************\
153 * Field Description *
154 \***************************************************************************/
156 void CSMTrackballBase::classDescInserter(TypeObject
&oType
)
158 FieldDescriptionBase
*pDesc
= NULL
;
161 pDesc
= new SFUInt32::Description(
162 SFUInt32::getClassType(),
165 ModifierMaskFieldId
, ModifierMaskFieldMask
,
167 (Field::SFDefaultFlags
| Field::FStdAccess
),
168 static_cast<FieldEditMethodSig
>(&CSMTrackball::editHandleModifierMask
),
169 static_cast<FieldGetMethodSig
>(&CSMTrackball::getHandleModifierMask
));
171 oType
.addInitialDesc(pDesc
);
173 pDesc
= new SFUInt32::Description(
174 SFUInt32::getClassType(),
177 ProcessingFieldId
, ProcessingFieldMask
,
179 (Field::SFDefaultFlags
| Field::FStdAccess
),
180 static_cast<FieldEditMethodSig
>(&CSMTrackball::editHandleProcessing
),
181 static_cast<FieldGetMethodSig
>(&CSMTrackball::getHandleProcessing
));
183 oType
.addInitialDesc(pDesc
);
185 pDesc
= new SFReal32::Description(
186 SFReal32::getClassType(),
187 "translationScaleFactor",
189 TranslationScaleFactorFieldId
, TranslationScaleFactorFieldMask
,
191 (Field::SFDefaultFlags
| Field::FStdAccess
),
192 static_cast<FieldEditMethodSig
>(&CSMTrackball::editHandleTranslationScaleFactor
),
193 static_cast<FieldGetMethodSig
>(&CSMTrackball::getHandleTranslationScaleFactor
));
195 oType
.addInitialDesc(pDesc
);
197 pDesc
= new SFMatrix::Description(
198 SFMatrix::getClassType(),
201 MatrixResultFieldId
, MatrixResultFieldMask
,
203 (Field::SFDefaultFlags
| Field::FStdAccess
),
204 static_cast<FieldEditMethodSig
>(&CSMTrackball::editHandleMatrixResult
),
205 static_cast<FieldGetMethodSig
>(&CSMTrackball::getHandleMatrixResult
));
207 oType
.addInitialDesc(pDesc
);
209 pDesc
= new SFMatrix::Description(
210 SFMatrix::getClassType(),
211 "rotationMatrixResult",
213 RotationMatrixResultFieldId
, RotationMatrixResultFieldMask
,
215 (Field::SFDefaultFlags
| Field::FStdAccess
),
216 static_cast<FieldEditMethodSig
>(&CSMTrackball::editHandleRotationMatrixResult
),
217 static_cast<FieldGetMethodSig
>(&CSMTrackball::getHandleRotationMatrixResult
));
219 oType
.addInitialDesc(pDesc
);
221 pDesc
= new SFPnt3f::Description(
222 SFPnt3f::getClassType(),
225 ReferencePositionFieldId
, ReferencePositionFieldMask
,
227 (Field::SFDefaultFlags
| Field::FStdAccess
),
228 static_cast<FieldEditMethodSig
>(&CSMTrackball::editHandleReferencePosition
),
229 static_cast<FieldGetMethodSig
>(&CSMTrackball::getHandleReferencePosition
));
231 oType
.addInitialDesc(pDesc
);
233 pDesc
= new SFMatrix::Description(
234 SFMatrix::getClassType(),
237 ReferenceMatrixFieldId
, ReferenceMatrixFieldMask
,
239 (Field::SFDefaultFlags
| Field::FStdAccess
),
240 static_cast<FieldEditMethodSig
>(&CSMTrackball::editHandleReferenceMatrix
),
241 static_cast<FieldGetMethodSig
>(&CSMTrackball::getHandleReferenceMatrix
));
243 oType
.addInitialDesc(pDesc
);
245 pDesc
= new SFPnt3f::Description(
246 SFPnt3f::getClassType(),
249 TransformCenterFieldId
, TransformCenterFieldMask
,
251 (Field::SFDefaultFlags
| Field::FStdAccess
),
252 static_cast<FieldEditMethodSig
>(&CSMTrackball::editHandleTransformCenter
),
253 static_cast<FieldGetMethodSig
>(&CSMTrackball::getHandleTransformCenter
));
255 oType
.addInitialDesc(pDesc
);
257 pDesc
= new SFVec3f::Description(
258 SFVec3f::getClassType(),
261 WorldDiagFieldId
, WorldDiagFieldMask
,
263 (Field::SFDefaultFlags
| Field::FStdAccess
),
264 static_cast<FieldEditMethodSig
>(&CSMTrackball::editHandleWorldDiag
),
265 static_cast<FieldGetMethodSig
>(&CSMTrackball::getHandleWorldDiag
));
267 oType
.addInitialDesc(pDesc
);
269 pDesc
= new SFMouseData::Description(
270 SFMouseData::getClassType(),
273 MouseDataFieldId
, MouseDataFieldMask
,
275 (Field::SFDefaultFlags
| Field::FStdAccess
),
276 static_cast<FieldEditMethodSig
>(&CSMTrackball::editHandleMouseData
),
277 static_cast<FieldGetMethodSig
>(&CSMTrackball::getHandleMouseData
));
279 oType
.addInitialDesc(pDesc
);
281 pDesc
= new SFOSGAny::Description(
282 SFOSGAny::getClassType(),
285 ResetFieldId
, ResetFieldMask
,
287 (Field::SFDefaultFlags
| Field::FStdAccess
),
288 static_cast<FieldEditMethodSig
>(&CSMTrackball::editHandleReset
),
289 static_cast<FieldGetMethodSig
>(&CSMTrackball::getHandleReset
));
291 oType
.addInitialDesc(pDesc
);
295 CSMTrackballBase::TypeObject
CSMTrackballBase::_type(
296 CSMTrackballBase::getClassname(),
297 Inherited::getClassname(),
300 reinterpret_cast<PrototypeCreateF
>(&CSMTrackballBase::createEmptyLocal
),
301 reinterpret_cast<InitContainerF
>(&CSMTrackball::initMethod
),
302 reinterpret_cast<ExitContainerF
>(&CSMTrackball::exitMethod
),
303 reinterpret_cast<InitalInsertDescFunc
>(
304 reinterpret_cast<void *>(&CSMTrackball::classDescInserter
)),
307 "<?xml version=\"1.0\"?>\n"
310 " name=\"CSMTrackball\"\n"
311 " parent=\"AttachmentContainer\"\n"
312 " library=\"ContribCSM\"\n"
313 " pointerfieldtypes=\"both\"\n"
314 " structure=\"concrete\"\n"
315 " systemcomponent=\"true\"\n"
316 " parentsystemcomponent=\"true\"\n"
317 " decoratable=\"false\"\n"
318 " useLocalIncludes=\"false\"\n"
319 " isNodeCore=\"false\"\n"
320 " isBundle=\"true\"\n"
323 "\t\tname=\"modifierMask\"\n"
324 "\t\ttype=\"UInt32\"\n"
325 "\t\tcardinality=\"single\"\n"
326 "\t\tvisibility=\"external\"\n"
327 " defaultValue=\"0x0000\"\n"
331 "\t\tname=\"processing\"\n"
332 "\t\ttype=\"UInt32\"\n"
333 "\t\tcardinality=\"single\"\n"
334 "\t\tvisibility=\"external\"\n"
335 " defaultValue=\"false\"\n"
336 " access=\"protected\"\n"
340 "\t\tname=\"translationScaleFactor\"\n"
341 "\t\ttype=\"Real32\"\n"
342 "\t\tcardinality=\"single\"\n"
343 "\t\tvisibility=\"external\"\n"
344 " defaultValue=\"1.f\"\n"
348 "\t\tname=\"matrixResult\"\n"
349 "\t\ttype=\"Matrix\"\n"
350 "\t\tcardinality=\"single\"\n"
351 "\t\tvisibility=\"external\"\n"
352 " defaultValue=\"\"\n"
356 "\t\tname=\"rotationMatrixResult\"\n"
357 "\t\ttype=\"Matrix\"\n"
358 "\t\tcardinality=\"single\"\n"
359 "\t\tvisibility=\"external\"\n"
360 " defaultValue=\"\"\n"
364 "\t\tname=\"referencePosition\"\n"
365 "\t\ttype=\"Pnt3f\"\n"
366 "\t\tcardinality=\"single\"\n"
367 "\t\tvisibility=\"external\"\n"
368 " defaultValue=\"\"\n"
372 "\t\tname=\"referenceMatrix\"\n"
373 "\t\ttype=\"Matrix\"\n"
374 "\t\tcardinality=\"single\"\n"
375 "\t\tvisibility=\"external\"\n"
376 " defaultValue=\"\"\n"
380 "\t\tname=\"transformCenter\"\n"
381 "\t\ttype=\"Pnt3f\"\n"
382 "\t\tcardinality=\"single\"\n"
383 "\t\tvisibility=\"external\"\n"
384 " defaultValue=\"\"\n"
388 "\t\tname=\"worldDiag\"\n"
389 "\t\ttype=\"Vec3f\"\n"
390 "\t\tcardinality=\"single\"\n"
391 "\t\tvisibility=\"external\"\n"
392 " defaultValue=\"\"\n"
396 "\t\tname=\"mouseData\"\n"
397 "\t\ttype=\"MouseData\"\n"
398 "\t\tcardinality=\"single\"\n"
399 "\t\tvisibility=\"internal\"\n"
400 "\t\taccess=\"public\"\n"
405 "\t\tname=\"reset\"\n"
406 "\t\ttype=\"OSGAny\"\n"
407 "\t\tcardinality=\"single\"\n"
408 "\t\tvisibility=\"internal\"\n"
409 " defaultValue=\"\"\n"
412 "</FieldContainer>\n",
416 /*------------------------------ get -----------------------------------*/
418 FieldContainerType
&CSMTrackballBase::getType(void)
423 const FieldContainerType
&CSMTrackballBase::getType(void) const
428 UInt32
CSMTrackballBase::getContainerSize(void) const
430 return sizeof(CSMTrackball
);
433 /*------------------------- decorator get ------------------------------*/
436 SFUInt32
*CSMTrackballBase::editSFModifierMask(void)
438 editSField(ModifierMaskFieldMask
);
440 return &_sfModifierMask
;
443 const SFUInt32
*CSMTrackballBase::getSFModifierMask(void) const
445 return &_sfModifierMask
;
449 SFUInt32
*CSMTrackballBase::editSFProcessing(void)
451 editSField(ProcessingFieldMask
);
453 return &_sfProcessing
;
456 const SFUInt32
*CSMTrackballBase::getSFProcessing(void) const
458 return &_sfProcessing
;
462 SFReal32
*CSMTrackballBase::editSFTranslationScaleFactor(void)
464 editSField(TranslationScaleFactorFieldMask
);
466 return &_sfTranslationScaleFactor
;
469 const SFReal32
*CSMTrackballBase::getSFTranslationScaleFactor(void) const
471 return &_sfTranslationScaleFactor
;
475 SFMatrix
*CSMTrackballBase::editSFMatrixResult(void)
477 editSField(MatrixResultFieldMask
);
479 return &_sfMatrixResult
;
482 const SFMatrix
*CSMTrackballBase::getSFMatrixResult(void) const
484 return &_sfMatrixResult
;
488 SFMatrix
*CSMTrackballBase::editSFRotationMatrixResult(void)
490 editSField(RotationMatrixResultFieldMask
);
492 return &_sfRotationMatrixResult
;
495 const SFMatrix
*CSMTrackballBase::getSFRotationMatrixResult(void) const
497 return &_sfRotationMatrixResult
;
501 SFPnt3f
*CSMTrackballBase::editSFReferencePosition(void)
503 editSField(ReferencePositionFieldMask
);
505 return &_sfReferencePosition
;
508 const SFPnt3f
*CSMTrackballBase::getSFReferencePosition(void) const
510 return &_sfReferencePosition
;
514 SFMatrix
*CSMTrackballBase::editSFReferenceMatrix(void)
516 editSField(ReferenceMatrixFieldMask
);
518 return &_sfReferenceMatrix
;
521 const SFMatrix
*CSMTrackballBase::getSFReferenceMatrix(void) const
523 return &_sfReferenceMatrix
;
527 SFPnt3f
*CSMTrackballBase::editSFTransformCenter(void)
529 editSField(TransformCenterFieldMask
);
531 return &_sfTransformCenter
;
534 const SFPnt3f
*CSMTrackballBase::getSFTransformCenter(void) const
536 return &_sfTransformCenter
;
540 SFVec3f
*CSMTrackballBase::editSFWorldDiag(void)
542 editSField(WorldDiagFieldMask
);
544 return &_sfWorldDiag
;
547 const SFVec3f
*CSMTrackballBase::getSFWorldDiag(void) const
549 return &_sfWorldDiag
;
553 SFMouseData
*CSMTrackballBase::editSFMouseData(void)
555 editSField(MouseDataFieldMask
);
557 return &_sfMouseData
;
560 const SFMouseData
*CSMTrackballBase::getSFMouseData(void) const
562 return &_sfMouseData
;
566 SFOSGAny
*CSMTrackballBase::editSFReset(void)
568 editSField(ResetFieldMask
);
573 const SFOSGAny
*CSMTrackballBase::getSFReset(void) const
583 /*------------------------------ access -----------------------------------*/
585 SizeT
CSMTrackballBase::getBinSize(ConstFieldMaskArg whichField
)
587 SizeT returnValue
= Inherited::getBinSize(whichField
);
589 if(FieldBits::NoField
!= (ModifierMaskFieldMask
& whichField
))
591 returnValue
+= _sfModifierMask
.getBinSize();
593 if(FieldBits::NoField
!= (ProcessingFieldMask
& whichField
))
595 returnValue
+= _sfProcessing
.getBinSize();
597 if(FieldBits::NoField
!= (TranslationScaleFactorFieldMask
& whichField
))
599 returnValue
+= _sfTranslationScaleFactor
.getBinSize();
601 if(FieldBits::NoField
!= (MatrixResultFieldMask
& whichField
))
603 returnValue
+= _sfMatrixResult
.getBinSize();
605 if(FieldBits::NoField
!= (RotationMatrixResultFieldMask
& whichField
))
607 returnValue
+= _sfRotationMatrixResult
.getBinSize();
609 if(FieldBits::NoField
!= (ReferencePositionFieldMask
& whichField
))
611 returnValue
+= _sfReferencePosition
.getBinSize();
613 if(FieldBits::NoField
!= (ReferenceMatrixFieldMask
& whichField
))
615 returnValue
+= _sfReferenceMatrix
.getBinSize();
617 if(FieldBits::NoField
!= (TransformCenterFieldMask
& whichField
))
619 returnValue
+= _sfTransformCenter
.getBinSize();
621 if(FieldBits::NoField
!= (WorldDiagFieldMask
& whichField
))
623 returnValue
+= _sfWorldDiag
.getBinSize();
625 if(FieldBits::NoField
!= (MouseDataFieldMask
& whichField
))
627 returnValue
+= _sfMouseData
.getBinSize();
629 if(FieldBits::NoField
!= (ResetFieldMask
& whichField
))
631 returnValue
+= _sfReset
.getBinSize();
637 void CSMTrackballBase::copyToBin(BinaryDataHandler
&pMem
,
638 ConstFieldMaskArg whichField
)
640 Inherited::copyToBin(pMem
, whichField
);
642 if(FieldBits::NoField
!= (ModifierMaskFieldMask
& whichField
))
644 _sfModifierMask
.copyToBin(pMem
);
646 if(FieldBits::NoField
!= (ProcessingFieldMask
& whichField
))
648 _sfProcessing
.copyToBin(pMem
);
650 if(FieldBits::NoField
!= (TranslationScaleFactorFieldMask
& whichField
))
652 _sfTranslationScaleFactor
.copyToBin(pMem
);
654 if(FieldBits::NoField
!= (MatrixResultFieldMask
& whichField
))
656 _sfMatrixResult
.copyToBin(pMem
);
658 if(FieldBits::NoField
!= (RotationMatrixResultFieldMask
& whichField
))
660 _sfRotationMatrixResult
.copyToBin(pMem
);
662 if(FieldBits::NoField
!= (ReferencePositionFieldMask
& whichField
))
664 _sfReferencePosition
.copyToBin(pMem
);
666 if(FieldBits::NoField
!= (ReferenceMatrixFieldMask
& whichField
))
668 _sfReferenceMatrix
.copyToBin(pMem
);
670 if(FieldBits::NoField
!= (TransformCenterFieldMask
& whichField
))
672 _sfTransformCenter
.copyToBin(pMem
);
674 if(FieldBits::NoField
!= (WorldDiagFieldMask
& whichField
))
676 _sfWorldDiag
.copyToBin(pMem
);
678 if(FieldBits::NoField
!= (MouseDataFieldMask
& whichField
))
680 _sfMouseData
.copyToBin(pMem
);
682 if(FieldBits::NoField
!= (ResetFieldMask
& whichField
))
684 _sfReset
.copyToBin(pMem
);
688 void CSMTrackballBase::copyFromBin(BinaryDataHandler
&pMem
,
689 ConstFieldMaskArg whichField
)
691 Inherited::copyFromBin(pMem
, whichField
);
693 if(FieldBits::NoField
!= (ModifierMaskFieldMask
& whichField
))
695 editSField(ModifierMaskFieldMask
);
696 _sfModifierMask
.copyFromBin(pMem
);
698 if(FieldBits::NoField
!= (ProcessingFieldMask
& whichField
))
700 editSField(ProcessingFieldMask
);
701 _sfProcessing
.copyFromBin(pMem
);
703 if(FieldBits::NoField
!= (TranslationScaleFactorFieldMask
& whichField
))
705 editSField(TranslationScaleFactorFieldMask
);
706 _sfTranslationScaleFactor
.copyFromBin(pMem
);
708 if(FieldBits::NoField
!= (MatrixResultFieldMask
& whichField
))
710 editSField(MatrixResultFieldMask
);
711 _sfMatrixResult
.copyFromBin(pMem
);
713 if(FieldBits::NoField
!= (RotationMatrixResultFieldMask
& whichField
))
715 editSField(RotationMatrixResultFieldMask
);
716 _sfRotationMatrixResult
.copyFromBin(pMem
);
718 if(FieldBits::NoField
!= (ReferencePositionFieldMask
& whichField
))
720 editSField(ReferencePositionFieldMask
);
721 _sfReferencePosition
.copyFromBin(pMem
);
723 if(FieldBits::NoField
!= (ReferenceMatrixFieldMask
& whichField
))
725 editSField(ReferenceMatrixFieldMask
);
726 _sfReferenceMatrix
.copyFromBin(pMem
);
728 if(FieldBits::NoField
!= (TransformCenterFieldMask
& whichField
))
730 editSField(TransformCenterFieldMask
);
731 _sfTransformCenter
.copyFromBin(pMem
);
733 if(FieldBits::NoField
!= (WorldDiagFieldMask
& whichField
))
735 editSField(WorldDiagFieldMask
);
736 _sfWorldDiag
.copyFromBin(pMem
);
738 if(FieldBits::NoField
!= (MouseDataFieldMask
& whichField
))
740 editSField(MouseDataFieldMask
);
741 _sfMouseData
.copyFromBin(pMem
);
743 if(FieldBits::NoField
!= (ResetFieldMask
& whichField
))
745 editSField(ResetFieldMask
);
746 _sfReset
.copyFromBin(pMem
);
750 //! create a new instance of the class
751 CSMTrackballTransitPtr
CSMTrackballBase::createLocal(BitVector bFlags
)
753 CSMTrackballTransitPtr fc
;
755 if(getClassType().getPrototype() != NULL
)
757 FieldContainerTransitPtr tmpPtr
=
758 getClassType().getPrototype()-> shallowCopyLocal(bFlags
);
760 fc
= dynamic_pointer_cast
<CSMTrackball
>(tmpPtr
);
766 //! create a new instance of the class, copy the container flags
767 CSMTrackballTransitPtr
CSMTrackballBase::createDependent(BitVector bFlags
)
769 CSMTrackballTransitPtr fc
;
771 if(getClassType().getPrototype() != NULL
)
773 FieldContainerTransitPtr tmpPtr
=
774 getClassType().getPrototype()-> shallowCopyDependent(bFlags
);
776 fc
= dynamic_pointer_cast
<CSMTrackball
>(tmpPtr
);
782 //! create a new instance of the class
783 CSMTrackballTransitPtr
CSMTrackballBase::create(void)
785 return createLocal();
788 CSMTrackball
*CSMTrackballBase::createEmptyLocal(BitVector bFlags
)
790 CSMTrackball
*returnValue
;
792 newPtr
<CSMTrackball
>(returnValue
, bFlags
);
794 returnValue
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
799 //! create an empty new instance of the class, do not copy the prototype
800 CSMTrackball
*CSMTrackballBase::createEmpty(void)
802 return createEmptyLocal();
806 FieldContainerTransitPtr
CSMTrackballBase::shallowCopyLocal(
807 BitVector bFlags
) const
809 CSMTrackball
*tmpPtr
;
811 newPtr(tmpPtr
, dynamic_cast<const CSMTrackball
*>(this), bFlags
);
813 FieldContainerTransitPtr
returnValue(tmpPtr
);
815 tmpPtr
->_pFieldFlags
->_bNamespaceMask
&= ~bFlags
;
820 FieldContainerTransitPtr
CSMTrackballBase::shallowCopyDependent(
821 BitVector bFlags
) const
823 CSMTrackball
*tmpPtr
;
825 newPtr(tmpPtr
, dynamic_cast<const CSMTrackball
*>(this), ~bFlags
);
827 FieldContainerTransitPtr
returnValue(tmpPtr
);
829 tmpPtr
->_pFieldFlags
->_bNamespaceMask
= bFlags
;
834 FieldContainerTransitPtr
CSMTrackballBase::shallowCopy(void) const
836 return shallowCopyLocal();
842 /*------------------------- constructors ----------------------------------*/
844 CSMTrackballBase::CSMTrackballBase(void) :
846 _sfModifierMask (UInt32(0x0000)),
847 _sfProcessing (UInt32(false)),
848 _sfTranslationScaleFactor (Real32(1.f
)),
850 _sfRotationMatrixResult (),
851 _sfReferencePosition (),
852 _sfReferenceMatrix (),
853 _sfTransformCenter (),
860 CSMTrackballBase::CSMTrackballBase(const CSMTrackballBase
&source
) :
862 _sfModifierMask (source
._sfModifierMask
),
863 _sfProcessing (source
._sfProcessing
),
864 _sfTranslationScaleFactor (source
._sfTranslationScaleFactor
),
865 _sfMatrixResult (source
._sfMatrixResult
),
866 _sfRotationMatrixResult (source
._sfRotationMatrixResult
),
867 _sfReferencePosition (source
._sfReferencePosition
),
868 _sfReferenceMatrix (source
._sfReferenceMatrix
),
869 _sfTransformCenter (source
._sfTransformCenter
),
870 _sfWorldDiag (source
._sfWorldDiag
),
871 _sfMouseData (source
._sfMouseData
),
872 _sfReset (source
._sfReset
)
877 /*-------------------------- destructors ----------------------------------*/
879 CSMTrackballBase::~CSMTrackballBase(void)
884 GetFieldHandlePtr
CSMTrackballBase::getHandleModifierMask (void) const
886 SFUInt32::GetHandlePtr
returnValue(
887 new SFUInt32::GetHandle(
889 this->getType().getFieldDesc(ModifierMaskFieldId
),
890 const_cast<CSMTrackballBase
*>(this)));
895 EditFieldHandlePtr
CSMTrackballBase::editHandleModifierMask (void)
897 SFUInt32::EditHandlePtr
returnValue(
898 new SFUInt32::EditHandle(
900 this->getType().getFieldDesc(ModifierMaskFieldId
),
904 editSField(ModifierMaskFieldMask
);
909 GetFieldHandlePtr
CSMTrackballBase::getHandleProcessing (void) const
911 SFUInt32::GetHandlePtr
returnValue(
912 new SFUInt32::GetHandle(
914 this->getType().getFieldDesc(ProcessingFieldId
),
915 const_cast<CSMTrackballBase
*>(this)));
920 EditFieldHandlePtr
CSMTrackballBase::editHandleProcessing (void)
922 SFUInt32::EditHandlePtr
returnValue(
923 new SFUInt32::EditHandle(
925 this->getType().getFieldDesc(ProcessingFieldId
),
929 editSField(ProcessingFieldMask
);
934 GetFieldHandlePtr
CSMTrackballBase::getHandleTranslationScaleFactor (void) const
936 SFReal32::GetHandlePtr
returnValue(
937 new SFReal32::GetHandle(
938 &_sfTranslationScaleFactor
,
939 this->getType().getFieldDesc(TranslationScaleFactorFieldId
),
940 const_cast<CSMTrackballBase
*>(this)));
945 EditFieldHandlePtr
CSMTrackballBase::editHandleTranslationScaleFactor(void)
947 SFReal32::EditHandlePtr
returnValue(
948 new SFReal32::EditHandle(
949 &_sfTranslationScaleFactor
,
950 this->getType().getFieldDesc(TranslationScaleFactorFieldId
),
954 editSField(TranslationScaleFactorFieldMask
);
959 GetFieldHandlePtr
CSMTrackballBase::getHandleMatrixResult (void) const
961 SFMatrix::GetHandlePtr
returnValue(
962 new SFMatrix::GetHandle(
964 this->getType().getFieldDesc(MatrixResultFieldId
),
965 const_cast<CSMTrackballBase
*>(this)));
970 EditFieldHandlePtr
CSMTrackballBase::editHandleMatrixResult (void)
972 SFMatrix::EditHandlePtr
returnValue(
973 new SFMatrix::EditHandle(
975 this->getType().getFieldDesc(MatrixResultFieldId
),
979 editSField(MatrixResultFieldMask
);
984 GetFieldHandlePtr
CSMTrackballBase::getHandleRotationMatrixResult (void) const
986 SFMatrix::GetHandlePtr
returnValue(
987 new SFMatrix::GetHandle(
988 &_sfRotationMatrixResult
,
989 this->getType().getFieldDesc(RotationMatrixResultFieldId
),
990 const_cast<CSMTrackballBase
*>(this)));
995 EditFieldHandlePtr
CSMTrackballBase::editHandleRotationMatrixResult(void)
997 SFMatrix::EditHandlePtr
returnValue(
998 new SFMatrix::EditHandle(
999 &_sfRotationMatrixResult
,
1000 this->getType().getFieldDesc(RotationMatrixResultFieldId
),
1004 editSField(RotationMatrixResultFieldMask
);
1009 GetFieldHandlePtr
CSMTrackballBase::getHandleReferencePosition (void) const
1011 SFPnt3f::GetHandlePtr
returnValue(
1012 new SFPnt3f::GetHandle(
1013 &_sfReferencePosition
,
1014 this->getType().getFieldDesc(ReferencePositionFieldId
),
1015 const_cast<CSMTrackballBase
*>(this)));
1020 EditFieldHandlePtr
CSMTrackballBase::editHandleReferencePosition(void)
1022 SFPnt3f::EditHandlePtr
returnValue(
1023 new SFPnt3f::EditHandle(
1024 &_sfReferencePosition
,
1025 this->getType().getFieldDesc(ReferencePositionFieldId
),
1029 editSField(ReferencePositionFieldMask
);
1034 GetFieldHandlePtr
CSMTrackballBase::getHandleReferenceMatrix (void) const
1036 SFMatrix::GetHandlePtr
returnValue(
1037 new SFMatrix::GetHandle(
1038 &_sfReferenceMatrix
,
1039 this->getType().getFieldDesc(ReferenceMatrixFieldId
),
1040 const_cast<CSMTrackballBase
*>(this)));
1045 EditFieldHandlePtr
CSMTrackballBase::editHandleReferenceMatrix(void)
1047 SFMatrix::EditHandlePtr
returnValue(
1048 new SFMatrix::EditHandle(
1049 &_sfReferenceMatrix
,
1050 this->getType().getFieldDesc(ReferenceMatrixFieldId
),
1054 editSField(ReferenceMatrixFieldMask
);
1059 GetFieldHandlePtr
CSMTrackballBase::getHandleTransformCenter (void) const
1061 SFPnt3f::GetHandlePtr
returnValue(
1062 new SFPnt3f::GetHandle(
1063 &_sfTransformCenter
,
1064 this->getType().getFieldDesc(TransformCenterFieldId
),
1065 const_cast<CSMTrackballBase
*>(this)));
1070 EditFieldHandlePtr
CSMTrackballBase::editHandleTransformCenter(void)
1072 SFPnt3f::EditHandlePtr
returnValue(
1073 new SFPnt3f::EditHandle(
1074 &_sfTransformCenter
,
1075 this->getType().getFieldDesc(TransformCenterFieldId
),
1079 editSField(TransformCenterFieldMask
);
1084 GetFieldHandlePtr
CSMTrackballBase::getHandleWorldDiag (void) const
1086 SFVec3f::GetHandlePtr
returnValue(
1087 new SFVec3f::GetHandle(
1089 this->getType().getFieldDesc(WorldDiagFieldId
),
1090 const_cast<CSMTrackballBase
*>(this)));
1095 EditFieldHandlePtr
CSMTrackballBase::editHandleWorldDiag (void)
1097 SFVec3f::EditHandlePtr
returnValue(
1098 new SFVec3f::EditHandle(
1100 this->getType().getFieldDesc(WorldDiagFieldId
),
1104 editSField(WorldDiagFieldMask
);
1109 GetFieldHandlePtr
CSMTrackballBase::getHandleMouseData (void) const
1111 SFMouseData::GetHandlePtr
returnValue(
1112 new SFMouseData::GetHandle(
1114 this->getType().getFieldDesc(MouseDataFieldId
),
1115 const_cast<CSMTrackballBase
*>(this)));
1120 EditFieldHandlePtr
CSMTrackballBase::editHandleMouseData (void)
1122 SFMouseData::EditHandlePtr
returnValue(
1123 new SFMouseData::EditHandle(
1125 this->getType().getFieldDesc(MouseDataFieldId
),
1129 editSField(MouseDataFieldMask
);
1134 GetFieldHandlePtr
CSMTrackballBase::getHandleReset (void) const
1136 SFOSGAny::GetHandlePtr
returnValue(
1137 new SFOSGAny::GetHandle(
1139 this->getType().getFieldDesc(ResetFieldId
),
1140 const_cast<CSMTrackballBase
*>(this)));
1145 EditFieldHandlePtr
CSMTrackballBase::editHandleReset (void)
1147 SFOSGAny::EditHandlePtr
returnValue(
1148 new SFOSGAny::EditHandle(
1150 this->getType().getFieldDesc(ResetFieldId
),
1154 editSField(ResetFieldMask
);
1160 #ifdef OSG_MT_CPTR_ASPECT
1161 void CSMTrackballBase::execSyncV( FieldContainer
&oFrom
,
1162 ConstFieldMaskArg whichField
,
1163 AspectOffsetStore
&oOffsets
,
1164 ConstFieldMaskArg syncMode
,
1165 const UInt32 uiSyncInfo
)
1167 CSMTrackball
*pThis
= static_cast<CSMTrackball
*>(this);
1169 pThis
->execSync(static_cast<CSMTrackball
*>(&oFrom
),
1178 #ifdef OSG_MT_CPTR_ASPECT
1179 FieldContainer
*CSMTrackballBase::createAspectCopy(
1180 const FieldContainer
*pRefAspect
) const
1182 CSMTrackball
*returnValue
;
1184 newAspectCopy(returnValue
,
1185 dynamic_cast<const CSMTrackball
*>(pRefAspect
),
1186 dynamic_cast<const CSMTrackball
*>(this));
1192 void CSMTrackballBase::resolveLinks(void)
1194 Inherited::resolveLinks();