NorMIT-nav  22.09
An IGT application
cxVector3DProperty.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 
12 #ifndef CXVECTOR3DPROPERTY_H_
13 #define CXVECTOR3DPROPERTY_H_
14 
15 #include "cxResourceExport.h"
16 
17 #include <QDomElement>
18 #include <QStringList>
19 #include "cxDoubleRange.h"
20 #include "cxVector3DPropertyBase.h"
21 #include "cxXmlOptionItem.h"
22 
23 namespace cx
24 {
25 
26 typedef boost::shared_ptr<class Vector3DProperty> Vector3DPropertyPtr;
27 
39 class cxResource_EXPORT Vector3DProperty: public Vector3DPropertyBase
40 {
41 Q_OBJECT
42 public:
46  static Vector3DPropertyPtr initialize(const QString& uid, QString name, QString help, Vector3D value,
47  DoubleRange range, int decimals, QDomNode root = QDomNode());
48  void setInternal2Display(double factor);
49 
50 public:
51  // inherited interface
52  virtual QString getDisplayName() const;
53  virtual QString getUid() const;
54  virtual bool setValue(const Vector3D& value);
55  virtual Vector3D getValue() const;
56  virtual QString getHelp() const;
57  virtual DoubleRange getValueRange() const;
58  virtual void setValueRange(DoubleRange range);
59  virtual int getValueDecimals() const;
60  virtual double convertInternal2Display(double internal)
61  {
62  return mFactor * internal;
63  }
64  virtual double convertDisplay2Internal(double display)
65  {
66  return display / mFactor;
67  }
68 
69 
70 signals:
71  void valueWasSet();
72 
73 private:
75  QString mName;
76  QString mUid;
77  QString mHelp;
78  Vector3D mValue;
79  double mDecimals;
80  DoubleRange mRange;
81  XmlOptionItem mStore;
82  double mFactor;
83 };
84 
85 } // namespace cx
86 
87 #endif /* CXVECTOR3DPROPERTY_H_ */
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxDoubleRange.h
cxXmlOptionItem.h
cx::Vector3DPropertyBase
Abstract interface for interaction with internal Vector3D-valued data.
Definition: cxVector3DPropertyBase.h:34
cxVector3DPropertyBase.h
cx::Vector3DPropertyPtr
boost::shared_ptr< class Vector3DProperty > Vector3DPropertyPtr
Definition: cxOperatingTableWidget.h:10
cx::XmlOptionItem
Helper class for storing one string value in an xml document.
Definition: cxXmlOptionItem.h:38
cx::Vector3DProperty
Represents one option of the double type.
Definition: cxVector3DProperty.h:39
cx::DoubleRange
Utility class for describing a bounded numeric range.
Definition: cxDoubleRange.h:32
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42