本文整理汇总了C++中ToolPtr::getTooltipOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolPtr::getTooltipOffset方法的具体用法?C++ ToolPtr::getTooltipOffset怎么用?C++ ToolPtr::getTooltipOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToolPtr
的用法示例。
在下文中一共展示了ToolPtr::getTooltipOffset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: 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;
}
示例3: setManualToolPosition
void LandmarkRegistrationWidget::setManualToolPosition(Vector3D p_r)
{
Transform3D rMpr = mServices->patient()->get_rMpr();
Vector3D p_pr = rMpr.inv().coord(p_r);
// set the picked point as offset tip
ToolPtr tool = mServices->tracking()->getManualTool();
Vector3D offset = tool->get_prMt().vector(Vector3D(0, 0, tool->getTooltipOffset()));
p_pr -= offset;
p_r = rMpr.coord(p_pr);
// TODO set center here will not do: must handle
mServices->patient()->setCenter(p_r);
Vector3D p0_pr = tool->get_prMt().coord(Vector3D(0, 0, 0));
tool->set_prMt(createTransformTranslate(p_pr - p0_pr) * tool->get_prMt());
}
示例4: toolSampleButtonClickedSlot
void PatientLandMarksWidget::toolSampleButtonClickedSlot()
{
ToolPtr tool = mServices->tracking()->getActiveTool();
if (!tool)
{
reportError("mToolToSample is NULL!");
return;
}
//TODO What if the reference frame isnt visible?
Transform3D lastTransform_prMt = tool->get_prMt();
Vector3D p_pr = lastTransform_prMt.coord(Vector3D(0, 0, tool->getTooltipOffset()));
// TODO: do we want to allow sampling points not defined in image??
if (mActiveLandmark.isEmpty() && !mServices->patient()->getLandmarkProperties().empty())
mActiveLandmark = mServices->patient()->getLandmarkProperties().begin()->first;
mServices->patient()->getPatientLandmarks()->setLandmark(Landmark(mActiveLandmark, p_pr));
reporter()->playSampleSound();
this->activateLandmark(this->getNextLandmark());
this->performRegistration(); // automatic when sampling in physical patient space (Mantis #0000674)s
}