23 DataMetric(uid, name, dataManager, spaceProvider)
25 mArguments.reset(
new MetricReferenceArgumentList(QStringList() <<
"position" <<
"direction"));
26 connect(mArguments.get(), SIGNAL(argumentsChanged()),
this, SIGNAL(transformChanged()));
46 mArguments->addXml(dataNode);
47 dataNode.toElement().setAttribute(
"radius", mRadius);
48 dataNode.toElement().setAttribute(
"thickness", mThickness);
49 dataNode.toElement().setAttribute(
"height", mHeight);
50 dataNode.toElement().setAttribute(
"flat", mFlat);
57 mArguments->parseXml(dataNode, mDataManager->getDatas());
58 mRadius = dataNode.toElement().attribute(
"radius",
qstring_cast(mRadius)).toDouble();
59 mThickness = dataNode.toElement().attribute(
"thickness",
qstring_cast(mThickness)).toDouble();
60 mHeight = dataNode.toElement().attribute(
"height",
qstring_cast(mHeight)).toDouble();
61 mFlat = dataNode.toElement().attribute(
"flat",
qstring_cast(mFlat)).toInt();
66 return !mArguments->getRefCoords().empty();
71 return mArguments->getRefCoords().front();
81 std::vector<Vector3D> coords = mArguments->getRefCoords();
83 return Vector3D::Zero();
89 std::vector<Vector3D> coords = mArguments->getRefCoords();
91 return Vector3D::UnitZ();
92 Vector3D diff = (coords[1]-coords[0]);
93 if (
similar(diff.length(), 0.0))
101 emit propertiesChanged();
112 emit propertiesChanged();
123 emit propertiesChanged();
134 emit propertiesChanged();
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
virtual Vector3D getRefCoord() const
double getThickness() const
static DoubleBoundingBox3D fromCloud(std::vector< Vector3D > cloud)
void parseXml(QDomNode &dataNode)
Use a XML node to load data.
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)
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.
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
bool similar(const CameraInfo &lhs, const CameraInfo &rhs, double tol)
void setRadius(double val)
void setThickness(double val)
void setHeight(double val)
virtual bool isValid() const
Namespace for all CustusX production code.