Line data Source code
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 : /****************************************************************************/
14 : /// @file GUIPointOfInterest.h
15 : /// @author Daniel Krajzewicz
16 : /// @author Jakob Erdmann
17 : /// @author Michael Behrisch
18 : /// @date June 2006
19 : ///
20 : // missing_desc
21 : /****************************************************************************/
22 : #pragma once
23 : #include <config.h>
24 :
25 : #include <string>
26 : #include <utils/shapes/PointOfInterest.h>
27 : #include <utils/gui/globjects/GUIGlObject_AbstractAdd.h>
28 : #include <utils/gui/settings/GUIVisualizationSettings.h>
29 :
30 :
31 : // ===========================================================================
32 : // class definitions
33 : // ===========================================================================
34 : /*
35 : * @class GUIPointOfInterest
36 : * @brief The GUI-version of a point of interest
37 : */
38 : class GUIPointOfInterest : public PointOfInterest, public GUIGlObject_AbstractAdd {
39 : public:
40 : /** @brief Constructor
41 : * @param[in] id The name of the POI
42 : * @param[in] type The (abstract) type of the POI
43 : * @param[in] color The color of the POI
44 : * @param[in] pos The position of the POI
45 : * @param[in[ geo use GEO coordinates (lon/lat)
46 : * @param[in] lane The Lane in which this POI is placed
47 : * @param[in] posOverLane The position over Lane
48 : * @param[in] friendlyPos enable or disable friendlyPos
49 : * @param[in] posLat The position lateral over Lane
50 : * @param[in] icon The icon of the POI
51 : * @param[in] layer The layer of the POI
52 : * @param[in] angle The rotation of the POI
53 : * @param[in] imgFile The raster image of the shape
54 : * @param[in] relativePath set image file as relative path
55 : * @param[in] width The width of the POI image
56 : * @param[in] height The height of the POI image
57 : */
58 : GUIPointOfInterest(const std::string& id, const std::string& type, const RGBColor& color,
59 : const Position& pos, bool geo, const std::string& lane, double posOverLane,
60 : bool friendlyPos, double posLat, const std::string& icon, double layer, double angle,
61 : const std::string& imgFile, bool relativePath, double width, double height);
62 :
63 : /// @brief Destructor
64 : virtual ~GUIPointOfInterest();
65 :
66 : /// @name inherited from GUIGlObject
67 : //@{
68 :
69 : /** @brief Returns an own popup-menu
70 : *
71 : * @param[in] app The application needed to build the popup-menu
72 : * @param[in] parent The parent window needed to build the popup-menu
73 : * @return The built popup-menu
74 : * @see GUIGlObject::getPopUpMenu
75 : */
76 : GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) override;
77 :
78 : /** @brief Returns an own parameter window
79 : *
80 : * @param[in] app The application needed to build the parameter window
81 : * @param[in] parent The parent window needed to build the parameter window
82 : * @return The built parameter window
83 : * @see GUIGlObject::getParameterWindow
84 : */
85 : GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent) override;
86 :
87 : /// @brief return exaggeration associated with this GLObject
88 : double getExaggeration(const GUIVisualizationSettings& s) const override;
89 :
90 : /** @brief Returns the boundary to which the view shall be centered in order to show the object
91 : *
92 : * @return The boundary the object is within
93 : * @see GUIGlObject::getCenteringBoundary
94 : */
95 : Boundary getCenteringBoundary() const override;
96 :
97 : /** @brief Draws the object
98 : * @param[in] s The settings for the current view (may influence drawing)
99 : * @see GUIGlObject::drawGL
100 : */
101 : void drawGL(const GUIVisualizationSettings& s) const override;
102 :
103 0 : double getClickPriority() const override {
104 0 : return getShapeLayer();
105 : }
106 :
107 : /// @brief Returns the name of the object (default "")
108 0 : virtual const std::string getOptionalName() const override {
109 0 : return getShapeName();
110 : }
111 : //@}
112 :
113 : /// @brief check if POI can be drawn
114 : static bool checkDraw(const GUIVisualizationSettings& s, const GUIGlObject* o);
115 :
116 : /// @brief set color
117 : static void setColor(const GUIVisualizationSettings& s, const PointOfInterest* POI, const GUIGlObject* o, bool forceSelectionColor);
118 :
119 : /// @brief draw inner POI (before pushName() )
120 : static void drawInnerPOI(const GUIVisualizationSettings& s, const PointOfInterest* POI, const GUIGlObject* o, const bool disableSelectionColor,
121 : const double layer, const double width, const double height);
122 : };
|