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 /****************************************************************************/
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 
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:788
NBNodeShapeComputer::myNode
const NBNode & myNode
The node to compute the geometry for.
Definition: NBNodeShapeComputer.h:153
NBNodeShapeComputer::myRadius
double myRadius
the computed node radius
Definition: NBNodeShapeComputer.h:156
EdgeVector
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:35
NBNodeShapeComputer::getExtraWidth
static double getExtraWidth(const NBEdge *e, SVCPermissions exclude)
compute with of rightmost lanes that exlude the given permissions
Definition: NBNodeShapeComputer.cpp:953
PositionVector
A list of positions.
Definition: PositionVector.h:46
NBNodeShapeComputer::closestIntersection
double closestIntersection(const PositionVector &geom1, const PositionVector &geom2, double offset)
return the intersection point closest to the given offset
Definition: NBNodeShapeComputer.cpp:470
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:86
NBNodeShapeComputer::getRadius
double getRadius() const
get computed radius for node
Definition: NBNodeShapeComputer.h:57
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:145
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:219
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
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:709
NBNodeShapeComputer::NBNodeShapeComputer
NBNodeShapeComputer(const NBNode &node)
Constructor.
Definition: NBNodeShapeComputer.cpp:50
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
NBNodeShapeComputer::compute
PositionVector compute()
Computes the shape of the assigned junction.
Definition: NBNodeShapeComputer.cpp:60
NBNodeShapeComputer::getSmoothCorner
PositionVector getSmoothCorner(PositionVector begShape, PositionVector endShape, const Position &begPoint, const Position &endPoint, int cornerDetail)
Compute smoothed corner shape.
Definition: NBNodeShapeComputer.cpp:483
config.h
NBNodeShapeComputer::getDefaultRadius
double getDefaultRadius(const OptionsCont &oc)
determine the default radius appropriate for the current junction
Definition: NBNodeShapeComputer.cpp:860
NBNodeShapeComputer::operator=
NBNodeShapeComputer & operator=(const NBNodeShapeComputer &s)
Invalidated assignment operator.
NBNode
Represents a single node (junction) during network building.
Definition: NBNode.h:68
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:559
PositionVector.h
NBNodeShapeComputer::badIntersection
bool badIntersection(const NBEdge *e1, const NBEdge *e2, double distance)
Definition: NBNodeShapeComputer.cpp:664
NBNodeShapeComputer::computeNodeShapeSmall
PositionVector computeNodeShapeSmall()
Computes the node geometry using normals.
Definition: NBNodeShapeComputer.cpp:825
NBNodeShapeComputer::~NBNodeShapeComputer
~NBNodeShapeComputer()
Destructor.
Definition: NBNodeShapeComputer.cpp:56
NBNodeShapeComputer
This class computes shapes of junctions.
Definition: NBNodeShapeComputer.h:45
NBNodeShapeComputer::GeomsMap
std::map< NBEdge *, PositionVector > GeomsMap
Definition: NBNodeShapeComputer.h:62