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 #include <string>
36 #include <utility>
37 #include <microsim/MSLane.h>
38 #include <microsim/MSJunction.h>
39 #include <utils/geom/Position.h>
40 #include <microsim/MSNet.h>
43 #include <gui/GUIGlobals.h>
46 #include "GUIJunctionWrapper.h"
50 #include <utils/gui/div/GLHelper.h>
53 
54 #ifdef CHECK_MEMORY_LEAKS
55 #include <foreign/nvwa/debug_new.h>
56 #endif // CHECK_MEMORY_LEAKS
57 
58 
59 // ===========================================================================
60 // method definitions
61 // ===========================================================================
63  : GUIGlObject(GLO_JUNCTION, junction.getID()),
64  myJunction(junction) {
65  if (myJunction.getShape().size() == 0) {
67  myBoundary = Boundary(pos.x() - 1., pos.y() - 1., pos.x() + 1., pos.y() + 1.);
68  } else {
70  }
72 #ifdef HAVE_INTERNAL_LANES
73  myIsInner = dynamic_cast<MSInternalJunction*>(&myJunction) != 0;
74 #else
75  myIsInner = false;
76 #endif
77 }
78 
79 
81 
82 
85  GUISUMOAbstractView& parent) {
86  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
87  buildPopupHeader(ret, app);
91  buildPositionCopyEntry(ret, false);
92  return ret;
93 }
94 
95 
99  return 0;
100 }
101 
102 
103 Boundary
105  Boundary b = myBoundary;
106  b.grow(20);
107  return b;
108 }
109 
110 
111 void
113  // check whether it is not too small
114  if (s.scale * myMaxSize < 1.) {
115  return;
116  }
117  if (!myIsInner) {
118  glPushName(getGlID());
119  glPushMatrix();
120  glColor3d(0, 0, 0);
121  glTranslated(0, 0, getType());
123  glPopMatrix();
124  }
125  if (myIsInner) {
127  } else {
129  }
130  glPopName();
131 }
132 
133 
134 /****************************************************************************/
135