SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIJunctionWrapper.cpp
Go to the documentation of this file.
1 /****************************************************************************/
11 // }
12 /****************************************************************************/
13 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
14 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
15 /****************************************************************************/
16 //
17 // This file is part of SUMO.
18 // SUMO is free software: you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation, either version 3 of the License, or
21 // (at your option) any later version.
22 //
23 /****************************************************************************/
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 #ifdef WIN32
36 #include <windows.h>
37 #endif
38 
39 #include <GL/gl.h>
40 
41 #include <string>
42 #include <utility>
43 #include <microsim/MSLane.h>
44 #include <microsim/MSJunction.h>
45 #include <utils/geom/Position.h>
46 #include <microsim/MSNet.h>
49 #include <gui/GUIGlobals.h>
52 #include "GUIJunctionWrapper.h"
56 #include <utils/gui/div/GLHelper.h>
58 
59 #ifdef CHECK_MEMORY_LEAKS
60 #include <foreign/nvwa/debug_new.h>
61 #endif // CHECK_MEMORY_LEAKS
62 
63 
64 // ===========================================================================
65 // method definitions
66 // ===========================================================================
68  : GUIGlObject(GLO_JUNCTION, junction.getID()),
69  myJunction(junction) {
70  if (myJunction.getShape().size() == 0) {
72  myBoundary = Boundary(pos.x() - 1., pos.y() - 1., pos.x() + 1., pos.y() + 1.);
73  } else {
75  }
77 #ifdef HAVE_INTERNAL_LANES
78  myIsInner = dynamic_cast<MSInternalJunction*>(&myJunction) != 0;
79 #else
80  myIsInner = false;
81 #endif
82 }
83 
84 
86 
87 
90  GUISUMOAbstractView& parent) {
91  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
92  buildPopupHeader(ret, app);
96  buildPositionCopyEntry(ret, false);
97  return ret;
98 }
99 
100 
104  return 0;
105 }
106 
107 
108 Boundary
110  Boundary b = myBoundary;
111  b.grow(20);
112  return b;
113 }
114 
115 
116 void
118  // check whether it is not too small
119  if (s.scale * myMaxSize < 1.) {
120  return;
121  }
122  if (!myIsInner) {
123  glPushName(getGlID());
124  glPushMatrix();
125  glColor3d(0, 0, 0);
126  glTranslated(0, 0, getType());
128  glPopMatrix();
129  }
130  if (myIsInner) {
132  } else {
134  }
135  glPopName();
136 }
137 
138 
139 /****************************************************************************/
140