Eclipse SUMO - Simulation of Urban MObility
GUIPolygon.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 // The GUI-version of a polygon
18 /****************************************************************************/
19 #ifndef GUIPolygon_h
20 #define GUIPolygon_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <string>
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
38 /*
39  * @class GUIPolygon
40  * @brief The GUI-version of a polygon
41  */
43 public:
57  GUIPolygon(const std::string& id, const std::string& type,
58  const RGBColor& color, const PositionVector& shape, bool geo, bool fill, double lineWidth,
59  double layer = 0, double angle = 0, const std::string& imgFile = "", bool relativePath = false);
60 
62  ~GUIPolygon();
63 
64 
66 
67 
76  GUISUMOAbstractView& parent);
77 
78 
87  GUISUMOAbstractView& parent);
88 
89 
96 
97 
102  virtual void drawGL(const GUIVisualizationSettings& s) const;
104 
105 
107  virtual void setShape(const PositionVector& shape);
108 
109 protected:
111  void setColor(const GUIVisualizationSettings& s, bool disableSelectionColor) const;
112 
114  bool checkDraw(const GUIVisualizationSettings& s) const;
115 
117  void drawInnerPolygon(const GUIVisualizationSettings& s, bool disableSelectionColor) const;
118 
119 private:
121  mutable FXMutex myLock;
122 
124  mutable GLuint myDisplayList;
125 
127  void storeTesselation(double lineWidth) const;
128 
129  // @brief perform the tesselation / drawing
130  void performTesselation(double lineWidth) const;
131 
132 };
133 
134 
135 #endif
136 
137 /****************************************************************************/
138 
void drawInnerPolygon(const GUIVisualizationSettings &s, bool disableSelectionColor) const
draw inner Polygon (before pushName() )
Definition: GUIPolygon.cpp:258
void performTesselation(double lineWidth) const
Definition: GUIPolygon.cpp:170
void storeTesselation(double lineWidth) const
store the drawing commands in a display list
Definition: GUIPolygon.cpp:204
Stores the information about how to visualize structures.
FXMutex myLock
The mutex used to avoid concurrent updates of the shape.
Definition: GUIPolygon.h:121
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
GLuint myDisplayList
id of the display list for the cached tesselation
Definition: GUIPolygon.h:124
A list of positions.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIPolygon.cpp:122
bool checkDraw(const GUIVisualizationSettings &s) const
check if Polygon can be drawn
Definition: GUIPolygon.cpp:236
virtual void setShape(const PositionVector &shape)
set a new shape and update the tesselation
Definition: GUIPolygon.cpp:162
void setColor(const GUIVisualizationSettings &s, bool disableSelectionColor) const
set color
Definition: GUIPolygon.cpp:219
virtual void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIPolygon.cpp:144
GUIPolygon(const std::string &id, const std::string &type, const RGBColor &color, const PositionVector &shape, bool geo, bool fill, double lineWidth, double layer=0, double angle=0, const std::string &imgFile="", bool relativePath=false)
Constructor.
Definition: GUIPolygon.cpp:89
~GUIPolygon()
Destructor.
Definition: GUIPolygon.cpp:100
The popup menu of a globject.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIPolygon.cpp:135
A window containing a gl-object&#39;s parameter.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIPolygon.cpp:105