Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxVector3DWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #ifndef CXVECTOR3DWIDGET_H_
12 #define CXVECTOR3DWIDGET_H_
13 
14 #include "cxResourceWidgetsExport.h"
15 
16 #include "cxVector3D.h"
17 #include <QWidget>
18 class QBoxLayout;
19 #include "cxVector3DPropertyBase.h"
20 #include "cxDoubleProperty.h"
21 
22 namespace cx
23 {
24 
25 
32 class cxResourceWidgets_EXPORT Vector3DWidget: public QWidget
33 {
34 Q_OBJECT
35 public:
36  Vector3DWidget(QWidget* parent, Vector3DPropertyBasePtr data);
37  virtual ~Vector3DWidget() {}
38 
39  static Vector3DWidget* createSmallHorizontal(QWidget* parent, Vector3DPropertyBasePtr data);
40  static Vector3DWidget* createVerticalWithSliders(QWidget* parent, Vector3DPropertyBasePtr data);
41  void showDim(int dim, bool visible);
42 
43 private:
44  void addSliderControlsForIndex(QString name, QString help, int index, QBoxLayout* layout);
45  void addSmallControlsForIndex(QString name, QString help, int index, QBoxLayout* layout);
46 
48  boost::array<DoublePropertyBasePtr, 3> mDoubleAdapter;
49  boost::array<QWidget*, 3> mWidgets;
50 };
51 
52 }
53 
54 #endif /* CXVECTOR3DWIDGET_H_ */
Widget for displaying a Vector3D.
boost::shared_ptr< Vector3DPropertyBase > Vector3DPropertyBasePtr
Namespace for all CustusX production code.