SUMO - Simulation of Urban MObility
GUIPolygon.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // The GUI-version of a polygon
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUIPolygon_h
23 #define GUIPolygon_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
37 #include <utils/shapes/Polygon.h>
41 using namespace SUMO;
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
46 /*
47  * @class GUIPolygon
48  * @brief The GUI-version of a polygon
49  */
50 class GUIPolygon : public Polygon, public GUIGlObject_AbstractAdd {
51 public:
62  GUIPolygon(const std::string& id, const std::string& type,
63  const RGBColor& color, const PositionVector& shape, bool fill,
64  double layer = 0, double angle = 0, const std::string& imgFile = "");
65 
67  ~GUIPolygon();
68 
69 
70 
72 
73 
81  GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app,
82  GUISUMOAbstractView& parent);
83 
84 
92  GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app,
93  GUISUMOAbstractView& parent);
94 
95 
101  Boundary getCenteringBoundary() const;
102 
103 
108  virtual void drawGL(const GUIVisualizationSettings& s) const;
110 
111 
113  virtual void setShape(const PositionVector& shape);
114 
116  void setLineWidth(double lineWidth) {
117  myLineWidth = lineWidth;
118  }
119 
120 private:
122  mutable MFXMutex myLock;
123 
125  mutable GLuint myDisplayList;
126 
128  mutable double myLineWidth;
129 
131  void storeTesselation(double lineWidth) const;
132 
133  // @brief perform the tesselation / drawing
134  void performTesselation(double lineWidth) const;
135 
136 };
137 
138 
139 #endif
140 
141 /****************************************************************************/
142 
Stores the information about how to visualize structures.
void setLineWidth(double lineWidth)
set a new shape and update the tesselation
Definition: GUIPolygon.h:116
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
GLuint myDisplayList
id of the display list for the cached tesselation
Definition: GUIPolygon.h:125
A 2D- or 3D-polygon.
Definition: Polygon.h:57
A list of positions.
The popup menu of a globject.
MFXMutex myLock
The mutex used to avoid concurrent updates of the shape.
Definition: GUIPolygon.h:122
Definition: Polygon.h:48
double myLineWidth
the previous line width for deciding whether the display list must be refreshed
Definition: GUIPolygon.h:128
A window containing a gl-object&#39;s parameter.