Fraxinus  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:
68  SpaceProviderPtr mSpaceProvider;
69 
70  QColor mColor;
71 
72 };
73 typedef boost::shared_ptr<DataMetric> DataMetricPtr;
74 
78 }
79 
80 #endif /* CXDATAMETRIC_H_ */
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
boost::shared_ptr< class FileManagerService > FileManagerServicePtr
virtual void save(const QString &basePath, FileManagerServicePtr filemanager)
metrics don&#39;t store info in file, xml only.
Definition: cxDataMetric.h:64
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< DataMetric > DataMetricPtr
Definition: cxDataMetric.h:73
PatientModelServicePtr mDataManager
Definition: cxDataMetric.h:67
SpaceProviderPtr mSpaceProvider
Definition: cxDataMetric.h:68
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
virtual bool showValueInGraphics() const
Definition: cxDataMetric.h:56
Transform3D createTransformTranslate(const Vector3D &translation)
virtual Transform3D getRefFrame() const
Definition: cxDataMetric.h:53
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
Superclass for all data objects.
Definition: cxData.h:89
virtual QIcon getIcon()
Definition: cxDataMetric.h:49
virtual bool isValid() const
Definition: cxDataMetric.h:54
boost::shared_ptr< class SpaceListener > SpaceListenerPtr
Base class for all Data Metrics.
Definition: cxDataMetric.h:43
Namespace for all CustusX production code.