/*
5 * Authors: see git history
7 * Copyright (C) 2018 Authors
8 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
41 ConvertTo(iSrc, iBord, iWeight, iStartPoint);
55 for (
int i = 0; i < 2; i++) {
96 if (fabs(y) < 0.000001) {
112 y = cross(bNorm, nNorm);
114 y = cross(nNorm, bNorm);
117 y =
dot(bNorm, nNorm);
180 y =
dot(bNorm, diff);
293 Shape *iDst,
int iAtPoint,
bool rebalance,
bool sweepSens)
296 if (list.
racine ==
nullptr)
306 insertL, insertR, sweepSens);
327 static_cast<AVLTree *
>(insertR), rebalance);
340 bool rebalance,
bool sweepSens)
343 if (list.
racine ==
nullptr)
360 if (sweepSens ==
false)
375 double ang = cross(bNorm, nNorm);
405 if ((insertL->
src->
pData[ils].rx[0] != fromP[0]
406 || insertL->
src->
pData[ils].rx[1] != fromP[1])
407 && (insertL->
src->
pData[ile].rx[0] != fromP[0]
408 || insertL->
src->
pData[ile].rx[1] != fromP[1]))
421 ang = cross(bNorm, nNorm);
452 if ((insertR->
src->
pData[ils].rx[0] != fromP[0]
453 || insertR->
src->
pData[ils].rx[1] != fromP[1])
454 && (insertR->
src->
pData[ile].rx[0] != fromP[0]
455 || insertR->
src->
pData[ile].rx[1] != fromP[1]))
467 ang = cross(bNorm, nNorm);
479 if (insertL ==
nullptr) {
482 if (insertR ==
nullptr) {
503 static_cast<AVLTree *
>(insertR), rebalance);
538 std::swap(tL->
src, tR->
src);
TODO: insert short description here.
void Relocate(AVLTree *to)
int Insert(AVLTree *&racine, int insertType, AVLTree *insertL, AVLTree *insertR, bool rebalance)
int Remove(AVLTree *&racine, bool rebalance=true)
Two-dimensional point that doubles as a vector.
constexpr Point ccw() const
Return a point like this point but rotated -90 degrees.
A class to store/manipulate directed graphs.
std::vector< sweep_src_data > swsData
std::vector< raster_data > swrData
std::vector< edge_data > eData
dg_arete const & getEdge(int n) const
Get an edge.
dg_point const & getPoint(int n) const
Get a point.
std::vector< point_data > pData
The structure to hold the intersections events encountered during the sweep.
void remove(SweepEvent *e)
Remove event from the event queue.
The sweepline tree to store a linear sequence of edges that intersect with the sweepline in the exact...
One node in the AVL tree of edges.
void ConvertTo(Shape *iSrc, int iBord, int iWeight, int iStartPoint)
Reuse this node by just changing the variables.
void SwapWithRight(SweepTreeList &list, SweepEventQueue &queue)
Swap nodes, or more exactly, swap the edges in them.
int InsertAt(SweepTreeList &list, SweepEventQueue &queue, Shape *iDst, SweepTree *insNode, int fromPt, bool rebalance=true, bool sweepSens=true)
Insert this node near an existing node.
void Relocate(SweepTree *to)
TODO: Probably has to do with some AVL relocation.
void RemoveEvent(SweepEventQueue &queue, Side s)
Remove event on the side s if it exists from event queue.
int Insert(SweepTreeList &list, SweepEventQueue &queue, Shape *iDst, int iAtPoint, bool rebalance=true, bool sweepSens=true)
Insert this node at it's appropriate position in the sweepline tree.
void MakeDelete()
Delete this node.
int Remove(SweepTreeList &list, SweepEventQueue &queue, bool rebalance=true)
void RemoveEvents(SweepEventQueue &queue)
Remove sweepevents attached to this node.
int Find(Geom::Point const &iPt, SweepTree *newOne, SweepTree *&insertL, SweepTree *&insertR, bool sweepSens=true)
Find where the new edge needs to go in the sweepline tree.
double ang(Point n1, Point n2)
A container of intersection events.
TODO: insert short description here.
TODO: insert short description here.
TODO: insert short description here.
void dot(Cairo::RefPtr< Cairo::Context > &cr, double x, double y)