SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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-sim.org/
12 // Copyright (C) 2001-2013 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>
40 using namespace SUMO;
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
45 /*
46  * @class GUIPolygon
47  * @brief The GUI-version of a polygon
48  */
49 class GUIPolygon : public Polygon, public GUIGlObject_AbstractAdd {
50 public:
61  GUIPolygon(const std::string& id, const std::string& type,
62  const RGBColor& color, const PositionVector& shape, bool fill,
63  SUMOReal layer = 0, SUMOReal angle = 0, const std::string& imgFile = "");
64 
66  ~GUIPolygon();
67 
68 
69 
71 
72 
80  GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app,
81  GUISUMOAbstractView& parent);
82 
83 
91  GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app,
92  GUISUMOAbstractView& parent);
93 
94 
100  Boundary getCenteringBoundary() const;
101 
102 
107  void drawGL(const GUIVisualizationSettings& s) const;
109 
110 
112  virtual void setShape(const PositionVector& shape);
113 
114 
115 private:
117  mutable MFXMutex myLock;
118 
120  mutable GLuint myDisplayList;
121 
124 
126  void storeTesselation(SUMOReal lineWidth) const;
127 
128  // @brief perform the tesselation / drawing
129  void performTesselation(SUMOReal lineWidth) const;
130 
131 };
132 
133 
134 #endif
135 
136 /****************************************************************************/
137 
Stores the information about how to visualize structures.
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:120
A 2D- or 3D-polygon.
Definition: Polygon.h:48
A list of positions.
SUMOReal myLineWidth
the previous line width for deciding whether the display list must be refreshed
Definition: GUIPolygon.h:123
The popup menu of a globject.
MFXMutex myLock
The mutex used to avoid concurrent updates of the shape.
Definition: GUIPolygon.h:117
#define SUMOReal
Definition: config.h:221
A window containing a gl-object&#39;s parameter.