Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxShapedMetric.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 #ifndef CXSHAPEDMETRIC_H
12 #define CXSHAPEDMETRIC_H
13 
14 #include "cxResourceExport.h"
15 #include "cxPrecompiledHeader.h"
16 
17 #include "cxDataMetric.h"
18 #include "cxPointMetric.h"
20 
21 namespace cx
22 {
29 typedef boost::shared_ptr<class DonutMetric> DonutMetricPtr;
30 
40 class cxResource_EXPORT DonutMetric: public DataMetric
41 {
42 Q_OBJECT
43 public:
44  virtual ~DonutMetric();
45  static DonutMetricPtr create(QString uid, QString name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider);
46 
47  virtual bool isValid() const;
48  virtual QIcon getIcon() {return QIcon(":/icons/metric_torus.png");}
49 
50  void setRadius(double val);
51  double getRadius() const;
52  void setThickness(double val);
53  double getThickness() const;
54  void setHeight(double val);
55  double getHeight() const;
56  bool getFlat() const;
57  void setFlat(bool val);
58 
59  Vector3D getPosition();
60  Vector3D getDirection();
61 
63  virtual void addXml(QDomNode& dataNode);
64  virtual void parseXml(QDomNode& dataNode);
65  virtual DoubleBoundingBox3D boundingBox() const;
66  virtual Vector3D getRefCoord() const;
67  virtual QString getType() const
68  {
69  return getTypeName();
70  }
71  static QString getTypeName()
72  {
73  return "DonutMetric";
74  }
75  virtual QString getValueAsString() const { return ""; }
76  virtual bool showValueInGraphics() const { return false; }
77 
78 private:
79  DonutMetric(const QString& uid, const QString& name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider);
81  double mRadius;
82  double mThickness;
83  double mHeight;
84  bool mFlat;
85 };
86 
90 } // namespace cx
91 
92 #endif // CXSHAPEDMETRIC_H
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
boost::shared_ptr< class DonutMetric > DonutMetricPtr
virtual QString getType() const
static QString getTypeName()
MetricReferenceArgumentListPtr getArguments()
virtual QString getValueAsString() const
Data class that represents a donut.
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.
virtual bool showValueInGraphics() const
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
virtual QIcon getIcon()
Base class for all Data Metrics.
Definition: cxDataMetric.h:43
Namespace for all CustusX production code.