本文整理汇总了C++中mitk::surface::Pointer::SetVtkPolyData方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::SetVtkPolyData方法的具体用法?C++ Pointer::SetVtkPolyData怎么用?C++ Pointer::SetVtkPolyData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mitk::surface::Pointer
的用法示例。
在下文中一共展示了Pointer::SetVtkPolyData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setUp
/**
* @brief Setup Always call this method before each Test-case to ensure correct and new intialization of the used members for a new test case. (If the members are not used in a test, the method does not need to be called).
*/
void setUp() override
{
//generate two sets of points
m_PointsOne = vtkSmartPointer<vtkPoints>::New();
m_PointsOne->InsertNextPoint( 0.0, 0.0, 0.0 );
m_PointsOne->InsertNextPoint( 1.0, 0.0, 0.0 );
m_PointsOne->InsertNextPoint( 0.0, 1.0, 0.0 );
m_PointsOne->InsertNextPoint( 1.0, 1.0, 0.0 );
m_PointsTwo = vtkSmartPointer<vtkPoints>::New();
m_PointsTwo->InsertNextPoint( 0.0, 0.0, 0.0 );
m_PointsTwo->InsertNextPoint( 0.0, 0.0, 2.0 );
m_PointsTwo->InsertNextPoint( 0.0, 1.0, 0.0 );
m_PointsTwo->InsertNextPoint( 0.0, 1.0, 2.0 );
//generate two polygons
vtkSmartPointer<vtkPolygon> polygonOne = vtkSmartPointer<vtkPolygon>::New();
polygonOne->GetPointIds()->SetNumberOfIds(4);
polygonOne->GetPointIds()->SetId(0,0);
polygonOne->GetPointIds()->SetId(1,1);
polygonOne->GetPointIds()->SetId(2,2);
polygonOne->GetPointIds()->SetId(3,3);
vtkSmartPointer<vtkPolygon> polygonTwo = vtkSmartPointer<vtkPolygon>::New();
polygonTwo->GetPointIds()->SetNumberOfIds(4);
polygonTwo->GetPointIds()->SetId(0,3);
polygonTwo->GetPointIds()->SetId(1,2);
polygonTwo->GetPointIds()->SetId(2,0);
polygonTwo->GetPointIds()->SetId(3,1);
//generate polydatas
vtkSmartPointer<vtkCellArray> polygonArrayOne = vtkSmartPointer<vtkCellArray>::New();
polygonArrayOne->InsertNextCell(polygonOne);
m_PolyDataOne = vtkSmartPointer<vtkPolyData>::New();
m_PolyDataOne->SetPoints(m_PointsOne);
m_PolyDataOne->SetPolys(polygonArrayOne);
m_PolygonArrayTwo = vtkSmartPointer<vtkCellArray>::New();
m_PolygonArrayTwo->InsertNextCell(polygonTwo);
vtkSmartPointer<vtkPolyData> polyDataTwo = vtkSmartPointer<vtkPolyData>::New();
polyDataTwo->SetPoints(m_PointsOne);
polyDataTwo->SetPolys(m_PolygonArrayTwo);
//generate surfaces
m_Surface3D = mitk::Surface::New();
m_Surface3D->SetVtkPolyData( m_PolyDataOne );
m_Surface3DTwoTimeSteps = mitk::Surface::New();
m_Surface3DTwoTimeSteps->SetVtkPolyData( m_PolyDataOne, 0 );
m_Surface3DTwoTimeSteps->SetVtkPolyData( polyDataTwo, 1 );
}