NorMIT-nav  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
cx::FrameMetric::addXml
virtual void addXml(QDomNode &dataNode)
adds xml information about the data and its variabels
Definition: cxFrameMetric.cpp:33
qstring_cast
QString qstring_cast(const T &val)
Definition: cxTypeConversions.h:46
cx::FrameMetricPtr
boost::shared_ptr< class FrameMetric > FrameMetricPtr
Definition: cxFrameMetric.h:23
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxFrameMetric.h
cx::FrameMetric::~FrameMetric
virtual ~FrameMetric()
Definition: cxFrameMetric.cpp:29
cx::FrameMetricBase::mFrame
Transform3D mFrame
frame qFt described in local space q = mSpace
Definition: cxFrameMetricBase.h:55
cx::DataMetric::addXml
void addXml(QDomNode &dataNode)
adds xml information about the data and its variabels
Definition: cxDataMetric.cpp:55
cx::FrameMetricBase::setSpace
virtual void setSpace(CoordinateSystem space)
Definition: cxFrameMetricBase.cpp:74
cx::FrameMetricBase::setFrame
virtual void setFrame(const Transform3D &qMt)
Definition: cxFrameMetricBase.cpp:40
cx::PatientModelServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Definition: cxLogicManager.h:25
cxTool.h
cx::FrameMetric
Data class that represents a single frame (transform).
Definition: cxFrameMetric.h:33
cxTypeConversions.h
cx::FrameMetricBase
Abstract base class for frame metric.
Definition: cxFrameMetricBase.h:30
cx::FrameMetric::parseXml
virtual void parseXml(QDomNode &dataNode)
Use a XML node to load data.
Definition: cxFrameMetric.cpp:41
cx::CoordinateSystem::fromString
static CoordinateSystem fromString(QString text)
Definition: cxCoordinateSystemHelpers.cpp:24
cx::CoordinateSystem::toString
QString toString() const
Definition: cxCoordinateSystemHelpers.cpp:19
cx::FrameMetric::create
static FrameMetricPtr create(QString uid, QString name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider)
Definition: cxFrameMetric.cpp:19
cx::FrameMetricBase::mSpace
CoordinateSystem mSpace
Definition: cxFrameMetricBase.h:53
cx::DataMetric::parseXml
void parseXml(QDomNode &dataNode)
Use a XML node to load data.
Definition: cxDataMetric.cpp:65
cx::SpaceProviderPtr
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
Definition: cxLogicManager.h:23