当前位置: 首页>>代码示例>>C++>>正文


C++ ToolPtr::hasReferencePointWithId方法代码示例

本文整理汇总了C++中ToolPtr::hasReferencePointWithId方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolPtr::hasReferencePointWithId方法的具体用法?C++ ToolPtr::hasReferencePointWithId怎么用?C++ ToolPtr::hasReferencePointWithId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ToolPtr的用法示例。


在下文中一共展示了ToolPtr::hasReferencePointWithId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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

示例2: 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

示例3: toolSelectedSlot

void ToolTipCalibrateWidget::toolSelectedSlot()
{
  QString text("Ref. point: <UNDEFINED POINT>");
  mCalibrateButton->setEnabled(false);

  if(mTools->getTool())
  {
	ToolPtr tool = mTools->getTool();
    if(tool && tool->hasReferencePointWithId(1))
    {
      text = "Ref. point: "+qstring_cast(tool->getReferencePoints()[1]);
      mCalibrateButton->setEnabled(true);
    }
    else
		reportWarning("Selected tool have no known reference point");
    if(tool)
    {
      mCalibrationLabel->setText("Calibration:\n"+qstring_cast(tool->getCalibration_sMt()));
    }
  }

  mReferencePointLabel->setText(text);
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:23,代码来源:cxToolTipCalibrationWidget.cpp


注:本文中的ToolPtr::hasReferencePointWithId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。