# Write VoronoiDiagram2D Using VTKPolyDataWriter

Wanlin Zhu
2011-07-01
VoronoiDiagram2D is derived from Mesh, however it could not be used by VTKPolyDataWriter. We made the following changes: 1. Changing typedef VoronoiDiagram2D::CellType from PolygonCell< CellInterfaceType > to Superclass::CellType 2. Changing typedef VertexIterator from std::vector< PointType >::iterator to PointsContainerIterator 3. Removal of typedef CellInterfaceType, which is the same as CellType 4. Adding new typedef PolygonCellType as PolygonCell< CellType > Now we are able to write VoronoiDiagram2D as mesh using VTKPolyDataWriter.

for(allVerts=testVor->VertexBegin();allVerts!=testVor->VertexEnd();++allVerts) { std::cout<<": At ("<<(*allVerts)[0]<<","<<(*allVerts)[1]<<")"<<std::endl; }
for(allVerts=testVor->VertexBegin();allVerts!=testVor->VertexEnd();++allVerts) { std::cout<<": At ("<<(allVerts.Value())[0]<<","<<(allVerts.Value())[1]<<")"<<std::endl; }
Ie6fa45dab69cb6b3df26896546d3962af172b035
Documentation/Migration/WriteVoronoiDiagram2DUsingVTKPolyDataWriter.xml Modules/Segmentation/Voronoi/include/itkVoronoiDiagram2D.h Modules/Segmentation/Voronoi/include/itkVoronoiDiagram2D.txx Modules/Segmentation/Voronoi/test/CMakeLists.txt Modules/Segmentation/Voronoi/test/itkVoronoiDiagram2DTest.cxx