Eclipse SUMO - Simulation of Urban MObility
GNEShapeFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // The Widget for add polygons
19 /****************************************************************************/
20 #include <config.h>
21 
27 #include <netedit/GNEViewParent.h>
28 #include <netedit/GNENet.h>
29 #include <netedit/GNEViewNet.h>
30 
31 #include "GNEShapeFrame.h"
32 
33 
34 // ===========================================================================
35 // FOX callback mapping
36 // ===========================================================================
37 
38 FXDEFMAP(GNEShapeFrame::GEOPOICreator) GEOPOICreatorMap[] = {
42 };
43 
44 // Object implementation
45 FXIMPLEMENT(GNEShapeFrame::GEOPOICreator, MFXGroupBoxModule, GEOPOICreatorMap, ARRAYNUMBER(GEOPOICreatorMap))
46 
47 
48 // ===========================================================================
49 // method definitions
50 // ===========================================================================
51 
52 // ---------------------------------------------------------------------------
53 // GNEShapeFrame::GEOPOICreator - methods
54 // ---------------------------------------------------------------------------
55 
57  MFXGroupBoxModule(polygonFrameParent, TL("GEO POI Creator")),
58  myShapeFrameParent(polygonFrameParent) {
59  // create RadioButtons for formats
60  myLonLatRadioButton = new FXRadioButton(getCollapsableFrame(), TL("Format: Lon-Lat"), this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
61  myLatLonRadioButton = new FXRadioButton(getCollapsableFrame(), TL("Format: Lat-Lon"), this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
62  // set lat-lon as default
63  myLatLonRadioButton->setCheck(TRUE);
64  // create text field for coordinates
65  myCoordinatesTextField = new FXTextField(getCollapsableFrame(), GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
66  // create checkBox
67  myCenterViewAfterCreationCheckButton = new FXCheckButton(getCollapsableFrame(), TL("Center View after creation"), this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
68  // create button for create GEO POIs
69  myCreateGEOPOIButton = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Create GEO POI (clipboard)"), "", "", nullptr, this, MID_GNE_CREATE, GUIDesignButton);
70  // create information label
71  myLabelCartesianPosition = new MFXDynamicLabel(getCollapsableFrame(),
72  (TL("Cartesian equivalence:") + std::string("\n") +
73  TL("- X = give valid longitude") + std::string("\n") +
74  TL("- Y = give valid latitude")).c_str(),
76 }
77 
78 
80 
81 
82 void
84  // check if there is an GEO Proj string is defined
85  if (GeoConvHelper::getFinal().getProjString() != "!") {
86  myCoordinatesTextField->enable();
87  myCoordinatesTextField->setText("");
88  myCoordinatesTextField->enable();
89  myCreateGEOPOIButton->enable();
90  } else {
91  myCoordinatesTextField->setText(TL("No geo-conversion defined"));
92  myCoordinatesTextField->disable();
93  myCreateGEOPOIButton->disable();
94  }
95  show();
96 }
97 
98 
99 void
101  hide();
102 }
103 
104 
105 long
107  // check if input contains spaces
108  std::string input = myCoordinatesTextField->getText().text();
109  std::string inputWithoutSpaces;
110  for (const auto& i : input) {
111  if (i != ' ') {
112  inputWithoutSpaces.push_back(i);
113  }
114  }
115  // if input contains spaces, call this function again, and in other case set red text color
116  if (input.size() != inputWithoutSpaces.size()) {
117  myCoordinatesTextField->setText(inputWithoutSpaces.c_str());
118  }
119  if (inputWithoutSpaces.size() > 0) {
120  myCreateGEOPOIButton->setText(TL("Create GEO POI"));
121  } else {
122  myCreateGEOPOIButton->setText(TL("Create GEO POI (clipboard)"));
123  }
124  // simply check if given value can be parsed to Position
125  if (GNEAttributeCarrier::canParse<Position>(myCoordinatesTextField->getText().text())) {
126  myCoordinatesTextField->setTextColor(FXRGB(0, 0, 0));
127  myCoordinatesTextField->killFocus();
128  // convert coordinates into lon-lat
129  Position geoPos = GNEAttributeCarrier::parse<Position>(myCoordinatesTextField->getText().text());
130  if (myLatLonRadioButton->getCheck() == TRUE) {
131  geoPos.swapXY();
132  }
134  // check if GEO Position has to be swapped
135  // update myLabelCartesianPosition
136  myLabelCartesianPosition->setText(
137  (TL("Cartesian equivalence:") + std::string("\n- X = ") + toString(geoPos.x()) + std::string("\n- Y = ") + toString(geoPos.y())).c_str());
138  } else {
139  myCoordinatesTextField->setTextColor(FXRGB(255, 0, 0));
140  myLabelCartesianPosition->setText(
141  (TL("Cartesian equivalence:") + std::string("\n") +
142  TL("- X = give valid longitude") + std::string("\n") +
143  TL("- Y = give valid latitude")).c_str());
144  };
145  return 1;
146 }
147 
148 
149 long
150 GNEShapeFrame::GEOPOICreator::onCmdSetFormat(FXObject* obj, FXSelector, void*) {
151  //disable other radio button depending of selected option
152  if (obj == myLonLatRadioButton) {
153  myLonLatRadioButton->setCheck(TRUE);
154  myLatLonRadioButton->setCheck(FALSE);
155  } else if (obj == myLatLonRadioButton) {
156  myLonLatRadioButton->setCheck(FALSE);
157  myLatLonRadioButton->setCheck(TRUE);
158  }
159  // in both cases call onCmdSetCoordinates(0,0,0) to set new cartesian equivalence
160  onCmdSetCoordinates(0, 0, 0);
161  return 1;
162 }
163 
164 
165 long
166 GNEShapeFrame::GEOPOICreator::onCmdCreateGEOPOI(FXObject*, FXSelector, void*) {
167  // first check if current GEO Position is valid
168  if (myShapeFrameParent->myShapeAttributes->areValuesValid()) {
169  std::string geoPosStr = myCoordinatesTextField->getText().text();
170  if (geoPosStr.empty()) {
171  // use clipboard
172  WRITE_WARNING(TL("Using clipboard"));
173  geoPosStr = GUIUserIO::copyFromClipboard(*getApp());
174  myCoordinatesTextField->setText(geoPosStr.c_str());
175  // remove spaces, update cartesian value
176  onCmdSetCoordinates(0, 0, 0);
177  geoPosStr = myCoordinatesTextField->getText().text();
178  myCoordinatesTextField->setText("");
179  myCreateGEOPOIButton->setText(TL("Create GEO POI (clipboard)"));
180  }
181  if (GNEAttributeCarrier::canParse<Position>(geoPosStr)) {
182  // create baseShape object
183  myShapeFrameParent->createBaseShapeObject(SUMO_TAG_POI);
184  // obtain shape attributes and values
185  myShapeFrameParent->myShapeAttributes->getAttributesAndValues(myShapeFrameParent->myBaseShape, true);
186  // obtain netedit attributes and values
187  myShapeFrameParent->myNeteditAttributes->getNeteditAttributesAndValues(myShapeFrameParent->myBaseShape, nullptr);
188  // Check if ID has to be generated
189  if (!myShapeFrameParent->myBaseShape->hasStringAttribute(SUMO_ATTR_ID)) {
190  myShapeFrameParent->myBaseShape->addStringAttribute(SUMO_ATTR_ID, myShapeFrameParent->myViewNet->getNet()->getAttributeCarriers()->generateAdditionalID(SUMO_TAG_POI));
191  }
192  // force GEO attribute to true and obtain position
193  myShapeFrameParent->myBaseShape->addBoolAttribute(SUMO_ATTR_GEO, true);
194  Position geoPos = GNEAttributeCarrier::parse<Position>(geoPosStr);
195  // convert coordinates into lon-lat
196  if (myLatLonRadioButton->getCheck() == TRUE) {
197  geoPos.swapXY();
198  }
199  // add lon/lat
200  myShapeFrameParent->myBaseShape->addDoubleAttribute(SUMO_ATTR_LON, geoPos.x());
201  myShapeFrameParent->myBaseShape->addDoubleAttribute(SUMO_ATTR_LAT, geoPos.y());
202  // set GEO Position as true
203  myShapeFrameParent->myBaseShape->addBoolAttribute(SUMO_ATTR_GEO, true);
204  // add shape
205  myShapeFrameParent->addShape();
206  // check if view has to be centered over created GEO POI
207  if (myCenterViewAfterCreationCheckButton->getCheck() == TRUE) {
208  // create a boundary over given GEO Position and center view over it
209  Boundary centerPosition;
211  centerPosition.add(geoPos);
212  centerPosition = centerPosition.grow(10);
213  myShapeFrameParent->myViewNet->getViewParent()->getView()->centerTo(centerPosition);
214  }
215  }
216  // refresh shape attributes
217  myShapeFrameParent->myShapeAttributes->refreshAttributesCreator();
218  }
219  return 1;
220 }
221 
222 
223 // ---------------------------------------------------------------------------
224 // GNEShapeFrame - methods
225 // ---------------------------------------------------------------------------
226 
228  GNEFrame(viewParent, viewNet, TL("Shapes")),
229  myBaseShape(nullptr) {
230 
231  // create item Selector module for shapes
232  myShapeTagSelector = new GNETagSelector(this, GNETagProperties::TagType::SHAPE, SUMO_TAG_POLY);
233 
234  // Create shape parameters
236 
237  // Create Netedit parameter
239 
240  // Create drawing controls
241  myDrawingShape = new GNEDrawingShape(this);
242 
244  myGEOPOICreator = new GEOPOICreator(this);
245 }
246 
247 
249  // check if we have to delete base additional object
250  if (myBaseShape) {
251  delete myBaseShape;
252  }
253 }
254 
255 
256 void
258  // refresh tag selector
260  // show frame
261  GNEFrame::show();
262 }
263 
264 
265 bool
266 GNEShapeFrame::processClick(const Position& clickedPosition, const GNEViewNetHelper::ViewObjectsSelector& viewObjects, bool& updateTemporalShape) {
267  // reset updateTemporalShape
268  updateTemporalShape = false;
269  // check if current selected shape is valid
270  if (myShapeTagSelector->getCurrentTemplateAC() != nullptr) {
271  // get tag
273  // continue depending of tag
274  switch (shapeTag) {
275  case SUMO_TAG_POI:
276  return processClickPOI(shapeTag, clickedPosition, viewObjects);
277  case GNE_TAG_POIGEO:
278  return processClickPOIGeo(clickedPosition, viewObjects);
279  case GNE_TAG_POILANE:
280  return processClickPOILanes(clickedPosition, viewObjects);
281  case SUMO_TAG_POLY:
284  return processClickPolygons(clickedPosition, updateTemporalShape);
285  default:
286  break;
287  }
288  }
289  myViewNet->setStatusBarText(TL("Current selected shape isn't valid."));
290  return false;
291 }
292 
293 
294 std::string
295 GNEShapeFrame::getIdsSelected(const FXList* list) {
296  // Obtain Id's of list
297  std::string vectorOfIds;
298  for (int i = 0; i < list->getNumItems(); i++) {
299  if (list->isItemSelected(i)) {
300  if (vectorOfIds.size() > 0) {
301  vectorOfIds += " ";
302  }
303  vectorOfIds += (list->getItem(i)->getText()).text();
304  }
305  }
306  return vectorOfIds;
307 }
308 
309 
312  return myDrawingShape;
313 }
314 
315 
316 void
318  // check if baseShape exist, and if yes, delete it
319  if (myBaseShape) {
320  // delete baseShape (and all children)
321  delete myBaseShape;
322  }
323  // just create a base shape
325  // set tag
326  myBaseShape->setTag(shapeTag);
327 }
328 
329 
330 bool
332  // show warning dialogbox and stop check if input parameters are valid
335  return false;
336  } else if (myDrawingShape->getTemporalShape().size() == 0) {
337  WRITE_WARNING(TL("Polygon shape cannot be empty"));
338  return false;
339  } else {
340  // get tag
342  // create baseShape object
343  createBaseShapeObject(shapeTag);
344  // obtain shape attributes and values
346  // obtain netedit attributes and values
348  // Check if ID has to be generated
351  }
352  // obtain shape and check if has to be closed
355  (shapeTag == GNE_TAG_JPS_WALKABLEAREA) || (shapeTag == GNE_TAG_JPS_OBSTACLE)) {
356  temporalShape.closePolygon();
357  }
359  // obtain geo (by default false)
361  // add shape
362  addShape();
363  // refresh shape attributes
365  // shape added, then return true;
366  return true;
367  }
368 }
369 
370 
371 void
374  // if there are parameters, show and Recalc groupBox
376  // show netedit attributes
378  // get shape tag
380  // Check if drawing mode has to be shown
381  if ((shapeTag == SUMO_TAG_POLY) || (shapeTag == GNE_TAG_JPS_WALKABLEAREA) || (shapeTag == GNE_TAG_JPS_OBSTACLE)) {
383  } else {
385  }
386  // Check if GEO POI Creator has to be shown
387  if (shapeTag == GNE_TAG_POIGEO) {
389  } else {
391  }
392  } else {
393  // hide all widgets
398  }
399 }
400 
401 
402 void
404  // declare additional handler
405  GNEAdditionalHandler additionalHandler(myViewNet->getNet(), true, false);
406  // build shape
407  additionalHandler.parseSumoBaseObject(myBaseShape);
408 }
409 
410 
411 bool
412 GNEShapeFrame::processClickPolygons(const Position& clickedPosition, bool& updateTemporalShape) {
413  if (myDrawingShape->isDrawing()) {
414  // add or delete a new point depending of flag "delete last created point"
417  } else {
418  myDrawingShape->addNewPoint(clickedPosition);
419  }
420  // set temporal shape
421  updateTemporalShape = true;
422  return true;
423  } else {
424  return false;
425  }
426 }
427 
428 
429 bool
431  // show warning dialogbox and stop if input parameters are invalid
434  return false;
435  }
436  // create baseShape object
437  createBaseShapeObject(POITag);
438  // obtain shape attributes and values
440  // obtain netedit attributes and values
442  // Check if ID has to be generated
445  }
446  // add X-Y
447  myBaseShape->addDoubleAttribute(SUMO_ATTR_X, clickedPosition.x());
448  myBaseShape->addDoubleAttribute(SUMO_ATTR_Y, clickedPosition.y());
449  // set GEO Position as false (because we have created POI clicking over View
451  // add shape
452  addShape();
453  // refresh shape attributes
455  // shape added, then return true
456  return true;
457 }
458 
459 
460 bool
462  // show warning dialogbox and stop if input parameters are invalid
465  return false;
466  }
467  // create baseShape object
469  // obtain shape attributes and values
471  // obtain netedit attributes and values
473  // Check if ID has to be generated
476  }
477  // convert position to cartesian
478  Position GEOPos = clickedPosition;
480  // add X-Y in geo format
483  // set GEO Position as false (because we have created POI clicking over View
485  // add shape
486  addShape();
487  // refresh shape attributes
489  // shape added, then return true
490  return true;
491 }
492 
493 
494 bool
496  // abort if lane is nullptr
497  if (viewObjects.getLaneFront() == nullptr) {
498  WRITE_WARNING(TL("POILane can be only placed over lanes"));
499  return false;
500  }
501  // show warning dialogbox and stop if input parameters are invalid
504  return false;
505  }
506  // create baseShape object
508  // obtain shape attributes and values
510  // obtain netedit attributes and values
512  // Check if ID has to be generated
515  }
516  // obtain Lane
518  // obtain position over lane
520  // add shape
521  addShape();
522  // refresh shape attributes
524  // shape added, then return true
525  return true;
526 }
527 
528 /****************************************************************************/
FXDEFMAP(GNEShapeFrame::GEOPOICreator) GEOPOICreatorMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:930
@ MID_CHOOSEN_OPERATION
set type of selection
Definition: GUIAppEnum.h:593
@ MID_GNE_CREATE
create element
Definition: GUIAppEnum.h:932
#define GUIDesignButton
Definition: GUIDesigns.h:88
#define GUIDesignTextField
Definition: GUIDesigns.h:65
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:80
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:198
#define GUIDesignRadioButton
Definition: GUIDesigns.h:235
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:285
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:295
#define TL(string)
Definition: MsgHandler.h:315
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ GNE_TAG_POIGEO
Point of interest over view with GEO attributes.
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ GNE_TAG_POILANE
Point of interest over Lane.
@ GNE_TAG_JPS_OBSTACLE
polygon used for draw juPedSim obstacles
@ GNE_TAG_JPS_WALKABLEAREA
polygon used for draw juPedSim walkable areas
@ SUMO_ATTR_LANE
@ SUMO_ATTR_LON
@ SUMO_ATTR_Y
@ SUMO_ATTR_X
@ SUMO_ATTR_GEO
@ GNE_ATTR_CLOSE_SHAPE
Close shape of a polygon (Used by GNEPolys)
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_LAT
@ SUMO_ATTR_ID
@ SUMO_ATTR_POSITION
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:78
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:319
bool hasBoolAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given bool attribute
bool hasStringAttribute(const SumoXMLAttr attr) const
has function
void setTag(const SumoXMLTag tag)
set SumoBaseObject tag
void addPositionVectorAttribute(const SumoXMLAttr attr, const PositionVector &value)
add PositionVector attribute into current SumoBaseObject node
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
bool getBoolAttribute(const SumoXMLAttr attr) const
get bool attribute
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc.....
const std::string getID() const
get ID (all Attribute Carriers have one)
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
void getAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, bool includeAll) const
get attributes and their values
bool areValuesValid() const
check if parameters of attributes are valid
void showAttributesCreatorModule(GNEAttributeCarrier *templateAC, const std::vector< SumoXMLAttr > &hiddenAttributes)
show GNEAttributesCreator modul
void hideAttributesCreatorModule()
hide group box
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
void refreshAttributesCreator()
refresh attribute creator
bool isDrawing() const
return true if currently a shape is drawed
void addNewPoint(const Position &P)
add new point to temporal shape
bool getDeleteLastCreatedPoint()
get flag delete last created point
void removeLastPoint()
remove last added point
void showDrawingShape()
show Drawing mode
void hideDrawingShape()
hide Drawing mode
const PositionVector & getTemporalShape() const
get Temporal shape
GNEViewNet * myViewNet
FOX need this.
Definition: GNEFrame.h:117
virtual void show()
show Frame
Definition: GNEFrame.cpp:115
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:124
const PositionVector & getLaneShape() const
get elements shape
Definition: GNELane.cpp:214
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:121
void showNeteditAttributesModule(GNEAttributeCarrier *templateAC)
show Netedit attributes modul
void hideNeteditAttributesModule()
hide Netedit attributes modul
bool getNeteditAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, const GNELane *lane) const
fill valuesMap with netedit attributes
long onCmdSetFormat(FXObject *, FXSelector, void *)
called when user select a format radio button
void hideGEOPOICreatorModule()
hide GEOPOICreator Module
long onCmdSetCoordinates(FXObject *, FXSelector, void *)
void showGEOPOICreatorModule()
Show list of GEOPOICreator Module.
long onCmdCreateGEOPOI(FXObject *, FXSelector, void *)
called when user type in search box
void tagSelected()
Tag selected in GNETagSelector.
void show()
show Frame
bool processClickPOI(SumoXMLTag POITag, const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click for POIs over view
bool processClickPolygons(const Position &clickedPosition, bool &updateTemporalShape)
process click for Polygons
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects, bool &updateTemporalShape)
process click over Viewnet
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode editor
GNEAttributesCreator * myShapeAttributes
shape internal attributes
void addShape()
add shape (using base shape)
void createBaseShapeObject(const SumoXMLTag shapeTag)
GNEDrawingShape * myDrawingShape
Drawing shape.
CommonXMLStructure::SumoBaseObject * myBaseShape
SumoBaseObject used for create shape.
GEOPOICreator * myGEOPOICreator
GEOPOICreator.
~GNEShapeFrame()
Destructor.
bool processClickPOILanes(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click for POILanes
GNENeteditAttributes * myNeteditAttributes
Netedit parameter.
static std::string getIdsSelected(const FXList *list)
get list of selecte id's in string format
bool processClickPOIGeo(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click for POIGeo
GNEShapeFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
bool shapeDrawed()
build a shaped element using the drawed shape return true if was successfully created
GNETagSelector * myShapeTagSelector
shape tag selector
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void refreshTagSelector()
refresh tagSelector (used when frameParent is show)
GNEAttributeCarrier * getCurrentTemplateAC() const
get current templateAC
class used to group all variables related with objects under cursor after a click over view
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
GNENet * getNet() const
get the net object
void setStatusBarText(const std::string &text)
set statusBar text
Definition: GNEViewNet.cpp:841
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:88
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
Definition: GUIDesigns.cpp:128
static std::string copyFromClipboard(const FXApp &app)
Copies text from the clipboard.
Definition: GUIUserIO.cpp:44
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation.
A list item which allows for custom coloring.
MFXGroupBoxModule (based on FXGroupBox)
C++ TraCI client API implementation.
Definition: POI.h:34
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
double x() const
Returns the x-position.
Definition: Position.h:55
void swapXY()
swap position X and Y
Definition: Position.h:307
double y() const
Returns the y-position.
Definition: Position.h:60
A list of positions.
void closePolygon()
ensures that the last position equals the first
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D