本文整理汇总了C++中mitk::datanode::Pointer::IsNotNull方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::IsNotNull方法的具体用法?C++ Pointer::IsNotNull怎么用?C++ Pointer::IsNotNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mitk::datanode::Pointer
的用法示例。
在下文中一共展示了Pointer::IsNotNull方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddDisplayPlaneSubTree
void AddDisplayPlaneSubTree()
{
// add the displayed planes of the multiwidget to a node to which the subtree
// @a planesSubTree points ...
float white[3] = {1.0f, 1.0f, 1.0f};
mitk::PlaneGeometryDataMapper2D::Pointer mapper;
mitk::IntProperty::Pointer layer = mitk::IntProperty::New(1000);
// ... of widget 1
m_PlaneNode1 =
(mitk::BaseRenderer::GetInstance(mitkWidget1->GetVtkRenderWindow()))->GetCurrentWorldPlaneGeometryNode();
m_PlaneNode1->SetColor(white, mitk::BaseRenderer::GetInstance(mitkWidget4->GetVtkRenderWindow()));
m_PlaneNode1->SetProperty("visible", mitk::BoolProperty::New(true));
m_PlaneNode1->SetProperty("name", mitk::StringProperty::New("widget1Plane"));
m_PlaneNode1->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
m_PlaneNode1->SetProperty("helper object", mitk::BoolProperty::New(true));
m_PlaneNode1->SetProperty("layer", layer);
m_PlaneNode1->SetColor(1.0, 0.0, 0.0);
mapper = mitk::PlaneGeometryDataMapper2D::New();
m_PlaneNode1->SetMapper(mitk::BaseRenderer::Standard2D, mapper);
// ... of widget 2
m_PlaneNode2 =
(mitk::BaseRenderer::GetInstance(mitkWidget2->GetVtkRenderWindow()))->GetCurrentWorldPlaneGeometryNode();
m_PlaneNode2->SetColor(white, mitk::BaseRenderer::GetInstance(mitkWidget4->GetVtkRenderWindow()));
m_PlaneNode2->SetProperty("visible", mitk::BoolProperty::New(true));
m_PlaneNode2->SetProperty("name", mitk::StringProperty::New("widget2Plane"));
m_PlaneNode2->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
m_PlaneNode2->SetProperty("helper object", mitk::BoolProperty::New(true));
m_PlaneNode2->SetProperty("layer", layer);
m_PlaneNode2->SetColor(0.0, 1.0, 0.0);
mapper = mitk::PlaneGeometryDataMapper2D::New();
m_PlaneNode2->SetMapper(mitk::BaseRenderer::Standard2D, mapper);
// ... of widget 3
m_PlaneNode3 =
(mitk::BaseRenderer::GetInstance(mitkWidget3->GetVtkRenderWindow()))->GetCurrentWorldPlaneGeometryNode();
m_PlaneNode3->SetColor(white, mitk::BaseRenderer::GetInstance(mitkWidget4->GetVtkRenderWindow()));
m_PlaneNode3->SetProperty("visible", mitk::BoolProperty::New(true));
m_PlaneNode3->SetProperty("name", mitk::StringProperty::New("widget3Plane"));
m_PlaneNode3->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
m_PlaneNode3->SetProperty("helper object", mitk::BoolProperty::New(true));
m_PlaneNode3->SetProperty("layer", layer);
m_PlaneNode3->SetColor(0.0, 0.0, 1.0);
mapper = mitk::PlaneGeometryDataMapper2D::New();
m_PlaneNode3->SetMapper(mitk::BaseRenderer::Standard2D, mapper);
// AddPlanesToDataStorage
if (m_PlaneNode1.IsNotNull() && m_PlaneNode2.IsNotNull() && m_PlaneNode3.IsNotNull() && m_Node.IsNotNull())
{
if (m_DataStorage.IsNotNull())
{
m_DataStorage->Add(m_PlaneNode1);
m_DataStorage->Add(m_PlaneNode2);
m_DataStorage->Add(m_PlaneNode3);
}
}
}
示例2: SetToolTipSurface
void QmitkNavigationToolCreationAdvancedWidget::SetToolTipSurface( bool cone, mitk::DataNode::Pointer node /*= NULL*/ )
{
m_ToolTipSurface = NULL;
if(cone)
{
m_ToolTipSurface = mitk::Surface::New();
vtkConeSource *vtkData = vtkConeSource::New();
vtkData->SetAngle(5.0);
vtkData->SetResolution(50);
vtkData->SetHeight(6.0f);
vtkData->SetRadius(2.0f);
vtkData->SetCenter(0.0, 0.0, 0.0);
vtkData->Update();
m_ToolTipSurface->SetVtkPolyData(vtkData->GetOutput());
vtkData->Delete();
m_SurfaceNodeName ="";
}
else if(!cone && node.IsNotNull())
{
m_ToolTipSurface = dynamic_cast<mitk::Surface*>(node->GetData());
m_SurfaceNodeName = node->GetName();
}
}
示例3: foreach
foreach ( mitk::DataNode::Pointer referenceNode, selectedNodes )
{
if (referenceNode.IsNotNull())
{
mitk::LabelSetImage::Pointer referenceImage = dynamic_cast<mitk::LabelSetImage*>( referenceNode->GetData() );
assert(referenceImage);
if(referenceImage->GetNumberOfLabels() <= 1)
{
QMessageBox::information(nullptr, "Create LabelSetImage Preset", "Could not create a LabelSetImage preset.\nNo Labels defined!\n");\
return;
}
std::string sName = referenceNode->GetName();
QString qName;
qName.sprintf("%s.lsetp",sName.c_str());
QString filename = QFileDialog::getSaveFileName( nullptr,"save file dialog",QString(),"LabelSet Preset(*.lsetp)");
if ( filename.isEmpty() )
return;
std::string fileName = filename.toStdString();
bool wasSaved = mitk::LabelSetIOHelper::SaveLabelSetImagePreset(fileName,referenceImage);
if(!wasSaved)
{
QMessageBox::information(nullptr, "Create LabelSetImage Preset", "Could not save a LabelSetImage preset as Xml.\n");\
return;
}
}
}
示例4: foreach
foreach( mitk::DataNode::Pointer node, nodes )
{
if( node.IsNotNull() )
{
m_Controls.m_AddInteractor->setEnabled( true );
return;
}
}
示例5: foreach
// iterate all selected objects, adjust warning visibility
foreach( mitk::DataNode::Pointer node, nodes )
{
if( node.IsNotNull() && dynamic_cast<mitk::Image*>(node->GetData()) )
{
m_Controls.labelWarning->setVisible( false );
m_Controls.buttonPerformImageProcessing->setEnabled( true );
return;
}
}
示例6: foreach
foreach( mitk::DataNode::Pointer node, nodes )
{
if( node.IsNotNull() && dynamic_cast< mitk::TubeGraph* >(node->GetData()) )
{
m_Controls.activeGraphComboBox->SetSelectedNode(node);
m_ActiveTubeGraph = dynamic_cast< mitk::TubeGraph* >(node->GetData());
m_ActiveProperty = dynamic_cast<mitk::TubeGraphProperty*>(m_ActiveTubeGraph->GetProperty( "Tube Graph.Visualization Information" ).GetPointer());
this->UpdateActiveTubeGraphInInteractors();
this->UpdateLabelGroups();
this->UpdateAnnotation();
}
}
示例7: AddTrajectory
void QmitkNavigationDataPlayerView::AddTrajectory(mitk::DataStorage* ds, mitk::DataNode::Pointer trajectoryNode)
{
if(ds == NULL)
return;
if(m_Trajectory.IsNotNull())
ds->Remove(m_Trajectory); // remove trajectory from DataStorage if already exists
// add trajectory to DataStorage
if(ds != NULL && trajectoryNode.IsNotNull())
{
m_Trajectory = trajectoryNode;
ds->Add(m_Trajectory);
}
}