GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_abstractmanipulator.h
Go to the documentation of this file.
1 /****************************************************************************
2 
3  This file is part of the GLC-lib library.
4  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
5  http://glc-lib.sourceforge.net
6 
7  GLC-lib is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  GLC-lib is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with GLC-lib; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  *****************************************************************************/
22 
23 #ifndef GLC_ABSTRACTMANIPULATOR_H_
24 #define GLC_ABSTRACTMANIPULATOR_H_
25 
26 #include "../maths/glc_vector3d.h"
27 #include "../maths/glc_matrix4x4.h"
28 #include "../maths/glc_plane.h"
29 
30 #include "../glc_config.h"
31 
32 class GLC_Viewport;
33 
36 
39 
41 {
43 
45 
46 public:
49 
51  GLC_AbstractManipulator(const GLC_AbstractManipulator& abstractManipulator);
52 
54  virtual ~GLC_AbstractManipulator();
56 
58 
60 
61 public:
63  inline bool isInManipulateState() const
64  {return m_IsInManipulateState;}
65 
67  const GLC_Point3d& previousPosition() const
68  {return m_PreviousPosition;}
69 
71  inline GLC_Viewport* viewportHandle() const
72  {return m_pViewport;}
73 
75  virtual GLC_AbstractManipulator* clone() const= 0;
76 
78 
80 
82 
83 public:
85  void enterManipulateState(const GLC_Point3d& startPoint);
86 
88  GLC_Matrix4x4 manipulate(const GLC_Point3d& newPoint);
89 
91  inline void exitManipulateState()
92  {m_IsInManipulateState= false;}
93 
95  inline void setViewport(GLC_Viewport* pViewport)
96  {m_pViewport= pViewport;}
97 
99 
101 // Protected services function
103 protected:
105  virtual GLC_Matrix4x4 doManipulate(const GLC_Point3d& newPoint, const GLC_Vector3d& projectionDirection)= 0;
106 
108 // protected Member
110 protected:
113 
116 
119 
122 
123 };
124 
125 #endif /* GLC_ABSTRACTMANIPULATOR_H_ */

©2005-2013 Laurent Ribon