Fraxinus  16.5.0-fx-rc5
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxMetricManager.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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 #ifndef CXMETRICMANAGER_H
34 #define CXMETRICMANAGER_H
35 
36 #include "cxGuiExport.h"
37 
38 #include "cxForwardDeclarations.h"
39 #include "cxDataMetric.h"
40 #include "cxDefinitions.h"
42 
43 namespace cx
44 {
45 typedef boost::shared_ptr<class MetricReferenceArgumentList> MetricReferenceArgumentListPtr;
46 typedef boost::shared_ptr<class MetricManager> MetricManagerPtr;
47 typedef boost::shared_ptr<class DataFactory> DataFactoryPtr;
48 
56 class cxGui_EXPORT MetricManager : public QObject
57 {
58  Q_OBJECT
59 public:
60  MetricManager();
61 
62  DataMetricPtr getMetric(QString uid);
63  void moveToMetric(QString uid);
64  void setSelection(std::set<QString> selection);
65  void setActiveUid(QString uid);
66  QString getActiveUid() const { return mActiveLandmark; }
67  void exportMetricsToFile(QString filename);
68  PointMetricPtr addPoint(Vector3D point, CoordinateSystem space=CoordinateSystem(csREF), QString uid="point%1", QColor color = QColor(240, 170, 255, 255));
69 
70 signals:
71  void activeMetricChanged();
72  void metricsChanged();
73 
74 public slots:
75  void loadReferencePointsSlot();
76  void addPointButtonClickedSlot();
77  void addFrameButtonClickedSlot();
78  void addToolButtonClickedSlot();
79  void addPlaneButtonClickedSlot();
80  void addAngleButtonClickedSlot();
81  void addDistanceButtonClickedSlot();
82  void addSphereButtonClickedSlot();
83  void addDonutButtonClickedSlot();
84 
85 private:
86  void setManualToolPosition(Vector3D p_r);
87  std::vector<DataPtr> refinePointArguments(std::vector<DataPtr> args, unsigned argNo);
88  std::vector<DataPtr> getSpecifiedNumberOfValidArguments(MetricReferenceArgumentListPtr arguments, int numberOfRequiredArguments=-1);
89  void installNewMetric(DataMetricPtr metric);
90  PointMetricPtr addPointInDefaultPosition();
91  std::vector<DataMetricPtr> getAllMetrics();
92 // DataFactoryPtr getDataFactory();
93 
94  QString mActiveLandmark;
95  std::set<QString> mSelection;
96 };
97 
98 
99 } // namespace cx
100 
101 #endif // CXMETRICMANAGER_H
boost::shared_ptr< DataMetric > DataMetricPtr
Definition: cxDataMetric.h:95
csREF
the data reference space (r) using LPS (left-posterior-superior) coordinates.
boost::shared_ptr< class MetricManager > MetricManagerPtr
boost::shared_ptr< class MetricReferenceArgumentList > MetricReferenceArgumentListPtr
Identification of a Coordinate system.
QString getActiveUid() const
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:63
boost::shared_ptr< class DataFactory > DataFactoryPtr
boost::shared_ptr< class PointMetric > PointMetricPtr