SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
NBNodeShapeComputer.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // This class computes shapes of junctions
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef NBNodeShapeComputer_h
23 #define NBNodeShapeComputer_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
36 
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
41 class NBNode;
42 class NBEdge;
43 
44 
45 // ===========================================================================
46 // class declarations
47 // ===========================================================================
53 public:
55  NBNodeShapeComputer(const NBNode& node);
56 
59 
61  PositionVector compute(bool leftHand);
62 
63 private:
64  typedef std::map<NBEdge*, PositionVector> GeomsMap;
65 
71  PositionVector computeNodeShapeDefault(bool simpleContinuation);
72 
85 
86 
96  void joinSameDirectionEdges(std::map<NBEdge*, std::set<NBEdge*> >& same,
97  GeomsMap& geomsCCW,
98  GeomsMap& geomsCW);
99 
108  std::map<NBEdge*, std::set<NBEdge*> >& same,
109  GeomsMap& geomsCCW,
110  GeomsMap& geomsCW,
111  std::map<NBEdge*, NBEdge*>& ccwBoundary,
112  std::map<NBEdge*, NBEdge*>& cwBoundary);
113 
123  const Position& begPoint, const Position& endPoint, int cornerDetail);
124 
135  static void initNeighbors(const EdgeVector& edges, const EdgeVector::const_iterator& current,
136  GeomsMap& geomsCW,
137  GeomsMap& geomsCCW,
138  EdgeVector::const_iterator& cwi,
139  EdgeVector::const_iterator& ccwi,
140  SUMOReal& cad,
141  SUMOReal& ccad);
142 
144  bool badIntersection(const NBEdge* e1, const NBEdge* e2,
145  const PositionVector& e1cw, const PositionVector& e2ccw, SUMOReal distance);
146 
148  SUMOReal closestIntersection(const PositionVector& geom1, const PositionVector& geom2, SUMOReal offset);
149 
150 private:
152  const NBNode& myNode;
153 
154 private:
157 
158 };
159 
160 #endif
161 
162 /****************************************************************************/
163 
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.
The representation of a single edge during network building.
Definition: NBEdge.h:71
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
SUMOReal closestIntersection(const PositionVector &geom1, const PositionVector &geom2, SUMOReal offset)
return the intersection point closest to the given offset
NBNodeShapeComputer(const NBNode &node)
Constructor.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
PositionVector compute(bool leftHand)
Computes the shape of the assigned junction.
~NBNodeShapeComputer()
Destructor.
PositionVector computeNodeShapeSmall()
Computes the node geometry using normals.
std::vector< NBEdge * > EdgeVector
Definition: NBCont.h:41
static void initNeighbors(const EdgeVector &edges, const EdgeVector::const_iterator &current, GeomsMap &geomsCW, GeomsMap &geomsCCW, EdgeVector::const_iterator &cwi, EdgeVector::const_iterator &ccwi, SUMOReal &cad, SUMOReal &ccad)
Initialize neighbors and angles.
bool badIntersection(const NBEdge *e1, const NBEdge *e2, const PositionVector &e1cw, const PositionVector &e2ccw, SUMOReal distance)
void joinSameDirectionEdges(std::map< NBEdge *, std::set< NBEdge * > > &same, GeomsMap &geomsCCW, GeomsMap &geomsCW)
Joins edges and computes ccw/cw boundaries.
Represents a single node (junction) during network building.
Definition: NBNode.h:75
#define SUMOReal
Definition: config.h:218
EdgeVector computeUniqueDirectionList(std::map< NBEdge *, std::set< NBEdge * > > &same, GeomsMap &geomsCCW, GeomsMap &geomsCW, std::map< NBEdge *, NBEdge * > &ccwBoundary, std::map< NBEdge *, NBEdge * > &cwBoundary)
Joins edges and computes ccw/cw boundaries.