NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxPointMetric.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 #ifndef CXPOINTMETRIC_H_
14 #define CXPOINTMETRIC_H_
15 
16 #include "cxResourceExport.h"
17 #include "cxPrecompiledHeader.h"
18 
19 #include "cxDataMetric.h"
20 #include "cxOptionalValue.h"
22 
23 namespace cx
24 {
25 struct CoordinateSystem;
26 
33 typedef boost::shared_ptr<class PointMetric> PointMetricPtr;
34 
42 class cxResource_EXPORT PointMetric: public DataMetric
43 {
44 Q_OBJECT
45 public:
46  virtual ~PointMetric();
47  static PointMetricPtr create(QString uid, QString name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider);
48  virtual QString getParentSpace();
49 
50  void setCoordinate(const Vector3D& p);
51  Vector3D getCoordinate() const;
52  void setSpace(CoordinateSystem space); // use parentframe from Data
53  CoordinateSystem getSpace() const; // use parentframe from Data
54  virtual QString getType() const
55  {
56  return getTypeName();
57  }
58  static QString getTypeName()
59  {
60  return "pointMetric";
61  }
62  virtual QIcon getIcon() {return QIcon(":/icons/metric_point.png");}
63  virtual Vector3D getRefCoord() const;
64 
65  virtual void addXml(QDomNode& dataNode);
66  virtual void parseXml(QDomNode& dataNode);
67  virtual DoubleBoundingBox3D boundingBox() const;
68 
69  virtual QString getValueAsString() const;
70  virtual bool showValueInGraphics() const { return false; }
71 
72 private slots:
73  void resetCachedValues();
74 private:
75  PointMetric(const QString& uid, const QString& name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider);
76  Vector3D mCoordinate;
77  CoordinateSystem mSpace;
78  SpaceListenerPtr mSpaceListener;
79  mutable OptionalValue<Vector3D> mCachedRefCoord;
80 };
81 
85 }
86 
87 #endif /* CXPOINTMETRIC_H_ */
cx::OptionalValue< Vector3D >
cx::SpaceListenerPtr
boost::shared_ptr< class SpaceListener > SpaceListenerPtr
Definition: cxAxisConnector.h:23
cx::DoubleBoundingBox3D
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,...
Definition: cxBoundingBox3D.h:63
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxPrecompiledHeader.h
cxDataMetric.h
cx::PointMetric::getTypeName
static QString getTypeName()
Definition: cxPointMetric.h:58
cx::PatientModelServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Definition: cxLogicManager.h:25
cxCoordinateSystemHelpers.h
cxOptionalValue.h
cx::DataMetric
Base class for all Data Metrics.
Definition: cxDataMetric.h:43
cx::PointMetric::getIcon
virtual QIcon getIcon()
Definition: cxPointMetric.h:62
cx::PointMetric
Data class that represents a single point.
Definition: cxPointMetric.h:42
cx::PointMetric::showValueInGraphics
virtual bool showValueInGraphics() const
Definition: cxPointMetric.h:70
cx::PointMetric::getType
virtual QString getType() const
Definition: cxPointMetric.h:54
cx::PointMetricPtr
boost::shared_ptr< class PointMetric > PointMetricPtr
Definition: cxForwardDeclarations.h:84
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::CoordinateSystem
Identification of a Coordinate system.
Definition: cxCoordinateSystemHelpers.h:31