63 myName(name), myFromDef(from_def), myToDef(to_def),
64 myAssignedVehicles(assignedVehicles), myClosedLanes(clv) {}
77 DictType::iterator i =
myDict.find(
id);
89 DictType::iterator i =
myDict.find(
id);
99 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
103 std::vector<int> connections =
106 std::vector<int>(),
true);
117 std::vector<int> ret;
118 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
119 if ((*i).second->crosses(poly)) {
120 ret.push_back((*i).second->myID);
139 std::vector<int> ret;
140 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
141 int connID = (*i).first;
142 if ((*i).second->myFromDef.getEdgeID() == edgeid
144 (*i).second->myToDef.getEdgeID() == edgeid) {
145 if (!(*i).second->hasNodeCluster()) {
146 ret.push_back(connID);
210 int unsetConnections = 0;
212 NBEdge* fromEdge =
nullptr;
218 if (vissimFrom !=
nullptr) {
228 if (vissimTo !=
nullptr) {
240 if (fromEdge ==
nullptr || toEdge ==
nullptr) {
246 const std::vector<int>& toLanes =
getToLanes();
247 if (fromLanes.size() != toLanes.size()) {
250 for (
int index = 0; index < (int)fromLanes.size(); ++index) {
260 return unsetConnections;
266 int unsetConnections = 0;
268 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
269 unsetConnections += (*i).second->buildEdgeConnections(ec);
271 if (unsetConnections != 0) {
272 WRITE_WARNING(toString<int>(unsetConnections) +
" of " + toString<int>((
int)
myDict.size()) +
" connections could not be assigned.");
277const std::vector<int>&
283const std::vector<int>&
305 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
#define WRITE_WARNINGF(...)
#define WRITE_WARNING(msg)
std::vector< NIVissimClosedLaneDef * > NIVissimClosedLanesVector
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
double xmin() const
Returns minimum x-coordinate.
double xmax() const
Returns maximum x-coordinate.
Storage for edges, including some functionality operating on multiple edges.
NBEdge * retrievePossiblySplit(const std::string &id, bool downstream) const
Tries to retrieve an edge, even if it is splitted.
The representation of a single edge during network building.
bool addLane2LaneConnection(int fromLane, NBEdge *dest, int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, KeepClear keepClear=KEEPCLEAR_UNSPECIFIED, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, double friction=UNSPECIFIED_FRICTION, double length=myDefaultConnectionLength, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions permissions=SVC_UNSPECIFIED, const bool indirectLeft=false, const std::string &edgeType="", SVCPermissions changeLeft=SVC_UNSPECIFIED, SVCPermissions changeRight=SVC_UNSPECIFIED, bool postProcess=false)
Adds a connection between the specified this edge's lane and an approached one.
const std::string & getID() const
int getNumLanes() const
Returns the number of lanes.
@ VALIDATED
The connection was computed and validated.
virtual ~NIVissimConnection()
static void buildNodeClusters()
NIVissimExtendedEdgePoint myToDef
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)
static std::vector< int > getWithin(const AbstractPoly &poly)
const std::vector< int > & getFromLanes() const
static void dict_buildNBEdgeConnections(NBEdgeCont &ec)
double getFromPosition() const
void setNodeCluster(int nodeid)
static std::vector< int > getForEdge(int edgeid, bool omitNodeAssigned=true)
NIVissimExtendedEdgePoint myFromDef
const Boundary & getBoundingBox() const
int buildEdgeConnections(NBEdgeCont &ec)
const std::vector< int > & getToLanes() const
static void dict_assignToEdges()
int getFromEdgeID() const
static bool dictionary(int id, NIVissimConnection *o)
Position getToGeomPosition() const
std::map< int, NIVissimConnection * > DictType
double getToPosition() const
NIVissimClosedLanesVector myClosedLanes
Position getFromGeomPosition() const
void recheckLanes(const NBEdge *const fromEdge, const NBEdge *const toEdge)
Resets lane numbers if all lanes shall be used.
A temporary storage for edges imported from Vissim.
NIVissimEdge * getBestOutgoing() const
NIVissimEdge * getBestIncoming() const
bool wasWithinAJunction() const
Returns whether this edge was found to be within a junction.
static bool dictionary(int id, const std::string &name, const std::string &type, int noLanes, double zuschlag1, double zuschlag2, double length, const PositionVector &geom, const NIVissimClosedLanesVector &clv)
Adds the described item to the dictionary Builds the edge first.
void recheckLanes(const NBEdge *const edge)
Resets lane numbers if all lanes shall be used.
const std::vector< int > & getLanes() const
Position getGeomPosition() const
double getPosition() const
static bool dictionary(int id, NIVissimNodeCluster *o)
A point in 2D or 3D with translation and scaling methods.