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