Eclipse 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-2019 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 /****************************************************************************/
16 // This class computes shapes of junctions
17 /****************************************************************************/
18 #ifndef NBNodeShapeComputer_h
19 #define NBNodeShapeComputer_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
28 
29 
30 // ===========================================================================
31 // class definitions
32 // ===========================================================================
33 class NBNode;
34 class NBEdge;
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
45 public:
47  NBNodeShapeComputer(const NBNode& node);
48 
51 
54 
56  double getRadius() const {
57  return myRadius;
58  }
59 
60 private:
61  typedef std::map<NBEdge*, PositionVector> GeomsMap;
62 
68  PositionVector computeNodeShapeDefault(bool simpleContinuation);
69 
82 
83 
93  void joinSameDirectionEdges(std::map<NBEdge*, std::set<NBEdge*> >& same,
94  GeomsMap& geomsCCW,
95  GeomsMap& geomsCW);
96 
105  std::map<NBEdge*, std::set<NBEdge*> >& same,
106  GeomsMap& geomsCCW,
107  GeomsMap& geomsCW);
108 
118  const Position& begPoint, const Position& endPoint, int cornerDetail);
119 
130  static void initNeighbors(const EdgeVector& edges, const EdgeVector::const_iterator& current,
131  GeomsMap& geomsCW,
132  GeomsMap& geomsCCW,
133  EdgeVector::const_iterator& cwi,
134  EdgeVector::const_iterator& ccwi,
135  double& cad,
136  double& ccad);
137 
139  bool badIntersection(const NBEdge* e1, const NBEdge* e2, double distance);
140 
142  double closestIntersection(const PositionVector& geom1, const PositionVector& geom2, double offset);
143 
145  double getDefaultRadius(const OptionsCont& oc);
146 
148  static double getExtraWidth(const NBEdge* e, SVCPermissions exclude);
149 
150 private:
152  const NBNode& myNode;
153 
155  double myRadius;
156 
157 private:
160 
161 };
162 
163 #endif
164 
165 /****************************************************************************/
166 
NBNodeShapeComputer::initNeighbors
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.
Definition: NBNodeShapeComputer.cpp:787
NBNodeShapeComputer::myNode
const NBNode & myNode
The node to compute the geometry for.
Definition: NBNodeShapeComputer.h:152
NBNodeShapeComputer::myRadius
double myRadius
the computed node radius
Definition: NBNodeShapeComputer.h:155
EdgeVector
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:34
NBNodeShapeComputer::getExtraWidth
static double getExtraWidth(const NBEdge *e, SVCPermissions exclude)
compute with of rightmost lanes that exlude the given permissions
Definition: NBNodeShapeComputer.cpp:952
PositionVector
A list of positions.
Definition: PositionVector.h:45
NBNodeShapeComputer::closestIntersection
double closestIntersection(const PositionVector &geom1, const PositionVector &geom2, double offset)
return the intersection point closest to the given offset
Definition: NBNodeShapeComputer.cpp:469
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:91
NBNodeShapeComputer::getRadius
double getRadius() const
get computed radius for node
Definition: NBNodeShapeComputer.h:56
NBNodeShapeComputer::computeNodeShapeDefault
PositionVector computeNodeShapeDefault(bool simpleContinuation)
Computes the node geometry Edges with the same direction are grouped. Then the node geometry is built...
Definition: NBNodeShapeComputer.cpp:144
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:218
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
NBNodeShapeComputer::computeUniqueDirectionList
EdgeVector computeUniqueDirectionList(std::map< NBEdge *, std::set< NBEdge * > > &same, GeomsMap &geomsCCW, GeomsMap &geomsCW)
Joins edges and computes ccw/cw boundaries.
Definition: NBNodeShapeComputer.cpp:708
NBNodeShapeComputer::NBNodeShapeComputer
NBNodeShapeComputer(const NBNode &node)
Constructor.
Definition: NBNodeShapeComputer.cpp:49
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
NBNodeShapeComputer::compute
PositionVector compute()
Computes the shape of the assigned junction.
Definition: NBNodeShapeComputer.cpp:59
NBNodeShapeComputer::getSmoothCorner
PositionVector getSmoothCorner(PositionVector begShape, PositionVector endShape, const Position &begPoint, const Position &endPoint, int cornerDetail)
Compute smoothed corner shape.
Definition: NBNodeShapeComputer.cpp:482
config.h
NBNodeShapeComputer::getDefaultRadius
double getDefaultRadius(const OptionsCont &oc)
determine the default radius appropriate for the current junction
Definition: NBNodeShapeComputer.cpp:859
NBNodeShapeComputer::operator=
NBNodeShapeComputer & operator=(const NBNodeShapeComputer &s)
Invalidated assignment operator.
NBNode
Represents a single node (junction) during network building.
Definition: NBNode.h:67
NBNodeShapeComputer::joinSameDirectionEdges
void joinSameDirectionEdges(std::map< NBEdge *, std::set< NBEdge * > > &same, GeomsMap &geomsCCW, GeomsMap &geomsCW)
Joins edges and computes ccw/cw boundaries.
Definition: NBNodeShapeComputer.cpp:558
PositionVector.h
NBNodeShapeComputer::badIntersection
bool badIntersection(const NBEdge *e1, const NBEdge *e2, double distance)
Definition: NBNodeShapeComputer.cpp:663
NBNodeShapeComputer::computeNodeShapeSmall
PositionVector computeNodeShapeSmall()
Computes the node geometry using normals.
Definition: NBNodeShapeComputer.cpp:824
NBNodeShapeComputer::~NBNodeShapeComputer
~NBNodeShapeComputer()
Destructor.
Definition: NBNodeShapeComputer.cpp:55
NBNodeShapeComputer
This class computes shapes of junctions.
Definition: NBNodeShapeComputer.h:44
NBNodeShapeComputer::GeomsMap
std::map< NBEdge *, PositionVector > GeomsMap
Definition: NBNodeShapeComputer.h:61