KiCad PCB EDA Suite
ctrack_ball.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
5  * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program 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 General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #ifndef CTRACK_BALL_H
31 #define CTRACK_BALL_H
32 
33 #include "ccamera.h"
34 
35 
36 class CTRACK_BALL : public CCAMERA
37 {
38 
39  public:
40 
41  explicit CTRACK_BALL( float aRangeScale );
42 
43  void Drag( const wxPoint &aNewMousePosition ) override;
44 
45  void Pan( const wxPoint &aNewMousePosition ) override;
46 
47  void Pan( const SFVEC3F &aDeltaOffsetInc ) override;
48 
49  void Pan_T1( const SFVEC3F &aDeltaOffsetInc ) override;
50 
51  void SetLookAtPos( const SFVEC3F &aLookAtPos ) override;
52 
53  void Reset() override;
54 
55  void Reset_T1() override;
56 
57  void SetT0_and_T1_current_T() override;
58 
59  void Interpolate( float t ) override;
60 
61  private:
62 
66  double m_quat[4];
67  double m_quat_t0[4];
68  double m_quat_t1[4];
69 };
70 
71 #endif // CTRACK_BALL_H
void Pan_T1(const SFVEC3F &aDeltaOffsetInc) override
void SetLookAtPos(const SFVEC3F &aLookAtPos) override
Definition: ctrack_ball.cpp:81
void Reset() override
Reset the camera to initial state.
Class CCAMERA is a virtual class used to derive CCAMERA objects from.
Definition: ccamera.h:80
double m_quat[4]
quarternion of the trackball
Definition: ctrack_ball.h:66
Define an abstract camera.
CTRACK_BALL(float aRangeScale)
Definition: ctrack_ball.cpp:37
void SetT0_and_T1_current_T() override
SetT0_and_T1_current_T - This will set T0 and T1 with the current values.
void Drag(const wxPoint &aNewMousePosition) override
Calculate a new mouse drag position.
Definition: ctrack_ball.cpp:51
double m_quat_t0[4]
Definition: ctrack_ball.h:67
void Reset_T1() override
double m_quat_t1[4]
Definition: ctrack_ball.h:68
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
void Pan(const wxPoint &aNewMousePosition) override
Definition: ctrack_ball.cpp:95
void Interpolate(float t) override
Interpolate - It will update the matrix to interpolate between T0 and T1 values.