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.dev/sumo
3 // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // Some helping functions for geometry parsing
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <string>
27 #include <utils/geom/Boundary.h>
28 
29 
30 // ===========================================================================
31 // class definitions
32 // ===========================================================================
38 public:
50  static PositionVector parseShapeReporting(const std::string& shpdef, const std::string& objecttype,
51  const char* objectid, bool& ok, bool allowEmpty, bool report = true);
52 
53 
65  static Boundary parseBoundaryReporting(const std::string& def, const std::string& objecttype,
66  const char* objectid, bool& ok, bool report = true, bool offsets = false);
67 
68 
69 private:
77  static void emitError(bool report, const std::string& what, const std::string& objecttype,
78  const char* objectid, const std::string& desc);
79 
80 
81 };
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
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, bool offsets=false)
Builds a boundary from its string representation, reporting occurred errors.
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.
A list of positions.