diff --git a/src/libavoid/graph.cpp b/src/libavoid/graph.cpp
index 5e41f79f548ba5702a079423681f059e69a105fc..1970212df4e31214beb8b398c528588d8c6046f0 100644 (file)
--- a/src/libavoid/graph.cpp
+++ b/src/libavoid/graph.cpp
#include <math.h>
#include <math.h>
+using std::pair;
+
namespace Avoid {
EdgeInf::EdgeInf(VertInf *v1, VertInf *v2)
: lstPrev(NULL)
, lstNext(NULL)
namespace Avoid {
EdgeInf::EdgeInf(VertInf *v1, VertInf *v2)
: lstPrev(NULL)
, lstNext(NULL)
+ , _blocker(0)
, _router(NULL)
, _added(false)
, _visible(false)
, _router(NULL)
, _added(false)
, _visible(false)
assert(_v1->_router == _v2->_router);
_router = _v1->_router;
assert(_v1->_router == _v2->_router);
_router = _v1->_router;
- _blockers.clear();
_conns.clear();
}
_conns.clear();
}
_v2->invisList.erase(_pos2);
_v2->invisListSize--;
}
_v2->invisList.erase(_pos2);
_v2->invisListSize--;
}
- _blockers.clear();
+ _blocker = 0;
_conns.clear();
_added = false;
}
_conns.clear();
_added = false;
}
-double EdgeInf::getDist(void)
-{
- return _dist;
-}
-
-
void EdgeInf::setDist(double dist)
{
//assert(dist != 0);
void EdgeInf::setDist(double dist)
{
//assert(dist != 0);
makeActive();
}
_dist = dist;
makeActive();
}
_dist = dist;
- _blockers.clear();
+ _blocker = 0;
}
void EdgeInf::alertConns(void)
{
}
void EdgeInf::alertConns(void)
{
- for (FlagList::iterator i = _conns.begin(); i != _conns.end(); ++i)
+ FlagList::iterator finish = _conns.end();
+ for (FlagList::iterator i = _conns.begin(); i != finish; ++i)
{
*(*i) = true;
}
{
*(*i) = true;
}
makeActive();
}
_dist = 0;
makeActive();
}
_dist = 0;
- _blockers.clear();
- _blockers.push_back(b);
-}
-
-
-bool EdgeInf::hasBlocker(int b)
-{
- assert(_router->InvisibilityGrph);
-
- ShapeList::iterator finish = _blockers.end();
- for (ShapeList::iterator it = _blockers.begin(); it != finish; ++it)
- {
- if ((*it) == -1)
- {
- alertConns();
- return true;
- }
- else if ((*it) == b)
- {
- return true;
- }
- }
- return false;
+ _blocker = b;
}
}