44 DataMetric(uid, name, dataManager, spaceProvider)
46 mArguments.reset(
new MetricReferenceArgumentList(QStringList() <<
"position" <<
"direction"));
47 connect(mArguments.get(), SIGNAL(argumentsChanged()),
this, SIGNAL(transformChanged()));
67 mArguments->addXml(dataNode);
68 dataNode.toElement().setAttribute(
"radius", mRadius);
69 dataNode.toElement().setAttribute(
"thickness", mThickness);
70 dataNode.toElement().setAttribute(
"height", mHeight);
71 dataNode.toElement().setAttribute(
"flat", mFlat);
79 mRadius = dataNode.toElement().attribute(
"radius",
qstring_cast(mRadius)).toDouble();
80 mThickness = dataNode.toElement().attribute(
"thickness",
qstring_cast(mThickness)).toDouble();
81 mHeight = dataNode.toElement().attribute(
"height",
qstring_cast(mHeight)).toDouble();
82 mFlat = dataNode.toElement().attribute(
"flat",
qstring_cast(mFlat)).toInt();
87 return !mArguments->getRefCoords().empty();
92 return mArguments->getRefCoords().front();
102 std::vector<Vector3D> coords = mArguments->getRefCoords();
104 return Vector3D::Zero();
110 std::vector<Vector3D> coords = mArguments->getRefCoords();
112 return Vector3D::UnitZ();
113 Vector3D diff = (coords[1]-coords[0]);
114 if (
similar(diff.length(), 0.0))
116 return diff.normal();
122 return QString(
"%1 %2")
boost::shared_ptr< class SpaceProvider > SpaceProviderPtr
QString qstring_cast(const T &val)
virtual DoubleBoundingBox3D boundingBox() const
virtual void parseXml(QDomNode &dataNode)
Use a XML node to load data.
void addXml(QDomNode &dataNode)
adds xml information about the data and its variabels
boost::shared_ptr< class DonutMetric > DonutMetricPtr
void propertiesChanged()
emitted when one of the metadata properties (uid, name etc) changes
virtual Vector3D getRefCoord() const
double getThickness() const
PatientModelServicePtr mDataManager
static DoubleBoundingBox3D fromCloud(std::vector< Vector3D > cloud)
bool similar(const DoubleBoundingBox3D &a, const DoubleBoundingBox3D &b, double tol)
void parseXml(QDomNode &dataNode)
Use a XML node to load data.
virtual QString getAsSingleLineString() const
virtual void addXml(QDomNode &dataNode)
adds xml information about the data and its variabels
Data class that represents a donut.
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
static DonutMetricPtr create(QString uid, QString name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider)
QString getSingleLineHeader() const
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.
cxLogicManager_EXPORT SpaceProviderPtr spaceProvider()
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
void setRadius(double val)
void setThickness(double val)
void setHeight(double val)
virtual bool isValid() const