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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // The GUI-version of a polygon
20 /****************************************************************************/
21 #ifndef GUIPolygon_h
22 #define GUIPolygon_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
45 /*
46  * @class GUIPolygon
47  * @brief The GUI-version of a polygon
48  */
50 public:
62  GUIPolygon(const std::string& id, const std::string& type,
63  const RGBColor& color, const PositionVector& shape, bool geo, bool fill,
64  double layer = 0, double angle = 0, const std::string& imgFile = "");
65 
67  ~GUIPolygon();
68 
69 
71 
72 
81  GUISUMOAbstractView& parent);
82 
83 
92  GUISUMOAbstractView& parent);
93 
94 
101 
102 
107  virtual void drawGL(const GUIVisualizationSettings& s) const;
109 
110 
112  virtual void setShape(const PositionVector& shape);
113 
115  void setLineWidth(double lineWidth) {
116  myLineWidth = lineWidth;
117  }
118 
119 private:
121  mutable MFXMutex myLock;
122 
124  mutable GLuint myDisplayList;
125 
127  mutable double myLineWidth;
128 
130  void storeTesselation(double lineWidth) const;
131 
132  // @brief perform the tesselation / drawing
133  void performTesselation(double lineWidth) const;
134 
135 };
136 
137 
138 #endif
139 
140 /****************************************************************************/
141 
void performTesselation(double lineWidth) const
Definition: GUIPolygon.cpp:238
void storeTesselation(double lineWidth) const
store the drawing commands in a display list
Definition: GUIPolygon.cpp:272
Stores the information about how to visualize structures.
void setLineWidth(double lineWidth)
set a new shape and update the tesselation
Definition: GUIPolygon.h:115
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:47
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:80
virtual void setShape(const PositionVector &shape)
set a new shape and update the tesselation
Definition: GUIPolygon.cpp:230
virtual void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIPolygon.cpp:142
~GUIPolygon()
Destructor.
Definition: GUIPolygon.cpp:58
The popup menu of a globject.
MFXMutex myLock
The mutex used to avoid concurrent updates of the shape.
Definition: GUIPolygon.h:121
double myLineWidth
the previous line width for deciding whether the display list must be refreshed
Definition: GUIPolygon.h:127
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIPolygon.cpp:93
A window containing a gl-object&#39;s parameter.
GUIPolygon(const std::string &id, const std::string &type, const RGBColor &color, const PositionVector &shape, bool geo, bool fill, double layer=0, double angle=0, const std::string &imgFile="")
Constructor.
Definition: GUIPolygon.cpp:47
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIPolygon.cpp:63