18 #ifndef itkVoronoiDiagram2D_h
19 #define itkVoronoiDiagram2D_h
46 template<
typename TCoordType >
48 public Mesh< TCoordType, 2,
49 DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >
68 itkStaticConstMacro(PointDimension,
unsigned int,
69 MeshTraits::PointDimension);
70 itkStaticConstMacro(MaxTopologicalDimension,
unsigned int,
71 MeshTraits::MaxTopologicalDimension);
133 typedef typename PointCellLinksContainer::const_iterator
152 itkGetConstMacro(NumberOfSeeds,
unsigned int);
180 void GetPoint(
int pId,
PointType *answer);
213 m_CellNeighborsID[x[0]].push_back(x[1]);
214 m_CellNeighborsID[x[1]].push_back(x[0]);
219 m_VoronoiRegions[i]->ClearPoints();
224 m_VoronoiRegions[id]->AddPointId(x);
229 m_VoronoiRegions[id]->BuildEdges();
244 if ( this->m_PointsContainer.IsNull() )
246 this->m_PointsContainer = PointsContainer::New();
249 this->m_PointsContainer->Initialize();
254 return static_cast< int >( m_LineList.size() );
259 return static_cast< int >( m_EdgeList.size() );
264 return static_cast< int >(this->m_PointsContainer->Size());
269 m_LineList.push_back(x);
274 m_EdgeList.push_back(x);
279 this->m_PointsContainer->InsertElement(this->m_PointsContainer->Size(), x);
284 return m_LineList[id];
289 return m_EdgeList[id];
294 return this-> m_PointsContainer->ElementAt(
id);
301 x[0] = m_EdgeList[id].m_LeftID;
302 x[1] = m_EdgeList[id].m_RightID;
308 return m_EdgeList[id].m_LineID;
314 virtual
void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
320 unsigned int m_NumberOfSeeds;
324 std::vector< std::vector<
int > > m_CellNeighborsID;
332 #ifndef ITK_MANUAL_INSTANTIATION
333 #include "itkVoronoiDiagram2D.hxx"
CellDataContainer::Pointer CellDataContainerPointer
Superclass::CellType CellType
MeshTraits::CellsContainer CellsContainer
PointDataContainer::Pointer PointDataContainerPointer
CellDataContainer::ConstIterator CellDataContainerIterator
SmartPointer< const Self > ConstPointer
PolygonCell< CellType > PolygonCellType
Represents a line segment for a Mesh.
IdentifierType PointIdentifier
std::vector< VoronoiEdge >::iterator VoronoiEdgeIterator
A wrapper of the STL "map" container.
CellType::MultiVisitor CellMultiVisitorType
SeedsType::iterator SeedsIterator
MeshTraits::PointCellLinksContainer PointCellLinksContainer
void VoronoiRegionAddPointId(int id, int x)
itkMakeCellTraitsMacro CellTraits
BoundingBoxType::Pointer BoundingBoxPointer
Implements the 2-Dimensional Voronoi Diagram.
PointDataContainer::ConstIterator PointDataContainerIterator
Implements the N-dimensional mesh structure.
IdentifierType CellIdentifier
MeshTraits::CoordRepType CoordRepType
MeshTraits::PointDataContainer PointDataContainer
IdentifierType CellFeatureIdentifier
EdgeInfo GetEdgeEnd(int id)
TInterpolationWeight InterpolationWeightType
Edge::SelfAutoPointer EdgeAutoPointer
CellsContainer::ConstIterator CellsContainerConstIterator
void AddEdge(VoronoiEdge x)
CellsContainer::Iterator CellsContainerIterator
MeshTraits::PixelType PixelType
PointsContainer::Pointer PointsContainerPointer
CellsContainer::Pointer CellsContainerPointer
The non-const iterator type for the map.
CellLinksContainer::ConstIterator CellLinksContainerIterator
std::vector< int > INTvector
MeshTraits::PointIdentifier PointIdentifier
The const iterator type for the map.
DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > MeshTraits
MeshTraits::CellAutoPointer genericCellPointer
PointsContainerIterator VertexIterator
CellType::CellAutoPointer CellAutoPointer
INTvector::iterator NeighborIdIterator
std::list< PointType > PointList
MeshTraits::CellIdentifier CellIdentifier
void AddVert(PointType x)
Represents a polygon in a Mesh.
int GetEdgeLineID(int id)
void AddCellNeighbor(EdgeInfo x)
PointsContainer::Iterator PointsContainerIterator
MeshTraits::InterpolationWeightType InterpolationWeightType
Control indentation during Print() invocation.
BoundingBox< PointIdentifier, itkGetStaticConstMacro(PointDimension), CoordRepType, PointsContainer > BoundingBoxType
CellFeatureIdentifier CellFeatureCount
std::vector< PointType > SeedsType
SmartPointer< Self > Pointer
MeshTraits::CellDataContainer CellDataContainer
A simple structure that holds type information for a mesh and its cells.
PointCellLinksContainer::const_iterator PointCellLinksContainerIterator
VoronoiEdge GetEdge(int id)
Superclass::CellAutoPointer CellAutoPointer
MeshTraits::CellLinksContainer CellLinksContainer
CellLinksContainer::Pointer CellLinksContainerPointer
PointsContainer::ConstIterator PointsContainerConstIterator
A templated class holding a geometric point in n-Dimensional space.
MeshTraits::CellFeatureIdentifier CellFeatureIdentifier
MeshTraits::CellTraits CellTraits
MeshTraits::PointType PointType
MeshTraits::PointsContainer PointsContainer
Base class for all data objects in ITK.
Represent and compute information about bounding boxes.
LineCell< CellType > Edge
std::deque< EdgeInfo > EdgeInfoDQ
Mesh< TCoordType, 2, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > > Superclass
std::set< CellIdentifier > PointCellLinksContainer
PointType GetVertex(int id)