本文整理汇总了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]);
}
}
示例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);
}
示例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");
}