Fraxinus  22.04-rc5
An IGT application
cxAngleMetric.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 CXANGLEMETRIC_H_
15 #define CXANGLEMETRIC_H_
16 
17 #include "cxResourceExport.h"
18 #include "cxPrecompiledHeader.h"
19 
20 #include "cxDataMetric.h"
21 #include "cxPointMetric.h"
23 #include "cxOptionalValue.h"
24 
25 namespace cx
26 {
33 typedef boost::shared_ptr<class AngleMetric> AngleMetricPtr;
34 
46 class cxResource_EXPORT AngleMetric : public DataMetric
47 {
48 Q_OBJECT
49 public:
50  virtual ~AngleMetric();
51  static AngleMetricPtr create(QString uid, QString name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider);
52 
53  double getAngle() const;
54  std::vector<Vector3D> getEndpoints() const;
55  virtual QIcon getIcon() {return QIcon(":/icons/metric_angle.png");}
57  virtual bool isValid() const;
58 
59  virtual void addXml(QDomNode& dataNode);
60  virtual void parseXml(QDomNode& dataNode);
61  virtual DoubleBoundingBox3D boundingBox() const;
62  virtual Vector3D getRefCoord() const;
63  virtual QString getType() const
64  {
65  return getTypeName();
66  }
67  static QString getTypeName()
68  {
69  return "angleMetric";
70  }
71 
72  virtual QString getValueAsString() const;
73  virtual bool showValueInGraphics() const { return true; }
74  bool getUseSimpleVisualization() const;
75  void setUseSimpleVisualization(bool val);
76 
77 private slots:
78  void resetCachedValues();
79 private:
80  AngleMetric(const QString& uid, const QString& name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider);
81  boost::array<DataPtr, 4> mArgument;
83  bool mUseSimpleVisualization;
84  mutable OptionalValue<std::vector<Vector3D> > mCachedEndPoints;
85 
86 };
87 
91 }
92 
93 #endif /* CXANGLEMETRIC_H_ */
static QString getTypeName()
Definition: cxAngleMetric.h:67
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
virtual QIcon getIcon()
Definition: cxAngleMetric.h:55
virtual bool showValueInGraphics() const
Definition: cxAngleMetric.h:73
MetricReferenceArgumentListPtr getArguments()
Definition: cxAngleMetric.h:56
boost::shared_ptr< class AngleMetric > AngleMetricPtr
Definition: cxAngleMetric.h:33
virtual QString getType() const
Definition: cxAngleMetric.h:63
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
boost::shared_ptr< class MetricReferenceArgumentList > MetricReferenceArgumentListPtr
Representation of a floating-point bounding box in 3D. The data are stored as {xmin,xmax,ymin,ymax,zmin,zmax}, in order to simplify communication with vtk.
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
Base class for all Data Metrics.
Definition: cxDataMetric.h:43
Data class that represents an angle between two lines.
Definition: cxAngleMetric.h:46
Namespace for all CustusX production code.