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-2022 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 
26 #include <netedit/GNEViewParent.h>
27 #include <netedit/GNENet.h>
28 #include <netedit/GNEViewNet.h>
29 #include <netedit/GNEUndoList.h>
31 
32 #include "GNEPolygonFrame.h"
33 
34 
35 // ===========================================================================
36 // FOX callback mapping
37 // ===========================================================================
38 
39 FXDEFMAP(GNEPolygonFrame::GEOPOICreator) GEOPOICreatorMap[] = {
43 };
44 
45 // Object implementation
46 FXIMPLEMENT(GNEPolygonFrame::GEOPOICreator, FXGroupBoxModule, GEOPOICreatorMap, ARRAYNUMBER(GEOPOICreatorMap))
47 
48 
49 // ===========================================================================
50 // method definitions
51 // ===========================================================================
52 
53 // ---------------------------------------------------------------------------
54 // GNEPolygonFrame::GEOPOICreator - methods
55 // ---------------------------------------------------------------------------
56 
58  FXGroupBoxModule(polygonFrameParent->myContentFrame, "GEO POI Creator"),
59  myPolygonFrameParent(polygonFrameParent) {
60  // create RadioButtons for formats
61  myLonLatRadioButton = new FXRadioButton(getCollapsableFrame(), "Format: Lon-Lat", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
62  myLatLonRadioButton = new FXRadioButton(getCollapsableFrame(), "Format: Lat-Lon", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
63  // set lat-lon as default
64  myLatLonRadioButton->setCheck(TRUE);
65  // create text field for coordinates
66  myCoordinatesTextField = new FXTextField(getCollapsableFrame(), GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
67  // create checkBox
68  myCenterViewAfterCreationCheckButton = new FXCheckButton(getCollapsableFrame(), "Center View after creation", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
69  // create button for create GEO POIs
70  myCreateGEOPOIButton = new FXButton(getCollapsableFrame(), "Create GEO POI (clipboard)", nullptr, this, MID_GNE_CREATE, GUIDesignButton);
71  // create information label
72  myLabelCartesianPosition = new FXLabel(getCollapsableFrame(), "Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude", 0, GUIDesignLabelFrameInformation);
73 }
74 
75 
77 
78 
79 void
81  // check if there is an GEO Proj string is defined
82  if (GeoConvHelper::getFinal().getProjString() != "!") {
83  myCoordinatesTextField->enable();
84  myCoordinatesTextField->setText("");
85  myCoordinatesTextField->enable();
86  myCreateGEOPOIButton->enable();
87  } else {
88  myCoordinatesTextField->setText("No geo-conversion defined");
89  myCoordinatesTextField->disable();
90  myCreateGEOPOIButton->disable();
91  }
92  show();
93 }
94 
95 
96 void
98  hide();
99 }
100 
101 
102 long
104  // check if input contains spaces
105  std::string input = myCoordinatesTextField->getText().text();
106  std::string inputWithoutSpaces;
107  for (const auto& i : input) {
108  if (i != ' ') {
109  inputWithoutSpaces.push_back(i);
110  }
111  }
112  // if input contains spaces, call this function again, and in other case set red text color
113  if (input.size() != inputWithoutSpaces.size()) {
114  myCoordinatesTextField->setText(inputWithoutSpaces.c_str());
115  }
116  if (inputWithoutSpaces.size() > 0) {
117  myCreateGEOPOIButton->setText("Create GEO POI");
118  } else {
119  myCreateGEOPOIButton->setText("Create GEO POI (clipboard)");
120  }
121  // simply check if given value can be parsed to Position
122  if (GNEAttributeCarrier::canParse<Position>(myCoordinatesTextField->getText().text())) {
123  myCoordinatesTextField->setTextColor(FXRGB(0, 0, 0));
124  myCoordinatesTextField->killFocus();
125  // convert coordinates into lon-lat
126  Position geoPos = GNEAttributeCarrier::parse<Position>(myCoordinatesTextField->getText().text());
127  if (myLatLonRadioButton->getCheck() == TRUE) {
128  geoPos.swapXY();
129  }
131  // check if GEO Position has to be swapped
132  // update myLabelCartesianPosition
133  myLabelCartesianPosition->setText(("Cartesian equivalence:\n- X = " + toString(geoPos.x()) + "\n- Y = " + toString(geoPos.y())).c_str());
134  } else {
135  myCoordinatesTextField->setTextColor(FXRGB(255, 0, 0));
136  myLabelCartesianPosition->setText("Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude");
137  };
138  return 1;
139 }
140 
141 
142 long
143 GNEPolygonFrame::GEOPOICreator::onCmdSetFormat(FXObject* obj, FXSelector, void*) {
144  //disable other radio button depending of selected option
145  if (obj == myLonLatRadioButton) {
146  myLonLatRadioButton->setCheck(TRUE);
147  myLatLonRadioButton->setCheck(FALSE);
148  } else if (obj == myLatLonRadioButton) {
149  myLonLatRadioButton->setCheck(FALSE);
150  myLatLonRadioButton->setCheck(TRUE);
151  }
152  // in both cases call onCmdSetCoordinates(0,0,0) to set new cartesian equivalence
153  onCmdSetCoordinates(0, 0, 0);
154  return 1;
155 }
156 
157 
158 long
160  // first check if current GEO Position is valid
161  if (myPolygonFrameParent->myShapeAttributes->areValuesValid()) {
162  std::string geoPosStr = myCoordinatesTextField->getText().text();
163  if (geoPosStr.empty()) {
164  // use clipboard
165  WRITE_WARNING("Using clipboard");
166  geoPosStr = GUIUserIO::copyFromClipboard(*getApp());
167  myCoordinatesTextField->setText(geoPosStr.c_str());
168  // remove spaces, update cartesian value
169  onCmdSetCoordinates(0, 0, 0);
170  geoPosStr = myCoordinatesTextField->getText().text();
171  myCoordinatesTextField->setText("");
172  myCreateGEOPOIButton->setText("Create GEO POI (clipboard)");
173  }
174  if (GNEAttributeCarrier::canParse<Position>(geoPosStr)) {
175  // create baseShape object
176  myPolygonFrameParent->createBaseShapeObject(SUMO_TAG_POI);
177  // obtain shape attributes and values
178  myPolygonFrameParent->myShapeAttributes->getAttributesAndValues(myPolygonFrameParent->myBaseShape, true);
179  // obtain netedit attributes and values
180  myPolygonFrameParent->myNeteditAttributes->getNeteditAttributesAndValues(myPolygonFrameParent->myBaseShape, nullptr);
181  // Check if ID has to be generated
182  if (!myPolygonFrameParent->myBaseShape->hasStringAttribute(SUMO_ATTR_ID)) {
183  myPolygonFrameParent->myBaseShape->addStringAttribute(SUMO_ATTR_ID, myPolygonFrameParent->myViewNet->getNet()->getAttributeCarriers()->generateAdditionalID(SUMO_TAG_POI));
184  }
185  // force GEO attribute to true and obain position
186  myPolygonFrameParent->myBaseShape->addBoolAttribute(SUMO_ATTR_GEO, true);
187  Position geoPos = GNEAttributeCarrier::parse<Position>(geoPosStr);
188  // convert coordinates into lon-lat
189  if (myLatLonRadioButton->getCheck() == TRUE) {
190  geoPos.swapXY();
191  }
193  myPolygonFrameParent->myBaseShape->addPositionAttribute(SUMO_ATTR_POSITION, geoPos);
194  // add shape
195  myPolygonFrameParent->addShape();
196  // check if view has to be centered over created GEO POI
197  if (myCenterViewAfterCreationCheckButton->getCheck() == TRUE) {
198  // create a boundary over given GEO Position and center view over it
199  Boundary centerPosition;
200  centerPosition.add(geoPos);
201  centerPosition = centerPosition.grow(10);
202  myPolygonFrameParent->myViewNet->getViewParent()->getView()->centerTo(centerPosition);
203  }
204  }
205  // refresh shape attributes
206  myPolygonFrameParent->myShapeAttributes->refreshAttributesCreator();
207  }
208  return 1;
209 }
210 
211 
212 // ---------------------------------------------------------------------------
213 // GNEPolygonFrame - methods
214 // ---------------------------------------------------------------------------
215 
216 GNEPolygonFrame::GNEPolygonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
217  GNEFrame(horizontalFrameParent, viewNet, "Shapes"),
218  myBaseShape(nullptr) {
219 
220  // create item Selector modul for shapes
221  myShapeTagSelector = new GNEFrameModules::TagSelector(this, GNETagProperties::TagType::SHAPE, SUMO_TAG_POLY);
222 
223  // Create shape parameters
225 
226  // Create Netedit parameter
228 
229  // Create drawing controls
231 
233  myGEOPOICreator = new GEOPOICreator(this);
234 }
235 
236 
238  // check if we have to delete base additional object
239  if (myBaseShape) {
240  delete myBaseShape;
241  }
242 }
243 
244 
245 void
247  // refresh tag selector
249  // show frame
250  GNEFrame::show();
251 }
252 
253 
254 bool
255 GNEPolygonFrame::processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool& updateTemporalShape) {
256  // reset updateTemporalShape
257  updateTemporalShape = false;
258  // check if current selected shape is valid
259  if (myShapeTagSelector->getCurrentTemplateAC() != nullptr) {
261  // show warning dialogbox and stop if input parameters are invalid
262  if (myShapeAttributes->areValuesValid() == false) {
264  return false;
265  }
266  // create baseShape object
268  // obtain shape attributes and values
270  // obtain netedit attributes and values
272  // Check if ID has to be generated
275  }
276  // add X-Y
277  myBaseShape->addDoubleAttribute(SUMO_ATTR_X, clickedPosition.x());
278  myBaseShape->addDoubleAttribute(SUMO_ATTR_Y, clickedPosition.y());
279  // set GEO Position as false (because we have created POI clicking over View
281  // add shape
282  addShape();
283  // refresh shape attributes
285  // shape added, then return true
286  return true;
288  // show warning dialogbox and stop if input parameters are invalid
289  if (myShapeAttributes->areValuesValid() == false) {
291  return false;
292  }
293  // create baseShape object
295  // obtain shape attributes and values
297  // obtain netedit attributes and values
299  // Check if ID has to be generated
302  }
303  // convert position to cartesian
304  Position GEOPos = clickedPosition;
306  // add X-Y in geo format
309  // set GEO Position as false (because we have created POI clicking over View
311  // add shape
312  addShape();
313  // refresh shape attributes
315  // shape added, then return true
316  return true;
318  // abort if lane is nullptr
319  if (objectsUnderCursor.getLaneFront() == nullptr) {
320  WRITE_WARNING(toString(GNE_TAG_POILANE) + " can be only placed over lanes");
321  return false;
322  }
323  // show warning dialogbox and stop if input parameters are invalid
324  if (myShapeAttributes->areValuesValid() == false) {
326  return false;
327  }
328  // create baseShape object
330  // obtain shape attributes and values
332  // obtain netedit attributes and values
334  // Check if ID has to be generated
337  }
338  // obtain Lane
340  // obtain position over lane
342  // add shape
343  addShape();
344  // refresh shape attributes
346  // shape added, then return true
347  return true;
349  if (myDrawingShape->isDrawing()) {
350  // add or delete a new point depending of flag "delete last created point"
353  } else {
354  myDrawingShape->addNewPoint(clickedPosition);
355  }
356  // set temporal shape
357  updateTemporalShape = true;
358  return true;
359  } else {
360  return false;
361  }
362  }
363  }
364  myViewNet->setStatusBarText("Current selected shape isn't valid.");
365  return false;
366 }
367 
368 
369 std::string
370 GNEPolygonFrame::getIdsSelected(const FXList* list) {
371  // Obtain Id's of list
372  std::string vectorOfIds;
373  for (int i = 0; i < list->getNumItems(); i++) {
374  if (list->isItemSelected(i)) {
375  if (vectorOfIds.size() > 0) {
376  vectorOfIds += " ";
377  }
378  vectorOfIds += (list->getItem(i)->getText()).text();
379  }
380  }
381  return vectorOfIds;
382 }
383 
384 
387  return myDrawingShape;
388 }
389 
390 
391 void
393  // check if baseShape exist, and if yes, delete it
394  if (myBaseShape) {
395  // delete baseShape (and all children)
396  delete myBaseShape;
397  }
398  // just create a base shape
400  // set tag
401  myBaseShape->setTag(shapeTag);
402 }
403 
404 
405 bool
407  // show warning dialogbox and stop check if input parameters are valid
410  return false;
411  } else if (myDrawingShape->getTemporalShape().size() == 0) {
412  WRITE_WARNING("Polygon shape cannot be empty");
413  return false;
414  } else {
415  // create baseShape object
417  // obtain shape attributes and values
419  // obtain netedit attributes and values
421  // Check if ID has to be generated
424  }
425  // obtain shape and check if has to be closed
428  temporalShape.closePolygon();
429  }
431  // obtain geo (by default false)
433  // add shape
434  addShape();
435  // refresh shape attributes
437  // shape added, then return true;
438  return true;
439  }
440 }
441 
442 
443 void
446  // if there are parmeters, show and Recalc groupBox
448  // show netedit attributes
450  // Check if drawing mode has to be shown
453  } else {
455  }
456  // Check if GEO POI Creator has to be shown
459  } else {
461  }
462  } else {
463  // hide all widgets
468  }
469 }
470 
471 
472 void
474  // declare additional handler
475  GNEAdditionalHandler additionalHandler(myViewNet->getNet(), true);
476  // build shape
477  additionalHandler.parseSumoBaseObject(myBaseShape);
478 }
479 
480 /****************************************************************************/
GNEFrameModules::DrawingShape::hideDrawingShape
void hideDrawingShape()
hide Drawing mode
Definition: GNEFrameModules.cpp:1749
GUIDesignTextFieldNCol
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:60
GNEPolygonFrame::myDrawingShape
GNEFrameModules::DrawingShape * myDrawingShape
Drawing shape.
Definition: GNEPolygonFrame.h:149
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:280
GNEFrameModules::DrawingShape::addNewPoint
void addNewPoint(const Position &P)
add new point to temporal shape
Definition: GNEFrameModules.cpp:1798
SUMO_TAG_POLY
@ SUMO_TAG_POLY
begin/end of the description of a polygon
Definition: SUMOXMLDefinitions.h:53
GNEAttributeCarrier::getTagProperty
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
Definition: GNEAttributeCarrier.cpp:600
GNEPolygonFrame::myBaseShape
CommonXMLStructure::SumoBaseObject * myBaseShape
SumoBaseObject used for create shape.
Definition: GNEPolygonFrame.h:121
MID_CHOOSEN_OPERATION
@ MID_CHOOSEN_OPERATION
set type of selection
Definition: GUIAppEnum.h:559
GeoConvHelper::x2cartesian_const
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation.
Definition: GeoConvHelper.cpp:429
GNEPolygonFrame::myShapeTagSelector
GNEFrameModules::TagSelector * myShapeTagSelector
shape tag selector
Definition: GNEPolygonFrame.h:140
GNEPolygonFrame::addShape
void addShape()
add shape (using base shape)
Definition: GNEPolygonFrame.cpp:473
GNEFrameAttributeModules::NeteditAttributes::showNeteditAttributesModule
void showNeteditAttributesModule(const GNETagProperties &tagValue)
show Netedit attributes modul
Definition: GNEFrameAttributeModules.cpp:2380
GNEFrameAttributeModules::AttributesCreator::refreshAttributesCreator
void refreshAttributesCreator()
refresh attribute creator
Definition: GNEFrameAttributeModules.cpp:633
GNEPolygonFrame::GNEPolygonFrame
GNEPolygonFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
Definition: GNEPolygonFrame.cpp:216
CommonXMLStructure::SumoBaseObject
SumoBaseObject.
Definition: CommonXMLStructure.h:39
GNEPolygonFrame::myNeteditAttributes
GNEFrameAttributeModules::NeteditAttributes * myNeteditAttributes
Netedit parameter.
Definition: GNEPolygonFrame.h:146
GNEPolygonFrame::getIdsSelected
static std::string getIdsSelected(const FXList *list)
get list of selecte id's in string format
Definition: GNEPolygonFrame.cpp:370
GNEViewNet::setStatusBarText
void setStatusBarText(const std::string &text)
set staturBar text
Definition: GNEViewNet.cpp:630
GeoConvHelper.h
GNEFrameAttributeModules::AttributesCreator
Definition: GNEFrameAttributeModules.h:150
GNEFrame
Definition: GNEFrame.h:33
CommonXMLStructure::SumoBaseObject::getBoolAttribute
bool getBoolAttribute(const SumoXMLAttr attr) const
get bool attribute
Definition: CommonXMLStructure.cpp:178
SUMO_TAG_POI
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
Definition: SUMOXMLDefinitions.h:55
GNEViewNet
Definition: GNEViewNet.h:43
SUMO_ATTR_ID
@ SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:539
GUIDesigns.h
GNEPolygonFrame::GEOPOICreator::showGEOPOICreatorModule
void showGEOPOICreatorModule()
Show list of GEOPOICreator Module.
Definition: GNEPolygonFrame.cpp:80
SUMO_ATTR_LANE
@ SUMO_ATTR_LANE
Definition: SUMOXMLDefinitions.h:525
GNEFrameModules::TagSelector::refreshTagSelector
void refreshTagSelector()
refresh tagSelector (used when frameParent is show)
Definition: GNEFrameModules.cpp:303
GNEFrameModules::DrawingShape::showDrawingShape
void showDrawingShape()
show Drawing mode
Definition: GNEFrameModules.cpp:1741
GNEPolygonFrame.h
GUIDesignTextField
#define GUIDesignTextField
Definition: GUIDesigns.h:42
GNENet::getAttributeCarriers
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:125
GNEPolygonFrame::shapeDrawed
bool shapeDrawed()
build a shaped element using the drawed shape return true if was successfully created
Definition: GNEPolygonFrame.cpp:406
PositionVector
A list of positions.
Definition: PositionVector.h:43
GNE_TAG_POILANE
@ GNE_TAG_POILANE
Point of interest over Lane.
Definition: SUMOXMLDefinitions.h:404
GNEPolygonFrame::GEOPOICreator::hideGEOPOICreatorModule
void hideGEOPOICreatorModule()
hide GEOPOICreator Module
Definition: GNEPolygonFrame.cpp:97
CommonXMLStructure::SumoBaseObject::setTag
void setTag(const SumoXMLTag tag)
set SumoBaseObject tag
Definition: CommonXMLStructure.cpp:93
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:39
GUIDesignButton
#define GUIDesignButton
Definition: GUIDesigns.h:68
GNEFrameAttributeModules::NeteditAttributes
Definition: GNEFrameAttributeModules.h:640
GNEFrameModules::DrawingShape::removeLastPoint
void removeLastPoint()
remove last added point
Definition: GNEFrameModules.cpp:1808
GUIAppEnum.h
GUIDesignLabelFrameInformation
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:244
GNEPolygonFrame::show
void show()
show Frame
Definition: GNEPolygonFrame.cpp:246
FXDEFMAP
FXDEFMAP(GNEPolygonFrame::GEOPOICreator) GEOPOICreatorMap[]
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:1355
PositionVector::nearest_offset_to_point2D
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Definition: PositionVector.cpp:829
GNEFrameModules::TagSelector
Definition: GNEFrameModules.h:48
GNEPolygonFrame::myGEOPOICreator
GEOPOICreator * myGEOPOICreator
GEOPOICreator.
Definition: GNEPolygonFrame.h:152
GeoConvHelper::getFinal
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
Definition: GeoConvHelper.h:103
GNELane::getLaneShape
const PositionVector & getLaneShape() const
get elements shape
Definition: GNELane.cpp:131
GNEFrameAttributeModules::AttributesCreator::getAttributesAndValues
void getAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, bool includeAll) const
get attributes and their values
Definition: GNEFrameAttributeModules.cpp:555
GNEPolygonFrame::GEOPOICreator::onCmdSetCoordinates
long onCmdSetCoordinates(FXObject *, FXSelector, void *)
Definition: GNEPolygonFrame.cpp:103
GNEViewNetHelper::ObjectsUnderCursor
class used to group all variables related with objects under cursor after a click over view
Definition: GNEViewNetHelper.h:157
PositionVector::closePolygon
void closePolygon()
ensures that the last position equals the first
Definition: PositionVector.cpp:1287
GNEViewNet.h
GNEAdditionalHandler.h
CommonXMLStructure::SumoBaseObject::addStringAttribute
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
Definition: CommonXMLStructure.cpp:347
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
GNEPolygonFrame::getDrawingShapeModule
GNEFrameModules::DrawingShape * getDrawingShapeModule() const
get drawing mode editor
Definition: GNEPolygonFrame.cpp:386
GNE_ATTR_CLOSE_SHAPE
@ GNE_ATTR_CLOSE_SHAPE
Close shape of a polygon (Used by GNEPolys)
Definition: SUMOXMLDefinitions.h:1305
GUIDesignCheckButton
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:145
GeoConvHelper::cartesian2geo
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
Definition: GeoConvHelper.cpp:305
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
Position::x
double x() const
Returns the x-position.
Definition: Position.h:55
Boundary::add
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:77
GNEFrame::myViewNet
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:114
CommonXMLStructure::SumoBaseObject::addBoolAttribute
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
Definition: CommonXMLStructure.cpp:365
GNE_TAG_POIGEO
@ GNE_TAG_POIGEO
Point of interest over view with GEO attributes.
Definition: SUMOXMLDefinitions.h:406
MID_GNE_SET_ATTRIBUTE
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:809
SUMO_ATTR_Y
@ SUMO_ATTR_Y
Definition: SUMOXMLDefinitions.h:519
GNEPolygonFrame::~GNEPolygonFrame
~GNEPolygonFrame()
Destructor.
Definition: GNEPolygonFrame.cpp:237
GNEFrameModules::DrawingShape
Definition: GNEFrameModules.h:318
GNENetHelper::AttributeCarriers::generateAdditionalID
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
Definition: GNENetHelper.cpp:1002
GNEPolygonFrame::GEOPOICreator
Definition: GNEPolygonFrame.h:39
GNEFrameAttributeModules::NeteditAttributes::hideNeteditAttributesModule
void hideNeteditAttributesModule()
hide Netedit attributes modul
Definition: GNEFrameAttributeModules.cpp:2417
GNETagProperties::getTag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
Definition: GNETagProperties.cpp:67
SUMO_ATTR_POSITION
@ SUMO_ATTR_POSITION
Definition: SUMOXMLDefinitions.h:523
GNEViewParent.h
GNEFrameAttributeModules::AttributesCreator::areValuesValid
bool areValuesValid() const
check if parameters of attributes are valid
Definition: GNEFrameAttributeModules.cpp:655
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
GNENetworkElement::getID
const std::string & getID() const
get ID
Definition: GNENetworkElement.cpp:48
Position::y
double y() const
Returns the y-position.
Definition: Position.h:60
GNEFrameModules::DrawingShape::getDeleteLastCreatedPoint
bool getDeleteLastCreatedPoint()
get flag delete last created point
Definition: GNEFrameModules.cpp:1834
GUIUserIO.h
GNEFrameModules::DrawingShape::isDrawing
bool isDrawing() const
return true if currently a shape is drawed
Definition: GNEFrameModules.cpp:1822
GNEPolygonFrame::GEOPOICreator::~GEOPOICreator
~GEOPOICreator()
destructor
Definition: GNEPolygonFrame.cpp:76
GNEPolygonFrame
Definition: GNEPolygonFrame.h:31
GNEFrameAttributeModules::NeteditAttributes::getNeteditAttributesAndValues
bool getNeteditAttributesAndValues(CommonXMLStructure::SumoBaseObject *baseObject, const GNELane *lane) const
fill valuesMap with netedit attributes
Definition: GNEFrameAttributeModules.cpp:2423
GUIDesignRadioButton
#define GUIDesignRadioButton
Definition: GUIDesigns.h:179
SUMO_ATTR_LAT
@ SUMO_ATTR_LAT
Definition: SUMOXMLDefinitions.h:1137
GNEFrameAttributeModules::AttributesCreator::showWarningMessage
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
Definition: GNEFrameAttributeModules.cpp:617
MID_GNE_CREATE
@ MID_GNE_CREATE
create element
Definition: GUIAppEnum.h:811
FXGroupBoxModule
FXGroupBoxModule (based on FXGroupBox)
Definition: FXGroupBoxModule.h:27
CommonXMLStructure::SumoBaseObject::addPositionVectorAttribute
void addPositionVectorAttribute(const SumoXMLAttr attr, const PositionVector &value)
add PositionVector attribute into current SumoBaseObject node
Definition: CommonXMLStructure.cpp:395
CommonXMLStructure::SumoBaseObject::addDoubleAttribute
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
Definition: CommonXMLStructure.cpp:359
GNEViewNetHelper::ObjectsUnderCursor::getLaneFront
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
Definition: GNEViewNetHelper.cpp:319
config.h
Position::swapXY
void swapXY()
swap position X and Y
Definition: Position.h:283
GNEFrameAttributeModules::AttributesCreator::showAttributesCreatorModule
void showAttributesCreatorModule(GNEAttributeCarrier *templateAC, const std::vector< SumoXMLAttr > &hiddenAttributes)
show AttributesCreator modul
Definition: GNEFrameAttributeModules.cpp:513
Boundary::grow
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:299
POI
C++ TraCI client API implementation.
Definition: POI.h:34
SUMO_ATTR_LON
@ SUMO_ATTR_LON
Definition: SUMOXMLDefinitions.h:1136
GNEAdditionalHandler
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc.....
Definition: GNEAdditionalHandler.h:41
GUIUserIO::copyFromClipboard
static std::string copyFromClipboard(const FXApp &app)
Copies text from the clipboard.
Definition: GUIUserIO.cpp:44
GNEFrameModules::TagSelector::getCurrentTemplateAC
GNEAttributeCarrier * getCurrentTemplateAC() const
get current templateAC
Definition: GNEFrameModules.cpp:192
AdditionalHandler::parseSumoBaseObject
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
Definition: AdditionalHandler.cpp:235
GNEPolygonFrame::tagSelected
void tagSelected()
Tag selected in TagSelector.
Definition: GNEPolygonFrame.cpp:444
GNEFrame::show
virtual void show()
show Frame
Definition: GNEFrame.cpp:108
SUMO_ATTR_SHAPE
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
Definition: SUMOXMLDefinitions.h:972
SUMO_ATTR_X
@ SUMO_ATTR_X
Definition: SUMOXMLDefinitions.h:518
GNEPolygonFrame::myShapeAttributes
GNEFrameAttributeModules::AttributesCreator * myShapeAttributes
shape internal attributes
Definition: GNEPolygonFrame.h:143
CommonXMLStructure::SumoBaseObject::hasStringAttribute
bool hasStringAttribute(const SumoXMLAttr attr) const
has function
Definition: CommonXMLStructure.cpp:293
GNEPolygonFrame::createBaseShapeObject
void createBaseShapeObject(const SumoXMLTag shapeTag)
Definition: GNEPolygonFrame.cpp:392
GNEPolygonFrame::GEOPOICreator::onCmdSetFormat
long onCmdSetFormat(FXObject *, FXSelector, void *)
called when user select a format radio button
Definition: GNEPolygonFrame.cpp:143
SUMO_ATTR_GEO
@ SUMO_ATTR_GEO
Definition: SUMOXMLDefinitions.h:1139
GNEFrame::hide
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:117
GNEFrameModules::DrawingShape::getTemporalShape
const PositionVector & getTemporalShape() const
get Temporal shape
Definition: GNEFrameModules.cpp:1816
GNENet.h
GNEUndoList.h
GNEPolygonFrame::processClick
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool &updateTemporalShape)
process click over Viewnet
Definition: GNEPolygonFrame.cpp:255
GNEFrameAttributeModules::AttributesCreator::hideAttributesCreatorModule
void hideAttributesCreatorModule()
hide group box
Definition: GNEFrameAttributeModules.cpp:540
GNEPolygonFrame::GEOPOICreator::onCmdCreateGEOPOI
long onCmdCreateGEOPOI(FXObject *, FXSelector, void *)
called when user type in search box
Definition: GNEPolygonFrame.cpp:159