cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vctQtWidgetRotation.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 
6  Author(s): Zihan Chen
7  Created on: 2013-03-20
8 
9  (C) Copyright 2013-2014 Johns Hopkins University (JHU), All Rights Reserved.
10 
11 --- begin cisst license - do not edit ---
12 
13 This software is provided "as is" under an open source license, with
14 no warranty. The complete license can be found in license.txt and
15 http://www.cisst.org/cisst/license.txt.
16 
17 --- end cisst license ---
18 */
19 
20 
21 #ifndef _vctQtWidgetRotation_h
22 #define _vctQtWidgetRotation_h
23 
24 // cisst include
28 
29 #include <QWidget>
30 #include <QtOpenGL>
31 
32 class QWidget;
33 class QVBoxLayout;
34 
35 
36 // Always include last
38 
39 
46 class CISST_EXPORT vctQtWidgetRotationOpenGL: public QGLWidget
47 {
48  Q_OBJECT;
49 
50 public:
52  inline ~vctQtWidgetRotationOpenGL(void) {};
53 
54  void SetValue(const vctMatRot3 & rotation);
55 
56 protected:
57  void initializeGL(void);
58  void paintGL(void);
59  void resizeGL(int width, int height);
60  void draw3DAxis(const double scale);
61  vct3 orientation; // should be replaced by rotation matrix using column-first storage order, isn't OpenGL Fortran like?
62 };
63 
64 
67 {
68  Q_OBJECT;
69 
70  public:
73  typedef enum {UNDEFINED_WIDGET, MATRIX_WIDGET, AXIS_ANGLE_WIDGET, QUATERNION_WIDGET,
74  EULERZYZ_WIDGET, EULERZYX_WIDGET, OPENGL_WIDGET} DisplayModeType;
75 
78  vctQtWidgetRotationDoubleRead(const DisplayModeType displayMode = MATRIX_WIDGET);
79 
81 
85  template <class _containerType>
87  this->Rotation.FromRaw(rotation);
88  this->UpdateCurrentWidget();
89  }
90 
96  void SetDisplayMode(const DisplayModeType displayMode);
97 
98  protected slots:
100  void ShowContextMenu(const QPoint & position);
101 
102  protected:
107 
112  void UpdateCurrentWidget(void);
113 
116 
117  // Matrix
119 
120  // Axis Angle
123  QWidget * AxisAngleWidget;
124 
125  // Quaternion
127 
128  // Euler Angles (in degrees)
131 
132  // Visualization
134 
135  // current widget
136  QWidget * CurrentWidget;
137  QVBoxLayout * Layout;
138 };
139 
140 #endif // _vctQtWidgetRotation_h
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
vct3 orientation
Definition: vctQtWidgetRotation.h:61
vctQtWidgetDynamicVectorDoubleRead * AxisWidget
Definition: vctQtWidgetRotation.h:121
DisplayModeType
Definition: vctQtWidgetRotation.h:73
vctQtWidgetDynamicVectorDoubleRead * EulerZYZWidget
Definition: vctQtWidgetRotation.h:129
Definition: vctQtWidgetRotation.h:73
void SetValue(const vctMatrixRotation3ConstBase< _containerType > &rotation)
Definition: vctQtWidgetRotation.h:86
Forward declarations and #define for cisstVector.
~vctQtWidgetRotationOpenGL(void)
Definition: vctQtWidgetRotation.h:52
vctQtWidgetDynamicMatrixDoubleRead * MatrixWidget
Definition: vctQtWidgetRotation.h:118
Definition: vctQtForwardDeclarations.h:25
Typedef for different transformations.
vctQtWidgetRotationOpenGL * OpenGLWidget
Definition: vctQtWidgetRotation.h:133
DisplayModeType DisplayMode
Definition: vctQtWidgetRotation.h:106
vctQtWidgetDynamicVectorDoubleRead * EulerZYXWidget
Definition: vctQtWidgetRotation.h:130
QWidget * CurrentWidget
Definition: vctQtWidgetRotation.h:136
Definition: vctQtWidgetRotation.h:46
QWidget * AxisAngleWidget
Definition: vctQtWidgetRotation.h:123
~vctQtWidgetRotationDoubleRead(void)
Definition: vctQtWidgetRotation.h:80
Macros to export the symbols of cisstVectorQt (in a Dll).
Define a rotation matrix for a space of dimension 3.
Definition: vctForwardDeclarations.h:198
vctMatRot3 Rotation
Definition: vctQtWidgetRotation.h:115
QVBoxLayout * Layout
Definition: vctQtWidgetRotation.h:137
vctQtWidgetDynamicVectorDoubleRead * QuaternionWidget
Definition: vctQtWidgetRotation.h:126
Definition: vctQtWidgetRotation.h:66
vctQtWidgetDynamicVectorDoubleRead * AngleWidget
Definition: vctQtWidgetRotation.h:122
Definition: vctQtWidgetDynamicMatrix.h:34