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-2018 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/GNEUndoList.h>
32 
33 #include "GNEPolygonFrame.h"
34 
35 
36 // ===========================================================================
37 // FOX callback mapping
38 // ===========================================================================
39 
40 FXDEFMAP(GNEPolygonFrame::GEOPOICreator) GEOPOICreatorMap[] = {
44 };
45 
46 // Object implementation
47 FXIMPLEMENT(GNEPolygonFrame::GEOPOICreator, FXGroupBox, GEOPOICreatorMap, ARRAYNUMBER(GEOPOICreatorMap))
48 
49 
50 // ===========================================================================
51 // method definitions
52 // ===========================================================================
53 
54 // ---------------------------------------------------------------------------
55 // GNEPolygonFrame::GEOPOICreator - methods
56 // ---------------------------------------------------------------------------
57 
59  FXGroupBox(polygonFrameParent->myContentFrame, "GEO POI Creator", GUIDesignGroupBoxFrame),
60  myPolygonFrameParent(polygonFrameParent) {
61  // create RadioButtons for formats
62  myLonLatRadioButton = new FXRadioButton(this, "Format: Lon-Lat", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
63  myLatLonRadioButton = new FXRadioButton(this, "Format: Lat-Lon", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
64  // set lat-lon as default
65  myLatLonRadioButton->setCheck(TRUE);
66  // create text field for coordinates
67  myCoordinatesTextField = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
68  // create checkBox
69  myCenterViewAfterCreationCheckButton = new FXCheckButton(this, "Center View after creation", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButtonAttribute);
70  // create button for create GEO POIs
71  myCreateGEOPOIButton = new FXButton(this, "Create GEO POI (clipboard)", nullptr, this, MID_GNE_CREATE, GUIDesignButton);
72  // create information label
73  myLabelCartesianPosition = new FXLabel(this, "Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude", 0, GUIDesignLabelFrameInformation);
74 }
75 
76 
78 
79 
80 void
82  // check if there is an GEO Proj string is defined
83  if (GeoConvHelper::getFinal().getProjString() != "!") {
84  myCoordinatesTextField->enable();
85  myCoordinatesTextField->setText("");
86  myCoordinatesTextField->enable();
87  myCreateGEOPOIButton->enable();
88  } else {
89  myCoordinatesTextField->setText("No geo-conversion defined");
90  myCoordinatesTextField->disable();
91  myCreateGEOPOIButton->disable();
92  }
93  show();
94 }
95 
96 
97 void
99  hide();
100 }
101 
102 
103 long
105  // check if input contains spaces
106  std::string input = myCoordinatesTextField->getText().text();
107  std::string inputWithoutSpaces;
108  for (const auto &i : input) {
109  if (i != ' ') {
110  inputWithoutSpaces.push_back(i);
111  }
112  }
113  // if input contains spaces, call this function again, and in other case set red text color
114  if (input.size() != inputWithoutSpaces.size()) {
115  myCoordinatesTextField->setText(inputWithoutSpaces.c_str());
116  }
117  if (inputWithoutSpaces.size() > 0) {
118  myCreateGEOPOIButton->setText("Create GEO POI");
119  } else {
120  myCreateGEOPOIButton->setText("Create GEO POI (clipboard)");
121  }
122  // simply check if given value can be parsed to Position
123  if (GNEAttributeCarrier::canParse<Position>(myCoordinatesTextField->getText().text())) {
124  myCoordinatesTextField->setTextColor(FXRGB(0, 0, 0));
125  myCoordinatesTextField->killFocus();
126  // convert coordinates into lon-lat
127  Position geoPos = GNEAttributeCarrier::parse<Position>(myCoordinatesTextField->getText().text());
128  if (myLatLonRadioButton->getCheck() == TRUE) {
129  geoPos.swapXY();
130  }
132  // check if GEO Position has to be swapped
133  // update myLabelCartesianPosition
134  myLabelCartesianPosition->setText(("Cartesian equivalence:\n- X = " + toString(geoPos.x()) + "\n- Y = " + toString(geoPos.y())).c_str());
135  } else {
136  myCoordinatesTextField->setTextColor(FXRGB(255, 0, 0));
137  myLabelCartesianPosition->setText("Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude");
138  };
139  return 1;
140 }
141 
142 
143 long
144 GNEPolygonFrame::GEOPOICreator::onCmdSetFormat(FXObject* obj, FXSelector, void*) {
145  //disable other radio button depending of selected option
146  if(obj == myLonLatRadioButton) {
147  myLonLatRadioButton->setCheck(TRUE);
148  myLatLonRadioButton->setCheck(FALSE);
149  } else if (obj == myLatLonRadioButton) {
150  myLonLatRadioButton->setCheck(FALSE);
151  myLatLonRadioButton->setCheck(TRUE);
152  }
153  // in both cases call onCmdSetCoordinates(0,0,0) to set new cartesian equivalence
154  onCmdSetCoordinates(0,0,0);
155  return 1;
156 }
157 
158 
159 long
161  // first check if current GEO Position is valid
163  std::string geoPosStr = myCoordinatesTextField->getText().text();
164  if (geoPosStr.empty()) {
165  // use clipboard
166  WRITE_WARNING("Using clipboard");
167  geoPosStr = GUIUserIO::copyFromClipboard(*getApp());
168  myCoordinatesTextField->setText(geoPosStr.c_str());
169  // remove spaces, update cartesian value
170  onCmdSetCoordinates(0, 0, 0);
171  geoPosStr = myCoordinatesTextField->getText().text();
172  myCoordinatesTextField->setText("");
173  myCreateGEOPOIButton->setText("Create GEO POI (clipboard)");
174  }
175  if (GNEAttributeCarrier::canParse<Position>(geoPosStr)) {
176  // obtain shape attributes and values
178  // obtain netedit attributes and values
180  // generate new ID
182  // force GEO attribute to true and obain position
183  valuesOfElement[SUMO_ATTR_GEO] = "true";
184  Position geoPos = GNEAttributeCarrier::parse<Position>(geoPosStr);
185  // convert coordinates into lon-lat
186  if (myLatLonRadioButton->getCheck() == TRUE) {
187  geoPos.swapXY();
188  }
190  valuesOfElement[SUMO_ATTR_POSITION] = toString(geoPos);
191  // return ADDSHAPE_SUCCESS if POI was sucesfully created
192  if (myPolygonFrameParent->addPOI(valuesOfElement)) {
193  // check if view has to be centered over created GEO POI
194  if(myCenterViewAfterCreationCheckButton->getCheck() == TRUE) {
195  // create a boundary over given GEO Position and center view over it
196  Boundary centerPosition;
197  centerPosition.add(geoPos);
198  centerPosition = centerPosition.grow(10);
200  }
201  } else {
202  WRITE_WARNING("Could not create GEO POI");
203  }
204  }
205  }
206  return 1;
207 }
208 
209 
210 // ---------------------------------------------------------------------------
211 // GNEPolygonFrame - methods
212 // ---------------------------------------------------------------------------
213 
214 GNEPolygonFrame::GNEPolygonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
215  GNEFrame(horizontalFrameParent, viewNet, "Shapes") {
216 
217  // create item Selector modul for shapes
218  myItemSelector = new ItemSelector(this, GNEAttributeCarrier::TAGProperty::TAGPROPERTY_SHAPE);
219 
220  // Create shape parameters
221  myShapeAttributes = new ACAttributes(this);
222 
223  // Create Netedit parameter
225 
226  // Create drawing controls
227  myDrawingShape = new DrawingShape(this);
228 
230  myGEOPOICreator = new GEOPOICreator(this);
231 
232  // set polygon as default shape
234 }
235 
236 
238 }
239 
240 
241 void
243  // refresh item selector
245  // show frame
246  GNEFrame::show();
247 }
248 
249 
251 GNEPolygonFrame::processClick(const Position& clickedPosition, const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor) {
252  // Declare map to keep values
253  std::map<SumoXMLAttr, std::string> valuesOfElement;
254  // check if current selected shape is valid
256  // show warning dialogbox and stop if input parameters are invalid
257  if (myShapeAttributes->areValuesValid() == false) {
259  return ADDSHAPE_INVALID;
260  }
261  // obtain shape attributes and values
262  valuesOfElement = myShapeAttributes->getAttributesAndValues();
263  // obtain netedit attributes and values
264  myNeteditAttributes->getNeteditAttributesAndValues(valuesOfElement, objectsUnderCursor.getLaneFront());
265  // generate new ID
267  // obtain position
268  valuesOfElement[SUMO_ATTR_POSITION] = toString(clickedPosition);
269  // set GEO Position as false (because we have created POI clicking over View
270  valuesOfElement[SUMO_ATTR_GEO] = "false";
271  // return ADDSHAPE_SUCCESS if POI was sucesfully created
272  if (addPOI(valuesOfElement)) {
273  return ADDSHAPE_SUCCESS;
274  } else {
275  return ADDSHAPE_INVALID;
276  }
278  // abort if lane is nullptr
279  if (objectsUnderCursor.getLaneFront() == nullptr) {
280  WRITE_WARNING(toString(SUMO_TAG_POILANE) + " can be only placed over lanes");
281  return ADDSHAPE_INVALID;
282  }
283  // show warning dialogbox and stop if input parameters are invalid
284  if (myShapeAttributes->areValuesValid() == false) {
286  return ADDSHAPE_INVALID;
287  }
288  // obtain shape attributes and values
289  valuesOfElement = myShapeAttributes->getAttributesAndValues();
290  // obtain netedit attributes and values
291  myNeteditAttributes->getNeteditAttributesAndValues(valuesOfElement, objectsUnderCursor.getLaneFront());
292  // generate new ID
294  // obtain Lane
295  valuesOfElement[SUMO_ATTR_LANE] = objectsUnderCursor.getLaneFront()->getID();
296  // obtain position over lane
297  valuesOfElement[SUMO_ATTR_POSITION] = toString(objectsUnderCursor.getLaneFront()->getShape().nearest_offset_to_point2D(clickedPosition));
298  // return ADDSHAPE_SUCCESS if POI was sucesfully created
299  if (addPOILane(valuesOfElement)) {
300  return ADDSHAPE_SUCCESS;
301  } else {
302  return ADDSHAPE_INVALID;
303  }
305  if (myDrawingShape->isDrawing()) {
306  // add or delete a new point depending of flag "delete last created point"
309  } else {
310  myDrawingShape->addNewPoint(clickedPosition);
311  }
313  } else {
314  // return ADDSHAPE_NOTHING if is drawing isn't enabled
315  return ADDSHAPE_NOTHING;
316  }
317  } else {
318  myViewNet->setStatusBarText("Current selected shape isn't valid.");
319  return ADDSHAPE_INVALID;
320  }
321 }
322 
323 
324 std::string
325 GNEPolygonFrame::getIdsSelected(const FXList* list) {
326  // Obtain Id's of list
327  std::string vectorOfIds;
328  for (int i = 0; i < list->getNumItems(); i++) {
329  if (list->isItemSelected(i)) {
330  if (vectorOfIds.size() > 0) {
331  vectorOfIds += " ";
332  }
333  vectorOfIds += (list->getItem(i)->getText()).text();
334  }
335  }
336  return vectorOfIds;
337 }
338 
339 
342  return myDrawingShape;
343 }
344 
345 
346 bool
348  // show warning dialogbox and stop check if input parameters are valid
349  if (myShapeAttributes->areValuesValid() == false) {
351  return false;
352  } else if(myDrawingShape->getTemporalShape().size() == 0) {
353  WRITE_WARNING("Polygon shape cannot be empty");
354  return false;
355  } else {
356  // Declare map to keep values
357  std::map<SumoXMLAttr, std::string> valuesOfElement = myShapeAttributes->getAttributesAndValues();
358 
359  // obtain netedit attributes and values
360  myNeteditAttributes->getNeteditAttributesAndValues(valuesOfElement, nullptr);
361 
362  // generate new ID
364 
365  // obtain shape and check if has to be closed
367  if(valuesOfElement[GNE_ATTR_CLOSE_SHAPE] == "true") {
368  temporalShape.closePolygon();
369  }
370  valuesOfElement[SUMO_ATTR_SHAPE] = toString(temporalShape);
371 
372  // obtain geo (by default false)
373  valuesOfElement[SUMO_ATTR_GEO] = "false";
374 
375  // return ADDSHAPE_SUCCESS if POI was sucesfully created
376  return addPolygon(valuesOfElement);
377  }
378 }
379 
380 
381 void
383  // if there are parmeters, show and Recalc groupBox
385  // show netedit attributes
387  // Check if drawing mode has to be shown
390  } else {
392  }
393  // Check if GEO POI Creator has to be shown
396  } else {
398  }
399 }
400 
401 
402 void
404  // hide all widgets
409 }
410 
411 
412 bool
413 GNEPolygonFrame::addPolygon(const std::map<SumoXMLAttr, std::string>& polyValues) {
414  // parse attributes from polyValues
415  std::string id = polyValues.at(SUMO_ATTR_ID);
416  std::string type = polyValues.at(SUMO_ATTR_TYPE);
417  RGBColor color = RGBColor::parseColor(polyValues.at(SUMO_ATTR_COLOR));
418  std::string layerStr = polyValues.at(SUMO_ATTR_LAYER);
419  double angle = GNEAttributeCarrier::parse<double>(polyValues.at(SUMO_ATTR_ANGLE));
420  std::string imgFile = polyValues.at(SUMO_ATTR_IMGFILE);
421  bool relativePath = GNEAttributeCarrier::parse<bool>(polyValues.at(SUMO_ATTR_RELATIVEPATH));
422  PositionVector shape = GNEAttributeCarrier::parse<PositionVector>(polyValues.at(SUMO_ATTR_SHAPE));
423  bool fill = GNEAttributeCarrier::parse<bool>(polyValues.at(SUMO_ATTR_FILL));
424  double lineWidth = GNEAttributeCarrier::parse<double>(polyValues.at(SUMO_ATTR_LINEWIDTH));
425  // parse layer
426  double layer = GNEAttributeCarrier::canParse<double>(layerStr) ? GNEAttributeCarrier::parse<double>(layerStr) : Shape::DEFAULT_LAYER;
427  // create new Polygon only if number of shape points is greather than 2
429  if ((shape.size() > 0) && myViewNet->getNet()->addPolygon(id, type, color, layer, angle, imgFile, relativePath, shape, false, fill, lineWidth)) {
430  // set manually attributes use GEO, block movement and block shape
431  GNEPoly* polygon = myViewNet->getNet()->retrievePolygon(id);
435  return true;
436  } else {
437  // abort creation
439  return false;
440  }
441 }
442 
443 
444 bool
445 GNEPolygonFrame::addPOI(const std::map<SumoXMLAttr, std::string>& POIValues) {
446  // parse attributes from POIValues
447  std::string id = POIValues.at(SUMO_ATTR_ID);
448  std::string type = POIValues.at(SUMO_ATTR_TYPE);
449  RGBColor color = RGBColor::parseColor(POIValues.at(SUMO_ATTR_COLOR));
450  std::string layerStr = POIValues.at(SUMO_ATTR_LAYER);
451  Position pos = GNEAttributeCarrier::parse<Position>(POIValues.at(SUMO_ATTR_POSITION));
452  double angle = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_ANGLE));
453  std::string imgFile = POIValues.at(SUMO_ATTR_IMGFILE);
454  bool relativePath = GNEAttributeCarrier::parse<bool>(POIValues.at(SUMO_ATTR_RELATIVEPATH));
455  double widthPOI = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_WIDTH));
456  double heightPOI = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_HEIGHT));
457  double layer = GNEAttributeCarrier::canParse<double>(layerStr) ? GNEAttributeCarrier::parse<double>(layerStr) : Shape::DEFAULT_LAYER_POI;
458  bool geo = GNEAttributeCarrier::parse<bool>(POIValues.at(SUMO_ATTR_GEO));
459  // create new POI
461  if (myViewNet->getNet()->addPOI(id, type, color, pos, geo, "", 0, 0, layer, angle, imgFile, relativePath, widthPOI, heightPOI)) {
462  // Set manually the attribute block movement
463  GNEPOI* poi = myViewNet->getNet()->retrievePOI(id);
466  return true;
467  } else {
468  // abort creation
470  return false;
471  }
472 }
473 
474 
475 bool
476 GNEPolygonFrame::addPOILane(const std::map<SumoXMLAttr, std::string>& POIValues) {
477  // parse attributes from POIValues
478  std::string id = POIValues.at(SUMO_ATTR_ID);
479  std::string type = POIValues.at(SUMO_ATTR_TYPE);
480  RGBColor color = RGBColor::parseColor(POIValues.at(SUMO_ATTR_COLOR));
481  std::string layerStr = POIValues.at(SUMO_ATTR_LAYER);
482  double angle = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_ANGLE));
483  std::string imgFile = POIValues.at(SUMO_ATTR_IMGFILE);
484  bool relativePath = GNEAttributeCarrier::parse<bool>(POIValues.at(SUMO_ATTR_RELATIVEPATH));
485  GNELane* lane = myViewNet->getNet()->retrieveLane(POIValues.at(SUMO_ATTR_LANE));
486  double posLane = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_POSITION));
487  double posLat = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_POSITION_LAT));
488  double widthPOI = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_WIDTH));
489  double heightPOI = GNEAttributeCarrier::parse<double>(POIValues.at(SUMO_ATTR_HEIGHT));
490  // parse layer
491  double layer = GNEAttributeCarrier::canParse<double>(layerStr) ? GNEAttributeCarrier::parse<double>(layerStr) : Shape::DEFAULT_LAYER_POI;
492  // create new POILane
494  if (myViewNet->getNet()->addPOI(id, type, color, Position(), false, lane->getID(), posLane, posLat, layer, angle, imgFile, relativePath, widthPOI, heightPOI)) {
495  // Set manually the attribute block movement
499  return true;
500  } else {
501  // abort creation
503  return false;
504  }
505 }
506 
507 /****************************************************************************/
GUISUMOAbstractView * getView() const
void hideNeteditAttributesModul()
hide Netedit attributes modul
Definition: GNEFrame.cpp:1435
long onCmdSetCoordinates(FXObject *, FXSelector, void *)
static RGBColor parseColor(std::string coldef)
Parses a color information.
Definition: RGBColor.cpp:177
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
Definition: GUIDesigns.h:115
ItemSelector * myItemSelector
item selector
std::map< SumoXMLAttr, std::string > getAttributesAndValues() const
get attributes and their values
Definition: GNEFrame.cpp:493
~GNEPolygonFrame()
Destructor.
void enableModuls(const GNEAttributeCarrier::TagProperties &tagProperties)
enable moduls depending of item selected in ItemSelector
block shape of a graphic element (Used mainly in GNEShapes)
AddShapeResult
enum with all possible values after try to create an shape using frame
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:322
GNEViewParent * getViewParent() const
get the net object
double y() const
Returns the y-position.
Definition: Position.h:62
struct with the attribute Properties
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
Definition: GNENet.cpp:946
void removeLastPoint()
remove last added point
Definition: GNEFrame.cpp:1291
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
void hideDrawingShape()
hide Drawing mode
Definition: GNEFrame.cpp:1230
GNEPoly * retrievePolygon(const std::string &id, bool failHard=true) const
get Polygon by id
Definition: GNENet.cpp:933
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn&#39;t)
Definition: GNEViewNet.cpp:367
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:47
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
GEOPOICreator * myGEOPOICreator
GEOPOICreator.
begin/end of the description of a Point of interest
void refreshTagProperties()
due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show ...
Definition: GNEFrame.cpp:176
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:241
void showGEOPOICreatorModul()
Show list of GEOPOICreator Modul.
void showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties &tagValue)
show Netedit attributes modul
Definition: GNEFrame.cpp:1384
std::string generateShapeID(SumoXMLTag shapeTag) const
generate Shape ID
Definition: GNENet.cpp:2009
GNEViewNet * myViewNet
View Net for changes.
Definition: GNEFrame.h:612
AddShapeResult processClick(const Position &clickedPosition, const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
const GNEAttributeCarrier::TagProperties & getCurrentTagProperties() const
get current type tag
Definition: GNEFrame.cpp:149
GNEUndoList * getUndoList() const
get the undoList object
set type of selection
Definition: GUIAppEnum.h:344
void hideGEOPOICreatorModul()
hide GEOPOICreator Modul
#define GUIDesignTextField
Definition: GUIDesigns.h:34
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
FXDEFMAP(GNEPolygonFrame::GEOPOICreator) GEOPOICreatorMap[]
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
FXTextField * myCoordinatesTextField
text field for given geo coordinates
A list of positions.
DrawingShape * getDrawingShapeModul() const
get drawing mode editor
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
void showDrawingShape()
show Drawing mode
Definition: GNEFrame.cpp:1222
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:219
block movement of a graphic element
void showACAttributesModul(const GNEAttributeCarrier::TagProperties &myTagProperties)
show ACAttributes modul
Definition: GNEFrame.cpp:466
bool addPOILane(const std::map< SumoXMLAttr, std::string > &POIValues)
add POILane
void swapXY()
swap position X and Y
Definition: Position.h:275
DrawingShape * myDrawingShape
Drawing shape.
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
Definition: GNEFrame.cpp:506
FXRadioButton * myLatLonRadioButton
radio button for the configuration lat-lon
edge: the shape in xml-definition
const PositionVector & getTemporalShape() const
get Temporal shape
Definition: GNEFrame.cpp:1297
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:301
const std::string getID() const
function to support debugging
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:622
NeteditAttributes * myNeteditAttributes
Netedit parameter.
bool getNeteditAttributesAndValues(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane) const
fill valuesMap with netedit attributes
Definition: GNEFrame.cpp:1441
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:184
void p_abort()
reverts and discards ALL active command groups
Definition: GNEUndoList.cpp:94
void addNewPoint(const Position &P)
add new point to temporal shape
Definition: GNEFrame.cpp:1281
bool isDrawing() const
return true if currently a shape is drawed
Definition: GNEFrame.cpp:1303
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:46
#define GUIDesignButton
Definition: GUIDesigns.h:54
void disableModuls()
disable moduls if element selected in itemSelector isn&#39;t valid
const PositionVector & getShape() const
returns the shape of the lane
Definition: GNELane.cpp:669
virtual void show()
show Frame
Definition: GNEFrame.cpp:1695
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:227
void show()
show Frame
ACAttributes * myShapeAttributes
shape internal attributes
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:1704
static std::string getIdsSelected(const FXList *list)
get list of selecte id&#39;s in string format
GNENet * getNet() const
get the net object
GNEPolygonFrame * myPolygonFrameParent
pointer to Shape frame parent
attribute edited
Definition: GUIAppEnum.h:537
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:727
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation. ...
bool areValuesValid() const
check if parameters of attributes are valid
Definition: GNEFrame.cpp:533
bool buildShape()
build a shaped element using the drawed shape return true if was sucesfully created ...
bool getDeleteLastCreatedPoint()
get flag delete last created point
Definition: GNEFrame.cpp:1315
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 something
Definition: GUIAppEnum.h:539
#define GUIDesignRadioButton
Definition: GUIDesigns.h:135
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:1059
A color information.
FXButton * myCreateGEOPOIButton
button for create GEO Coordinates
void setCurrentTypeTag(SumoXMLTag typeTag)
set current type manually
Definition: GNEFrame.cpp:155
static std::string copyFromClipboard(const FXApp &app)
Copies text from the clipboard.
Definition: GUIUserIO.cpp:46
void hideACAttributesModul()
hide group box
Definition: GNEFrame.cpp:487
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:196
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