changed: gcc8 base update
[opensg.git] / Source / Contrib / Manipulators / OSGManipulator.h
blob197059ffaa8f8c9dfa13ee834f8bf30a600b5b0b
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
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 #ifndef _OSGMANIPULATOR_H_
40 #define _OSGMANIPULATOR_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGConfig.h"
47 #include "OSGManipulatorBase.h"
48 #include "OSGExternalUpdateHandler.h"
50 #include "OSGComponentTransform.h"
52 OSG_BEGIN_NAMESPACE
54 /*! \brief Manipulator class. See \ref
55 PageManipulatorsManipulator for a description.
58 class OSG_CONTRIBGUI_DLLMAPPING Manipulator : public ManipulatorBase
60 /*========================== PUBLIC =================================*/
61 public:
63 /*---------------------------------------------------------------------*/
64 /*! \name Sync */
65 /*! \{ */
67 virtual void changed(ConstFieldMaskArg whichField,
68 UInt32 origin,
69 BitVector detail);
71 /*! \} */
72 /*---------------------------------------------------------------------*/
73 /*! \name Output */
74 /*! \{ */
76 virtual void dump( UInt32 uiIndent = 0,
77 const BitVector bvFlags = 0) const;
79 virtual void mouseMove(Int16 x,
80 Int16 y);
82 virtual void mouseButtonPress(UInt16 button,
83 Int16 x,
84 Int16 y );
86 virtual void mouseButtonRelease(UInt16 button,
87 Int16 x,
88 Int16 y );
90 virtual bool hasSubHandle(Node * const n);
92 void setExternalUpdateHandler(ExternalUpdateHandler* h);
94 void callExternalUpdateHandler();
96 /*! \} */
97 /*========================= PROTECTED ===============================*/
98 protected:
100 typedef ManipulatorBase Inherited;
102 // Variables should all be in ManipulatorBase.
104 /*---------------------------------------------------------------------*/
105 /*! \name Constructors */
106 /*! \{ */
108 Manipulator(void);
109 Manipulator(const Manipulator &source);
111 void onCreate();
112 void onCreate(const Manipulator* source);
115 /*! \} */
116 /*---------------------------------------------------------------------*/
117 /*! \name Destructors */
118 /*! \{ */
120 virtual ~Manipulator(void);
122 void onDestroy();
124 virtual void resolveLinks(void);
126 /*! \} */
127 /*---------------------------------------------------------------------*/
128 /*! \name Init */
129 /*! \{ */
131 static void initMethod(InitPhase ePhase);
133 /*! \} */
135 virtual NodeTransitPtr makeHandleGeo() = 0;
136 virtual void addHandleGeo(Node * n);
137 virtual void subHandleGeo(Node * n);
138 void updateHandleTransform();
140 /*---------------------------------------------------------------------*/
141 /*! \name Helpers */
142 /*! \{ */
144 virtual void doMovement( Transform *t,
145 const Int32 coord,
146 const Real32 value,
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;
160 /*! \} */
162 /*========================== PRIVATE ================================*/
163 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;
175 OSG_END_NAMESPACE
177 #include "OSGManipulatorBase.inl"
178 #include "OSGManipulator.inl"
180 #endif /* _OSGMANIPULATOR_H_ */