18#ifndef itkVoronoiDiagram2D_h
19#define itkVoronoiDiagram2D_h
50template <
typename TCoordType>
52 :
public Mesh<TCoordType, 2, DefaultDynamicMeshTraits<TCoordType, 2, 2, TCoordType>>
73 static constexpr unsigned int PointDimension = MeshTraits::PointDimension;
74 static constexpr unsigned int MaxTopologicalDimension = MeshTraits::MaxTopologicalDimension;
109 using typename Superclass::CellType;
110 using typename Superclass::CellAutoPointer;
124 itkGetConstMacro(NumberOfSeeds,
unsigned int);
201 m_CellNeighborsID[x[0]].push_back(x[1]);
202 m_CellNeighborsID[x[1]].push_back(x[0]);
208 m_VoronoiRegions[i]->ClearPoints();
214 m_VoronoiRegions[id]->AddPointId(x);
220 m_VoronoiRegions[id]->BuildEdges();
238 if (this->m_PointsContainer.IsNull())
243 this->m_PointsContainer->Initialize();
249 return static_cast<int>(m_LineList.size());
255 return static_cast<int>(m_EdgeList.size());
261 return static_cast<int>(this->m_PointsContainer->Size());
267 m_LineList.push_back(x);
273 m_EdgeList.push_back(x);
279 this->m_PointsContainer->InsertElement(this->m_PointsContainer->Size(), x);
285 return m_LineList[id];
291 return m_EdgeList[id];
297 return this->m_PointsContainer->ElementAt(
id);
305 x[0] = m_EdgeList[id].m_LeftID;
306 x[1] = m_EdgeList[id].m_RightID;
313 return m_EdgeList[id].m_LineID;
324 unsigned int m_NumberOfSeeds{};
325 std::vector<PolygonCellType *> m_VoronoiRegions{};
328 std::vector<std::vector<int>> m_CellNeighborsID{};
330 std::vector<EdgeInfo> m_LineList{};
331 std::vector<VoronoiEdge> m_EdgeList{};
336#ifndef ITK_MANUAL_INSTANTIATION
337# include "itkVoronoiDiagram2D.hxx"
Represent and compute information about bounding boxes.
A visitor that can visit different cell types in a mesh. CellInterfaceVisitor instances can be regist...
Base class for all data objects in ITK.
A simple structure that holds type information for a mesh and its cells.
itkMakeCellTraitsMacro CellTraits
typename CellType::CellAutoPointer CellAutoPointer
std::set< CellIdentifier > PointCellLinksContainer
IdentifierType PointIdentifier
IdentifierType CellFeatureIdentifier
IdentifierType CellIdentifier
TInterpolationWeight InterpolationWeightType
Control indentation during Print() invocation.
Represents a line segment for a Mesh.
A wrapper of the STL "map" container.
Implements the N-dimensional mesh structure.
typename CellType::CellAutoPointer CellAutoPointer
Base class for most ITK classes.
A templated class holding a geometric point in n-Dimensional space.
Represents a polygon in a Mesh.
Implements the 2-Dimensional Voronoi Diagram.
typename std::vector< VoronoiEdge >::iterator VoronoiEdgeIterator
typename CellType::MultiVisitor CellMultiVisitorType
VertexIterator VertexBegin()
typename MeshTraits::PointType PointType
void GetCellId(CellIdentifier cellId, CellAutoPointer &)
typename CellsContainer::Pointer CellsContainerPointer
typename MeshTraits::PixelType PixelType
typename MeshTraits::CoordRepType CoordRepType
typename CellDataContainer::ConstIterator CellDataContainerIterator
typename CellDataContainer::Pointer CellDataContainerPointer
typename SeedsType::iterator SeedsIterator
int GetEdgeLineID(int id)
typename PointDataContainer::ConstIterator PointDataContainerIterator
typename MeshTraits::CellTraits CellTraits
void SetOrigin(PointType vorsize)
typename PointsContainer::ConstIterator PointsContainerConstIterator
NeighborIdIterator NeighborIdsEnd(int seeds)
typename MeshTraits::CellsContainer CellsContainer
typename MeshTraits::PointsContainer PointsContainer
typename MeshTraits::CellDataContainer CellDataContainer
typename PointsContainer::Pointer PointsContainerPointer
typename MeshTraits::PointDataContainer PointDataContainer
void AddCellNeighbor(EdgeInfo x)
void AddVert(PointType x)
VoronoiEdge GetEdge(int id)
VertexIterator VertexEnd()
typename INTvector::iterator NeighborIdIterator
typename CellLinksContainer::ConstIterator CellLinksContainerIterator
void SetSeeds(int num, SeedsIterator begin)
PointType GetSeed(int SeedID)
PointType GetVertex(int id)
typename PointDataContainer::Pointer PointDataContainerPointer
VoronoiEdgeIterator EdgeBegin()
CellFeatureIdentifier CellFeatureCount
typename MeshTraits::InterpolationWeightType InterpolationWeightType
typename MeshTraits::CellLinksContainer CellLinksContainer
typename MeshTraits::CellFeatureIdentifier CellFeatureIdentifier
void VoronoiRegionAddPointId(int id, int x)
typename BoundingBoxType::Pointer BoundingBoxPointer
NeighborIdIterator NeighborIdsBegin(int seeds)
void SetBoundary(PointType vorsize)
PointsContainerIterator VertexIterator
EdgeInfo GetSeedsIDAroundEdge(VoronoiEdge *task)
EdgeInfo GetEdgeEnd(int id)
typename MeshTraits::PointIdentifier PointIdentifier
typename PointCellLinksContainer::const_iterator PointCellLinksContainerIterator
typename Edge::SelfAutoPointer EdgeAutoPointer
typename MeshTraits::CellIdentifier CellIdentifier
typename MeshTraits::CellAutoPointer genericCellPointer
void AddEdge(VoronoiEdge x)
typename CellsContainer::ConstIterator CellsContainerConstIterator
std::vector< int > INTvector
VoronoiEdgeIterator EdgeEnd()
typename MeshTraits::PointCellLinksContainer PointCellLinksContainer
typename CellLinksContainer::Pointer CellLinksContainerPointer
std::vector< PointType > SeedsType
void PrintSelf(std::ostream &os, Indent indent) const override
~VoronoiDiagram2D() override=default
typename CellsContainer::Iterator CellsContainerIterator
std::list< PointType > PointList
typename PointsContainer::Iterator PointsContainerIterator
std::deque< EdgeInfo > EdgeInfoDQ
void GetPoint(int pId, PointType *answer)
SmartPointer< Self > Pointer
ImageBaseType::PointType PointType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....