SUMO - Simulation of Urban MObility
NBNodeShapeComputer.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // This class computes shapes of junctions
18 /****************************************************************************/
19 #ifndef NBNodeShapeComputer_h
20 #define NBNodeShapeComputer_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
29 
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
34 class NBNode;
35 class NBEdge;
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
46 public:
48  NBNodeShapeComputer(const NBNode& node);
49 
52 
55 
57  double getRadius() const {
58  return myRadius;
59  }
60 
61 private:
62  typedef std::map<NBEdge*, PositionVector> GeomsMap;
63 
69  PositionVector computeNodeShapeDefault(bool simpleContinuation);
70 
83 
84 
94  void joinSameDirectionEdges(std::map<NBEdge*, std::set<NBEdge*> >& same,
95  GeomsMap& geomsCCW,
96  GeomsMap& geomsCW);
97 
106  std::map<NBEdge*, std::set<NBEdge*> >& same,
107  GeomsMap& geomsCCW,
108  GeomsMap& geomsCW);
109 
119  const Position& begPoint, const Position& endPoint, int cornerDetail);
120 
131  static void initNeighbors(const EdgeVector& edges, const EdgeVector::const_iterator& current,
132  GeomsMap& geomsCW,
133  GeomsMap& geomsCCW,
134  EdgeVector::const_iterator& cwi,
135  EdgeVector::const_iterator& ccwi,
136  double& cad,
137  double& ccad);
138 
140  bool badIntersection(const NBEdge* e1, const NBEdge* e2, double distance);
141 
143  double closestIntersection(const PositionVector& geom1, const PositionVector& geom2, double offset);
144 
146  double getDefaultRadius(const OptionsCont& oc);
147 
149  static double getExtraWidth(const NBEdge* e, SVCPermissions exclude);
150 
151 private:
153  const NBNode& myNode;
154 
156  double myRadius;
157 
158 private:
161 
162 };
163 
164 #endif
165 
166 /****************************************************************************/
167 
double myRadius
the computed node radius
static void initNeighbors(const EdgeVector &edges, const EdgeVector::const_iterator &current, GeomsMap &geomsCW, GeomsMap &geomsCCW, EdgeVector::const_iterator &cwi, EdgeVector::const_iterator &ccwi, double &cad, double &ccad)
Initialize neighbors and angles.
double getDefaultRadius(const OptionsCont &oc)
determine the default radius appropriate for the current junction
double getRadius() const
get computed radius for node
NBNodeShapeComputer & operator=(const NBNodeShapeComputer &s)
Invalidated assignment operator.
PositionVector getSmoothCorner(PositionVector begShape, PositionVector endShape, const Position &begPoint, const Position &endPoint, int cornerDetail)
Compute smoothed corner shape.
This class computes shapes of junctions.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
The representation of a single edge during network building.
Definition: NBEdge.h:65
PositionVector computeNodeShapeDefault(bool simpleContinuation)
Computes the node geometry Edges with the same direction are grouped. Then the node geometry is built...
const NBNode & myNode
The node to compute the geometry for.
std::map< NBEdge *, PositionVector > GeomsMap
static double getExtraWidth(const NBEdge *e, SVCPermissions exclude)
compute with of rightmost lanes that exlude the given permissions
NBNodeShapeComputer(const NBNode &node)
Constructor.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
A list of positions.
PositionVector compute()
Computes the shape of the assigned junction.
~NBNodeShapeComputer()
Destructor.
PositionVector computeNodeShapeSmall()
Computes the node geometry using normals.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:34
void joinSameDirectionEdges(std::map< NBEdge *, std::set< NBEdge *> > &same, GeomsMap &geomsCCW, GeomsMap &geomsCW)
Joins edges and computes ccw/cw boundaries.
A storage for options typed value containers)
Definition: OptionsCont.h:92
bool badIntersection(const NBEdge *e1, const NBEdge *e2, double distance)
Represents a single node (junction) during network building.
Definition: NBNode.h:68
EdgeVector computeUniqueDirectionList(std::map< NBEdge *, std::set< NBEdge *> > &same, GeomsMap &geomsCCW, GeomsMap &geomsCW)
Joins edges and computes ccw/cw boundaries.
double closestIntersection(const PositionVector &geom1, const PositionVector &geom2, double offset)
return the intersection point closest to the given offset