25 DataMetric(uid, name, dataManager, spaceProvider)
27 mUseSimpleVisualization =
false;
28 mArguments.reset(
new MetricReferenceArgumentList(QStringList() <<
"point 0" <<
"point 1" <<
"point 2" <<
"point 3"));
30 connect(mArguments.get(), SIGNAL(argumentsChanged()),
this, SLOT(resetCachedValues()));
31 connect(mArguments.get(), SIGNAL(argumentsChanged()),
this, SIGNAL(
transformChanged()));
46 mArguments->addXml(dataNode);
47 dataNode.toElement().setAttribute(
"useSimpleVisualization", QString::number(mUseSimpleVisualization));
54 mArguments->parseXml(dataNode,
mDataManager->getDatas());
56 mUseSimpleVisualization = dataNode.toElement().attribute(
"useSimpleVisualization", QString::number(mUseSimpleVisualization)).toInt();
57 this->resetCachedValues();
60 void AngleMetric::resetCachedValues()
62 mCachedEndPoints.
reset();
72 if (!mCachedEndPoints.
isValid())
74 mCachedEndPoints.
set(mArguments->getRefCoords());
76 return mCachedEndPoints.
get();
91 Vector3D a = (p[0] - p[1]).normalized();
92 Vector3D b = (p[3] - p[2]).normalized();
94 double angle = acos(
dot(a, b) / a.length() / b.length());
100 return QString(
"%1*").arg(this->
getAngle() /
M_PI * 180, 0,
'f', 1);
110 return mUseSimpleVisualization;
115 mUseSimpleVisualization = val;