SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIGLObjectPopupMenu.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // The popup menu of a globject
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 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <iostream>
34 #include <cassert>
42 #include <utils/common/ToString.h>
43 #include "GUIGLObjectPopupMenu.h"
44 
45 #ifdef CHECK_MEMORY_LEAKS
46 #include <foreign/nvwa/debug_new.h>
47 #endif // CHECK_MEMORY_LEAKS
48 
49 
50 // ===========================================================================
51 // FOX callback mapping
52 // ===========================================================================
53 FXDEFMAP(GUIGLObjectPopupMenu) GUIGLObjectPopupMenuMap[] = {
54  FXMAPFUNC(SEL_COMMAND, MID_CENTER, GUIGLObjectPopupMenu::onCmdCenter),
55  FXMAPFUNC(SEL_COMMAND, MID_COPY_NAME, GUIGLObjectPopupMenu::onCmdCopyName),
59  FXMAPFUNC(SEL_COMMAND, MID_SHOWPARS, GUIGLObjectPopupMenu::onCmdShowPars),
62 };
63 
64 // Object implementation
65 FXIMPLEMENT(GUIGLObjectPopupMenu, FXMenuPane, GUIGLObjectPopupMenuMap, ARRAYNUMBER(GUIGLObjectPopupMenuMap))
66 
67 
68 // ===========================================================================
69 // method definitions
70 // ===========================================================================
72  GUISUMOAbstractView& parent,
73  GUIGlObject& o)
74  : FXMenuPane(&parent), myParent(&parent), myObject(&o),
75  myApplication(&app), myNetworkPosition(parent.getPositionInformation()) {
76 }
77 
78 
80 
81 
82 long
84  // we already know where the object is since we clicked on it -> zoom on Boundary
85  myParent->centerTo(myObject->getGlID(), true, -1);
86  return 1;
87 }
88 
89 
90 long
93  return 1;
94 }
95 
96 
97 long
100  return 1;
101 }
102 
103 
104 long
107  return 1;
108 }
109 
110 
111 long
115  // formated for pasting into google maps
116  const std::string posString = toString(pos.y(), GEO_OUTPUT_ACCURACY) + ", " + toString(pos.x(), GEO_OUTPUT_ACCURACY);
117  GUIUserIO::copyToClipboard(*myParent->getApp(), posString);
118  return 1;
119 }
120 
121 
122 long
124  myObject->getParameterWindow(*myApplication, *myParent); // !!! showParameterWindow would be more appropriate
125  return 1;
126 }
127 
128 
129 long
132  myParent->update();
133  return 1;
134 }
135 
136 
137 long
140  myParent->update();
141  return 1;
142 }
143 
144 
145 /****************************************************************************/
146