Eclipse SUMO - Simulation of Urban MObility
GNEPolygonFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The Widget for add polygons
16 /****************************************************************************/
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 #include <config.h>
22 
26 #include <netedit/GNEViewParent.h>
27 #include <netedit/GNENet.h>
28 #include <netedit/GNEViewNet.h>
29 #include <netedit/GNEUndoList.h>
33 
34 #include "GNEPolygonFrame.h"
35 
36 
37 // ===========================================================================
38 // FOX callback mapping
39 // ===========================================================================
40 
41 FXDEFMAP(GNEPolygonFrame::GEOPOICreator) GEOPOICreatorMap[] = {
45 };
46 
47 // Object implementation
48 FXIMPLEMENT(GNEPolygonFrame::GEOPOICreator, FXGroupBox, GEOPOICreatorMap, ARRAYNUMBER(GEOPOICreatorMap))
49 
50 
51 // ===========================================================================
52 // method definitions
53 // ===========================================================================
54 
55 // ---------------------------------------------------------------------------
56 // GNEPolygonFrame::GEOPOICreator - methods
57 // ---------------------------------------------------------------------------
58 
60  FXGroupBox(polygonFrameParent->myContentFrame, "GEO POI Creator", GUIDesignGroupBoxFrame),
61  myPolygonFrameParent(polygonFrameParent) {
62  // create RadioButtons for formats
63  myLonLatRadioButton = new FXRadioButton(this, "Format: Lon-Lat", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
64  myLatLonRadioButton = new FXRadioButton(this, "Format: Lat-Lon", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
65  // set lat-lon as default
66  myLatLonRadioButton->setCheck(TRUE);
67  // create text field for coordinates
68  myCoordinatesTextField = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
69  // create checkBox
70  myCenterViewAfterCreationCheckButton = new FXCheckButton(this, "Center View after creation", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
71  // create button for create GEO POIs
72  myCreateGEOPOIButton = new FXButton(this, "Create GEO POI (clipboard)", nullptr, this, MID_GNE_CREATE, GUIDesignButton);
73  // create information label
74  myLabelCartesianPosition = new FXLabel(this, "Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude", 0, GUIDesignLabelFrameInformation);
75 }
76 
77 
79 
80 
81 void
83  // check if there is an GEO Proj string is defined
84  if (GeoConvHelper::getFinal().getProjString() != "!") {
85  myCoordinatesTextField->enable();
86  myCoordinatesTextField->setText("");
87  myCoordinatesTextField->enable();
88  myCreateGEOPOIButton->enable();
89  } else {
90  myCoordinatesTextField->setText("No geo-conversion defined");
91  myCoordinatesTextField->disable();
92  myCreateGEOPOIButton->disable();
93  }
94  show();
95 }
96 
97 
98 void
100  hide();
101 }
102 
103 
104 long
106  // check if input contains spaces
107  std::string input = myCoordinatesTextField->getText().text();
108  std::string inputWithoutSpaces;
109  for (const auto& i : input) {
110  if (i != ' ') {
111  inputWithoutSpaces.push_back(i);
112  }
113  }
114  // if input contains spaces, call this function again, and in other case set red text color
115  if (input.size() != inputWithoutSpaces.size()) {
116  myCoordinatesTextField->setText(inputWithoutSpaces.c_str());
117  }
118  if (inputWithoutSpaces.size() > 0) {
119  myCreateGEOPOIButton->setText("Create GEO POI");
120  } else {
121  myCreateGEOPOIButton->setText("Create GEO POI (clipboard)");
122  }
123  // simply check if given value can be parsed to Position
124  if (GNEAttributeCarrier::canParse<Position>(myCoordinatesTextField->getText().text())) {
125  myCoordinatesTextField->setTextColor(FXRGB(0, 0, 0));
126  myCoordinatesTextField->killFocus();
127  // convert coordinates into lon-lat
128  Position geoPos = GNEAttributeCarrier::parse<Position>(myCoordinatesTextField->getText().text());
129  if (myLatLonRadioButton->getCheck() == TRUE) {
130  geoPos.swapXY();
131  }
133  // check if GEO Position has to be swapped
134  // update myLabelCartesianPosition
135  myLabelCartesianPosition->setText(("Cartesian equivalence:\n- X = " + toString(geoPos.x()) + "\n- Y = " + toString(geoPos.y())).c_str());
136  } else {
137  myCoordinatesTextField->setTextColor(FXRGB(255, 0, 0));
138  myLabelCartesianPosition->setText("Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude");
139  };
140  return 1;
141 }
142 
143 
144 long
145 GNEPolygonFrame::GEOPOICreator::onCmdSetFormat(FXObject* obj, FXSelector, void*) {
146  //disable other radio button depending of selected option
147  if (obj == myLonLatRadioButton) {
148  myLonLatRadioButton->setCheck(TRUE);
149  myLatLonRadioButton->setCheck(FALSE);
150  } else if (obj == myLatLonRadioButton) {
151  myLonLatRadioButton->setCheck(FALSE);
152  myLatLonRadioButton->setCheck(TRUE);
153  }
154  // in both cases call onCmdSetCoordinates(0,0,0) to set new cartesian equivalence
155  onCmdSetCoordinates(0, 0, 0);
156  return 1;
157 }
158 
159 
160 long
162  // first check if current GEO Position is valid
164  std::string geoPosStr = myCoordinatesTextField->getText().text();
165  if (geoPosStr.empty()) {
166  // use clipboard
167  WRITE_WARNING("Using clipboard");
168  geoPosStr = GUIUserIO::copyFromClipboard(*getApp());
169  myCoordinatesTextField->setText(geoPosStr.c_str());
170  // remove spaces, update cartesian value
171  onCmdSetCoordinates(0, 0, 0);
172  geoPosStr = myCoordinatesTextField->getText().text();
173  myCoordinatesTextField->setText("");
174  myCreateGEOPOIButton->setText("Create GEO POI (clipboard)");
175  }
176  if (GNEAttributeCarrier::canParse<Position>(geoPosStr)) {
177  // obtain shape attributes and values
178  auto valuesOfElement = myPolygonFrameParent->myShapeAttributes->getAttributesAndValues(true);
179  // obtain netedit attributes and values
181  // generate new ID
183  // force GEO attribute to true and obain position
184  valuesOfElement[SUMO_ATTR_GEO] = "true";
185  Position geoPos = GNEAttributeCarrier::parse<Position>(geoPosStr);
186  // convert coordinates into lon-lat
187  if (myLatLonRadioButton->getCheck() == TRUE) {
188  geoPos.swapXY();
189  }
191  valuesOfElement[SUMO_ATTR_POSITION] = toString(geoPos);
192  // return ADDSHAPE_SUCCESS if POI was sucesfully created
193  if (myPolygonFrameParent->addPOI(valuesOfElement)) {
194  // check if view has to be centered over created GEO POI
195  if (myCenterViewAfterCreationCheckButton->getCheck() == TRUE) {
196  // create a boundary over given GEO Position and center view over it
197  Boundary centerPosition;
198  centerPosition.add(geoPos);
199  centerPosition = centerPosition.grow(10);
201  }
202  } else {
203  WRITE_WARNING("Could not create GEO POI");
204  }
205  }
206  }
207  return 1;
208 }
209 
210 
211 // ---------------------------------------------------------------------------
212 // GNEPolygonFrame - methods
213 // ---------------------------------------------------------------------------
214 
215 GNEPolygonFrame::GNEPolygonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
216  GNEFrame(horizontalFrameParent, viewNet, "Shapes") {
217 
218  // create item Selector modul for shapes
219  myShapeTagSelector = new GNEFrameModuls::TagSelector(this, GNEAttributeCarrier::TagType::TAGTYPE_SHAPE);
220 
221  // Create shape parameters
223 
224  // Create Netedit parameter
226 
227  // Create drawing controls
229 
231  myGEOPOICreator = new GEOPOICreator(this);
232 
233  // set polygon as default shape
235 }
236 
237 
239 }
240 
241 
242 void
244  // refresh item selector
246  // show frame
247  GNEFrame::show();
248 }
249 
250 
252 GNEPolygonFrame::processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) {
253  // Declare map to keep values
254  std::map<SumoXMLAttr, std::string> valuesOfElement;
255  // check if current selected shape is valid
257  // show warning dialogbox and stop if input parameters are invalid
258  if (myShapeAttributes->areValuesValid() == false) {
260  return ADDSHAPE_INVALID;
261  }
262  // obtain shape attributes and values
263  valuesOfElement = myShapeAttributes->getAttributesAndValues(true);
264  // obtain netedit attributes and values
265  myNeteditAttributes->getNeteditAttributesAndValues(valuesOfElement, objectsUnderCursor.getLaneFront());
266  // generate new ID
268  // obtain position
269  valuesOfElement[SUMO_ATTR_POSITION] = toString(clickedPosition);
270  // set GEO Position as false (because we have created POI clicking over View
271  valuesOfElement[SUMO_ATTR_GEO] = "false";
272  // return ADDSHAPE_SUCCESS if POI was sucesfully created
273  if (addPOI(valuesOfElement)) {
274  return ADDSHAPE_SUCCESS;
275  } else {
276  return ADDSHAPE_INVALID;
277  }
279  // abort if lane is nullptr
280  if (objectsUnderCursor.getLaneFront() == nullptr) {
281  WRITE_WARNING(toString(SUMO_TAG_POILANE) + " can be only placed over lanes");
282  return ADDSHAPE_INVALID;
283  }
284  // show warning dialogbox and stop if input parameters are invalid
285  if (myShapeAttributes->areValuesValid() == false) {
287  return ADDSHAPE_INVALID;
288  }
289  // obtain shape attributes and values
290  valuesOfElement = myShapeAttributes->getAttributesAndValues(true);
291  // obtain netedit attributes and values
292  myNeteditAttributes->getNeteditAttributesAndValues(valuesOfElement, objectsUnderCursor.getLaneFront());
293  // generate new ID
295  // obtain Lane
296  valuesOfElement[SUMO_ATTR_LANE] = objectsUnderCursor.getLaneFront()->getID();
297  // obtain position over lane
298  valuesOfElement[SUMO_ATTR_POSITION] = toString(objectsUnderCursor.getLaneFront()->getGeometry().shape.nearest_offset_to_point2D(clickedPosition));
299  // return ADDSHAPE_SUCCESS if POI was sucesfully created
300  if (addPOILane(valuesOfElement)) {
301  return ADDSHAPE_SUCCESS;
302  } else {
303  return ADDSHAPE_INVALID;
304  }
306  if (myDrawingShape->isDrawing()) {
307  // add or delete a new point depending of flag "delete last created point"
310  } else {
311  myDrawingShape->addNewPoint(clickedPosition);
312  }
314  } else {
315  // return ADDSHAPE_NOTHING if is drawing isn't enabled
316  return ADDSHAPE_NOTHING;
317  }
318  } else {
319  myViewNet->setStatusBarText("Current selected shape isn't valid.");
320  return ADDSHAPE_INVALID;
321  }
322 }
323 
324 
325 std::string
326 GNEPolygonFrame::getIdsSelected(const FXList* list) {
327  // Obtain Id's of list
328  std::string vectorOfIds;
329  for (int i = 0; i < list->getNumItems(); i++) {
330  if (list->isItemSelected(i)) {
331  if (vectorOfIds.size() > 0) {
332  vectorOfIds += " ";
333  }
334  vectorOfIds += (list->getItem(i)->getText()).text();
335  }
336  }
337  return vectorOfIds;
338 }
339 
340 
343  return myDrawingShape;
344 }
345 
346 
347 bool
349  // show warning dialogbox and stop check if input parameters are valid
350  if (myShapeAttributes->areValuesValid() == false) {
352  return false;
353  } else if (myDrawingShape->getTemporalShape().size() == 0) {
354  WRITE_WARNING("Polygon shape cannot be empty");
355  return false;
356  } else {
357  // Declare map to keep values
358  std::map<SumoXMLAttr, std::string> valuesOfElement = myShapeAttributes->getAttributesAndValues(true);
359 
360  // obtain netedit attributes and values
361  myNeteditAttributes->getNeteditAttributesAndValues(valuesOfElement, nullptr);
362 
363  // generate new ID
365 
366  // obtain shape and check if has to be closed
368  if (valuesOfElement[GNE_ATTR_CLOSE_SHAPE] == "true") {
369  temporalShape.closePolygon();
370  }
371  valuesOfElement[SUMO_ATTR_SHAPE] = toString(temporalShape);
372 
373  // obtain geo (by default false)
374  valuesOfElement[SUMO_ATTR_GEO] = "false";
375 
376  // return ADDSHAPE_SUCCESS if POI was sucesfully created
377  return addPolygon(valuesOfElement);
378  }
379 }
380 
381 
382 void
385  // if there are parmeters, show and Recalc groupBox
387  // show netedit attributes
389  // Check if drawing mode has to be shown
392  } else {
394  }
395  // Check if GEO POI Creator has to be shown
398  } else {
400  }
401  } else {
402  // hide all widgets
407  }
408 }
409 
410 
411 bool
412 GNEPolygonFrame::addPolygon(const std::map<SumoXMLAttr, std::string>& polyValues) {
413  // parse attributes from polyValues
414  std::string id = polyValues.at(SUMO_ATTR_ID);
415  std::string type = polyValues.at(SUMO_ATTR_TYPE);
416  RGBColor color = RGBColor::parseColor(polyValues.at(SUMO_ATTR_COLOR));
417  std::string layerStr = polyValues.at(SUMO_ATTR_LAYER);
418  double angle = GNEAttributeCarrier::parse<double>(polyValues.at(SUMO_ATTR_ANGLE));
419  std::string imgFile = polyValues.at(SUMO_ATTR_IMGFILE);
420  bool relativePath = GNEAttributeCarrier::parse<bool>(polyValues.at(SUMO_ATTR_RELATIVEPATH));
421  PositionVector shape = GNEAttributeCarrier::parse<PositionVector>(polyValues.at(SUMO_ATTR_SHAPE));
422  bool fill = GNEAttributeCarrier::parse<bool>(polyValues.at(SUMO_ATTR_FILL));
423  double lineWidth = GNEAttributeCarrier::parse<double>(polyValues.at(SUMO_ATTR_LINEWIDTH));
424  // parse layer
425  double layer = GNEAttributeCarrier::canParse<double>(layerStr) ? GNEAttributeCarrier::parse<double>(layerStr) : Shape::DEFAULT_LAYER;
426  // create new Polygon only if number of shape points is greather than 2
428  if ((shape.size() > 0) && myViewNet->getNet()->addPolygon(id, type, color, layer, angle, imgFile, relativePath, shape, false, fill, lineWidth)) {
429  // set manually attributes use GEO, block movement and block shape
430  GNEPoly* polygon = myViewNet->getNet()->retrievePolygon(id);
434  return true;
435  } else {
436  // abort creation
438  return false;
439  }
440 }
441 
442 
443 bool
444 GNEPolygonFrame::addPOI(const std::map<SumoXMLAttr, std::string>& POIValues) {
445  // parse attributes from POIValues
446  std::string id = POIValues.at(SUMO_ATTR_ID);
447  std::string type = POIValues.at(SUMO_ATTR_TYPE);
448  RGBColor color = RGBColor::parseColor(POIValues.at(SUMO_ATTR_COLOR));
449  std::string layerStr = POIValues.at(SUMO_ATTR_LAYER);
450  Position pos = GNEAttributeCarrier::parse<Position>(POIValues.at(SUMO_ATTR_POSITION));
451  double angle = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_ANGLE));
452  std::string imgFile = POIValues.at(SUMO_ATTR_IMGFILE);
453  bool relativePath = GNEAttributeCarrier::parse<bool>(POIValues.at(SUMO_ATTR_RELATIVEPATH));
454  double widthPOI = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_WIDTH));
455  double heightPOI = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_HEIGHT));
456  double layer = GNEAttributeCarrier::canParse<double>(layerStr) ? GNEAttributeCarrier::parse<double>(layerStr) : Shape::DEFAULT_LAYER_POI;
457  bool geo = GNEAttributeCarrier::parse<bool>(POIValues.at(SUMO_ATTR_GEO));
458  // create new POI
460  if (myViewNet->getNet()->addPOI(id, type, color, pos, geo, "", 0, 0, layer, angle, imgFile, relativePath, widthPOI, heightPOI)) {
461  // Set manually the attribute block movement
462  GNEPOI* poi = myViewNet->getNet()->retrievePOI(id);
465  return true;
466  } else {
467  // abort creation
469  return false;
470  }
471 }
472 
473 
474 bool
475 GNEPolygonFrame::addPOILane(const std::map<SumoXMLAttr, std::string>& POIValues) {
476  // parse attributes from POIValues
477  std::string id = POIValues.at(SUMO_ATTR_ID);
478  std::string type = POIValues.at(SUMO_ATTR_TYPE);
479  RGBColor color = RGBColor::parseColor(POIValues.at(SUMO_ATTR_COLOR));
480  std::string layerStr = POIValues.at(SUMO_ATTR_LAYER);
481  double angle = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_ANGLE));
482  std::string imgFile = POIValues.at(SUMO_ATTR_IMGFILE);
483  bool relativePath = GNEAttributeCarrier::parse<bool>(POIValues.at(SUMO_ATTR_RELATIVEPATH));
484  GNELane* lane = myViewNet->getNet()->retrieveLane(POIValues.at(SUMO_ATTR_LANE));
485  double posLane = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_POSITION));
486  double posLat = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_POSITION_LAT));
487  double widthPOI = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_WIDTH));
488  double heightPOI = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_HEIGHT));
489  // parse layer
490  double layer = GNEAttributeCarrier::canParse<double>(layerStr) ? GNEAttributeCarrier::parse<double>(layerStr) : Shape::DEFAULT_LAYER_POI;
491  // create new POILane
493  if (myViewNet->getNet()->addPOI(id, type, color, Position(), false, lane->getID(), posLane, posLat, layer, angle, imgFile, relativePath, widthPOI, heightPOI)) {
494  // Set manually the attribute block movement
498  return true;
499  } else {
500  // abort creation
502  return false;
503  }
504 }
505 
506 /****************************************************************************/
long onCmdSetCoordinates(FXObject *, FXSelector, void *)
static RGBColor parseColor(std::string coldef)
Parses a color information.
Definition: RGBColor.cpp:177
PositionVector shape
The shape of the netElement element.
Definition: GNENetElement.h:57
~GNEPolygonFrame()
Destructor.
block shape of a graphic element (Used mainly in GNEShapes)
AddShapeResult processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
AddShapeResult
enum with all possible values after try to create an shape using frame
bool isDrawing() const
return true if currently a shape is drawed
bool getDeleteLastCreatedPoint()
get flag delete last created point
static const double DEFAULT_LAYER_POI
Definition: Shape.h:46
A layer number.
GNEPolygonFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
Definition: GNEPOI.h:45
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
Definition: GNEPOI.cpp:308
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:921
double y() const
Returns the y-position.
Definition: Position.h:62
void showAttributesCreatorModul(const GNEAttributeCarrier::TagProperties &myTagProperties)
show AttributesCreator modul
void showDrawingShape()
show Drawing mode
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
Definition: GNENet.cpp:1066
void addNewPoint(const Position &P)
add new point to temporal shape
double x() const
Returns the x-position.
Definition: Position.h:57
Close shape of a polygon (Used by GNEPolys)
long onCmdSetFormat(FXObject *, FXSelector, void *)
called when user select a format radio button
GNEPoly * retrievePolygon(const std::string &id, bool failHard=true) const
get Polygon by id
Definition: GNENet.cpp:1053
GNEFrameAttributesModuls::AttributesCreator * myShapeAttributes
shape internal attributes
void removeLastPoint()
remove last added point
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
Definition: GNEUndoList.cpp:73
void hideNeteditAttributesModul()
hide Netedit attributes modul
GEOPOICreator * myGEOPOICreator
GEOPOICreator.
begin/end of the description of a Point of interest
std::map< SumoXMLAttr, std::string > getAttributesAndValues(bool includeAll) const
get attributes and their values
FXLabel * myLabelCartesianPosition
FXLabel for the equivalent position of GEO Position in Cartesian Position.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
FXCheckButton * myCenterViewAfterCreationCheckButton
button for enable or disable certer view after creation of GEO POI
bool addPolygon(const std::map< SumoXMLAttr, std::string > &POIValues)
add Polygon
bool addPOI(const std::map< SumoXMLAttr, std::string > &POIValues)
add POI
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:239
void showGEOPOICreatorModul()
Show list of GEOPOICreator Modul.
bool areValuesValid() const
check if parameters of attributes are valid
std::string generateShapeID(SumoXMLTag shapeTag) const
generate Shape ID
Definition: GNENet.cpp:2547
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:120
void hideDrawingShape()
hide Drawing mode
void showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties &tagValue)
show Netedit attributes modul
void tagSelected()
Tag selected in TagSelector.
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:933
set type of selection
Definition: GUIAppEnum.h:493
void hideGEOPOICreatorModul()
hide GEOPOICreator Modul
GNEFrameModuls::DrawingShape * getDrawingShapeModul() const
get drawing mode editor
GNEFrameAttributesModuls::NeteditAttributes * myNeteditAttributes
Netedit parameter.
#define GUIDesignTextField
Definition: GUIDesigns.h:34
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
FXDEFMAP(GNEPolygonFrame::GEOPOICreator) GEOPOICreatorMap[]
GNEFrameModuls::DrawingShape * myDrawingShape
Drawing shape.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
Definition: GNEUndoList.cpp:80
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:131
FXTextField * myCoordinatesTextField
text field for given geo coordinates
A list of positions.
void refreshTagProperties()
due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show ...
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
bool addPOI(const std::string &id, const std::string &type, const RGBColor &color, const Position &pos, bool geo, const std::string &lane, double posOverLane, double posLat, double layer, double angle, const std::string &imgFile, bool relativePath, double width, double height, bool ignorePruning=false)
Builds a POI using the given values and adds it to the container.
Definition: GNENet.cpp:241
block movement of a graphic element
bool addPOILane(const std::map< SumoXMLAttr, std::string > &POIValues)
add POILane
void swapXY()
swap position X and Y
Definition: Position.h:275
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 if there isn&#39;t)
FXRadioButton * myLatLonRadioButton
radio button for the configuration lat-lon
edge: the shape in xml-definition
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:301
const std::string getID() const
function to support debugging
const NetElementGeometry & getGeometry() const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
Definition: GNEPoly.cpp:642
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:210
void p_abort()
reverts and discards ALL active command groups
Definition: GNEUndoList.cpp:94
const PositionVector & getTemporalShape() const
get Temporal shape
bool getNeteditAttributesAndValues(std::map< SumoXMLAttr, std::string > &valuesMap, const GNELane *lane) const
fill valuesMap with netedit attributes
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:58
#define GUIDesignButton
Definition: GUIDesigns.h:66
virtual void show()
show Frame
Definition: GNEFrame.cpp:108
GUISUMOAbstractView * getView() const
return GUISUMOAbstractView
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:255
void show()
show Frame
const GNEAttributeCarrier::TagProperties & getCurrentTagProperties() const
get current type tag
bool shapeDrawed()
build a shaped element using the drawed shape return true if was sucesfully created ...
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:117
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
static std::string getIdsSelected(const FXList *list)
get list of selecte id&#39;s in string format
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:927
GNEPolygonFrame * myPolygonFrameParent
pointer to Shape frame parent
attribute edited
Definition: GUIAppEnum.h:619
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:482
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation. ...
GNEFrameModuls::TagSelector * myShapeTagSelector
shape tag selector
void setCurrentTag(SumoXMLTag newTag)
set current type manually
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:79
begin/end of the description of a Point of interest over Lane (used by Netedit)
create element
Definition: GUIAppEnum.h:621
#define GUIDesignRadioButton
Definition: GUIDesigns.h:155
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
void closePolygon()
ensures that the last position equals the first
C++ TraCI client API implementation.
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Definition: GNENet.cpp:1179
A color information.
FXButton * myCreateGEOPOIButton
button for create GEO Coordinates
static std::string copyFromClipboard(const FXApp &app)
Copies text from the clipboard.
Definition: GUIUserIO.cpp:46
Fill the polygon.
bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, bool relativePath, const PositionVector &shape, bool geo, bool fill, double lineWidth, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
Definition: GNENet.cpp:218
FXRadioButton * myLonLatRadioButton
radio button for the configuration lon-lat
long onCmdCreateGEOPOI(FXObject *, FXSelector, void *)
called when user type in search box
begin/end of the description of a polygon
static const double DEFAULT_LAYER
Definition: Shape.h:44