18#ifndef itkVoronoiDiagram2DGenerator_h
19#define itkVoronoiDiagram2DGenerator_h
49template <
typename TCoordinate>
76#ifndef ITK_FUTURE_LEGACY_REMOVE
77 using CoordRepType ITK_FUTURE_DEPRECATED(
78 "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") =
CoordinateType;
83 itkGetConstMacro(NumberOfSeeds,
unsigned int);
137 unsigned int m_NumberOfSeeds{ 0 };
181 float m_A{ 0.0 }, m_B{ 0.0 }, m_C{ 0.0 };
186 FortuneEdge() { m_Ep[0] = m_Ep[1] = m_Reg[0] = m_Reg[1] =
nullptr; }
197 bool m_RorL{
false };
199 double m_Ystar{ 0.0 };
211 : m_Left(edge.m_Left)
212 , m_Right(edge.m_Right)
213 , m_Edge(edge.m_Edge)
214 , m_RorL(edge.m_RorL)
215 , m_Vert(edge.m_Vert)
216 , m_Ystar(edge.m_Ystar)
217 , m_Next(edge.m_Next)
223 double m_Pxmin{ 0.0 };
224 double m_Pxmax{ 0.0 };
225 double m_Pymin{ 0.0 };
226 double m_Pymax{ 0.0 };
227 double m_Deltax{ 0.0 };
228 double m_Deltay{ 0.0 };
229 double m_SqrtNSites{ 0.0 };
231 unsigned int m_PQcount{ 0 };
233 unsigned int m_PQhashsize{ 0 };
234 unsigned int m_Nedges{ 0 };
235 unsigned int m_Nvert{ 0 };
237 std::vector<FortuneHalfEdge> m_PQHash{};
239 unsigned int m_ELhashsize{ 0 };
242 std::vector<FortuneHalfEdge *> m_ELHash{};
245 std::vector<FortuneSite> m_SeedSites{};
325#ifndef ITK_MANUAL_INSTANTIATION
326# include "itkVoronoiDiagram2DGenerator.hxx"
Control indentation during Print() invocation.
Light weight base class for most itk classes.
Base class for all process objects that output mesh data.
Define additional traits for native types such as int or float.
A templated class holding a geometric point in n-Dimensional space.
FortuneHalfEdge * m_Right
~FortuneHalfEdge()=default
FortuneHalfEdge(const FortuneHalfEdge &edge)
Small data structures for Fortune's Method and some public variables/methods not for external access.
Implement the Sweep Line Algorithm for the construction of the 2D Voronoi Diagram.
void GenerateOutputInformation() override
typename VDMesh::EdgeInfoDQ EdgeInfoDQ
void PrintSelf(std::ostream &os, Indent indent) const override
FortuneHalfEdge * ELgethash(int b)
void SetOrigin(PointType vorsize)
void SetSeeds(int num, SeedsIterator begin)
FortuneHalfEdge * getPQmin()
void insertEdgeList(FortuneHalfEdge *lbase, FortuneHalfEdge *lnew)
void AddOneSeed(PointType)
typename VDMesh::EdgeInfo EdgeInfo
double dist(FortuneSite *s1, FortuneSite *s2)
~VoronoiDiagram2DGenerator() override=default
void insertPQ(FortuneHalfEdge *he, FortuneSite *v, double offset)
bool almostsame(CoordinateType p1, CoordinateType p2)
void GenerateData() override
typename VDMesh::SeedsIterator SeedsIterator
FortuneSite * getLeftReg(FortuneHalfEdge *he)
int PQbucket(FortuneHalfEdge *task)
void PQshowMin(PointType *answer)
typename VDMesh::CoordinateType CoordinateType
void bisect(FortuneEdge *, FortuneSite *s1, FortuneSite *s2)
void deletePQ(FortuneHalfEdge *task)
FortuneSite * getRightReg(FortuneHalfEdge *he)
bool differentPoint(PointType p1, PointType p2)
void AddSeeds(int num, SeedsIterator begin)
typename VDMesh::VoronoiEdge VoronoiEdge
void clip_line(FortuneEdge *task)
typename VDMesh::Pointer OutputType
void createHalfEdge(FortuneHalfEdge *task, FortuneEdge *e, bool pm)
typename VDMesh::PointType PointType
bool right_of(FortuneHalfEdge *el, PointType *p)
void intersect(FortuneSite *newV, FortuneHalfEdge *el1, FortuneHalfEdge *el2)
void SetRandomSeeds(int num)
VoronoiDiagram2DGenerator()
void makeEndPoint(FortuneEdge *task, bool lr, FortuneSite *ends)
void SetBoundary(PointType vorsize)
void deleteEdgeList(FortuneHalfEdge *task)
typename VDMesh::SeedsType SeedsType
static bool comp(PointType arg1, PointType arg2)
unsigned char Pointonbnd(int VertID)
PointType GetSeed(int SeedID)
FortuneHalfEdge * findLeftHE(PointType *p)
Implements the 2-Dimensional Voronoi Diagram.
typename SeedsType::iterator SeedsIterator
std::vector< PointType > SeedsType
typename MeshTraits::CoordinateType CoordinateType
std::deque< EdgeInfo > EdgeInfoDQ
SmartPointer< Self > Pointer
ImageBaseType::PointType PointType
static constexpr double e
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....