Eclipse SUMO - Simulation of Urban MObility
GeomConvHelper.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 // Some helping functions for geometry parsing
18 /****************************************************************************/
19 #ifndef GeomConvHelper_h
20 #define GeomConvHelper_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <string>
30 #include <utils/geom/Boundary.h>
31 
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
41 public:
53  static PositionVector parseShapeReporting(const std::string& shpdef, const std::string& objecttype,
54  const char* objectid, bool& ok, bool allowEmpty, bool report = true);
55 
56 
67  static Boundary parseBoundaryReporting(const std::string& def, const std::string& objecttype,
68  const char* objectid, bool& ok, bool report = true);
69 
70 
71 private:
79  static void emitError(bool report, const std::string& what, const std::string& objecttype,
80  const char* objectid, const std::string& desc);
81 
82 
83 };
84 
85 
86 #endif
87 
88 /****************************************************************************/
89 
static void emitError(bool report, const std::string &what, const std::string &objecttype, const char *objectid, const std::string &desc)
Writes an error message into the MessageHandler.
static Boundary parseBoundaryReporting(const std::string &def, const std::string &objecttype, const char *objectid, bool &ok, bool report=true)
Builds a boundary from its string representation, reporting occurred errors.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
A list of positions.
static PositionVector parseShapeReporting(const std::string &shpdef, const std::string &objecttype, const char *objectid, bool &ok, bool allowEmpty, bool report=true)
Builds a PositionVector from a string representation, reporting occurred errors.