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


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

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


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

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

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

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


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