Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/polyconvert/PCNetProjectionLoader.h
169666 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 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
/****************************************************************************/
14
/// @file PCNetProjectionLoader.h
15
/// @author Daniel Krajzewicz
16
/// @author Jakob Erdmann
17
/// @author Michael Behrisch
18
/// @date Thu, 02.11.2006
19
///
20
// A reader for a SUMO network's projection description
21
/****************************************************************************/
22
#pragma once
23
#include <config.h>
24
25
#include <string>
26
#include <utils/xml/SUMOSAXHandler.h>
27
#include <utils/common/UtilExceptions.h>
28
#include <utils/geom/Position.h>
29
30
31
// ===========================================================================
32
// class definitions
33
// ===========================================================================
34
class OptionsCont;
35
36
37
// ===========================================================================
38
// class declarations
39
// ===========================================================================
40
/**
41
* @class PCNetProjectionLoader
42
* @brief A reader for a SUMO network's projection description
43
*/
44
class PCNetProjectionLoader : public SUMOSAXHandler {
45
public:
46
/** @brief Loads network projection if wished
47
*
48
* @param[in] file The network file from which to parse the location element
49
* @param[in] shift The shift of the decimal point when interpreting loaded coordinates
50
*/
51
static void load(const std::string& file, double scale);
52
53
54
protected:
55
/** @brief Constructor
56
*/
57
PCNetProjectionLoader(double scale);
58
59
60
/// @brief Destructor
61
~PCNetProjectionLoader();
62
63
64
/** @brief Returns whether all needed values were read
65
* @return Whether all needed values were read
66
*/
67
bool hasReadAll() const;
68
69
70
protected:
71
/// @name inherited from GenericSAXHandler
72
//@{
73
74
/** @brief Called on the opening of a tag;
75
*
76
* @param[in] element ID of the currently opened element
77
* @param[in] attrs Attributes within the currently opened element
78
* @exception ProcessError If something fails
79
* @see GenericSAXHandler::myStartElement
80
*/
81
virtual void myStartElement(int element,
82
const SUMOSAXAttributes& attrs);
83
//@}
84
85
86
private:
87
/// @brief Information whether the parameter was read
88
bool myFoundLocation;
89
90
/// @brief scaling of input coordinates (not given in the location element)
91
double myScale;
92
93
94
};
95
96