operator: fix in PEC curves

Operator::FindPath method is not optimal yet,
will find weird pathes in some occasions,
at least they will be closed now... hopefully :)

Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>
pull/1/head
Thorsten Liebig 2010-10-12 12:49:44 +02:00
parent 16e0e2f3f2
commit b6362495d8
1 changed files with 21 additions and 0 deletions

View File

@ -265,6 +265,27 @@ struct Operator::Grid_Path Operator::FindPath(double start[], double stop[])
currFoot=minFoot;
path.dir.push_back(minDir);
}
//close missing edges, if currPos is not equal to uiStopPos
for (int n=0;n<3;++n)
{
if (currPos[n]>uiStop[n])
{
--currPos[n];
path.posPath[0].push_back(currPos[0]);
path.posPath[1].push_back(currPos[1]);
path.posPath[2].push_back(currPos[2]);
path.dir.push_back(n);
}
else if (currPos[n]<uiStop[n])
{
path.posPath[0].push_back(currPos[0]);
path.posPath[1].push_back(currPos[1]);
path.posPath[2].push_back(currPos[2]);
path.dir.push_back(n);
}
}
return path;
}