SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StdDefs.cpp
Go to the documentation of this file.
1 /****************************************************************************/
7 /****************************************************************************/
8 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
9 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
10 /****************************************************************************/
11 //
12 // This file is part of SUMO.
13 // SUMO is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 /****************************************************************************/
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include "RGBColor.h"
25 #include "StdDefs.h"
26 
27 
28 #ifdef CHECK_MEMORY_LEAKS
29 #include <foreign/nvwa/debug_new.h>
30 #endif // CHECK_MEMORY_LEAKS
31 
32 /* -------------------------------------------------------------------------
33  * color constants for link states
34  * ----------------------------------------------------------------------- */
35 const RGBColor SUMO_color_TL_GREEN_MAJOR(0, 255, 0);
36 const RGBColor SUMO_color_TL_GREEN_MINOR(0, 179, 0);
37 const RGBColor SUMO_color_TL_RED(255, 0, 0);
38 const RGBColor SUMO_color_TL_YELLOW_MAJOR(255, 255, 0);
39 const RGBColor SUMO_color_TL_YELLOW_MINOR(255, 255, 0);
40 const RGBColor SUMO_color_TL_OFF_BLINKING(255, 140, 0);
41 const RGBColor SUMO_color_TL_OFF_NOSIGNAL(0, 255, 255);
42 const RGBColor SUMO_color_MAJOR(255, 255, 255);
43 const RGBColor SUMO_color_MINOR(51, 51, 51);
44 const RGBColor SUMO_color_EQUAL(128, 128, 128);
45 const RGBColor SUMO_color_STOP(102, 51, 51);
46 const RGBColor SUMO_color_ALLWAY_STOP(51, 51, 102);
47 const RGBColor SUMO_color_DEADEND(0, 0, 0);
48 
49 const RGBColor& getLinkColor(const LinkState& ls) {
50  switch (ls) {
55  case LINKSTATE_TL_RED:
56  return SUMO_color_TL_RED;
65  case LINKSTATE_MAJOR:
66  return SUMO_color_MAJOR;
67  case LINKSTATE_MINOR:
68  return SUMO_color_MINOR;
69  case LINKSTATE_EQUAL:
70  return SUMO_color_EQUAL;
71  case LINKSTATE_STOP:
72  return SUMO_color_STOP;
75  case LINKSTATE_DEADEND:
76  return SUMO_color_DEADEND;
77  default:
78  throw ProcessError("No color defined for LinkState '" + std::string(ls, 1) + "'");
79  }
80 }
81 
82 bool gDebugFlag1 = false;
83 bool gDebugFlag2 = false;
84 
85 /****************************************************************************/
86 
bool gDebugFlag1
global utility flags for debugging
Definition: StdDefs.cpp:82
const RGBColor SUMO_color_DEADEND(0, 0, 0)
const RGBColor SUMO_color_ALLWAY_STOP(51, 51, 102)
The link has green light, may pass.
const RGBColor SUMO_color_STOP(102, 51, 51)
const RGBColor SUMO_color_MINOR(51, 51, 51)
The link has green light, has to brake.
This is an uncontrolled, minor link, has to stop.
const RGBColor SUMO_color_TL_YELLOW_MINOR(255, 255, 0)
const RGBColor & getLinkColor(const LinkState &ls)
Definition: StdDefs.cpp:49
const RGBColor SUMO_color_TL_OFF_BLINKING(255, 140, 0)
This is a dead end link.
This is an uncontrolled, right-before-left link.
The link is controlled by a tls which is off, not blinking, may pass.
This is an uncontrolled, all-way stop link.
This is an uncontrolled, minor link, has to brake.
const RGBColor SUMO_color_TL_OFF_NOSIGNAL(0, 255, 255)
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
const RGBColor SUMO_color_TL_GREEN_MAJOR(0, 255, 0)
const RGBColor SUMO_color_TL_YELLOW_MAJOR(255, 255, 0)
const RGBColor SUMO_color_EQUAL(128, 128, 128)
const RGBColor SUMO_color_TL_GREEN_MINOR(0, 179, 0)
const RGBColor SUMO_color_TL_RED(255, 0, 0)
The link has yellow light, may pass.
The link is controlled by a tls which is off and blinks, has to brake.
The link has red light (must brake)
This is an uncontrolled, major link, may pass.
const RGBColor SUMO_color_MAJOR(255, 255, 255)
bool gDebugFlag2
Definition: StdDefs.cpp:83
The link has yellow light, has to brake anyway.