SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AGPosition.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // References a street of the city and defines a position in this street
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
13 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
14 // activitygen module
15 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
16 /****************************************************************************/
17 //
18 // This file is part of SUMO.
19 // SUMO is free software: you can redistribute it and/or modify
20 // it under the terms of the GNU General Public License as published by
21 // the Free Software Foundation, either version 3 of the License, or
22 // (at your option) any later version.
23 //
24 /****************************************************************************/
25 #ifndef AGPOSITION_H
26 #define AGPOSITION_H
27 
28 
29 // ===========================================================================
30 // included modules
31 // ===========================================================================
32 #ifdef _MSC_VER
33 #include <windows_config.h>
34 #else
35 #include <config.h>
36 #endif
37 
38 #include "../../utils/geom/Position.h"
39 #include <list>
40 #include <map>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class AGStreet;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
63 class AGPosition {
64 public:
74  AGPosition(const AGStreet& str, SUMOReal pos) ;
82  AGPosition(const AGStreet& str) ;
83 
88  const AGStreet& getStreet() const ;
89 
97  SUMOReal getPosition() const ;
98 
107  bool operator==(const AGPosition& pos) const ;
108 
114  SUMOReal distanceTo(const AGPosition& otherPos) const ;
115 
124  SUMOReal minDistanceTo(const std::list<AGPosition>& positions) const ;
125 
134  SUMOReal minDistanceTo(const std::map<int, AGPosition>& positions) const ;
135 
139  void print() const ;
140 
141 private:
142  const AGStreet* street;
145 
151 
159  Position compute2dPosition() const ;
160 };
161 
162 #endif /* AGPOSITION_H */
163 
164 /****************************************************************************/