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 _OSG_NAVIGATORENGINE_H_
40 #define _OSG_NAVIGATORENGINE_H_
42 #include "OSGConfig.h"
43 #include "OSGUtilDef.h"
45 #include "OSGVector.h"
46 #include "OSGQuaternion.h"
47 #include "OSGViewport.h"
48 #include "OSGMemoryObject.h"
49 #include "OSGNavigatorBase.h"
55 /*! \brief Base class for all navigator engines.
56 \ingroup GrpUtilNavigation
57 \ingroup GrpLibOSGUtil
60 class OSG_UTIL_DLLMAPPING NavigatorEngine
: public MemoryObject
62 typedef MemoryObject Inherited
;
63 typedef NavigatorEngine Self
;
65 /*========================== PUBLIC =================================*/
69 /*---------------------------------------------------------------------*/
73 OSG_GEN_INTERNAL_MEMOBJPTR(NavigatorEngine
);
76 /*---------------------------------------------------------------------*/
77 /*! \name Class Get */
80 const char *getClassname(void) { return "NavigatorEngine"; }
83 /*---------------------------------------------------------------------*/
87 NavigatorBase::State
getState() const;
89 virtual const Pnt3f
&getFrom (void) = 0;
90 virtual const Pnt3f
&getAt (void) = 0;
91 virtual const Vec3f
&getUp (void) = 0;
92 virtual const Matrix
&getMatrix (void) = 0;
93 virtual Real32
getDistance(void) = 0;
96 /*---------------------------------------------------------------------*/
100 virtual void setFrom ( Pnt3f new_from
) = 0;
101 virtual void setAt ( Pnt3f new_at
) = 0;
102 virtual void setUp ( Vec3f new_up
) = 0;
103 virtual void set ( Pnt3f new_from
,
106 virtual void set (const Matrix
&new_matrix
) = 0;
107 virtual void setDistance( Real32 new_distance
) = 0;
110 /*---------------------------------------------------------------------*/
111 /*! \name navigator engine callbacks */
114 virtual void buttonPress (Int16 button
,
117 Navigator
*nav
) = 0;
118 virtual void buttonRelease(Int16
,
121 Navigator
*nav
) = 0;
122 virtual void keyPress (Int16 key
,
125 Navigator
*nav
) = 0;
126 virtual void moveTo (Int16 x
,
128 Navigator
*nav
) = 0;
129 virtual void idle (Int16 buttons
,
132 Navigator
*nav
) = 0;
135 /*---------------------------------------------------------------------*/
136 /*! \name navigator engine callbacks */
139 virtual void onViewportChanged (Navigator
*nav
);
140 virtual void onActivation (Navigator
*nav
);
141 virtual void onUpdateCameraTransformation(Navigator
*nav
);
144 /*========================== PROTECTED ==============================*/
148 /*---------------------------------------------------------------------*/
149 /*! \name Constructors/Destructor */
152 NavigatorEngine(void);
153 virtual ~NavigatorEngine(void) = 0;
155 /*---------------------------------------------------------------------*/
159 NavigatorBase::State _currentState
;
162 /*---------------------------------------------------------------------*/
166 /* Not implemented */
167 NavigatorEngine(const NavigatorEngine
&other
);
168 NavigatorEngine
&operator =(const NavigatorEngine
&other
);
171 OSG_GEN_MEMOBJPTR(NavigatorEngine
);