/*
5 * Authors: see git history
7 * Copyright (C) 2018 Authors
8 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
42 if (
sTree ==
nullptr) {
45 if (
sEvts ==
nullptr) {
56 pData[i].nextLinkedPoint = -1;
97 Direction
const d = (pos < to) ? DOWNWARDS : UPWARDS;
104 ( d == UPWARDS && curPt > 0 &&
getPoint(curPt - 1).x[1] >= to) )
106 int nPt = (d == DOWNWARDS) ? curPt++ : --curPt;
115 if ( d == DOWNWARDS ) {
119 if ( upNo >= 0 &&
swrData[upNo].misc ==
nullptr ) {
126 if ( dnNo >= 0 &&
swrData[dnNo].misc ==
nullptr ) {
131 if ( ( d == DOWNWARDS && nbUp > 0 ) || ( d == UPWARDS && nbDn > 0 ) ) {
137 if ( (d == DOWNWARDS && nPt == std::max(e.
st, e.
en)) ||
138 (d == UPWARDS && nPt == std::min(e.
st, e.
en)) )
140 if ( ( d == DOWNWARDS && cb != upNo ) || ( d == UPWARDS && cb != dnNo ) ) {
159 int rmNo=(d == DOWNWARDS) ? upNo:dnNo;
160 int neNo=(d == DOWNWARDS) ? dnNo:upNo;
164 int const P = (d == DOWNWARDS) ? nPt :
Other(nPt, neNo);
165 node->ConvertTo(
this, neNo, 1, P);
168 insertionNode =
node;
175 insertionNode =
node;
184 insertionNode =
node;
190 if ( ( d == DOWNWARDS && nbDn > 1 ) || ( d == UPWARDS && nbUp > 1 ) ) {
195 if ( nPt == std::min(e.
st, e.
en) ) {
196 if ( cb != dnNo && cb != upNo ) {
308 swrData[lb].guess = lastGuess - 1;
340 if ( upNo >= 0 &&
swrData[upNo].misc ==
nullptr ) {
344 if ( nbUp > 1 || ( nbUp == 1 && upNo < 0 ) ) {
348 if ( nPt == std::max(e.
st, e.
en) ) {
372 node->ConvertTo(
this, dnNo, 1, nPt);
375 insertionNode =
node;
382 insertionNode =
node;
391 if ( nPt == std::min(e.
st, e.
en) ) {
463 if ( fabs(dir[1]) < 0.000001 ) {
466 swrData[no].dxdy = dir[0]/dir[1];
469 if ( fabs(dir[0]) < 0.000001 ) {
472 swrData[no].dydx = dir[1]/dir[0];
493 if ( fabs(dir[1]) < 0.000001 ) {
494 swrData[no].calcX = stp[0] + dir[0];
496 swrData[no].calcX = stp[0] + ((to - stp[1]) * dir[0]) / dir[1];
630 if ( P == std::max(e.
st, e.
en) ) {
634 if ( P == std::min(e.
st, e.
en) ) {
650 int *numberUp,
int *numberDown,
int *upEdge,
int *downEdge)
const
659 if ( P == std::max(e.
st, e.
en) ) {
663 if ( P == std::min(e.
st, e.
en) ) {
TODO: insert short description here.
Coverage with floating-point boundaries.
int AddBordR(float spos, float sval, float epos, float eval, float pente, int guess=-1)
Add a coverage portion.
int AppendBord(float spos, float sval, float epos, float eval, float pente)
Add a coverage portion by appending boundaries at the end of the list.
int AddBord(float spos, float sval, float epos, float eval, int guess=-1)
Add a coverage portion.
Two-dimensional point that doubles as a vector.
int Other(int p, int b) const
void CreateEdge(int no, float to, float step)
void _updateIntersection(int e, int p)
void Scan(float &pos, int &curP, float to, float step)
void _countUpDown(int P, int *numberUp, int *numberDown, int *upEdge, int *downEdge) const
std::vector< raster_data > swrData
void SortPoints()
Sort the points (all points) only if needed.
void MakePointData(bool nVal)
Initialize the point data cache.
int numberOfEdges() const
Returns number of edges.
void BeginRaster(float &pos, int &curPt)
std::vector< edge_data > eData
int NextAt(int p, int b) const
int numberOfPoints() const
Returns number of points.
void AvanceEdge(int no, float to, bool exact, float step)
dg_arete const & getEdge(int n) const
Get an edge.
void MakeRasterData(bool nVal)
void _countUpDownTotalDegree2(int P, int *numberUp, int *numberDown, int *upEdge, int *downEdge) const
Version of Shape::_countUpDown optimised for the case when getPoint(P).totalDegree() == 2.
friend class SweepEventQueue
void MakeEdgeData(bool nVal)
Initialize the edge data cache.
void DestroyEdge(int no, float to, FloatLigne *line)
dg_point const & getPoint(int n) const
Get a point.
std::vector< point_data > pData
The sweepline tree to store a linear sequence of edges that intersect with the sweepline in the exact...
SweepTree * add(Shape *iSrc, int iBord, int iWeight, int iStartPoint, Shape *iDst)
Create a new node and add it.
One node in the AVL tree of edges.
TODO: insert short description here.
Inkscape::XML::Node * node
An edge in the directed graph.
A container of intersection events.
TODO: insert short description here.
TODO: insert short description here.