本文整理汇总了C++中mitk::datanode::Pointer::GetFloatProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::GetFloatProperty方法的具体用法?C++ Pointer::GetFloatProperty怎么用?C++ Pointer::GetFloatProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mitk::datanode::Pointer
的用法示例。
在下文中一共展示了Pointer::GetFloatProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void mitk::USZonesInteractor::UpdateSurface(mitk::DataNode::Pointer dataNode)
{
if (!dataNode->GetData())
{
MITK_WARN("USZonesInteractor")("DataInteractor")
<< "Cannot update surface for node as no data is set to the node.";
return;
}
mitk::Point3D origin = dataNode->GetData()->GetGeometry()->GetOrigin();
float radius;
if (!dataNode->GetFloatProperty(DATANODE_PROPERTY_SIZE, radius))
{
MITK_WARN("USZonesInteractor")("DataInteractor")
<< "Cannut update surface for node as no radius is specified in the node properties.";
return;
}
mitk::Surface::Pointer zone = mitk::Surface::New();
// create a vtk sphere with given radius
vtkSphereSource *vtkData = vtkSphereSource::New();
vtkData->SetRadius(radius);
vtkData->SetCenter(0, 0, 0);
vtkData->SetPhiResolution(20);
vtkData->SetThetaResolution(20);
vtkData->Update();
zone->SetVtkPolyData(vtkData->GetOutput());
vtkData->Delete();
// set vtk sphere and origin to data node (origin must be set
// again, because of the new sphere set as data)
dataNode->SetData(zone);
dataNode->GetData()->GetGeometry()->SetOrigin(origin);
// update the RenderWindow to show the changed surface
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}