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>
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
46 /*
47  * @class GUIPolygon
48  * @brief The GUI-version of a polygon
49  */
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 
82  GUISUMOAbstractView& parent);
83 
84 
93  GUISUMOAbstractView& parent);
94 
95 
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 
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 fill, double layer=0, double angle=0, const std::string &imgFile="")
Constructor.
Definition: GUIPolygon.cpp:49
Stores the information about how to visualize structures.
void storeTesselation(double lineWidth) const
store the drawing commands in a display list
Definition: GUIPolygon.cpp:274
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
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIPolygon.cpp:95
A list of positions.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIPolygon.cpp:82
virtual void setShape(const PositionVector &shape)
set a new shape and update the tesselation
Definition: GUIPolygon.cpp:232
~GUIPolygon()
Destructor.
Definition: GUIPolygon.cpp:60
The popup menu of a globject.
MFXMutex myLock
The mutex used to avoid concurrent updates of the shape.
Definition: GUIPolygon.h:122
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.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIPolygon.cpp:65
void performTesselation(double lineWidth) const
Definition: GUIPolygon.cpp:240