Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxFrameMetric.cpp
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 #include "cxFrameMetric.h"
13 #include "cxTool.h"
14 #include "cxTypeConversions.h"
15 
16 namespace cx
17 {
18 
19 FrameMetricPtr FrameMetric::create(QString uid, QString name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider)
20 {
21  return FrameMetricPtr(new FrameMetric(uid, name, dataManager, spaceProvider));
22 }
23 
24 FrameMetric::FrameMetric(const QString& uid, const QString& name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider) :
25  cx::FrameMetricBase(uid, name, dataManager, spaceProvider)
26 {
27 }
28 
30 {
31 }
32 
33 void FrameMetric::addXml(QDomNode& dataNode)
34 {
35  DataMetric::addXml(dataNode);
36 
37  dataNode.toElement().setAttribute("space", mSpace.toString());
38  dataNode.toElement().setAttribute("frame", qstring_cast(mFrame));
39 }
40 
41 void FrameMetric::parseXml(QDomNode& dataNode)
42 {
43  DataMetric::parseXml(dataNode);
44 
45  this->setSpace(CoordinateSystem::fromString(dataNode.toElement().attribute("space", mSpace.toString())));
46  this->setFrame(Transform3D::fromString(dataNode.toElement().attribute("frame", qstring_cast(mFrame))));
47 }
48 
49 
50 } //namespace cx
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
QString qstring_cast(const T &val)
virtual void setFrame(const Transform3D &qMt)
void addXml(QDomNode &dataNode)
adds xml information about the data and its variabels
boost::shared_ptr< class FrameMetric > FrameMetricPtr
Definition: cxFrameMetric.h:23
CoordinateSystem mSpace
virtual void setSpace(CoordinateSystem space)
Data class that represents a single frame (transform).
Definition: cxFrameMetric.h:33
virtual void parseXml(QDomNode &dataNode)
Use a XML node to load data.
void parseXml(QDomNode &dataNode)
Use a XML node to load data.
virtual ~FrameMetric()
virtual void addXml(QDomNode &dataNode)
adds xml information about the data and its variabels
Abstract base class for frame metric.
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
static FrameMetricPtr create(QString uid, QString name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider)
static CoordinateSystem fromString(QString text)
Namespace for all CustusX production code.
Transform3D mFrame
frame qFt described in local space q = mSpace