1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
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 #ifndef _OSGMANIPULATOR_H_
40 #define _OSGMANIPULATOR_H_
45 #include "OSGConfig.h"
47 #include "OSGManipulatorBase.h"
48 #include "OSGExternalUpdateHandler.h"
50 #include "OSGComponentTransform.h"
54 /*! \brief Manipulator class. See \ref
55 PageManipulatorsManipulator for a description.
58 class OSG_CONTRIBGUI_DLLMAPPING Manipulator
: public ManipulatorBase
60 /*========================== PUBLIC =================================*/
63 /*---------------------------------------------------------------------*/
67 virtual void changed(ConstFieldMaskArg whichField
,
72 /*---------------------------------------------------------------------*/
76 virtual void dump( UInt32 uiIndent
= 0,
77 const BitVector bvFlags
= 0) const;
79 virtual void mouseMove(Int16 x
,
82 virtual void mouseButtonPress(UInt16 button
,
86 virtual void mouseButtonRelease(UInt16 button
,
90 virtual bool hasSubHandle(Node
* const n
);
92 void setExternalUpdateHandler(ExternalUpdateHandler
* h
);
94 void callExternalUpdateHandler();
97 /*========================= PROTECTED ===============================*/
100 typedef ManipulatorBase Inherited
;
102 // Variables should all be in ManipulatorBase.
104 /*---------------------------------------------------------------------*/
105 /*! \name Constructors */
109 Manipulator(const Manipulator
&source
);
112 void onCreate(const Manipulator
* source
);
116 /*---------------------------------------------------------------------*/
117 /*! \name Destructors */
120 virtual ~Manipulator(void);
124 virtual void resolveLinks(void);
127 /*---------------------------------------------------------------------*/
131 static void initMethod(InitPhase ePhase
);
135 virtual NodeTransitPtr
makeHandleGeo() = 0;
136 virtual void addHandleGeo(Node
* n
);
137 virtual void subHandleGeo(Node
* n
);
138 void updateHandleTransform();
140 /*---------------------------------------------------------------------*/
144 virtual void doMovement( Transform
*t
,
147 const Vec3f
&translation
,
148 const Quaternion
&rotation
,
149 const Vec3f
&scaleFactor
,
150 const Quaternion
&scaleOrientation
);
152 Pnt2f
calcScreenProjection(const Pnt3f
&,
153 Viewport
* const port
);
155 const Vec3f
& getActiveAxis(void) const;
157 NodeRefPtr _activeParent
;
158 ExternalUpdateHandler
* _externalUpdateHandler
;
162 /*========================== PRIVATE ================================*/
164 friend class FieldContainer
;
165 friend class ManipulatorBase
;
167 friend class ManipulatorManager
;
169 // prohibit default functions (move to 'public' if you need one)
170 void operator =(const Manipulator
&source
);
173 typedef Manipulator
*ManipulatorP
;
177 #include "OSGManipulatorBase.inl"
178 #include "OSGManipulator.inl"
180 #endif /* _OSGMANIPULATOR_H_ */