12 #define _USE_MATH_DEFINES 16 #include <QStringList> 17 #include <QTextStream> 31 mValid(false), mConfigured(false), mTracked(false)
36 mValid = igstkTool->isValid();
41 &ToolUsingIGSTK::toolTransformAndTimestampSlot);
43 connect(mTool.get(), SIGNAL(
toolVisible(
bool)),
this, SLOT(toolVisibleSlot(
bool)));
45 connect(&mTpsTimer, SIGNAL(timeout()),
this, SLOT(calculateTpsSlot()));
51 connect(mProbe.get(), SIGNAL(sectorChanged()),
this, SIGNAL(
toolProbeSector()));
66 return mTool->isVisible();
71 return mTool->isInitialized();
87 return this->
getProbe()->getProbeDefinition().getDepthStart();
107 return !
similar(sMt, identity);
119 mTool->updateCalibration(calibration);
132 void ToolUsingIGSTK::printInternalStructure()
134 mTool->printInternalStructure();
139 return mTool->getInternalStructure();
144 QDomDocument doc = dataNode.ownerDocument();
146 if (mProbe && mProbe->isValid())
148 QDomElement probeNode = doc.createElement(
"probe");
149 mProbe->addXml(probeNode);
150 dataNode.appendChild(probeNode);
156 if (dataNode.isNull())
160 QDomNode probeNode = dataNode.namedItem(
"probe");
161 mProbe->parseXml(probeNode);
175 mTimestamp = timestamp;
180 (*mPositionHistory)[timestamp] = matrix;
187 void ToolUsingIGSTK::calculateTpsSlot()
192 if ( numberOfTransformsToCheck <= 1)
199 double lastTransform = it->first;
200 for (
size_t i = 0; i < numberOfTransformsToCheck; ++i)
202 double firstTransform = it->first;
203 double secondsPassed = (lastTransform - firstTransform) / 1000;
205 if (!
similar(secondsPassed, 0))
206 tpsNr =
int(numberOfTransformsToCheck / secondsPassed);
211 void ToolUsingIGSTK::toolVisibleSlot(
bool on)
214 mTpsTimer.start(1000);
QString qstring_cast(const T &val)
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class IgstkTool > IgstkToolPtr
boost::shared_ptr< Probe > ProbePtr
static ProbeImplPtr New(QString instrumentUid, QString scannerUid, ProbeXmlConfigParserPtr xml=ProbeXmlConfigParserPtr())
bool similar(const CameraInfo &lhs, const CameraInfo &rhs, double tol)
Namespace for all CustusX production code.