NorMIT-nav  22.09
An IGT application
cxDataMetric.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 
13 
14 #ifndef CXDATAMETRIC_H_
15 #define CXDATAMETRIC_H_
16 
17 #include "cxResourceExport.h"
18 #include "cxPrecompiledHeader.h"
19 
20 #include "cxData.h"
21 #include <QColor>
22 
23 namespace cx
24 {
25 typedef boost::shared_ptr<class SpaceProvider> SpaceProviderPtr;
26 typedef boost::shared_ptr<class SpaceListener> SpaceListenerPtr;
27 
43 class cxResource_EXPORT DataMetric : public Data
44 {
45 public:
46  DataMetric(const QString& uid, const QString& name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider);
47  virtual ~DataMetric();
48 
49  virtual QIcon getIcon() {return QIcon(":/icons/metric.png");}
50 
51  virtual QString getSpace();
52  virtual Vector3D getRefCoord() const = 0;
53  virtual Transform3D getRefFrame() const { return createTransformTranslate(this->getRefCoord()); }
54  virtual bool isValid() const { return true; }
55  virtual QString getValueAsString() const = 0;
56  virtual bool showValueInGraphics() const { return false; }
57 
58  void setColor(const QColor& color);
59  QColor getColor();
60 
61  void addXml(QDomNode& dataNode);
62  void parseXml(QDomNode& dataNode);
63  virtual bool load(QString path, FileManagerServicePtr filemanager);
64  virtual void save(const QString& basePath, FileManagerServicePtr filemanager) {}
65 
66 protected:
69 
70  QColor mColor;
71 
72 };
73 typedef boost::shared_ptr<DataMetric> DataMetricPtr;
74 
78 }
79 
80 #endif /* CXDATAMETRIC_H_ */
cx::SpaceListenerPtr
boost::shared_ptr< class SpaceListener > SpaceListenerPtr
Definition: cxAxisConnector.h:23
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxPrecompiledHeader.h
cx::DataMetric::mDataManager
PatientModelServicePtr mDataManager
Definition: cxDataMetric.h:67
cx::DataMetricPtr
boost::shared_ptr< DataMetric > DataMetricPtr
Definition: cxDataMetric.h:73
cx::DataMetric::isValid
virtual bool isValid() const
Definition: cxDataMetric.h:54
cx::FileManagerServicePtr
boost::shared_ptr< class FileManagerService > FileManagerServicePtr
Definition: cxLogicManager.h:31
cx::DataMetric::showValueInGraphics
virtual bool showValueInGraphics() const
Definition: cxDataMetric.h:56
cxData.h
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cx::PatientModelServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Definition: cxLogicManager.h:25
cx::DataMetric::mSpaceProvider
SpaceProviderPtr mSpaceProvider
Definition: cxDataMetric.h:68
cx::DataMetric
Base class for all Data Metrics.
Definition: cxDataMetric.h:43
cx::DataMetric::mColor
QColor mColor
Definition: cxDataMetric.h:70
cx::createTransformTranslate
Transform3D createTransformTranslate(const Vector3D &translation)
Definition: cxTransform3D.cpp:164
cx::DataMetric::getRefFrame
virtual Transform3D getRefFrame() const
Definition: cxDataMetric.h:53
cx::Data
Superclass for all data objects.
Definition: cxData.h:89
cx::Vector3D
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
cx::SpaceProviderPtr
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
Definition: cxLogicManager.h:23
cx::DataMetric::getIcon
virtual QIcon getIcon()
Definition: cxDataMetric.h:49