1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
42 ** This file is automatically generated. **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
47 ** Do not change this file, changes should be done in the derived **
50 *****************************************************************************
51 \*****************************************************************************/
57 #pragma warning(disable: 4355) // turn off 'this' : used in base member initializer list warning
58 #pragma warning(disable: 4290) // disable exception specification warning
61 #include "OSGConfig.h"
65 #include "OSGNode.h" // Target Class
66 #include "OSGViewport.h" // Viewport Class
67 #include "OSGMaterial.h" // MaterialX Class
69 #include "OSGManipulatorBase.h"
70 #include "OSGManipulator.h"
72 #include <boost/bind.hpp>
76 /***************************************************************************\
78 \***************************************************************************/
80 /*! \class OSG::Manipulator
81 Baseclass for all Manipulators
84 /***************************************************************************\
85 * Field Documentation *
86 \***************************************************************************/
88 /*! \var Node * ManipulatorBase::_sfTarget
89 The target node to be manipulated.
92 /*! \var bool ManipulatorBase::_sfEnablePivot
93 Flag to enable the pivot point manipulation.
96 /*! \var Node * ManipulatorBase::_sfActiveSubHandle
100 /*! \var Pnt2f ManipulatorBase::_sfLastMousePos
101 Last mouse position (in pixel, although 2f is used!)
104 /*! \var Viewport * ManipulatorBase::_sfViewport
108 /*! \var bool ManipulatorBase::_sfActive
112 /*! \var Vec3f ManipulatorBase::_sfLength
113 The length of the three axes in one vector
116 /*! \var Pnt3f ManipulatorBase::_sfPivot
117 The position of the pivot point, in local object coordinates.
120 /*! \var Node * ManipulatorBase::_sfHandleXNode
121 The node for the x-handle geometry
124 /*! \var Node * ManipulatorBase::_sfHandleYNode
125 The node for the y-handle geometry
128 /*! \var Node * ManipulatorBase::_sfHandleZNode
129 The node for the z-handle geometry
132 /*! \var Node * ManipulatorBase::_sfHandlePNode
133 The node for the pivot geometry
136 /*! \var Node * ManipulatorBase::_sfTransXNode
137 The node for the x-handle transform
140 /*! \var Node * ManipulatorBase::_sfTransYNode
141 The node for the y-handle transform
144 /*! \var Node * ManipulatorBase::_sfTransZNode
145 The node for the z-handle transform
148 /*! \var Node * ManipulatorBase::_sfPivotNode
149 The node for the pivot transform
152 /*! \var Material * ManipulatorBase::_sfMaterialX
153 material for the x-axis geometry
156 /*! \var Material * ManipulatorBase::_sfMaterialY
157 material for the y-axis geometry
160 /*! \var Material * ManipulatorBase::_sfMaterialZ
161 material for the z-axis geometry
164 /*! \var Material * ManipulatorBase::_sfMaterialPivot
165 material for the pivot geometry
168 /*! \var Node * ManipulatorBase::_sfAxisLinesN
173 /***************************************************************************\
174 * FieldType/FieldTrait Instantiation *
175 \***************************************************************************/
177 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
178 PointerType FieldTraits
<Manipulator
*, nsOSG
>::_type(
181 Manipulator::getClassType(),
185 OSG_FIELDTRAITS_GETTYPE_NS(Manipulator
*, nsOSG
)
187 OSG_EXPORT_PTR_SFIELD_FULL(PointerSField
,
191 OSG_EXPORT_PTR_MFIELD_FULL(PointerMField
,
195 /***************************************************************************\
196 * Field Description *
197 \***************************************************************************/
199 void ManipulatorBase::classDescInserter(TypeObject
&oType
)
201 FieldDescriptionBase
*pDesc
= NULL
;
204 pDesc
= new SFUnrecNodePtr::Description(
205 SFUnrecNodePtr::getClassType(),
207 "The target node to be manipulated.\n",
208 TargetFieldId
, TargetFieldMask
,
210 (Field::SFDefaultFlags
| Field::FStdAccess
),
211 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleTarget
),
212 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleTarget
));
214 oType
.addInitialDesc(pDesc
);
216 pDesc
= new SFBool::Description(
217 SFBool::getClassType(),
219 "Flag to enable the pivot point manipulation.\n",
220 EnablePivotFieldId
, EnablePivotFieldMask
,
222 (Field::SFDefaultFlags
| Field::FStdAccess
),
223 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleEnablePivot
),
224 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleEnablePivot
));
226 oType
.addInitialDesc(pDesc
);
228 pDesc
= new SFUnrecNodePtr::Description(
229 SFUnrecNodePtr::getClassType(),
231 "the active sub handle\n",
232 ActiveSubHandleFieldId
, ActiveSubHandleFieldMask
,
234 (Field::SFDefaultFlags
| Field::FStdAccess
),
235 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleActiveSubHandle
),
236 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleActiveSubHandle
));
238 oType
.addInitialDesc(pDesc
);
240 pDesc
= new SFPnt2f::Description(
241 SFPnt2f::getClassType(),
243 "Last mouse position (in pixel, although 2f is used!)\n",
244 LastMousePosFieldId
, LastMousePosFieldMask
,
246 (Field::SFDefaultFlags
| Field::FStdAccess
),
247 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleLastMousePos
),
248 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleLastMousePos
));
250 oType
.addInitialDesc(pDesc
);
252 pDesc
= new SFUnrecViewportPtr::Description(
253 SFUnrecViewportPtr::getClassType(),
256 ViewportFieldId
, ViewportFieldMask
,
258 (Field::SFDefaultFlags
| Field::FStdAccess
),
259 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleViewport
),
260 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleViewport
));
262 oType
.addInitialDesc(pDesc
);
264 pDesc
= new SFBool::Description(
265 SFBool::getClassType(),
268 ActiveFieldId
, ActiveFieldMask
,
270 (Field::SFDefaultFlags
| Field::FStdAccess
),
271 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleActive
),
272 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleActive
));
274 oType
.addInitialDesc(pDesc
);
276 pDesc
= new SFVec3f::Description(
277 SFVec3f::getClassType(),
279 "The length of the three axes in one vector\n",
280 LengthFieldId
, LengthFieldMask
,
282 (Field::SFDefaultFlags
| Field::FStdAccess
),
283 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleLength
),
284 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleLength
));
286 oType
.addInitialDesc(pDesc
);
288 pDesc
= new SFPnt3f::Description(
289 SFPnt3f::getClassType(),
291 "The position of the pivot point, in local object coordinates.\n",
292 PivotFieldId
, PivotFieldMask
,
294 (Field::SFDefaultFlags
| Field::FStdAccess
),
295 static_cast<FieldEditMethodSig
>(&Manipulator::editHandlePivot
),
296 static_cast<FieldGetMethodSig
>(&Manipulator::getHandlePivot
));
298 oType
.addInitialDesc(pDesc
);
300 pDesc
= new SFUnrecNodePtr::Description(
301 SFUnrecNodePtr::getClassType(),
303 "The node for the x-handle geometry\n",
304 HandleXNodeFieldId
, HandleXNodeFieldMask
,
306 (Field::SFDefaultFlags
| Field::FStdAccess
),
307 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleHandleXNode
),
308 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleHandleXNode
));
310 oType
.addInitialDesc(pDesc
);
312 pDesc
= new SFUnrecNodePtr::Description(
313 SFUnrecNodePtr::getClassType(),
315 "The node for the y-handle geometry\n",
316 HandleYNodeFieldId
, HandleYNodeFieldMask
,
318 (Field::SFDefaultFlags
| Field::FStdAccess
),
319 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleHandleYNode
),
320 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleHandleYNode
));
322 oType
.addInitialDesc(pDesc
);
324 pDesc
= new SFUnrecNodePtr::Description(
325 SFUnrecNodePtr::getClassType(),
327 "The node for the z-handle geometry\n",
328 HandleZNodeFieldId
, HandleZNodeFieldMask
,
330 (Field::SFDefaultFlags
| Field::FStdAccess
),
331 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleHandleZNode
),
332 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleHandleZNode
));
334 oType
.addInitialDesc(pDesc
);
336 pDesc
= new SFUnrecNodePtr::Description(
337 SFUnrecNodePtr::getClassType(),
339 "The node for the pivot geometry\n",
340 HandlePNodeFieldId
, HandlePNodeFieldMask
,
342 (Field::SFDefaultFlags
| Field::FStdAccess
),
343 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleHandlePNode
),
344 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleHandlePNode
));
346 oType
.addInitialDesc(pDesc
);
348 pDesc
= new SFUnrecNodePtr::Description(
349 SFUnrecNodePtr::getClassType(),
351 "The node for the x-handle transform\n",
352 TransXNodeFieldId
, TransXNodeFieldMask
,
354 (Field::SFDefaultFlags
| Field::FStdAccess
),
355 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleTransXNode
),
356 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleTransXNode
));
358 oType
.addInitialDesc(pDesc
);
360 pDesc
= new SFUnrecNodePtr::Description(
361 SFUnrecNodePtr::getClassType(),
363 "The node for the y-handle transform\n",
364 TransYNodeFieldId
, TransYNodeFieldMask
,
366 (Field::SFDefaultFlags
| Field::FStdAccess
),
367 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleTransYNode
),
368 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleTransYNode
));
370 oType
.addInitialDesc(pDesc
);
372 pDesc
= new SFUnrecNodePtr::Description(
373 SFUnrecNodePtr::getClassType(),
375 "The node for the z-handle transform\n",
376 TransZNodeFieldId
, TransZNodeFieldMask
,
378 (Field::SFDefaultFlags
| Field::FStdAccess
),
379 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleTransZNode
),
380 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleTransZNode
));
382 oType
.addInitialDesc(pDesc
);
384 pDesc
= new SFUnrecNodePtr::Description(
385 SFUnrecNodePtr::getClassType(),
387 "The node for the pivot transform\n",
388 PivotNodeFieldId
, PivotNodeFieldMask
,
390 (Field::SFDefaultFlags
| Field::FStdAccess
),
391 static_cast<FieldEditMethodSig
>(&Manipulator::editHandlePivotNode
),
392 static_cast<FieldGetMethodSig
>(&Manipulator::getHandlePivotNode
));
394 oType
.addInitialDesc(pDesc
);
396 pDesc
= new SFUnrecMaterialPtr::Description(
397 SFUnrecMaterialPtr::getClassType(),
399 "material for the x-axis geometry\n",
400 MaterialXFieldId
, MaterialXFieldMask
,
402 (Field::SFDefaultFlags
| Field::FStdAccess
),
403 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleMaterialX
),
404 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleMaterialX
));
406 oType
.addInitialDesc(pDesc
);
408 pDesc
= new SFUnrecMaterialPtr::Description(
409 SFUnrecMaterialPtr::getClassType(),
411 "material for the y-axis geometry\n",
412 MaterialYFieldId
, MaterialYFieldMask
,
414 (Field::SFDefaultFlags
| Field::FStdAccess
),
415 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleMaterialY
),
416 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleMaterialY
));
418 oType
.addInitialDesc(pDesc
);
420 pDesc
= new SFUnrecMaterialPtr::Description(
421 SFUnrecMaterialPtr::getClassType(),
423 "material for the z-axis geometry\n",
424 MaterialZFieldId
, MaterialZFieldMask
,
426 (Field::SFDefaultFlags
| Field::FStdAccess
),
427 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleMaterialZ
),
428 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleMaterialZ
));
430 oType
.addInitialDesc(pDesc
);
432 pDesc
= new SFUnrecMaterialPtr::Description(
433 SFUnrecMaterialPtr::getClassType(),
435 "material for the pivot geometry\n",
436 MaterialPivotFieldId
, MaterialPivotFieldMask
,
438 (Field::SFDefaultFlags
| Field::FStdAccess
),
439 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleMaterialPivot
),
440 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleMaterialPivot
));
442 oType
.addInitialDesc(pDesc
);
444 pDesc
= new SFUnrecNodePtr::Description(
445 SFUnrecNodePtr::getClassType(),
448 AxisLinesNFieldId
, AxisLinesNFieldMask
,
450 (Field::SFDefaultFlags
| Field::FStdAccess
),
451 static_cast<FieldEditMethodSig
>(&Manipulator::editHandleAxisLinesN
),
452 static_cast<FieldGetMethodSig
>(&Manipulator::getHandleAxisLinesN
));
454 oType
.addInitialDesc(pDesc
);
458 ManipulatorBase::TypeObject
ManipulatorBase::_type(
459 ManipulatorBase::getClassname(),
460 Inherited::getClassname(),
464 reinterpret_cast<InitContainerF
>(&Manipulator::initMethod
),
465 reinterpret_cast<ExitContainerF
>(&Manipulator::exitMethod
),
466 reinterpret_cast<InitalInsertDescFunc
>(
467 reinterpret_cast<void *>(&Manipulator::classDescInserter
)),
470 "<?xml version=\"1.0\"?>\n"
473 "\tname=\"Manipulator\"\n"
474 "\tparent=\"Transform\"\n"
475 "\tlibrary=\"ContribGUI\"\n"
476 "\tpointerfieldtypes=\"both\"\n"
477 "\tstructure=\"abstract\"\n"
478 "\tsystemcomponent=\"true\"\n"
479 "\tparentsystemcomponent=\"true\"\n"
480 "\tdecoratable=\"false\"\n"
481 "\tuseLocalIncludes=\"false\"\n"
483 "Baseclass for all Manipulators\n"
485 "\t\tname=\"target\"\n"
486 "\t\ttype=\"NodePtr\"\n"
487 "\t\tcardinality=\"single\"\n"
488 "\t\tvisibility=\"external\"\n"
489 "\t\taccess=\"public\"\n"
491 " The target node to be manipulated.\n"
494 "\t\tname=\"enablePivot\"\n"
495 "\t\ttype=\"bool\"\n"
496 "\t\tcardinality=\"single\"\n"
497 "\t\tvisibility=\"external\"\n"
498 "\t\taccess=\"public\"\n"
499 " defaultValue=\"false\"\n"
501 " Flag to enable the pivot point manipulation.\n"
504 "\t\tname=\"activeSubHandle\"\n"
505 "\t\ttype=\"NodePtr\"\n"
506 "\t\tcardinality=\"single\"\n"
507 "\t\tvisibility=\"internal\"\n"
508 "\t\taccess=\"public\"\n"
510 "\tthe active sub handle\n"
513 "\t\tname=\"lastMousePos\"\n"
514 "\t\ttype=\"Pnt2f\"\n"
515 "\t\tcardinality=\"single\"\n"
516 "\t\tvisibility=\"external\"\n"
517 "\t\taccess=\"protected\"\n"
519 "\tLast mouse position (in pixel, although 2f is used!)\n"
522 "\t\tname=\"viewport\"\n"
523 "\t\ttype=\"ViewportPtr\"\n"
524 "\t\tcardinality=\"single\"\n"
525 "\t\tvisibility=\"internal\"\n"
526 "\t\tdefaultValue=\"NULL\"\n"
527 "\t\taccess=\"public\"\n"
531 "\t\tname=\"active\"\n"
532 "\t\ttype=\"bool\"\n"
533 "\t\tcardinality=\"single\"\n"
534 "\t\tvisibility=\"external\"\n"
535 "\t\taccess=\"public\"\n"
539 "\t\tname=\"length\"\n"
540 "\t\ttype=\"Vec3f\"\n"
541 "\t\tcardinality=\"single\"\n"
542 "\t\tvisibility=\"external\"\n"
543 "\t\tdefaultValue=\"1,1,1\"\n"
544 "\t\taccess=\"public\"\n"
546 "\tThe length of the three axes in one vector\n"
549 "\t\tname=\"pivot\"\n"
550 "\t\ttype=\"Pnt3f\"\n"
551 "\t\tcardinality=\"single\"\n"
552 "\t\tvisibility=\"external\"\n"
553 "\t\tdefaultValue=\"0,0,0\"\n"
554 "\t\taccess=\"public\"\n"
556 "\tThe position of the pivot point, in local object coordinates.\n"
559 "\t\tname=\"handleXNode\"\n"
560 "\t\ttype=\"NodePtr\"\n"
561 "\t\tcardinality=\"single\"\n"
562 "\t\tvisibility=\"internal\"\n"
563 "\t\taccess=\"public\"\n"
565 "\tThe node for the x-handle geometry\n"
568 "\t\tname=\"handleYNode\"\n"
569 "\t\ttype=\"NodePtr\"\n"
570 "\t\tcardinality=\"single\"\n"
571 "\t\tvisibility=\"internal\"\n"
572 "\t\taccess=\"public\"\n"
574 "\tThe node for the y-handle geometry\n"
577 "\t\tname=\"handleZNode\"\n"
578 "\t\ttype=\"NodePtr\"\n"
579 "\t\tcardinality=\"single\"\n"
580 "\t\tvisibility=\"internal\"\n"
581 "\t\taccess=\"public\"\n"
583 "\tThe node for the z-handle geometry\n"
586 "\t\tname=\"handlePNode\"\n"
587 "\t\ttype=\"NodePtr\"\n"
588 "\t\tcardinality=\"single\"\n"
589 "\t\tvisibility=\"internal\"\n"
590 "\t\taccess=\"public\"\n"
592 "\tThe node for the pivot geometry\n"
595 "\t\tname=\"transXNode\"\n"
596 "\t\ttype=\"NodePtr\"\n"
597 "\t\tcardinality=\"single\"\n"
598 "\t\tvisibility=\"internal\"\n"
599 "\t\taccess=\"public\"\n"
601 "\tThe node for the x-handle transform\n"
604 "\t\tname=\"transYNode\"\n"
605 "\t\ttype=\"NodePtr\"\n"
606 "\t\tcardinality=\"single\"\n"
607 "\t\tvisibility=\"internal\"\n"
608 "\t\taccess=\"public\"\n"
610 "\tThe node for the y-handle transform\n"
613 "\t\tname=\"transZNode\"\n"
614 "\t\ttype=\"NodePtr\"\n"
615 "\t\tcardinality=\"single\"\n"
616 "\t\tvisibility=\"internal\"\n"
617 "\t\taccess=\"public\"\n"
619 "\tThe node for the z-handle transform\n"
622 "\t\tname=\"pivotNode\"\n"
623 "\t\ttype=\"NodePtr\"\n"
624 "\t\tcardinality=\"single\"\n"
625 "\t\tvisibility=\"internal\"\n"
626 "\t\taccess=\"public\"\n"
628 "\tThe node for the pivot transform\n"
631 "\t\tname=\"materialX\"\n"
632 "\t\ttype=\"MaterialPtr\"\n"
633 "\t\tcardinality=\"single\"\n"
634 "\t\tvisibility=\"internal\"\n"
635 "\t\taccess=\"public\"\n"
637 "\tmaterial for the x-axis geometry\n"
640 "\t\tname=\"materialY\"\n"
641 "\t\ttype=\"MaterialPtr\"\n"
642 "\t\tcardinality=\"single\"\n"
643 "\t\tvisibility=\"internal\"\n"
644 "\t\taccess=\"public\"\n"
646 "\tmaterial for the y-axis geometry\n"
649 "\t\tname=\"materialZ\"\n"
650 "\t\ttype=\"MaterialPtr\"\n"
651 "\t\tcardinality=\"single\"\n"
652 "\t\tvisibility=\"internal\"\n"
653 "\t\taccess=\"public\"\n"
655 "\tmaterial for the z-axis geometry\n"
658 "\t\tname=\"materialPivot\"\n"
659 "\t\ttype=\"MaterialPtr\"\n"
660 "\t\tcardinality=\"single\"\n"
661 "\t\tvisibility=\"internal\"\n"
662 "\t\taccess=\"public\"\n"
664 "\tmaterial for the pivot geometry\n"
667 "\t\tname=\"axisLinesN\"\n"
668 "\t\ttype=\"NodePtr\"\n"
669 "\t\tcardinality=\"single\"\n"
670 "\t\tvisibility=\"internal\"\n"
671 "\t\taccess=\"public\"\n"
674 "</FieldContainer>\n",
675 "Baseclass for all Manipulators\n"
678 /*------------------------------ get -----------------------------------*/
680 FieldContainerType
&ManipulatorBase::getType(void)
685 const FieldContainerType
&ManipulatorBase::getType(void) const
690 UInt32
ManipulatorBase::getContainerSize(void) const
692 return sizeof(Manipulator
);
695 /*------------------------- decorator get ------------------------------*/
698 //! Get the Manipulator::_sfTarget field.
699 const SFUnrecNodePtr
*ManipulatorBase::getSFTarget(void) const
704 SFUnrecNodePtr
*ManipulatorBase::editSFTarget (void)
706 editSField(TargetFieldMask
);
711 //! Get the value of the Manipulator::_sfTarget field.
712 Node
* ManipulatorBase::getTarget(void) const
714 return _sfTarget
.getValue();
717 //! Set the value of the Manipulator::_sfTarget field.
718 void ManipulatorBase::setTarget(Node
* const value
)
720 editSField(TargetFieldMask
);
722 _sfTarget
.setValue(value
);
726 SFBool
*ManipulatorBase::editSFEnablePivot(void)
728 editSField(EnablePivotFieldMask
);
730 return &_sfEnablePivot
;
733 const SFBool
*ManipulatorBase::getSFEnablePivot(void) const
735 return &_sfEnablePivot
;
739 //! Get the Manipulator::_sfActiveSubHandle field.
740 const SFUnrecNodePtr
*ManipulatorBase::getSFActiveSubHandle(void) const
742 return &_sfActiveSubHandle
;
745 SFUnrecNodePtr
*ManipulatorBase::editSFActiveSubHandle(void)
747 editSField(ActiveSubHandleFieldMask
);
749 return &_sfActiveSubHandle
;
752 //! Get the value of the Manipulator::_sfActiveSubHandle field.
753 Node
* ManipulatorBase::getActiveSubHandle(void) const
755 return _sfActiveSubHandle
.getValue();
758 //! Set the value of the Manipulator::_sfActiveSubHandle field.
759 void ManipulatorBase::setActiveSubHandle(Node
* const value
)
761 editSField(ActiveSubHandleFieldMask
);
763 _sfActiveSubHandle
.setValue(value
);
767 SFPnt2f
*ManipulatorBase::editSFLastMousePos(void)
769 editSField(LastMousePosFieldMask
);
771 return &_sfLastMousePos
;
774 const SFPnt2f
*ManipulatorBase::getSFLastMousePos(void) const
776 return &_sfLastMousePos
;
780 //! Get the Manipulator::_sfViewport field.
781 const SFUnrecViewportPtr
*ManipulatorBase::getSFViewport(void) const
786 SFUnrecViewportPtr
*ManipulatorBase::editSFViewport (void)
788 editSField(ViewportFieldMask
);
793 //! Get the value of the Manipulator::_sfViewport field.
794 Viewport
* ManipulatorBase::getViewport(void) const
796 return _sfViewport
.getValue();
799 //! Set the value of the Manipulator::_sfViewport field.
800 void ManipulatorBase::setViewport(Viewport
* const value
)
802 editSField(ViewportFieldMask
);
804 _sfViewport
.setValue(value
);
808 SFBool
*ManipulatorBase::editSFActive(void)
810 editSField(ActiveFieldMask
);
815 const SFBool
*ManipulatorBase::getSFActive(void) const
821 SFVec3f
*ManipulatorBase::editSFLength(void)
823 editSField(LengthFieldMask
);
828 const SFVec3f
*ManipulatorBase::getSFLength(void) const
834 SFPnt3f
*ManipulatorBase::editSFPivot(void)
836 editSField(PivotFieldMask
);
841 const SFPnt3f
*ManipulatorBase::getSFPivot(void) const
847 //! Get the Manipulator::_sfHandleXNode field.
848 const SFUnrecNodePtr
*ManipulatorBase::getSFHandleXNode(void) const
850 return &_sfHandleXNode
;
853 SFUnrecNodePtr
*ManipulatorBase::editSFHandleXNode (void)
855 editSField(HandleXNodeFieldMask
);
857 return &_sfHandleXNode
;
860 //! Get the value of the Manipulator::_sfHandleXNode field.
861 Node
* ManipulatorBase::getHandleXNode(void) const
863 return _sfHandleXNode
.getValue();
866 //! Set the value of the Manipulator::_sfHandleXNode field.
867 void ManipulatorBase::setHandleXNode(Node
* const value
)
869 editSField(HandleXNodeFieldMask
);
871 _sfHandleXNode
.setValue(value
);
875 //! Get the Manipulator::_sfHandleYNode field.
876 const SFUnrecNodePtr
*ManipulatorBase::getSFHandleYNode(void) const
878 return &_sfHandleYNode
;
881 SFUnrecNodePtr
*ManipulatorBase::editSFHandleYNode (void)
883 editSField(HandleYNodeFieldMask
);
885 return &_sfHandleYNode
;
888 //! Get the value of the Manipulator::_sfHandleYNode field.
889 Node
* ManipulatorBase::getHandleYNode(void) const
891 return _sfHandleYNode
.getValue();
894 //! Set the value of the Manipulator::_sfHandleYNode field.
895 void ManipulatorBase::setHandleYNode(Node
* const value
)
897 editSField(HandleYNodeFieldMask
);
899 _sfHandleYNode
.setValue(value
);
903 //! Get the Manipulator::_sfHandleZNode field.
904 const SFUnrecNodePtr
*ManipulatorBase::getSFHandleZNode(void) const
906 return &_sfHandleZNode
;
909 SFUnrecNodePtr
*ManipulatorBase::editSFHandleZNode (void)
911 editSField(HandleZNodeFieldMask
);
913 return &_sfHandleZNode
;
916 //! Get the value of the Manipulator::_sfHandleZNode field.
917 Node
* ManipulatorBase::getHandleZNode(void) const
919 return _sfHandleZNode
.getValue();
922 //! Set the value of the Manipulator::_sfHandleZNode field.
923 void ManipulatorBase::setHandleZNode(Node
* const value
)
925 editSField(HandleZNodeFieldMask
);
927 _sfHandleZNode
.setValue(value
);
931 //! Get the Manipulator::_sfHandlePNode field.
932 const SFUnrecNodePtr
*ManipulatorBase::getSFHandlePNode(void) const
934 return &_sfHandlePNode
;
937 SFUnrecNodePtr
*ManipulatorBase::editSFHandlePNode (void)
939 editSField(HandlePNodeFieldMask
);
941 return &_sfHandlePNode
;
944 //! Get the value of the Manipulator::_sfHandlePNode field.
945 Node
* ManipulatorBase::getHandlePNode(void) const
947 return _sfHandlePNode
.getValue();
950 //! Set the value of the Manipulator::_sfHandlePNode field.
951 void ManipulatorBase::setHandlePNode(Node
* const value
)
953 editSField(HandlePNodeFieldMask
);
955 _sfHandlePNode
.setValue(value
);
959 //! Get the Manipulator::_sfTransXNode field.
960 const SFUnrecNodePtr
*ManipulatorBase::getSFTransXNode(void) const
962 return &_sfTransXNode
;
965 SFUnrecNodePtr
*ManipulatorBase::editSFTransXNode (void)
967 editSField(TransXNodeFieldMask
);
969 return &_sfTransXNode
;
972 //! Get the value of the Manipulator::_sfTransXNode field.
973 Node
* ManipulatorBase::getTransXNode(void) const
975 return _sfTransXNode
.getValue();
978 //! Set the value of the Manipulator::_sfTransXNode field.
979 void ManipulatorBase::setTransXNode(Node
* const value
)
981 editSField(TransXNodeFieldMask
);
983 _sfTransXNode
.setValue(value
);
987 //! Get the Manipulator::_sfTransYNode field.
988 const SFUnrecNodePtr
*ManipulatorBase::getSFTransYNode(void) const
990 return &_sfTransYNode
;
993 SFUnrecNodePtr
*ManipulatorBase::editSFTransYNode (void)
995 editSField(TransYNodeFieldMask
);
997 return &_sfTransYNode
;
1000 //! Get the value of the Manipulator::_sfTransYNode field.
1001 Node
* ManipulatorBase::getTransYNode(void) const
1003 return _sfTransYNode
.getValue();
1006 //! Set the value of the Manipulator::_sfTransYNode field.
1007 void ManipulatorBase::setTransYNode(Node
* const value
)
1009 editSField(TransYNodeFieldMask
);
1011 _sfTransYNode
.setValue(value
);
1015 //! Get the Manipulator::_sfTransZNode field.
1016 const SFUnrecNodePtr
*ManipulatorBase::getSFTransZNode(void) const
1018 return &_sfTransZNode
;
1021 SFUnrecNodePtr
*ManipulatorBase::editSFTransZNode (void)
1023 editSField(TransZNodeFieldMask
);
1025 return &_sfTransZNode
;
1028 //! Get the value of the Manipulator::_sfTransZNode field.
1029 Node
* ManipulatorBase::getTransZNode(void) const
1031 return _sfTransZNode
.getValue();
1034 //! Set the value of the Manipulator::_sfTransZNode field.
1035 void ManipulatorBase::setTransZNode(Node
* const value
)
1037 editSField(TransZNodeFieldMask
);
1039 _sfTransZNode
.setValue(value
);
1043 //! Get the Manipulator::_sfPivotNode field.
1044 const SFUnrecNodePtr
*ManipulatorBase::getSFPivotNode(void) const
1046 return &_sfPivotNode
;
1049 SFUnrecNodePtr
*ManipulatorBase::editSFPivotNode (void)
1051 editSField(PivotNodeFieldMask
);
1053 return &_sfPivotNode
;
1056 //! Get the value of the Manipulator::_sfPivotNode field.
1057 Node
* ManipulatorBase::getPivotNode(void) const
1059 return _sfPivotNode
.getValue();
1062 //! Set the value of the Manipulator::_sfPivotNode field.
1063 void ManipulatorBase::setPivotNode(Node
* const value
)
1065 editSField(PivotNodeFieldMask
);
1067 _sfPivotNode
.setValue(value
);
1071 //! Get the Manipulator::_sfMaterialX field.
1072 const SFUnrecMaterialPtr
*ManipulatorBase::getSFMaterialX(void) const
1074 return &_sfMaterialX
;
1077 SFUnrecMaterialPtr
*ManipulatorBase::editSFMaterialX (void)
1079 editSField(MaterialXFieldMask
);
1081 return &_sfMaterialX
;
1084 //! Get the value of the Manipulator::_sfMaterialX field.
1085 Material
* ManipulatorBase::getMaterialX(void) const
1087 return _sfMaterialX
.getValue();
1090 //! Set the value of the Manipulator::_sfMaterialX field.
1091 void ManipulatorBase::setMaterialX(Material
* const value
)
1093 editSField(MaterialXFieldMask
);
1095 _sfMaterialX
.setValue(value
);
1099 //! Get the Manipulator::_sfMaterialY field.
1100 const SFUnrecMaterialPtr
*ManipulatorBase::getSFMaterialY(void) const
1102 return &_sfMaterialY
;
1105 SFUnrecMaterialPtr
*ManipulatorBase::editSFMaterialY (void)
1107 editSField(MaterialYFieldMask
);
1109 return &_sfMaterialY
;
1112 //! Get the value of the Manipulator::_sfMaterialY field.
1113 Material
* ManipulatorBase::getMaterialY(void) const
1115 return _sfMaterialY
.getValue();
1118 //! Set the value of the Manipulator::_sfMaterialY field.
1119 void ManipulatorBase::setMaterialY(Material
* const value
)
1121 editSField(MaterialYFieldMask
);
1123 _sfMaterialY
.setValue(value
);
1127 //! Get the Manipulator::_sfMaterialZ field.
1128 const SFUnrecMaterialPtr
*ManipulatorBase::getSFMaterialZ(void) const
1130 return &_sfMaterialZ
;
1133 SFUnrecMaterialPtr
*ManipulatorBase::editSFMaterialZ (void)
1135 editSField(MaterialZFieldMask
);
1137 return &_sfMaterialZ
;
1140 //! Get the value of the Manipulator::_sfMaterialZ field.
1141 Material
* ManipulatorBase::getMaterialZ(void) const
1143 return _sfMaterialZ
.getValue();
1146 //! Set the value of the Manipulator::_sfMaterialZ field.
1147 void ManipulatorBase::setMaterialZ(Material
* const value
)
1149 editSField(MaterialZFieldMask
);
1151 _sfMaterialZ
.setValue(value
);
1155 //! Get the Manipulator::_sfMaterialPivot field.
1156 const SFUnrecMaterialPtr
*ManipulatorBase::getSFMaterialPivot(void) const
1158 return &_sfMaterialPivot
;
1161 SFUnrecMaterialPtr
*ManipulatorBase::editSFMaterialPivot (void)
1163 editSField(MaterialPivotFieldMask
);
1165 return &_sfMaterialPivot
;
1168 //! Get the value of the Manipulator::_sfMaterialPivot field.
1169 Material
* ManipulatorBase::getMaterialPivot(void) const
1171 return _sfMaterialPivot
.getValue();
1174 //! Set the value of the Manipulator::_sfMaterialPivot field.
1175 void ManipulatorBase::setMaterialPivot(Material
* const value
)
1177 editSField(MaterialPivotFieldMask
);
1179 _sfMaterialPivot
.setValue(value
);
1183 //! Get the Manipulator::_sfAxisLinesN field.
1184 const SFUnrecNodePtr
*ManipulatorBase::getSFAxisLinesN(void) const
1186 return &_sfAxisLinesN
;
1189 SFUnrecNodePtr
*ManipulatorBase::editSFAxisLinesN (void)
1191 editSField(AxisLinesNFieldMask
);
1193 return &_sfAxisLinesN
;
1196 //! Get the value of the Manipulator::_sfAxisLinesN field.
1197 Node
* ManipulatorBase::getAxisLinesN(void) const
1199 return _sfAxisLinesN
.getValue();
1202 //! Set the value of the Manipulator::_sfAxisLinesN field.
1203 void ManipulatorBase::setAxisLinesN(Node
* const value
)
1205 editSField(AxisLinesNFieldMask
);
1207 _sfAxisLinesN
.setValue(value
);
1215 /*------------------------------ access -----------------------------------*/
1217 SizeT
ManipulatorBase::getBinSize(ConstFieldMaskArg whichField
)
1219 SizeT returnValue
= Inherited::getBinSize(whichField
);
1221 if(FieldBits::NoField
!= (TargetFieldMask
& whichField
))
1223 returnValue
+= _sfTarget
.getBinSize();
1225 if(FieldBits::NoField
!= (EnablePivotFieldMask
& whichField
))
1227 returnValue
+= _sfEnablePivot
.getBinSize();
1229 if(FieldBits::NoField
!= (ActiveSubHandleFieldMask
& whichField
))
1231 returnValue
+= _sfActiveSubHandle
.getBinSize();
1233 if(FieldBits::NoField
!= (LastMousePosFieldMask
& whichField
))
1235 returnValue
+= _sfLastMousePos
.getBinSize();
1237 if(FieldBits::NoField
!= (ViewportFieldMask
& whichField
))
1239 returnValue
+= _sfViewport
.getBinSize();
1241 if(FieldBits::NoField
!= (ActiveFieldMask
& whichField
))
1243 returnValue
+= _sfActive
.getBinSize();
1245 if(FieldBits::NoField
!= (LengthFieldMask
& whichField
))
1247 returnValue
+= _sfLength
.getBinSize();
1249 if(FieldBits::NoField
!= (PivotFieldMask
& whichField
))
1251 returnValue
+= _sfPivot
.getBinSize();
1253 if(FieldBits::NoField
!= (HandleXNodeFieldMask
& whichField
))
1255 returnValue
+= _sfHandleXNode
.getBinSize();
1257 if(FieldBits::NoField
!= (HandleYNodeFieldMask
& whichField
))
1259 returnValue
+= _sfHandleYNode
.getBinSize();
1261 if(FieldBits::NoField
!= (HandleZNodeFieldMask
& whichField
))
1263 returnValue
+= _sfHandleZNode
.getBinSize();
1265 if(FieldBits::NoField
!= (HandlePNodeFieldMask
& whichField
))
1267 returnValue
+= _sfHandlePNode
.getBinSize();
1269 if(FieldBits::NoField
!= (TransXNodeFieldMask
& whichField
))
1271 returnValue
+= _sfTransXNode
.getBinSize();
1273 if(FieldBits::NoField
!= (TransYNodeFieldMask
& whichField
))
1275 returnValue
+= _sfTransYNode
.getBinSize();
1277 if(FieldBits::NoField
!= (TransZNodeFieldMask
& whichField
))
1279 returnValue
+= _sfTransZNode
.getBinSize();
1281 if(FieldBits::NoField
!= (PivotNodeFieldMask
& whichField
))
1283 returnValue
+= _sfPivotNode
.getBinSize();
1285 if(FieldBits::NoField
!= (MaterialXFieldMask
& whichField
))
1287 returnValue
+= _sfMaterialX
.getBinSize();
1289 if(FieldBits::NoField
!= (MaterialYFieldMask
& whichField
))
1291 returnValue
+= _sfMaterialY
.getBinSize();
1293 if(FieldBits::NoField
!= (MaterialZFieldMask
& whichField
))
1295 returnValue
+= _sfMaterialZ
.getBinSize();
1297 if(FieldBits::NoField
!= (MaterialPivotFieldMask
& whichField
))
1299 returnValue
+= _sfMaterialPivot
.getBinSize();
1301 if(FieldBits::NoField
!= (AxisLinesNFieldMask
& whichField
))
1303 returnValue
+= _sfAxisLinesN
.getBinSize();
1309 void ManipulatorBase::copyToBin(BinaryDataHandler
&pMem
,
1310 ConstFieldMaskArg whichField
)
1312 Inherited::copyToBin(pMem
, whichField
);
1314 if(FieldBits::NoField
!= (TargetFieldMask
& whichField
))
1316 _sfTarget
.copyToBin(pMem
);
1318 if(FieldBits::NoField
!= (EnablePivotFieldMask
& whichField
))
1320 _sfEnablePivot
.copyToBin(pMem
);
1322 if(FieldBits::NoField
!= (ActiveSubHandleFieldMask
& whichField
))
1324 _sfActiveSubHandle
.copyToBin(pMem
);
1326 if(FieldBits::NoField
!= (LastMousePosFieldMask
& whichField
))
1328 _sfLastMousePos
.copyToBin(pMem
);
1330 if(FieldBits::NoField
!= (ViewportFieldMask
& whichField
))
1332 _sfViewport
.copyToBin(pMem
);
1334 if(FieldBits::NoField
!= (ActiveFieldMask
& whichField
))
1336 _sfActive
.copyToBin(pMem
);
1338 if(FieldBits::NoField
!= (LengthFieldMask
& whichField
))
1340 _sfLength
.copyToBin(pMem
);
1342 if(FieldBits::NoField
!= (PivotFieldMask
& whichField
))
1344 _sfPivot
.copyToBin(pMem
);
1346 if(FieldBits::NoField
!= (HandleXNodeFieldMask
& whichField
))
1348 _sfHandleXNode
.copyToBin(pMem
);
1350 if(FieldBits::NoField
!= (HandleYNodeFieldMask
& whichField
))
1352 _sfHandleYNode
.copyToBin(pMem
);
1354 if(FieldBits::NoField
!= (HandleZNodeFieldMask
& whichField
))
1356 _sfHandleZNode
.copyToBin(pMem
);
1358 if(FieldBits::NoField
!= (HandlePNodeFieldMask
& whichField
))
1360 _sfHandlePNode
.copyToBin(pMem
);
1362 if(FieldBits::NoField
!= (TransXNodeFieldMask
& whichField
))
1364 _sfTransXNode
.copyToBin(pMem
);
1366 if(FieldBits::NoField
!= (TransYNodeFieldMask
& whichField
))
1368 _sfTransYNode
.copyToBin(pMem
);
1370 if(FieldBits::NoField
!= (TransZNodeFieldMask
& whichField
))
1372 _sfTransZNode
.copyToBin(pMem
);
1374 if(FieldBits::NoField
!= (PivotNodeFieldMask
& whichField
))
1376 _sfPivotNode
.copyToBin(pMem
);
1378 if(FieldBits::NoField
!= (MaterialXFieldMask
& whichField
))
1380 _sfMaterialX
.copyToBin(pMem
);
1382 if(FieldBits::NoField
!= (MaterialYFieldMask
& whichField
))
1384 _sfMaterialY
.copyToBin(pMem
);
1386 if(FieldBits::NoField
!= (MaterialZFieldMask
& whichField
))
1388 _sfMaterialZ
.copyToBin(pMem
);
1390 if(FieldBits::NoField
!= (MaterialPivotFieldMask
& whichField
))
1392 _sfMaterialPivot
.copyToBin(pMem
);
1394 if(FieldBits::NoField
!= (AxisLinesNFieldMask
& whichField
))
1396 _sfAxisLinesN
.copyToBin(pMem
);
1400 void ManipulatorBase::copyFromBin(BinaryDataHandler
&pMem
,
1401 ConstFieldMaskArg whichField
)
1403 Inherited::copyFromBin(pMem
, whichField
);
1405 if(FieldBits::NoField
!= (TargetFieldMask
& whichField
))
1407 editSField(TargetFieldMask
);
1408 _sfTarget
.copyFromBin(pMem
);
1410 if(FieldBits::NoField
!= (EnablePivotFieldMask
& whichField
))
1412 editSField(EnablePivotFieldMask
);
1413 _sfEnablePivot
.copyFromBin(pMem
);
1415 if(FieldBits::NoField
!= (ActiveSubHandleFieldMask
& whichField
))
1417 editSField(ActiveSubHandleFieldMask
);
1418 _sfActiveSubHandle
.copyFromBin(pMem
);
1420 if(FieldBits::NoField
!= (LastMousePosFieldMask
& whichField
))
1422 editSField(LastMousePosFieldMask
);
1423 _sfLastMousePos
.copyFromBin(pMem
);
1425 if(FieldBits::NoField
!= (ViewportFieldMask
& whichField
))
1427 editSField(ViewportFieldMask
);
1428 _sfViewport
.copyFromBin(pMem
);
1430 if(FieldBits::NoField
!= (ActiveFieldMask
& whichField
))
1432 editSField(ActiveFieldMask
);
1433 _sfActive
.copyFromBin(pMem
);
1435 if(FieldBits::NoField
!= (LengthFieldMask
& whichField
))
1437 editSField(LengthFieldMask
);
1438 _sfLength
.copyFromBin(pMem
);
1440 if(FieldBits::NoField
!= (PivotFieldMask
& whichField
))
1442 editSField(PivotFieldMask
);
1443 _sfPivot
.copyFromBin(pMem
);
1445 if(FieldBits::NoField
!= (HandleXNodeFieldMask
& whichField
))
1447 editSField(HandleXNodeFieldMask
);
1448 _sfHandleXNode
.copyFromBin(pMem
);
1450 if(FieldBits::NoField
!= (HandleYNodeFieldMask
& whichField
))
1452 editSField(HandleYNodeFieldMask
);
1453 _sfHandleYNode
.copyFromBin(pMem
);
1455 if(FieldBits::NoField
!= (HandleZNodeFieldMask
& whichField
))
1457 editSField(HandleZNodeFieldMask
);
1458 _sfHandleZNode
.copyFromBin(pMem
);
1460 if(FieldBits::NoField
!= (HandlePNodeFieldMask
& whichField
))
1462 editSField(HandlePNodeFieldMask
);
1463 _sfHandlePNode
.copyFromBin(pMem
);
1465 if(FieldBits::NoField
!= (TransXNodeFieldMask
& whichField
))
1467 editSField(TransXNodeFieldMask
);
1468 _sfTransXNode
.copyFromBin(pMem
);
1470 if(FieldBits::NoField
!= (TransYNodeFieldMask
& whichField
))
1472 editSField(TransYNodeFieldMask
);
1473 _sfTransYNode
.copyFromBin(pMem
);
1475 if(FieldBits::NoField
!= (TransZNodeFieldMask
& whichField
))
1477 editSField(TransZNodeFieldMask
);
1478 _sfTransZNode
.copyFromBin(pMem
);
1480 if(FieldBits::NoField
!= (PivotNodeFieldMask
& whichField
))
1482 editSField(PivotNodeFieldMask
);
1483 _sfPivotNode
.copyFromBin(pMem
);
1485 if(FieldBits::NoField
!= (MaterialXFieldMask
& whichField
))
1487 editSField(MaterialXFieldMask
);
1488 _sfMaterialX
.copyFromBin(pMem
);
1490 if(FieldBits::NoField
!= (MaterialYFieldMask
& whichField
))
1492 editSField(MaterialYFieldMask
);
1493 _sfMaterialY
.copyFromBin(pMem
);
1495 if(FieldBits::NoField
!= (MaterialZFieldMask
& whichField
))
1497 editSField(MaterialZFieldMask
);
1498 _sfMaterialZ
.copyFromBin(pMem
);
1500 if(FieldBits::NoField
!= (MaterialPivotFieldMask
& whichField
))
1502 editSField(MaterialPivotFieldMask
);
1503 _sfMaterialPivot
.copyFromBin(pMem
);
1505 if(FieldBits::NoField
!= (AxisLinesNFieldMask
& whichField
))
1507 editSField(AxisLinesNFieldMask
);
1508 _sfAxisLinesN
.copyFromBin(pMem
);
1515 /*------------------------- constructors ----------------------------------*/
1517 ManipulatorBase::ManipulatorBase(void) :
1520 _sfEnablePivot (bool(false)),
1521 _sfActiveSubHandle (NULL
),
1525 _sfLength (Vec3f(1,1,1)),
1526 _sfPivot (Pnt3f(0,0,0)),
1527 _sfHandleXNode (NULL
),
1528 _sfHandleYNode (NULL
),
1529 _sfHandleZNode (NULL
),
1530 _sfHandlePNode (NULL
),
1531 _sfTransXNode (NULL
),
1532 _sfTransYNode (NULL
),
1533 _sfTransZNode (NULL
),
1534 _sfPivotNode (NULL
),
1535 _sfMaterialX (NULL
),
1536 _sfMaterialY (NULL
),
1537 _sfMaterialZ (NULL
),
1538 _sfMaterialPivot (NULL
),
1539 _sfAxisLinesN (NULL
)
1543 ManipulatorBase::ManipulatorBase(const ManipulatorBase
&source
) :
1546 _sfEnablePivot (source
._sfEnablePivot
),
1547 _sfActiveSubHandle (NULL
),
1548 _sfLastMousePos (source
._sfLastMousePos
),
1550 _sfActive (source
._sfActive
),
1551 _sfLength (source
._sfLength
),
1552 _sfPivot (source
._sfPivot
),
1553 _sfHandleXNode (NULL
),
1554 _sfHandleYNode (NULL
),
1555 _sfHandleZNode (NULL
),
1556 _sfHandlePNode (NULL
),
1557 _sfTransXNode (NULL
),
1558 _sfTransYNode (NULL
),
1559 _sfTransZNode (NULL
),
1560 _sfPivotNode (NULL
),
1561 _sfMaterialX (NULL
),
1562 _sfMaterialY (NULL
),
1563 _sfMaterialZ (NULL
),
1564 _sfMaterialPivot (NULL
),
1565 _sfAxisLinesN (NULL
)
1570 /*-------------------------- destructors ----------------------------------*/
1572 ManipulatorBase::~ManipulatorBase(void)
1576 void ManipulatorBase::onCreate(const Manipulator
*source
)
1578 Inherited::onCreate(source
);
1582 Manipulator
*pThis
= static_cast<Manipulator
*>(this);
1584 pThis
->setTarget(source
->getTarget());
1586 pThis
->setActiveSubHandle(source
->getActiveSubHandle());
1588 pThis
->setViewport(source
->getViewport());
1590 pThis
->setHandleXNode(source
->getHandleXNode());
1592 pThis
->setHandleYNode(source
->getHandleYNode());
1594 pThis
->setHandleZNode(source
->getHandleZNode());
1596 pThis
->setHandlePNode(source
->getHandlePNode());
1598 pThis
->setTransXNode(source
->getTransXNode());
1600 pThis
->setTransYNode(source
->getTransYNode());
1602 pThis
->setTransZNode(source
->getTransZNode());
1604 pThis
->setPivotNode(source
->getPivotNode());
1606 pThis
->setMaterialX(source
->getMaterialX());
1608 pThis
->setMaterialY(source
->getMaterialY());
1610 pThis
->setMaterialZ(source
->getMaterialZ());
1612 pThis
->setMaterialPivot(source
->getMaterialPivot());
1614 pThis
->setAxisLinesN(source
->getAxisLinesN());
1618 GetFieldHandlePtr
ManipulatorBase::getHandleTarget (void) const
1620 SFUnrecNodePtr::GetHandlePtr
returnValue(
1621 new SFUnrecNodePtr::GetHandle(
1623 this->getType().getFieldDesc(TargetFieldId
),
1624 const_cast<ManipulatorBase
*>(this)));
1629 EditFieldHandlePtr
ManipulatorBase::editHandleTarget (void)
1631 SFUnrecNodePtr::EditHandlePtr
returnValue(
1632 new SFUnrecNodePtr::EditHandle(
1634 this->getType().getFieldDesc(TargetFieldId
),
1637 returnValue
->setSetMethod(
1638 boost::bind(&Manipulator::setTarget
,
1639 static_cast<Manipulator
*>(this), _1
));
1641 editSField(TargetFieldMask
);
1646 GetFieldHandlePtr
ManipulatorBase::getHandleEnablePivot (void) const
1648 SFBool::GetHandlePtr
returnValue(
1649 new SFBool::GetHandle(
1651 this->getType().getFieldDesc(EnablePivotFieldId
),
1652 const_cast<ManipulatorBase
*>(this)));
1657 EditFieldHandlePtr
ManipulatorBase::editHandleEnablePivot (void)
1659 SFBool::EditHandlePtr
returnValue(
1660 new SFBool::EditHandle(
1662 this->getType().getFieldDesc(EnablePivotFieldId
),
1666 editSField(EnablePivotFieldMask
);
1671 GetFieldHandlePtr
ManipulatorBase::getHandleActiveSubHandle (void) const
1673 SFUnrecNodePtr::GetHandlePtr
returnValue(
1674 new SFUnrecNodePtr::GetHandle(
1675 &_sfActiveSubHandle
,
1676 this->getType().getFieldDesc(ActiveSubHandleFieldId
),
1677 const_cast<ManipulatorBase
*>(this)));
1682 EditFieldHandlePtr
ManipulatorBase::editHandleActiveSubHandle(void)
1684 SFUnrecNodePtr::EditHandlePtr
returnValue(
1685 new SFUnrecNodePtr::EditHandle(
1686 &_sfActiveSubHandle
,
1687 this->getType().getFieldDesc(ActiveSubHandleFieldId
),
1690 returnValue
->setSetMethod(
1691 boost::bind(&Manipulator::setActiveSubHandle
,
1692 static_cast<Manipulator
*>(this), _1
));
1694 editSField(ActiveSubHandleFieldMask
);
1699 GetFieldHandlePtr
ManipulatorBase::getHandleLastMousePos (void) const
1701 SFPnt2f::GetHandlePtr
returnValue(
1702 new SFPnt2f::GetHandle(
1704 this->getType().getFieldDesc(LastMousePosFieldId
),
1705 const_cast<ManipulatorBase
*>(this)));
1710 EditFieldHandlePtr
ManipulatorBase::editHandleLastMousePos (void)
1712 SFPnt2f::EditHandlePtr
returnValue(
1713 new SFPnt2f::EditHandle(
1715 this->getType().getFieldDesc(LastMousePosFieldId
),
1719 editSField(LastMousePosFieldMask
);
1724 GetFieldHandlePtr
ManipulatorBase::getHandleViewport (void) const
1726 SFUnrecViewportPtr::GetHandlePtr
returnValue(
1727 new SFUnrecViewportPtr::GetHandle(
1729 this->getType().getFieldDesc(ViewportFieldId
),
1730 const_cast<ManipulatorBase
*>(this)));
1735 EditFieldHandlePtr
ManipulatorBase::editHandleViewport (void)
1737 SFUnrecViewportPtr::EditHandlePtr
returnValue(
1738 new SFUnrecViewportPtr::EditHandle(
1740 this->getType().getFieldDesc(ViewportFieldId
),
1743 returnValue
->setSetMethod(
1744 boost::bind(&Manipulator::setViewport
,
1745 static_cast<Manipulator
*>(this), _1
));
1747 editSField(ViewportFieldMask
);
1752 GetFieldHandlePtr
ManipulatorBase::getHandleActive (void) const
1754 SFBool::GetHandlePtr
returnValue(
1755 new SFBool::GetHandle(
1757 this->getType().getFieldDesc(ActiveFieldId
),
1758 const_cast<ManipulatorBase
*>(this)));
1763 EditFieldHandlePtr
ManipulatorBase::editHandleActive (void)
1765 SFBool::EditHandlePtr
returnValue(
1766 new SFBool::EditHandle(
1768 this->getType().getFieldDesc(ActiveFieldId
),
1772 editSField(ActiveFieldMask
);
1777 GetFieldHandlePtr
ManipulatorBase::getHandleLength (void) const
1779 SFVec3f::GetHandlePtr
returnValue(
1780 new SFVec3f::GetHandle(
1782 this->getType().getFieldDesc(LengthFieldId
),
1783 const_cast<ManipulatorBase
*>(this)));
1788 EditFieldHandlePtr
ManipulatorBase::editHandleLength (void)
1790 SFVec3f::EditHandlePtr
returnValue(
1791 new SFVec3f::EditHandle(
1793 this->getType().getFieldDesc(LengthFieldId
),
1797 editSField(LengthFieldMask
);
1802 GetFieldHandlePtr
ManipulatorBase::getHandlePivot (void) const
1804 SFPnt3f::GetHandlePtr
returnValue(
1805 new SFPnt3f::GetHandle(
1807 this->getType().getFieldDesc(PivotFieldId
),
1808 const_cast<ManipulatorBase
*>(this)));
1813 EditFieldHandlePtr
ManipulatorBase::editHandlePivot (void)
1815 SFPnt3f::EditHandlePtr
returnValue(
1816 new SFPnt3f::EditHandle(
1818 this->getType().getFieldDesc(PivotFieldId
),
1822 editSField(PivotFieldMask
);
1827 GetFieldHandlePtr
ManipulatorBase::getHandleHandleXNode (void) const
1829 SFUnrecNodePtr::GetHandlePtr
returnValue(
1830 new SFUnrecNodePtr::GetHandle(
1832 this->getType().getFieldDesc(HandleXNodeFieldId
),
1833 const_cast<ManipulatorBase
*>(this)));
1838 EditFieldHandlePtr
ManipulatorBase::editHandleHandleXNode (void)
1840 SFUnrecNodePtr::EditHandlePtr
returnValue(
1841 new SFUnrecNodePtr::EditHandle(
1843 this->getType().getFieldDesc(HandleXNodeFieldId
),
1846 returnValue
->setSetMethod(
1847 boost::bind(&Manipulator::setHandleXNode
,
1848 static_cast<Manipulator
*>(this), _1
));
1850 editSField(HandleXNodeFieldMask
);
1855 GetFieldHandlePtr
ManipulatorBase::getHandleHandleYNode (void) const
1857 SFUnrecNodePtr::GetHandlePtr
returnValue(
1858 new SFUnrecNodePtr::GetHandle(
1860 this->getType().getFieldDesc(HandleYNodeFieldId
),
1861 const_cast<ManipulatorBase
*>(this)));
1866 EditFieldHandlePtr
ManipulatorBase::editHandleHandleYNode (void)
1868 SFUnrecNodePtr::EditHandlePtr
returnValue(
1869 new SFUnrecNodePtr::EditHandle(
1871 this->getType().getFieldDesc(HandleYNodeFieldId
),
1874 returnValue
->setSetMethod(
1875 boost::bind(&Manipulator::setHandleYNode
,
1876 static_cast<Manipulator
*>(this), _1
));
1878 editSField(HandleYNodeFieldMask
);
1883 GetFieldHandlePtr
ManipulatorBase::getHandleHandleZNode (void) const
1885 SFUnrecNodePtr::GetHandlePtr
returnValue(
1886 new SFUnrecNodePtr::GetHandle(
1888 this->getType().getFieldDesc(HandleZNodeFieldId
),
1889 const_cast<ManipulatorBase
*>(this)));
1894 EditFieldHandlePtr
ManipulatorBase::editHandleHandleZNode (void)
1896 SFUnrecNodePtr::EditHandlePtr
returnValue(
1897 new SFUnrecNodePtr::EditHandle(
1899 this->getType().getFieldDesc(HandleZNodeFieldId
),
1902 returnValue
->setSetMethod(
1903 boost::bind(&Manipulator::setHandleZNode
,
1904 static_cast<Manipulator
*>(this), _1
));
1906 editSField(HandleZNodeFieldMask
);
1911 GetFieldHandlePtr
ManipulatorBase::getHandleHandlePNode (void) const
1913 SFUnrecNodePtr::GetHandlePtr
returnValue(
1914 new SFUnrecNodePtr::GetHandle(
1916 this->getType().getFieldDesc(HandlePNodeFieldId
),
1917 const_cast<ManipulatorBase
*>(this)));
1922 EditFieldHandlePtr
ManipulatorBase::editHandleHandlePNode (void)
1924 SFUnrecNodePtr::EditHandlePtr
returnValue(
1925 new SFUnrecNodePtr::EditHandle(
1927 this->getType().getFieldDesc(HandlePNodeFieldId
),
1930 returnValue
->setSetMethod(
1931 boost::bind(&Manipulator::setHandlePNode
,
1932 static_cast<Manipulator
*>(this), _1
));
1934 editSField(HandlePNodeFieldMask
);
1939 GetFieldHandlePtr
ManipulatorBase::getHandleTransXNode (void) const
1941 SFUnrecNodePtr::GetHandlePtr
returnValue(
1942 new SFUnrecNodePtr::GetHandle(
1944 this->getType().getFieldDesc(TransXNodeFieldId
),
1945 const_cast<ManipulatorBase
*>(this)));
1950 EditFieldHandlePtr
ManipulatorBase::editHandleTransXNode (void)
1952 SFUnrecNodePtr::EditHandlePtr
returnValue(
1953 new SFUnrecNodePtr::EditHandle(
1955 this->getType().getFieldDesc(TransXNodeFieldId
),
1958 returnValue
->setSetMethod(
1959 boost::bind(&Manipulator::setTransXNode
,
1960 static_cast<Manipulator
*>(this), _1
));
1962 editSField(TransXNodeFieldMask
);
1967 GetFieldHandlePtr
ManipulatorBase::getHandleTransYNode (void) const
1969 SFUnrecNodePtr::GetHandlePtr
returnValue(
1970 new SFUnrecNodePtr::GetHandle(
1972 this->getType().getFieldDesc(TransYNodeFieldId
),
1973 const_cast<ManipulatorBase
*>(this)));
1978 EditFieldHandlePtr
ManipulatorBase::editHandleTransYNode (void)
1980 SFUnrecNodePtr::EditHandlePtr
returnValue(
1981 new SFUnrecNodePtr::EditHandle(
1983 this->getType().getFieldDesc(TransYNodeFieldId
),
1986 returnValue
->setSetMethod(
1987 boost::bind(&Manipulator::setTransYNode
,
1988 static_cast<Manipulator
*>(this), _1
));
1990 editSField(TransYNodeFieldMask
);
1995 GetFieldHandlePtr
ManipulatorBase::getHandleTransZNode (void) const
1997 SFUnrecNodePtr::GetHandlePtr
returnValue(
1998 new SFUnrecNodePtr::GetHandle(
2000 this->getType().getFieldDesc(TransZNodeFieldId
),
2001 const_cast<ManipulatorBase
*>(this)));
2006 EditFieldHandlePtr
ManipulatorBase::editHandleTransZNode (void)
2008 SFUnrecNodePtr::EditHandlePtr
returnValue(
2009 new SFUnrecNodePtr::EditHandle(
2011 this->getType().getFieldDesc(TransZNodeFieldId
),
2014 returnValue
->setSetMethod(
2015 boost::bind(&Manipulator::setTransZNode
,
2016 static_cast<Manipulator
*>(this), _1
));
2018 editSField(TransZNodeFieldMask
);
2023 GetFieldHandlePtr
ManipulatorBase::getHandlePivotNode (void) const
2025 SFUnrecNodePtr::GetHandlePtr
returnValue(
2026 new SFUnrecNodePtr::GetHandle(
2028 this->getType().getFieldDesc(PivotNodeFieldId
),
2029 const_cast<ManipulatorBase
*>(this)));
2034 EditFieldHandlePtr
ManipulatorBase::editHandlePivotNode (void)
2036 SFUnrecNodePtr::EditHandlePtr
returnValue(
2037 new SFUnrecNodePtr::EditHandle(
2039 this->getType().getFieldDesc(PivotNodeFieldId
),
2042 returnValue
->setSetMethod(
2043 boost::bind(&Manipulator::setPivotNode
,
2044 static_cast<Manipulator
*>(this), _1
));
2046 editSField(PivotNodeFieldMask
);
2051 GetFieldHandlePtr
ManipulatorBase::getHandleMaterialX (void) const
2053 SFUnrecMaterialPtr::GetHandlePtr
returnValue(
2054 new SFUnrecMaterialPtr::GetHandle(
2056 this->getType().getFieldDesc(MaterialXFieldId
),
2057 const_cast<ManipulatorBase
*>(this)));
2062 EditFieldHandlePtr
ManipulatorBase::editHandleMaterialX (void)
2064 SFUnrecMaterialPtr::EditHandlePtr
returnValue(
2065 new SFUnrecMaterialPtr::EditHandle(
2067 this->getType().getFieldDesc(MaterialXFieldId
),
2070 returnValue
->setSetMethod(
2071 boost::bind(&Manipulator::setMaterialX
,
2072 static_cast<Manipulator
*>(this), _1
));
2074 editSField(MaterialXFieldMask
);
2079 GetFieldHandlePtr
ManipulatorBase::getHandleMaterialY (void) const
2081 SFUnrecMaterialPtr::GetHandlePtr
returnValue(
2082 new SFUnrecMaterialPtr::GetHandle(
2084 this->getType().getFieldDesc(MaterialYFieldId
),
2085 const_cast<ManipulatorBase
*>(this)));
2090 EditFieldHandlePtr
ManipulatorBase::editHandleMaterialY (void)
2092 SFUnrecMaterialPtr::EditHandlePtr
returnValue(
2093 new SFUnrecMaterialPtr::EditHandle(
2095 this->getType().getFieldDesc(MaterialYFieldId
),
2098 returnValue
->setSetMethod(
2099 boost::bind(&Manipulator::setMaterialY
,
2100 static_cast<Manipulator
*>(this), _1
));
2102 editSField(MaterialYFieldMask
);
2107 GetFieldHandlePtr
ManipulatorBase::getHandleMaterialZ (void) const
2109 SFUnrecMaterialPtr::GetHandlePtr
returnValue(
2110 new SFUnrecMaterialPtr::GetHandle(
2112 this->getType().getFieldDesc(MaterialZFieldId
),
2113 const_cast<ManipulatorBase
*>(this)));
2118 EditFieldHandlePtr
ManipulatorBase::editHandleMaterialZ (void)
2120 SFUnrecMaterialPtr::EditHandlePtr
returnValue(
2121 new SFUnrecMaterialPtr::EditHandle(
2123 this->getType().getFieldDesc(MaterialZFieldId
),
2126 returnValue
->setSetMethod(
2127 boost::bind(&Manipulator::setMaterialZ
,
2128 static_cast<Manipulator
*>(this), _1
));
2130 editSField(MaterialZFieldMask
);
2135 GetFieldHandlePtr
ManipulatorBase::getHandleMaterialPivot (void) const
2137 SFUnrecMaterialPtr::GetHandlePtr
returnValue(
2138 new SFUnrecMaterialPtr::GetHandle(
2140 this->getType().getFieldDesc(MaterialPivotFieldId
),
2141 const_cast<ManipulatorBase
*>(this)));
2146 EditFieldHandlePtr
ManipulatorBase::editHandleMaterialPivot (void)
2148 SFUnrecMaterialPtr::EditHandlePtr
returnValue(
2149 new SFUnrecMaterialPtr::EditHandle(
2151 this->getType().getFieldDesc(MaterialPivotFieldId
),
2154 returnValue
->setSetMethod(
2155 boost::bind(&Manipulator::setMaterialPivot
,
2156 static_cast<Manipulator
*>(this), _1
));
2158 editSField(MaterialPivotFieldMask
);
2163 GetFieldHandlePtr
ManipulatorBase::getHandleAxisLinesN (void) const
2165 SFUnrecNodePtr::GetHandlePtr
returnValue(
2166 new SFUnrecNodePtr::GetHandle(
2168 this->getType().getFieldDesc(AxisLinesNFieldId
),
2169 const_cast<ManipulatorBase
*>(this)));
2174 EditFieldHandlePtr
ManipulatorBase::editHandleAxisLinesN (void)
2176 SFUnrecNodePtr::EditHandlePtr
returnValue(
2177 new SFUnrecNodePtr::EditHandle(
2179 this->getType().getFieldDesc(AxisLinesNFieldId
),
2182 returnValue
->setSetMethod(
2183 boost::bind(&Manipulator::setAxisLinesN
,
2184 static_cast<Manipulator
*>(this), _1
));
2186 editSField(AxisLinesNFieldMask
);
2192 #ifdef OSG_MT_CPTR_ASPECT
2193 void ManipulatorBase::execSyncV( FieldContainer
&oFrom
,
2194 ConstFieldMaskArg whichField
,
2195 AspectOffsetStore
&oOffsets
,
2196 ConstFieldMaskArg syncMode
,
2197 const UInt32 uiSyncInfo
)
2199 Manipulator
*pThis
= static_cast<Manipulator
*>(this);
2201 pThis
->execSync(static_cast<Manipulator
*>(&oFrom
),
2211 void ManipulatorBase::resolveLinks(void)
2213 Inherited::resolveLinks();
2215 static_cast<Manipulator
*>(this)->setTarget(NULL
);
2217 static_cast<Manipulator
*>(this)->setActiveSubHandle(NULL
);
2219 static_cast<Manipulator
*>(this)->setViewport(NULL
);
2221 static_cast<Manipulator
*>(this)->setHandleXNode(NULL
);
2223 static_cast<Manipulator
*>(this)->setHandleYNode(NULL
);
2225 static_cast<Manipulator
*>(this)->setHandleZNode(NULL
);
2227 static_cast<Manipulator
*>(this)->setHandlePNode(NULL
);
2229 static_cast<Manipulator
*>(this)->setTransXNode(NULL
);
2231 static_cast<Manipulator
*>(this)->setTransYNode(NULL
);
2233 static_cast<Manipulator
*>(this)->setTransZNode(NULL
);
2235 static_cast<Manipulator
*>(this)->setPivotNode(NULL
);
2237 static_cast<Manipulator
*>(this)->setMaterialX(NULL
);
2239 static_cast<Manipulator
*>(this)->setMaterialY(NULL
);
2241 static_cast<Manipulator
*>(this)->setMaterialZ(NULL
);
2243 static_cast<Manipulator
*>(this)->setMaterialPivot(NULL
);
2245 static_cast<Manipulator
*>(this)->setAxisLinesN(NULL
);