SUMO - Simulation of Urban MObility
ShapeHandler.h
Go to the documentation of this file.
1 
2 /****************************************************************************/
8 // The XML-Handler for network loading
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef ShapeHandler_h
22 #define ShapeHandler_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
35 #include <utils/geom/Position.h>
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class ShapeContainer;
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
55 class ShapeHandler : public SUMOSAXHandler {
56 public:
57 
58 public:
68  ShapeHandler(const std::string& file, ShapeContainer& sc);
69 
71  virtual ~ShapeHandler();
72 
74  static bool loadFiles(const std::vector<std::string>& files, ShapeHandler& sh);
75 
76 
77 protected:
79 
80 
89  virtual void myStartElement(int element,
90  const SUMOSAXAttributes& attrs);
91 
92 
94 
95 
97  virtual Position getLanePos(const std::string& poiID, const std::string& laneID, SUMOReal lanePos) = 0;
98 
99 
100 private:
101 
103  void addPOI(const SUMOSAXAttributes& attrs);
104 
106  void addPoly(const SUMOSAXAttributes& attrs);
107 
109 
110 
111 private:
113  ShapeHandler(const ShapeHandler& s);
114 
117 
118 };
119 
120 
121 #endif
122 
123 /****************************************************************************/
124 
ShapeHandler(const std::string &file, ShapeContainer &sc)
Constructor.
void addPoly(const SUMOSAXAttributes &attrs)
adds a polygon
ShapeHandler & operator=(const ShapeHandler &s)
static bool loadFiles(const std::vector< std::string > &files, ShapeHandler &sh)
loads all of the given files
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Storage for geometrical objects.
SAX-handler base for SUMO-files.
The XML-Handler for network loading.
Definition: ShapeHandler.h:55
Encapsulated SAX-Attributes.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
virtual Position getLanePos(const std::string &poiID, const std::string &laneID, SUMOReal lanePos)=0
get position for a given laneID
virtual ~ShapeHandler()
Destructor.
ShapeContainer & myShapeContainer
Definition: ShapeHandler.h:108
#define SUMOReal
Definition: config.h:214
void addPOI(const SUMOSAXAttributes &attrs)
adds a polygon