changed: gcc8 base update
[opensg.git] / Source / Contrib / Manipulators / OSGManipulatorManager.h
blob693e69088dacd0994c5f975e876e50f4a6b3c3c7
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 _OSGMANIPULATORMANAGER_H_
40 #define _OSGMANIPULATORMANAGER_H_
42 #include "OSGConfig.h"
43 #include "OSGBaseTypes.h"
44 #include "OSGNodeFields.h"
46 #include "OSGManipulator.h"
47 #include "OSGMoveManipulator.h"
48 #include "OSGRotateManipulator.h"
49 #include "OSGScaleManipulator.h"
50 #include "OSGPlaneMoveManipulator.h"
52 OSG_BEGIN_NAMESPACE
54 class OSG_CONTRIBGUI_DLLMAPPING ManipulatorManager
56 public:
57 enum ManipulatorType { ROTATE, SCALE, TRANSLATE, PLANE };
59 ManipulatorManager();
60 ~ManipulatorManager();
62 Node* createManipulator (const ManipulatorType type );
63 void changeManipulator (const ManipulatorType type );
64 void changeEnablePivot ( bool enablePivot );
65 ManipulatorType getCurrentType ( ) const;
66 bool getCurrentEnablePivot( ) const;
67 const Pnt3f & getCurrentPivot ( ) const;
68 bool activate ( Node *n );
70 void setTarget ( Node * const value);
71 void setViewport ( Viewport * const value);
72 bool isActive ( void );
74 void mouseMove (const Int16 x,
75 const Int16 y);
76 void mouseButtonPress (const UInt16 button,
77 const Int16 x,
78 const Int16 y );
79 void mouseButtonRelease (const UInt16 button,
80 const Int16 x,
81 const Int16 y );
82 private:
84 NodeRefPtr _maniN;
85 ManipulatorType _currentType;
86 bool _currentEnablePivot;
87 Pnt3f _currentPivot;
88 NodeRefPtr _target;
89 ViewportRefPtr _viewport;
90 bool _pivotChangePending;
93 OSG_END_NAMESPACE
95 #endif // _OSGMANIPULATORMANAGER_H_