35 #ifndef __vtkPolyDataToitkQuadEdgeMesh_h
36 #define __vtkPolyDataToitkQuadEdgeMesh_h
38 #include "vtkSmartPointer.h"
39 #include "vtkPolyData.h"
40 #include "vtkIdList.h"
42 #include "itkQuadEdgeMesh.h"
43 #include "itkTriangleCell.h"
45 #include "itkObject.h"
49 template<
class TMesh >
103 vtkIdType NbOfPoints =
m_PolyData->GetNumberOfPoints();
105 if( NbOfPoints == 0 )
107 itkGenericExceptionMacro( <<
"Number Of Points is 0" );
110 vtkIdType NbOfCells =
m_PolyData->GetNumberOfCells();
114 itkGenericExceptionMacro( <<
"Number Of Cells is 0" );
118 points->Reserve( NbOfPoints );
124 for( vtkIdType i = 0; i < NbOfPoints; ++i )
127 for( dim = 0; dim < 3; ++dim )
129 itk_p[dim] =
static_cast< CoordType >( vtk_p[dim] );
134 for( vtkIdType i = 0; i < NbOfCells; ++i )
136 vtkIdList* cell_list = vtkIdList::New();
142 for ( vtkIdType k = 0; k < cell_list->GetNumberOfIds(); ++k )
144 triangleCell->SetPointId( k, cell_list->GetId( k ) );
147 cell.TakeOwnership(triangleCell);
160 #endif // __vtkPolyDataToitkQuadEdgeMesh_h
vtkPolyDataToitkQuadEdgeMesh Self
~vtkPolyDataToitkQuadEdgeMesh()
TriangleCell< CellType > TriangleCellType
MeshType::CellType CellType
MeshType * GetOutput() const
MeshType::PointIdentifier PointIdentifier
void SetInput(vtkPolyData *iMesh)
PointType::CoordRepType CoordType
MeshType::CellAutoPointer CellAutoPointer
MeshType::PointType PointType
void operator=(const Self &)
vtkSmartPointer< vtkPolyData > m_PolyData
itkTypeMacro(vtkPolyDataToitkQuadEdgeMesh, Object)
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
MeshType::PointsContainerPointer PointsContainerPointer
vtkPolyDataToitkQuadEdgeMesh()
MeshType::Pointer MeshPointer