#include "livarot/sweep-event-queue.h"
#include "livarot/sweep-tree-list.h"
#include "livarot/sweep-tree.h"
#include "livarot/sweep-event.h"
/*
* the AVL tree holding the edges intersecting the sweepline
* that structure is very sensitive to anything
* you have edges stored in nodes, the nodes are sorted in increasing x-order of intersection
* with the sweepline, you have the 2 potential intersections of the edge in the node with its
* neighbours, plus the fact that it's stored in an array that's realloc'd
*/
{
bord = -1;
startPoint = -1;
sens = true;
//invDirLength=1;
}
{
MakeDelete();
}
void
{
}
void
{
if (iWeight >= 0)
sens = true;
else
sens = false;
} else {
if (iWeight >= 0)
sens = false;
else
sens = true;
}
//invDirLength=src->eData[bord].isqlength;
//invDirLength=1/sqrt(src->getEdge(bord).dx*src->getEdge(bord).dx+src->getEdge(bord).dy*src->getEdge(bord).dy);
}
{
for (int i = 0; i < 2; i++) {
if (evt[i]) {
}
}
AVLTree::MakeDelete();
}
// find the position at which node "newOne" should be inserted in the subtree rooted here
// we want to order with respect to the order of intersections with the sweepline, currently
// lying at y=px[1].
// px is the upper endpoint of newOne
int
{
// get the edge associated with this node: one point+one direction
// since we're dealing with line, the direction (bNorm) is taken downwards
}
// rotate to get the normal to the edge
// compute (px-orig)^dir to know on which side of this edge the point px lies
double y = 0;
//if ( startPoint == newOne->startPoint ) {
// y=0;
//} else {
//}
//y*=invDirLength;
if (fabs(y) < 0.000001) {
// that damn point px lies on me, so i need to consider to direction of the edge in
// newOne to know if it goes toward my left side or my right side
// sweepSens is needed (actually only used by the Scan() functions) because if the sweepline goes upward,
// signs change
// prendre en compte les directions
{
}
if (sweepSens) {
} else {
}
if (y == 0) {
if (y == 0) {
insertL = this;
return found_exact;
}
}
}
if (y < 0) {
} else {
insertR = this;
if (insertL) {
return found_between;
} else {
return found_on_left;
}
}
} else {
} else {
insertL = this;
if (insertR) {
return found_between;
} else {
return found_on_right;
}
}
}
return not_found;
}
// only find a point's position
int
{
{
}
double y = 0;
if (y == 0)
{
insertL = this;
return found_exact;
}
if (y < 0)
{
{
insertR);
}
else
{
insertR = this;
if (insertL)
{
return found_between;
}
else
{
return found_on_left;
}
}
}
else
{
{
insertR);
}
else
{
insertL = this;
if (insertR)
{
return found_between;
}
else
{
return found_on_right;
}
}
}
return not_found;
}
void
{
}
{
if (evt[s]) {
}
}
int
bool rebalance)
{
MakeDelete();
{
}
else
{
}
return err;
}
int
{
{
return avl_no_err;
}
int insertion =
if (insertion == found_exact) {
if (insertR) {
}
if (insertL) {
}
} else if (insertion == found_between) {
}
int err =
return err;
}
// insertAt() is a speedup on the regular sweepline: if the polygon contains a point of high degree, you
// get a set of edge that are to be added in the same position. thus you insert one edge with a regular insert(),
// and then insert all the other in a doubly-linked list fashion. this avoids the Find() call, but is O(d^2) worst-case
// where d is the number of edge to add in this fashion. hopefully d remains small
int
{
{
return avl_no_err;
}
{
}
if (sweepSens == false)
{
}
{
}
if (ang == 0)
{
}
else if (ang > 0)
{
while (insertL)
{
{
{
break;
}
}
else
{
{
break;
}
}
{
}
if (ang <= 0)
{
break;
}
}
}
else if (ang < 0)
{
while (insertR)
{
{
{
break;
}
}
else
{
{
break;
}
}
{
}
if (ang > 0)
{
break;
}
}
}
}
}
if (insertion == found_exact) {
/* FIXME: surely this can never be called? */
if (insertR) {
}
if (insertL) {
}
} else if (insertion == found_between) {
}
int err =
return err;
}
void
{
if (this == to)
return;
}
// TODO check if ignoring these parameters is bad
void
{
{
}
{
}
{
}
//{double swap=tL->invDirLength;tL->invDirLength=tR->invDirLength;tR->invDirLength=swap;}
{
}
}
void
{
return;
/* if ( curPoint != startPoint ) {
int nb=-1;
if ( sens ) {
// nb=dstPts->AddEdge(startPoint,curPoint);
} else {
// nb=dstPts->AddEdge(curPoint,startPoint);
}
if ( nb >= 0 ) {
dstPts->swsData[nb].misc=(void*)((src==b)?1:0);
int wp=waitingPoint;
dstPts->eData[nb].firstLinkedPoint=waitingPoint;
waitingPoint=-1;
while ( wp >= 0 ) {
dstPts->pData[wp].edgeOnLeft=nb;
wp=dstPts->pData[wp].nextLinkedPoint;
}
}
startPoint=curPoint;
}*/
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :