cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vctQtWidgetFrame.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): Anton Deguet
7  Created on: 2013-04-20
8 
9  (C) Copyright 2013 Johns Hopkins University (JHU), All Rights
10  Reserved.
11 
12 --- begin cisst license - do not edit ---
13 
14 This software is provided "as is" under an open source license, with
15 no warranty. The complete license can be found in license.txt and
16 http://www.cisst.org/cisst/license.txt.
17 
18 --- end cisst license ---
19 */
20 
21 
22 #ifndef _vctQtWidgetFrame_h
23 #define _vctQtWidgetFrame_h
24 
25 // cisst include
32 
33 #include <QWidget>
34 
35 class QWidget;
36 class QVBoxLayout;
37 
38 
39 // Always include last
41 
44 {
45  Q_OBJECT;
46 
47  public:
48 
53 
56  vctQtWidgetFrameDoubleRead(const DisplayModeType displayMode = RotationWidgetType::MATRIX_WIDGET);
57 
58  inline ~vctQtWidgetFrameDoubleRead(void) {};
59 
63  template <class _rotationType>
64  void SetValue(const vctFrameBase<_rotationType> & frame) {
65  vctMatRot3 rotationMatrix;
66  rotationMatrix.FromNormalized(frame.Rotation());
67  this->RotationWidget->SetValue(rotationMatrix);
68  // always display translations in mm
69  vctDoubleVec translation(frame.Translation());
70 #if CISST_USE_SI_UNITS
71  translation.Multiply(1000.0);
72 #endif
73  this->TranslationWidget->SetValue(translation);
74  }
75 
78  inline void SetDisplayMode(const DisplayModeType displayMode) {
79  this->RotationWidget->SetDisplayMode(displayMode);
80  }
81 
82  protected:
83  // widgets
86  // layout
87  QVBoxLayout * Layout;
88 };
89 
90 #endif // _vctQtWidgetFrame_h
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
vctQtWidgetDynamicVectorDoubleRead * TranslationWidget
Definition: vctQtWidgetFrame.h:85
void SetDisplayMode(const DisplayModeType displayMode)
Definition: vctQtWidgetFrame.h:78
Typedef for dynamic vectors.
DisplayModeType
Definition: vctQtWidgetRotation.h:73
Forward declarations and #define for cisstVector.
Definition: vctQtForwardDeclarations.h:25
QVBoxLayout * Layout
Definition: vctQtWidgetFrame.h:87
Typedef for different transformations.
Definition: vctQtWidgetFrame.h:43
void SetValue(const vctFrameBase< _rotationType > &frame)
Definition: vctQtWidgetFrame.h:64
vctQtWidgetRotationDoubleRead RotationWidgetType
Definition: vctQtWidgetFrame.h:45
~vctQtWidgetFrameDoubleRead(void)
Definition: vctQtWidgetFrame.h:58
Macros to export the symbols of cisstVectorQt (in a Dll).
const TranslationType & Translation(void) const
Definition: vctFrameBase.h:188
vctQtWidgetRotationDoubleRead * RotationWidget
Definition: vctQtWidgetFrame.h:84
RotationWidgetType::DisplayModeType DisplayModeType
Definition: vctQtWidgetFrame.h:52
ThisType & Multiply(const value_type scalar)
Definition: vctDynamicVectorBase.h:1110
Definition: vctQtWidgetRotation.h:66
Template base class for a frame.
Definition: vctForwardDeclarations.h:232
ThisType & FromNormalized(const vctMatrixRotation3Base< __containerType > &other)
Definition: vctMatrixRotation3Base.h:234
const RotationType & Rotation(void) const
Definition: vctFrameBase.h:196