index 2d7bfe252d3d023847aa198983eb334dee29d98a..00a0dd9a03efa9e680f1f2c2651560d3991e1f7a 100644 (file)
int curAPt = 0;
while (curAPt < a->numberOfPoints() || sEvts->size() > 0) {
- NR::Point ptX;
+ Geom::Point ptX;
double ptL, ptR;
SweepTree *intersL = NULL;
SweepTree *intersR = NULL;
continue;
}
- NR::Point rPtX;
+ Geom::Point rPtX;
rPtX[0]= Round (ptX[0]);
rPtX[1]= Round (ptX[1]);
int lastPointNo = -1;
}
printf("\n");*/
- NR::Point ptX;
+ Geom::Point ptX;
double ptL, ptR;
SweepTree *intersL = NULL;
SweepTree *intersR = NULL;
continue;
}
- NR::Point rPtX;
+ Geom::Point rPtX;
rPtX[0]= Round (ptX[0]);
rPtX[1]= Round (ptX[1]);
int lastPointNo = -1;
SweepTree *a = (s == LEFT) ? tt : t;
SweepTree *b = (s == LEFT) ? t : tt;
- NR::Point atx;
+ Geom::Point atx;
double atl;
double atr;
if (TesteIntersection(a, b, atx, atl, atr, onlyDiff)) {
// a crucial piece of code: computing intersections between segments
bool
-Shape::TesteIntersection (SweepTree * iL, SweepTree * iR, NR::Point &atx, double &atL, double &atR, bool onlyDiff)
+Shape::TesteIntersection (SweepTree * iL, SweepTree * iR, Geom::Point &atx, double &atL, double &atR, bool onlyDiff)
{
int lSt = iL->src->getEdge(iL->bord).st, lEn = iL->src->getEdge(iL->bord).en;
int rSt = iR->src->getEdge(iR->bord).st, rEn = iR->src->getEdge(iR->bord).en;
- NR::Point ldir, rdir;
+ Geom::Point ldir, rdir;
ldir = iL->src->eData[iL->bord].rdx;
rdir = iR->src->eData[iR->bord].rdx;
// first, a round of checks to quickly dismiss edge which obviously dont intersect,
@@ -1774,7 +1774,7 @@ Shape::TesteIntersection (SweepTree * iL, SweepTree * iR, NR::Point &atx, double
// Boissonat anr Preparata said in one paper that double precision floats were sufficient for get single precision
// coordinates for the intersection, if the endpoints are single precision. i hope they're right...
{
- NR::Point sDiff, eDiff;
+ Geom::Point sDiff, eDiff;
double slDot, elDot;
double srDot, erDot;
sDiff = iL->src->pData[lSt].rx - iR->src->pData[rSt].rx;
int
Shape::CreateIncidence (Shape * a, int no, int nPt)
{
- NR::Point adir, diff;
+ Geom::Point adir, diff;
adir = a->eData[no].rdx;
diff = getPoint(nPt).x - a->pData[a->getEdge(no).st].rx;
double t = dot (diff, adir);
}
int
-Shape::Winding (const NR::Point px) const
+Shape::Winding (const Geom::Point px) const
{
int lr = 0, ll = 0, rr = 0;
for (int i = 0; i < numberOfEdges(); i++)
{
- NR::Point adir, diff, ast, aen;
+ Geom::Point adir, diff, ast, aen;
adir = eData[i].rdx;
ast = pData[getEdge(i).st].rx;
@@ -2509,7 +2509,7 @@ Shape::GetWindings (Shape * /*a*/, Shape * /*b*/, BooleanOp /*mod*/, bool brutal
bool
Shape::TesteIntersection (Shape * ils, Shape * irs, int ilb, int irb,
- NR::Point &atx, double &atL, double &atR,
+ Geom::Point &atx, double &atL, double &atR,
bool /*onlyDiff*/)
{
int lSt = ils->getEdge(ilb).st, lEn = ils->getEdge(ilb).en;
return false;
}
- NR::Point ldir, rdir;
+ Geom::Point ldir, rdir;
ldir = ils->eData[ilb].rdx;
rdir = irs->eData[irb].rdx;
// pre-test
{
- NR::Point sDiff, eDiff;
+ Geom::Point sDiff, eDiff;
double slDot, elDot;
double srDot, erDot;
sDiff = ils->pData[lSt].rx - irs->pData[rSt].rx;
}
// a mettre en double precision pour des resultats exacts
- NR::Point usvs;
+ Geom::Point usvs;
usvs = irs->pData[rSt].rx - ils->pData[lSt].rx;
// pas sur de l'ordre des coefs de m
- NR::Matrix m(ldir[0], ldir[1],
+ Geom::Matrix m(ldir[0], ldir[1],
rdir[0], rdir[1],
0, 0);
double det = m.det();
if (tdet > -0.0001 && tdet < 0.0001)
{ // ces couillons de vecteurs sont colineaires
- NR::Point sDiff, eDiff;
+ Geom::Point sDiff, eDiff;
double sDot, eDot;
sDiff = ils->pData[lSt].rx - irs->pData[rSt].rx;
eDiff = ils->pData[lEn].rx - irs->pData[rSt].rx;
}
bool
-Shape::TesteAdjacency (Shape * a, int no, const NR::Point atx, int nPt,
+Shape::TesteAdjacency (Shape * a, int no, const Geom::Point atx, int nPt,
bool push)
{
if (nPt == a->swsData[no].stPt || nPt == a->swsData[no].enPt)
return false;
- NR::Point adir, diff, ast, aen, diff1, diff2, diff3, diff4;
+ Geom::Point adir, diff, ast, aen, diff1, diff2, diff3, diff4;
ast = a->pData[a->getEdge(no).st].rx;
aen = a->pData[a->getEdge(no).en].rx;
{
for (int j = i + 1; j < numberOfEdges(); j++)
{
- NR::Point atx;
+ Geom::Point atx;
double atL, atR;
if (TesteIntersection (this, this, i, j, atx, atL, atR, false))
{
else
{
double bdl = iS->eData[iB].ilength;
- NR::Point bpx = iS->pData[iS->getEdge(iB).st].rx;
- NR::Point bdx = iS->eData[iB].rdx;
- NR::Point psx = getPoint(getEdge(ne).st).x;
- NR::Point pex = getPoint(getEdge(ne).en).x;
- NR::Point psbx=psx-bpx;
- NR::Point pebx=pex-bpx;
+ Geom::Point bpx = iS->pData[iS->getEdge(iB).st].rx;
+ Geom::Point bdx = iS->eData[iB].rdx;
+ Geom::Point psx = getPoint(getEdge(ne).st).x;
+ Geom::Point pex = getPoint(getEdge(ne).en).x;
+ Geom::Point psbx=psx-bpx;
+ Geom::Point pebx=pex-bpx;
double pst = dot(psbx,bdx) * bdl;
double pet = dot(pebx,bdx) * bdl;
pst = iS->ebData[iB].tSt * (1 - pst) + iS->ebData[iB].tEn * pst;