67 #ifdef CHECK_MEMORY_LEAKS
69 #endif // CHECK_MEMORY_LEAKS
79 GUINet& net, FXGLVisual* glVis,
94 for (std::vector<std::string>::const_iterator i = names.begin(); i != names.end(); ++i) {
104 "\tLocate Junction\tLocate a junction within the network.",
106 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
109 "\tLocate Street\tLocate a street within the network.",
111 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
116 "\tLocate Vehicle\tLocate a vehicle within the network.",
118 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
122 "\tLocate TLS\tLocate a tls within the network.",
124 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
127 "\tLocate Additional\tLocate an additional structure within the network.",
129 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
132 "\tLocate POI\tLocate a POI within the network.",
134 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
137 "\tLocate Polygon\tLocate a Polygon within the network.",
139 ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED);
164 glMatrixMode(GL_MODELVIEW);
166 glDisable(GL_TEXTURE_2D);
167 glDisable(GL_ALPHA_TEST);
169 glEnable(GL_DEPTH_TEST);
180 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
183 minB[0] = bound.
xmin();
184 minB[1] = bound.
ymin();
185 maxB[0] = bound.
xmax();
186 maxB[1] = bound.
ymax();
188 glEnable(GL_POLYGON_OFFSET_FILL);
189 glEnable(GL_POLYGON_OFFSET_LINE);
193 glTranslated(0, 0, -.01);
199 glTranslated(0, 0, .01);
236 const std::vector<MSTrafficLightLogic*>& logics = tlsControl.
getAllLogics();
238 SUMOReal minDist = std::numeric_limits<SUMOReal>::infinity();
239 for (std::vector<MSTrafficLightLogic*>::const_iterator i = logics.begin(); i != logics.end(); ++i) {
245 if (lanes.size() > 0) {
246 const Position& endPos = lanes[0]->getShape().back();
256 const std::vector<MSTrafficLightLogic*> logics = vars.
getAllLogics();
257 if (logics.size() > 1) {
259 for (
unsigned int i = 0; i < logics.size() - 1; ++i) {
260 if (minTll->
getProgramID() == logics[i]->getProgramID()) {
265 if (l == logics[0]) {
void paintGLGrid()
paints a grid
void changeStepAndDuration(MSTLLogicControl &tlcontrol, SUMOTime simStep, unsigned int step, SUMOTime stepDuration)
Changes the current phase and her duration.
bool isActive(const MSTrafficLightLogic *tl) const
Returns whether the given tls program is the currently active for his tls.
virtual void buildViewToolBars(GUIGlChildWindow &)
builds the view toolbars
GUICompleteSchemeStorage gSchemeStorage
const SUMOReal SUMO_const_laneWidth
Storage for all programs of a single tls.
bool setColorScheme(const std::string &name)
void unlock()
release exclusive access to the simulation state
SUMORTree * myGrid
The visualization speed-up.
void switchTo(const std::string &id, const std::string &programID)
Switches the named (id) tls to the named (programID) program.
bool gaming
whether the application is in gaming mode or not
SUMOTime getCurrentTimeStep() const
get the current simulation time
SUMOReal ymin() const
Returns minimum y-coordinate.
GUIMainWindow * myApp
The application.
SUMOReal xmin() const
Returns minimum x-coordinate.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
void lock()
grant exclusive access to the simulation state
virtual int Search(const float a_min[2], const float a_max[2], const GUIVisualizationSettings &c)
Find all within search rectangle.
SUMOReal distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
GUIDialog_ViewSettings * myVisualizationChanger
SUMOTime getCurrentTimeStep() const
Returns the current simulation step (in s)
bool isGaming() const
return whether the gui is in gaming mode
Locate junction - button.
SUMOReal xmax() const
Returns maximum x-coordinate.
A class that stores a 2D geometrical boundary.
A fixed traffic light logic.
SUMOReal scale
information about a lane's width (temporary, used for a single view)
A class that stores and controls tls and switching of their programs.
std::vector< MSTrafficLightLogic * > getAllLogics() const
const std::string & getID() const
Returns the id.
SUMOTime duration
The duration of the phase.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
int getTrackedID() const
Returns the id of the tracked vehicle (-1 if none)
std::string name
The name of this setting.
std::map< GUIGlObject *, int > myAdditionallyDrawn
List of objects for which GUIGlObject::drawGLAdditional is called.
void setCurrentScheme(const std::string &)
Sets the named scheme as the current.
Locate polygons - button.
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
A point in 2D or 3D with translation and scaling methods.
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
FXComboBox & getColoringSchemesCombo()
const LaneVector & getLanesAt(unsigned int i) const
Returns the list of lanes that are controlled by the signals at the given position.
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
const MSPhaseDefinition & getPhase(unsigned int givenstep) const
Returns the definition of the phase from the given position within the plan.
void onGamingClick(Position pos)
handle mouse click in gaming mode
void startTrack(int id)
Starts vehicle tracking.
std::string getCurrentScheme() const
Returns the name of the currently chosen scheme.
A single child window which contains a view of the simulation area.
std::vector< MSLane * > LaneVector
Definition of the list of links that participate in this tl-light.
Locate addtional structure - button.
GUIVisualizationSettings * myVisualizationSettings
A MSNet extended by some values for usage within the gui.
virtual ~GUIViewTraffic()
destructor
int doPaintGL(int mode, const Boundary &bound)
SUMOReal m2p(SUMOReal meter) const
meter-to-pixels conversion method
TLSLogicVariants & get(const std::string &id) const
Returns the variants of a named tls.
bool showGrid
Information whether a grid shall be shown.
void drawDecals()
Draws the stored decals.
The parent class for traffic light logics.
static const bool gUseMesoSim
const std::string & getProgramID() const
Returns this tl-logic's id.
SUMOReal ymax() const
Returns maximum y-coordinate.
std::vector< MSTrafficLightLogic * > getAllLogics() const
Returns a vector which contains all logics.
static FXIcon * getIcon(GUIIcon which)
void stopTrack()
Stops vehicle tracking.
FXPopup * getLocatorPopup()