本文整理汇总了C++中ToolPtr类的典型用法代码示例。如果您正苦于以下问题:C++ ToolPtr类的具体用法?C++ ToolPtr怎么用?C++ ToolPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ToolPtr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: tool_t
/**Move the tool pos / axis pos to a new position given
* by the input click position in vp space.
*/
void ViewWrapper2D::setAxisPos(Vector3D click_vp)
{
ToolPtr tool = mServices->getToolManager()->getManualTool();
Transform3D sMr = mSliceProxy->get_sMr();
Transform3D rMpr = mServices->getPatientService()->get_rMpr();
Transform3D prMt = tool->get_prMt();
// find tool position in s
Vector3D tool_t(0, 0, tool->getTooltipOffset());
Vector3D tool_s = (sMr * rMpr * prMt).coord(tool_t);
// find click position in s.
Transform3D vpMs = mView->get_vpMs();
Vector3D click_s = vpMs.inv().coord(click_vp);
// compute the new tool position in slice space as a synthesis of the plane part of click and the z part of original.
Vector3D cross_s(click_s[0], click_s[1], tool_s[2]);
// compute the position change and transform to patient.
Vector3D delta_s = cross_s - tool_s;
Vector3D delta_pr = (rMpr.inv() * sMr.inv()).vector(delta_s);
// MD is the actual tool movement in patient space, matrix form
Transform3D MD = createTransformTranslate(delta_pr);
// set new tool position to old modified by MD:
tool->set_prMt(MD * prMt);
}
开发者ID:normit-nav,项目名称:CustusX,代码行数:30,代码来源:cxViewWrapper2D.cpp
示例2: calibrateSlot
void ToolTipCalibrateWidget::calibrateSlot()
{
ToolPtr refTool = mTools->getTool();
//Todo, we only allow the reference point with id 1 to be used to calibrate
//this could be done more dynamic.
if(!refTool || !refTool->hasReferencePointWithId(1))
return;
ToolPtr tool = mServices->tracking()->getActiveTool();
CoordinateSystem to = mServices->spaceProvider()->getT(tool);
Vector3D P_t = mServices->spaceProvider()->getActiveToolTipPoint(to);
ToolTipCalibrationCalculator calc(mServices->spaceProvider(), tool, refTool, P_t);
Transform3D calibration = calc.get_calibration_sMt();
QMessageBox msgBox;
msgBox.setText("Do you want to overwrite "+tool->getName()+"s calibration file?");
msgBox.setInformativeText("This cannot be undone.");
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Ok);
int ret = msgBox.exec();
if(ret == QMessageBox::Ok)
{
tool->setCalibration_sMt(calibration);
mCalibrationLabel->setText("Calibration:\n"+qstring_cast(calibration));
}
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:28,代码来源:cxToolTipCalibrationWidget.cpp
示例3: updateStatus
/** extract information from the IGTLinkUSStatusMessage
* and store locally. Also reset the old local info with
* information from the probe in toolmanager.
*/
void VideoConnection::updateStatus(ProbeDefinitionPtr msg)
{
ToolPtr tool = mBackend->tracking()->getFirstProbe();
if (!tool || !tool->getProbe())
{
//Don't throw away the ProbeDefinition. Save it until it can be used
if (mUnusedProbeDefinitionVector.empty())
connect(mBackend->tracking().get(), &TrackingService::stateChanged, this, &VideoConnection::useUnusedProbeDefinitionSlot);
mUnusedProbeDefinitionVector.push_back(msg);
return;
}
ProbePtr probe = tool->getProbe();
// start with getting a valid data object from the probe, in order to keep
// existing values (such as temporal calibration).
// Note that the 'active' data is get while the 'uid' data is set.
ProbeDefinition data = probe->getProbeDefinition();
data.setUid(msg->getUid());
data.setType(msg->getType());
data.setSector(msg->getDepthStart(), msg->getDepthEnd(), msg->getWidth());
data.setOrigin_p(msg->getOrigin_p());
data.setSize(msg->getSize());
data.setSpacing(msg->getSpacing());
data.setClipRect_p(msg->getClipRect_p());
data.setUseDigitalVideo(true);
probe->setProbeDefinition(data);
probe->setActiveStream(msg->getUid());
}
开发者ID:SINTEFMedtek,项目名称:CustusX,代码行数:34,代码来源:cxVideoConnection.cpp
示例4: getNullObject
ToolPtr Tool::getNullObject()
{
static ToolPtr mNull;
if (!mNull)
mNull.reset(new ToolNull, null_deleter());
return mNull;
}
开发者ID:normit-nav,项目名称:CustusX,代码行数:7,代码来源:cxTool.cpp
示例5: FindActiveTool
void ToolTabsContainerWidget::CallOnActiveTools( ToolFunction& func )
{
const ToolPtr activeTab = FindActiveTool();
if ( activeTab != 0 )
{
activeTab->CallOnSelfAndActiveSubTools( func );
}
}
开发者ID:Bullatov,项目名称:gts,代码行数:8,代码来源:ToolTabsContainerWidget.cpp
示例6: enableToolSampleButtonSlot
void FastOrientationRegistrationWidget::enableToolSampleButtonSlot()
{
ToolPtr tool = mServices->tracking()->getActiveTool();
bool enabled = tool &&
tool->getVisible() &&
(!tool->hasType(Tool::TOOL_MANUAL) || settings()->value("giveManualToolPhysicalProperties").toBool()); // enable only for non-manual tools.
mSetOrientationButton->setEnabled(enabled);
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:9,代码来源:cxFastOrientationRegistrationWidget.cpp
示例7: matrixWidgetChanged
void ToolManualCalibrationWidget::matrixWidgetChanged()
{
ToolPtr tool = mTool->getTool();
if (!tool)
return;
Transform3D M = mMatrixWidget->getMatrix();
tool->setCalibration_sMt(M);
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:9,代码来源:cxToolManualCalibrationWidget.cpp
示例8: qstring_cast
QString StringPropertySelectTool::convertInternal2Display(QString internal)
{
ToolPtr tool = mTrackingService->getTool(internal);
if (!tool)
{
return "<no tool>";
}
return qstring_cast(tool->getName());
}
开发者ID:normit-nav,项目名称:CustusX,代码行数:9,代码来源:cxStringPropertySelectTool.cpp
示例9: mBase
PlaybackTool::PlaybackTool(ToolPtr base, PlaybackTimePtr time) :
ToolImpl(base->getUid(), "playback "+base->getName()), mBase(base),
mTime(time),
mVisible(false)
{
connect(mTime.get(), SIGNAL(changed()), this, SLOT(timeChangedSlot()));
connect(mBase.get(), SIGNAL(toolProbeSector()), this, SIGNAL(toolProbeSector()));
connect(mBase.get(), SIGNAL(tooltipOffset(double)), this, SIGNAL(tooltipOffset(double)));
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:10,代码来源:cxPlaybackTool.cpp
示例10: findVirtualTooltip_s
Vector3D ViewFollower::findVirtualTooltip_s()
{
ToolPtr tool = mSliceProxy->getTool();
Transform3D sMr = mSliceProxy->get_sMr();
Transform3D rMpr = mDataManager->get_rMpr();
Transform3D prMt = tool->get_prMt();
Vector3D pt_s = sMr * rMpr * prMt.coord(Vector3D(0,0,tool->getTooltipOffset()));
pt_s[2] = 0; // project into plane
return pt_s;
}
开发者ID:SINTEFMedtek,项目名称:CustusX,代码行数:10,代码来源:cxViewFollower.cpp
示例11: toolCalibrationChanged
void ToolManualCalibrationWidget::toolCalibrationChanged()
{
ToolPtr tool = mTool->getTool();
if (!tool)
return;
mMatrixWidget->blockSignals(true);
mMatrixWidget->setMatrix(tool->getCalibration_sMt());
mMatrixWidget->blockSignals(false);
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:10,代码来源:cxToolManualCalibrationWidget.cpp
示例12: updateToolSampleButton
void PatientLandMarksWidget::updateToolSampleButton()
{
ToolPtr tool = mServices->tracking()->getActiveTool();
bool enabled = tool && tool->getVisible() && (!tool->hasType(Tool::TOOL_MANUAL) || settings()->value("giveManualToolPhysicalProperties").toBool()); // enable only for non-manual tools.
mToolSampleButton->setEnabled(enabled);
if (mServices->tracking()->getActiveTool())
mToolSampleButton->setText("Sample " + qstring_cast(tool->getName()));
else
mToolSampleButton->setText("No tool");
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:12,代码来源:cxPatientLandMarksWidget.cpp
示例13: connectVideoToProbe
/** Imbue probe with all stream and probe info from grabber.
*
* Call when active probe is changed or when streaming config is changed (new streams, new probeDefinition)
*
* Find the active probe, then insert all current streams into that probe.
*
*/
void VideoConnection::connectVideoToProbe()
{
ToolPtr tool = mBackend->tracking()->getFirstProbe();
if (!tool)
return;
ProbePtr probe = tool->getProbe();
if (!probe)
return;
for (unsigned i=0; i<mSources.size(); ++i)
probe->setRTSource(mSources[i]);
}
开发者ID:SINTEFMedtek,项目名称:CustusX,代码行数:20,代码来源:cxVideoConnection.cpp
示例14: resetProbe
void VideoConnection::resetProbe()
{
ToolPtr tool = mBackend->tracking()->getFirstProbe();
if (!tool || !tool->getProbe())
return;
ProbePtr probe = tool->getProbe();
if (probe)
{
ProbeDefinition data = probe->getProbeDefinition();
data.setUseDigitalVideo(false);
probe->setProbeDefinition(data);
}
}
开发者ID:SINTEFMedtek,项目名称:CustusX,代码行数:13,代码来源:cxVideoConnection.cpp
示例15: foreach
VideoSourcePtr VideoImplService::getGuessForActiveVideoSource(VideoSourcePtr old)
{
if(old && old->getUid().contains("playback"))
return old;
QStringList nameFilters;
nameFilters << "TissueAngio.fts" << "TissueFlow.fts" << "ScanConverted.fts";
// ask for playback stream:
foreach(USAcquisitionVideoPlaybackPtr uSAcquisitionVideoPlayback,mUSAcquisitionVideoPlaybacks)
{
if (uSAcquisitionVideoPlayback->isActive() && nameFilters.contains(uSAcquisitionVideoPlayback->getType()) )
return uSAcquisitionVideoPlayback->getVideoSource();
}
// ask for playback stream:
foreach(USAcquisitionVideoPlaybackPtr uSAcquisitionVideoPlayback,mUSAcquisitionVideoPlaybacks)
{
if (uSAcquisitionVideoPlayback->isActive())
return uSAcquisitionVideoPlayback->getVideoSource();
}
// ask for active stream in first probe:
ToolPtr tool = mBackend->tracking()->getFirstProbe();
if (tool && tool->getProbe() && tool->getProbe()->getRTSource())
{
// keep existing if present
if (old)
{
if (tool->getProbe()->getAvailableVideoSources().count(old->getUid()))
return old;
}
return tool->getProbe()->getRTSource();
}
std::vector<VideoSourcePtr> allSources = this->getVideoSources();
// keep existing if present
if (old)
{
if (std::count(allSources.begin(), allSources.end(), old))
return old;
}
// ask for anything
if (!allSources.empty())
return allSources.front();
// give up: return empty
return mEmptyVideoSource;
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:50,代码来源:cxVideoImplService.cpp
示例16: Q_UNUSED
void ToolTabsContainerWidget::CurrentTabChanged( const int newTabIndex )
{
Q_UNUSED(newTabIndex);
if ( m_mainWindow )
{
m_mainWindow->Reload();
}
const ToolPtr activeTab = FindActiveTool();
if ( activeTab != 0 )
{
activeTab->Activated();
}
}
开发者ID:Bullatov,项目名称:gts,代码行数:15,代码来源:ToolTabsContainerWidget.cpp
示例17: testCalibrationSlot
void ToolTipCalibrateWidget::testCalibrationSlot()
{
ToolPtr selectedTool = mTools->getTool();
if(!selectedTool || !selectedTool->hasReferencePointWithId(1))
return;
CoordinateSystem to = mServices->spaceProvider()->getT(mServices->tracking()->getActiveTool());
Vector3D sampledPoint = mServices->spaceProvider()->getActiveToolTipPoint(to);
ToolTipCalibrationCalculator calc(mServices->spaceProvider(), mServices->tracking()->getActiveTool(), selectedTool, sampledPoint);
Vector3D delta_selectedTool = calc.get_delta_ref();
mDeltaLabel->setText("<b>Delta:</b> "+qstring_cast(delta_selectedTool)+" <br> <b>Length:</b> "+qstring_cast(delta_selectedTool.length()));
report("Delta: "+qstring_cast(delta_selectedTool)+" Length: "+qstring_cast(delta_selectedTool.length()));
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:16,代码来源:cxToolTipCalibrationWidget.cpp
示例18: RepContainer
void ViewWrapper3D::toolsAvailableSlot()
{
std::vector<ToolRep3DPtr> reps = RepContainer::findReps<ToolRep3D>(mView->getReps());
TrackingService::ToolMap tools = mServices->tracking()->getTools();
TrackingService::ToolMap::iterator iter;
for (iter = tools.begin(); iter != tools.end(); ++iter)
{
ToolPtr tool = iter->second;
if (tool->hasType(Tool::TOOL_REFERENCE))
continue;
ToolRep3DPtr toolRep = RepContainer(mView->getReps()).findFirst<ToolRep3D>(tool);
std::vector<ToolRep3DPtr>::iterator oldRep = std::find(reps.begin(), reps.end(), toolRep);
if (oldRep!=reps.end())
reps.erase(oldRep);
if (tool->hasType(Tool::TOOL_MANUAL) && !settings()->value("showManualTool").toBool())
{
if (toolRep)
mView->removeRep(toolRep);
continue;
}
// mManualTool->setVisible(settings()->value("showManualTool").toBool());
if (!toolRep)
{
toolRep = ToolRep3D::New(mServices->spaceProvider(), tool->getUid() + "_rep3d_" + this->mView->getUid());
if (settings()->value("showToolPath").toBool())
toolRep->getTracer()->start();
}
toolRep->setSphereRadius(settings()->value("View3D/sphereRadius").toDouble()); // use fraction of set size
toolRep->setSphereRadiusInNormalizedViewport(true);
toolRep->setTool(tool);
toolRep->setOffsetPointVisibleAtZeroOffset(true);
mView->addRep(toolRep);
}
// remove reps for tools no longer present
for (unsigned i=0; i<reps.size(); ++i)
{
mView->removeRep(reps[i]);
}
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:47,代码来源:cxViewWrapper3D.cpp
示例19: getParent
TreeNodePtr ToolTreeNode::getParent() const
{
if (this->repo()->getMode()=="flat")
return this->repo()->getNodeForGroup("tool");
if (mTool->getUid() == this->getServices()->tracking()->getManualTool()->getUid())
return this->repo()->getNode(CoordinateSystem(csPATIENTREF).toString());
if (mTool->hasType(Tool::TOOL_REFERENCE))
return this->repo()->getNode(CoordinateSystem(csPATIENTREF).toString());
ToolPtr ref = this->getServices()->tracking()->getReferenceTool();
if (ref)
return this->repo()->getNode(ref->getUid());
return this->repo()->getNode(CoordinateSystem(csPATIENTREF).toString());
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:17,代码来源:cxToolTreeNode.cpp
示例20: createTransformTranslate
/**Move the tool pos / axis pos to a new position given
* by delta movement in vp space.
*/
void ViewWrapper2D::shiftAxisPos(Vector3D delta_vp)
{
delta_vp = -delta_vp;
ToolPtr tool = mServices->getToolManager()->getManualTool();
Transform3D sMr = mSliceProxy->get_sMr();
Transform3D rMpr = mServices->getPatientService()->get_rMpr();
Transform3D prMt = tool->get_prMt();
Transform3D vpMs = mView->get_vpMs();
Vector3D delta_s = vpMs.inv().vector(delta_vp);
Vector3D delta_pr = (rMpr.inv() * sMr.inv()).vector(delta_s);
// MD is the actual tool movement in patient space, matrix form
Transform3D MD = createTransformTranslate(delta_pr);
// set new tool position to old modified by MD:
tool->set_prMt(MD * prMt);
}
开发者ID:normit-nav,项目名称:CustusX,代码行数:21,代码来源:cxViewWrapper2D.cpp
注:本文中的ToolPtr类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论