Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h
169684 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 GUIGlObject_AbstractAdd.h
15
/// @author Daniel Krajzewicz
16
/// @author Jakob Erdmann
17
/// @author Michael Behrisch
18
/// @date 2004
19
///
20
// Base class for additional objects (detectors etc.)
21
/****************************************************************************/
22
#pragma once
23
#include <config.h>
24
25
#include <vector>
26
#include <map>
27
28
#include "GUIGlObjectTypes.h"
29
#include "GUIGlObject.h"
30
31
32
// ===========================================================================
33
// class definitions
34
// ===========================================================================
35
/**
36
* @class GUIGlObject_AbstractAdd
37
*/
38
class GUIGlObject_AbstractAdd : public GUIGlObject {
39
40
public:
41
/// @brief constructor
42
GUIGlObject_AbstractAdd(GUIGlObjectType type, const std::string& id, FXIcon* icon);
43
44
/// @brief destructor
45
~GUIGlObject_AbstractAdd();
46
47
/// @brief Clears the dictionary (the objects will not be deleted)
48
static void clearDictionary();
49
50
/// @brief Returns a named object
51
static GUIGlObject_AbstractAdd* get(const std::string& name);
52
53
/// @brief Removes an object
54
static void remove(GUIGlObject_AbstractAdd* o);
55
56
/// @brief Returns the list of all additional objects
57
static const std::vector<GUIGlObject_AbstractAdd*>& getObjectList();
58
59
/// @brief Returns the list of gl-ids of all additional objects that match the given type
60
static std::vector<GUIGlID> getIDList(GUIGlObjectType typeFilter);
61
62
protected:
63
/// @brief Map from names of loaded additional objects to the objects themselves
64
static std::map<std::string, GUIGlObject_AbstractAdd*> myObjects;
65
66
/// @brief The list of all additional objects currently loaded
67
static std::vector<GUIGlObject_AbstractAdd*> myObjectList;
68
};
69
70