55 #ifdef CHECK_MEMORY_LEAKS
57 #endif // CHECK_MEMORY_LEAKS
76 myName(name), myFromDef(from_def), myToDef(to_def),
77 myAssignedVehicles(assignedVehicles), myClosedLanes(clv) {}
90 DictType::iterator i =
myDict.find(
id);
102 DictType::iterator i =
myDict.find(
id);
112 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
116 std::vector<int> connections =
119 std::vector<int>(),
true);
130 std::vector<int> ret;
131 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
132 if ((*i).second->crosses(poly)) {
133 ret.push_back((*i).second->myID);
152 std::vector<int> ret;
153 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
154 int connID = (*i).first;
155 if ((*i).second->myFromDef.getEdgeID() == edgeid
157 (*i).second->myToDef.getEdgeID() == edgeid) {
158 if (!(*i).second->hasNodeCluster()) {
159 ret.push_back(connID);
223 unsigned int unsetConnections = 0;
231 if (vissimFrom != 0) {
253 if (fromEdge == 0 || toEdge == 0) {
259 const std::vector<int>& toLanes =
getToLanes();
260 if (fromLanes.size() != toLanes.size()) {
263 for (
unsigned int index = 0; index < fromLanes.size(); ++index) {
264 if (fromEdge->
getNumLanes() <=
static_cast<unsigned int>(fromLanes[index])) {
273 return unsetConnections;
279 unsigned int unsetConnections = 0;
281 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
282 unsetConnections += (*i).second->buildEdgeConnections(ec);
284 if (unsetConnections != 0) {
285 WRITE_WARNING(toString<size_t>(unsetConnections) +
" of " + toString<size_t>(
myDict.size()) +
" connections could not be assigned.");
290 const std::vector<int>&
296 const std::vector<int>&
318 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
SUMOReal getFromPosition() const
Position getGeomPosition() const
NBEdge * retrievePossiblySplit(const std::string &id, bool downstream) const
Tries to retrieve an edge, even if it is splitted.
const std::vector< int > & getToLanes() const
static void dict_buildNBEdgeConnections(NBEdgeCont &ec)
void recheckLanes(const NBEdge *const edge)
Resets lane numbers if all lanes shall be used.
virtual ~NIVissimConnection()
std::vector< NIVissimClosedLaneDef * > NIVissimClosedLanesVector
The representation of a single edge during network building.
std::map< int, NIVissimConnection * > DictType
SUMOReal xmin() const
Returns minimum x-coordinate.
NIVissimClosedLanesVector myClosedLanes
bool addLane2LaneConnection(unsigned int fromLane, NBEdge *dest, unsigned int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false)
Adds a connection between the specified this edge's lane and an approached one.
SUMOReal getPosition() const
static bool dictionary(int id, NIVissimNodeCluster *o)
static void buildNodeClusters()
static bool dictionary(int id, NIVissimConnection *o)
SUMOReal xmax() const
Returns maximum x-coordinate.
bool wasWithinAJunction() const
Returns whether this edge was found to be within a junction.
A class that stores a 2D geometrical boundary.
Position getToGeomPosition() const
#define WRITE_WARNING(msg)
The connection was computed and validated.
A temporary storage for edges imported from Vissim.
NIVissimExtendedEdgePoint myFromDef
static void dict_assignToEdges()
static std::vector< int > getWithin(const AbstractPoly &poly)
const std::string & getID() const
Returns the id.
SUMOReal getToPosition() const
A point in 2D or 3D with translation and scaling methods.
const std::vector< int > & getLanes() const
void setNodeCluster(int nodeid)
NIVissimEdge * getBestOutgoing() const
unsigned int getNumLanes() const
Returns the number of lanes.
Storage for edges, including some functionality operating on multiple edges.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
const Boundary & getBoundingBox() const
void push_back(const PositionVector &p)
Appends all positions from the given vector.
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
void recheckLanes(const NBEdge *const fromEdge, const NBEdge *const toEdge)
Resets lane numbers if all lanes shall be used.
const std::vector< int > & getFromLanes() const
static bool dictionary(int id, const std::string &name, const std::string &type, int noLanes, SUMOReal zuschlag1, SUMOReal zuschlag2, SUMOReal length, const PositionVector &geom, const NIVissimClosedLanesVector &clv)
Adds the described item to the dictionary Builds the edge first.
NIVissimConnection(int id, const std::string &name, const NIVissimExtendedEdgePoint &from_def, const NIVissimExtendedEdgePoint &to_def, const PositionVector &geom, const std::vector< int > &assignedVehicles, const NIVissimClosedLanesVector &clv)
NIVissimEdge * getBestIncoming() const
NIVissimExtendedEdgePoint myToDef
Position getFromGeomPosition() const
static std::vector< int > getForEdge(int edgeid, bool omitNodeAssigned=true)
unsigned int buildEdgeConnections(NBEdgeCont &ec)
int getFromEdgeID() const