SUMO - Simulation of Urban MObility
NBNodeShapeComputer.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // This class computes shapes of junctions
00010 /****************************************************************************/
00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00013 /****************************************************************************/
00014 //
00015 //   This file is part of SUMO.
00016 //   SUMO is free software: you can redistribute it and/or modify
00017 //   it under the terms of the GNU General Public License as published by
00018 //   the Free Software Foundation, either version 3 of the License, or
00019 //   (at your option) any later version.
00020 //
00021 /****************************************************************************/
00022 #ifndef NBNodeShapeComputer_h
00023 #define NBNodeShapeComputer_h
00024 
00025 
00026 // ===========================================================================
00027 // included modules
00028 // ===========================================================================
00029 #ifdef _MSC_VER
00030 #include <windows_config.h>
00031 #else
00032 #include <config.h>
00033 #endif
00034 
00035 #include <utils/geom/PositionVector.h>
00036 
00037 
00038 // ===========================================================================
00039 // class definitions
00040 // ===========================================================================
00041 class NBNode;
00042 class NBEdge;
00043 
00044 
00045 // ===========================================================================
00046 // class declarations
00047 // ===========================================================================
00052 class NBNodeShapeComputer {
00053 public:
00055     NBNodeShapeComputer(const NBNode& node);
00056 
00058     ~NBNodeShapeComputer();
00059 
00061     PositionVector compute(bool leftHand);
00062 
00063 private:
00064     PositionVector computeContinuationNodeShape(bool simpleContinuation);
00065 
00074     PositionVector computeNodeShapeByCrosses();
00075 
00076 
00077     void replaceLastChecking(PositionVector& g, bool decenter,
00078                              PositionVector counter, size_t counterLanes, SUMOReal counterDist,
00079                              int laneDiff);
00080 
00081 
00082     void replaceFirstChecking(PositionVector& g, bool decenter,
00083                               PositionVector counter, size_t counterLanes, SUMOReal counterDist,
00084                               int laneDiff);
00085 
00095     void joinSameDirectionEdges(std::map<NBEdge*, EdgeVector > &same,
00096                                 std::map<NBEdge*, PositionVector> &geomsCCW,
00097                                 std::map<NBEdge*, PositionVector> &geomsCW);
00098 
00106     EdgeVector computeUniqueDirectionList(
00107         const std::map<NBEdge*, EdgeVector > &same,
00108         std::map<NBEdge*, PositionVector> &geomsCCW,
00109         std::map<NBEdge*, PositionVector> &geomsCW,
00110         std::map<NBEdge*, NBEdge*> &ccwBoundary,
00111         std::map<NBEdge*, NBEdge*> &cwBoundary);
00112 
00113 
00114 private:
00116     const NBNode& myNode;
00117 
00118 };
00119 
00120 
00121 #endif
00122 
00123 /****************************************************************************/
00124 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines