本文整理汇总了C++中datanode::Pointer::GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::GetProperty方法的具体用法?C++ Pointer::GetProperty怎么用?C++ Pointer::GetProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datanode::Pointer
的用法示例。
在下文中一共展示了Pointer::GetProperty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void mitk::AffineBaseDataInteractor3D::SelectObject(StateMachineAction*, InteractionEvent* interactionEvent)
{
DataNode::Pointer node = this->GetDataNode();
if (node.IsNull())
return;
mitk::ColorProperty::Pointer selectedColor = dynamic_cast<mitk::ColorProperty*>(node->GetProperty(selectedColorPropertyName));
if ( selectedColor.IsNotNull() )
{
node->GetPropertyList()->SetProperty("color", selectedColor);
}
interactionEvent->GetSender()->GetRenderingManager()->RequestUpdateAll();
return;
}
示例2: FindTopmostVisibleNode
mitk::StdFunctionCommand::ActionFunction mitk::DisplayActionEventFunctions::SetLevelWindowAction()
{
auto actionFunction = [](const itk::EventObject& displayInteractorEvent)
{
if (DisplaySetLevelWindowEvent().CheckEvent(&displayInteractorEvent))
{
const DisplaySetLevelWindowEvent* displayActionEvent = dynamic_cast<const DisplaySetLevelWindowEvent*>(&displayInteractorEvent);
const BaseRenderer::Pointer sendingRenderer = displayActionEvent->GetSender();
if (nullptr == sendingRenderer)
{
return;
}
// get the the topmost visible image of the sending renderer
DataStorage::Pointer storage = sendingRenderer->GetDataStorage();
DataStorage::SetOfObjects::ConstPointer allImageNodes = storage->GetSubset(NodePredicateDataType::New("Image"));
Point3D worldposition;
const auto* positionEvent = dynamic_cast<const InteractionPositionEvent*>(displayActionEvent->GetInteractionEvent());
sendingRenderer->DisplayToWorld(positionEvent->GetPointerPositionOnScreen(), worldposition);
auto globalCurrentTimePoint = sendingRenderer->GetTime();
DataNode::Pointer node = FindTopmostVisibleNode(allImageNodes, worldposition, globalCurrentTimePoint, sendingRenderer);
if (node.IsNull())
{
return;
}
LevelWindow levelWindow = LevelWindow();
node->GetLevelWindow(levelWindow);
ScalarType level = levelWindow.GetLevel();
ScalarType window = levelWindow.GetWindow();
level += displayActionEvent->GetLevel();
window += displayActionEvent->GetWindow();
levelWindow.SetLevelWindow(level, window);
auto* levelWindowProperty = dynamic_cast<LevelWindowProperty*>(node->GetProperty("levelwindow"));
if (nullptr != levelWindowProperty)
{
levelWindowProperty->SetLevelWindow(levelWindow);
sendingRenderer->GetRenderingManager()->RequestUpdateAll();
}
}
};
return actionFunction;
}
示例3: ThreadedUpdateSuccessful
void ShowSegmentationAsSmoothedSurface::ThreadedUpdateSuccessful()
{
DataNode::Pointer node = DataNode::New();
bool wireframe = false;
GetParameter("Wireframe", wireframe);
if (wireframe)
{
VtkRepresentationProperty *representation = dynamic_cast<VtkRepresentationProperty *>(
node->GetProperty("material.representation"));
if (representation != nullptr)
representation->SetRepresentationToWireframe();
}
node->SetProperty("opacity", FloatProperty::New(1.0));
node->SetProperty("line width", IntProperty::New(1));
node->SetProperty("scalar visibility", BoolProperty::New(false));
std::string groupNodeName = "surface";
DataNode *groupNode = GetGroupNode();
if (groupNode != nullptr)
groupNode->GetName(groupNodeName);
node->SetProperty("name", StringProperty::New(groupNodeName));
node->SetData(m_Surface);
BaseProperty *colorProperty = groupNode->GetProperty("color");
if (colorProperty != nullptr)
node->ReplaceProperty("color", colorProperty->Clone());
else
node->SetProperty("color", ColorProperty::New(1.0f, 0.0f, 0.0f));
bool showResult = true;
GetParameter("Show result", showResult);
bool syncVisibility = false;
GetParameter("Sync visibility", syncVisibility);
Image::Pointer image;
GetPointerParameter("Input", image);
BaseProperty *organTypeProperty = image->GetProperty("organ type");
if (organTypeProperty != nullptr)
m_Surface->SetProperty("organ type", organTypeProperty);
BaseProperty *visibleProperty = groupNode->GetProperty("visible");
if (visibleProperty != nullptr && syncVisibility)
node->ReplaceProperty("visible", visibleProperty->Clone());
else
node->SetProperty("visible", BoolProperty::New(showResult));
InsertBelowGroupNode(node);
Superclass::ThreadedUpdateSuccessful();
}
示例4: ThreadedUpdateSuccessful
void ShowSegmentationAsSmoothedSurface::ThreadedUpdateSuccessful()
{
DataNode::Pointer node = LookForPointerTargetBelowGroupNode("Surface representation");
bool addToTree = node.IsNull();
if (addToTree)
{
node = DataNode::New();
bool wireframe = false;
GetParameter("Wireframe", wireframe);
if (wireframe)
{
VtkRepresentationProperty *representation = dynamic_cast<VtkRepresentationProperty *>(
node->GetProperty("material.representation"));
if (representation != NULL)
representation->SetRepresentationToWireframe();
}
node->SetProperty("opacity", FloatProperty::New(1.0));
node->SetProperty("line width", IntProperty::New(1));
node->SetProperty("scalar visibility", BoolProperty::New(false));
UIDGenerator uidGenerator("Surface_");
node->SetProperty("FILENAME", StringProperty::New(uidGenerator.GetUID() + ".vtk"));
std::string groupNodeName = "surface";
DataNode *groupNode = GetGroupNode();
if (groupNode != NULL)
groupNode->GetName(groupNodeName);
node->SetProperty("name", StringProperty::New(groupNodeName));
}
node->SetData(m_Surface);
if (addToTree)
{
DataNode* groupNode = GetGroupNode();
if (groupNode != NULL)
{
groupNode->SetProperty("Surface representation", SmartPointerProperty::New(node));
BaseProperty *colorProperty = groupNode->GetProperty("color");
if (colorProperty != NULL)
node->ReplaceProperty("color", colorProperty);
else
node->SetProperty("color", ColorProperty::New(1.0f, 0.0f, 0.0f));
bool showResult = true;
GetParameter("Show result", showResult);
bool syncVisibility = false;
GetParameter("Sync visibility", syncVisibility);
Image::Pointer image;
GetPointerParameter("Input", image);
BaseProperty *organTypeProperty = image->GetProperty("organ type");
if (organTypeProperty != NULL)
m_Surface->SetProperty("organ type", organTypeProperty);
BaseProperty *visibleProperty = groupNode->GetProperty("visible");
if (visibleProperty != NULL && syncVisibility)
node->ReplaceProperty("visible", visibleProperty);
else
node->SetProperty("visible", BoolProperty::New(showResult));
}
InsertBelowGroupNode(node);
}
Superclass::ThreadedUpdateSuccessful();
}
示例5: GetDataNode
//.........这里部分代码省略.........
double origin[3];
origin[0] = planeGeometry->GetOrigin()[0];
origin[1] = planeGeometry->GetOrigin()[1];
origin[2] = planeGeometry->GetOrigin()[2];
double normal[3];
normal[0] = planeGeometry->GetNormal()[0];
normal[1] = planeGeometry->GetNormal()[1];
normal[2] = planeGeometry->GetNormal()[2];
// MITK_INFO << "normal1 " << normal[0] << " " << normal[1] << " " << normal[2];
localStorage->m_CuttingPlane->SetOrigin(origin);
localStorage->m_CuttingPlane->SetNormal(normal);
// add cube polydata to local storage
localStorage->m_Cutter->SetInputData(polydata);
localStorage->m_Cutter->SetGenerateCutScalars(1);
localStorage->m_Cutter->Update();
if (localStorage->m_PropAssembly->GetParts()->IsItemPresent(localStorage->m_HandleActor))
localStorage->m_PropAssembly->RemovePart(localStorage->m_HandleActor);
if (localStorage->m_PropAssembly->GetParts()->IsItemPresent(localStorage->m_Actor))
localStorage->m_PropAssembly->RemovePart(localStorage->m_Actor);
vtkCoordinate *tcoord = vtkCoordinate::New();
tcoord->SetCoordinateSystemToWorld();
localStorage->m_HandleMapper->SetTransformCoordinate(tcoord);
tcoord->Delete();
if (localStorage->m_Cutter->GetOutput()->GetNumberOfPoints() > 0) // if plane is visible in the renderwindow
{
mitk::DoubleProperty::Pointer handleSizeProperty =
dynamic_cast<mitk::DoubleProperty *>(this->GetDataNode()->GetProperty("Bounding Shape.Handle Size Factor"));
ScalarType initialHandleSize;
if (handleSizeProperty != nullptr)
initialHandleSize = handleSizeProperty->GetValue();
else
initialHandleSize = 1.0 / 40.0;
mitk::Point2D displaySize = renderer->GetDisplaySizeInMM();
double handleSize = ((displaySize[0] + displaySize[1]) / 2.0) * initialHandleSize;
auto appendPoly = vtkSmartPointer<vtkAppendPolyData>::New();
unsigned int i = 0;
// add handles and their assigned properties to the local storage
mitk::IntProperty::Pointer activeHandleId =
dynamic_cast<mitk::IntProperty *>(node->GetProperty("Bounding Shape.Active Handle ID"));
bool visible = false;
bool selected = false;
for (auto handle : localStorage->m_Handles)
{
Point3D handleCenter = m_Impl->HandlePropertyList[i].GetPosition();
handle->SetRadius(handleSize);
handle->SetCenter(handleCenter[0], handleCenter[1], handleCenter[2]);
vtkMath::Normalize(normal);
double angle = vtkMath::DegreesFromRadians(acos(vtkMath::Dot(normal, result0)));
double angle1 = vtkMath::DegreesFromRadians(acos(vtkMath::Dot(normal, result1)));
double angle2 = vtkMath::DegreesFromRadians(acos(vtkMath::Dot(normal, result2)));
// show handles only if the corresponding face is aligned to the render window