本文整理汇总了C++中ToolPtr::set_prMt方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolPtr::set_prMt方法的具体用法?C++ ToolPtr::set_prMt怎么用?C++ ToolPtr::set_prMt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToolPtr
的用法示例。
在下文中一共展示了ToolPtr::set_prMt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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());
}
示例3: 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);
}