Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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/GNENet.h>
28#include <netedit/GNEViewNet.h>
31
32#include "GNEShapeFrame.h"
33
34
35// ===========================================================================
36// FOX callback mapping
37// ===========================================================================
38
44
45// Object implementation
46FXIMPLEMENT(GNEShapeFrame::GEOPOICreator, MFXGroupBoxModule, GEOPOICreatorMap, ARRAYNUMBER(GEOPOICreatorMap))
47
48
49// ===========================================================================
50// method definitions
51// ===========================================================================
52
53// ---------------------------------------------------------------------------
54// GNEShapeFrame::GEOPOICreator - methods
55// ---------------------------------------------------------------------------
56
58 MFXGroupBoxModule(polygonFrameParent, TL("GEO POI Creator")),
59 myShapeFrameParent(polygonFrameParent) {
60 // create RadioButtons for formats
61 myLonLatRadioButton = new FXRadioButton(getCollapsableFrame(), TL("Format: Lon-Lat"), this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
62 myLatLonRadioButton = new FXRadioButton(getCollapsableFrame(), TL("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(), TL("Center View after creation"), this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
69 // create button for create GEO POIs
70 myCreateGEOPOIButton = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Create GEO POI (clipboard)"), "", "", nullptr, this, MID_GNE_CREATE, GUIDesignButton);
71 // create information label
72 myLabelCartesianPosition = new MFXDynamicLabel(getCollapsableFrame(),
73 (TL("Cartesian equivalence:") + std::string("\n") +
74 TL("- X = give valid longitude") + std::string("\n") +
75 TL("- Y = give valid latitude")).c_str(),
77}
78
79
81
82
83void
85 // check if there is an GEO Proj string is defined
86 if (GeoConvHelper::getFinal().getProjString() != "!") {
87 myCoordinatesTextField->enable();
88 myCoordinatesTextField->setText("");
89 myCoordinatesTextField->enable();
90 myCreateGEOPOIButton->enable();
91 } else {
92 myCoordinatesTextField->setText(TL("No geo-conversion defined"));
93 myCoordinatesTextField->disable();
94 myCreateGEOPOIButton->disable();
95 }
96 show();
97}
98
99
100void
104
105
106long
108 // check if input contains spaces
109 std::string input = myCoordinatesTextField->getText().text();
110 std::string inputWithoutSpaces;
111 for (const auto& i : input) {
112 if (i != ' ') {
113 inputWithoutSpaces.push_back(i);
114 }
115 }
116 // if input contains spaces, call this function again, and in other case set red text color
117 if (input.size() != inputWithoutSpaces.size()) {
118 myCoordinatesTextField->setText(inputWithoutSpaces.c_str());
119 }
120 if (inputWithoutSpaces.size() > 0) {
121 myCreateGEOPOIButton->setText(TL("Create GEO POI"));
122 } else {
123 myCreateGEOPOIButton->setText(TL("Create GEO POI (clipboard)"));
124 }
125 // simply check if given value can be parsed to Position
126 if (GNEAttributeCarrier::canParse<Position>(myCoordinatesTextField->getText().text())) {
127 myCoordinatesTextField->setTextColor(FXRGB(0, 0, 0));
128 myCoordinatesTextField->killFocus();
129 // convert coordinates into lon-lat
130 Position geoPos = GNEAttributeCarrier::parse<Position>(myCoordinatesTextField->getText().text());
131 if (myLatLonRadioButton->getCheck() == TRUE) {
132 geoPos.swapXY();
133 }
135 // check if GEO Position has to be swapped
136 // update myLabelCartesianPosition
137 myLabelCartesianPosition->setText(
138 (TL("Cartesian equivalence:") + std::string("\n- X = ") + toString(geoPos.x()) + std::string("\n- Y = ") + toString(geoPos.y())).c_str());
139 } else {
140 myCoordinatesTextField->setTextColor(FXRGB(255, 0, 0));
141 myLabelCartesianPosition->setText(
142 (TL("Cartesian equivalence:") + std::string("\n") +
143 TL("- X = give valid longitude") + std::string("\n") +
144 TL("- Y = give valid latitude")).c_str());
145 };
146 return 1;
147}
148
149
150long
151GNEShapeFrame::GEOPOICreator::onCmdSetFormat(FXObject* obj, FXSelector, void*) {
152 //disable other radio button depending of selected option
153 if (obj == myLonLatRadioButton) {
154 myLonLatRadioButton->setCheck(TRUE);
155 myLatLonRadioButton->setCheck(FALSE);
156 } else if (obj == myLatLonRadioButton) {
157 myLonLatRadioButton->setCheck(FALSE);
158 myLatLonRadioButton->setCheck(TRUE);
159 }
160 // in both cases call onCmdSetCoordinates(0,0,0) to set new cartesian equivalence
161 onCmdSetCoordinates(0, 0, 0);
162 return 1;
163}
164
165
166long
168 // first check if current GEO Position is valid
169 if (myShapeFrameParent->myShapeAttributes->areValuesValid()) {
170 std::string geoPosStr = myCoordinatesTextField->getText().text();
171 if (geoPosStr.empty()) {
172 // use clipboard
173 WRITE_WARNING(TL("Using clipboard"));
174 geoPosStr = GUIUserIO::copyFromClipboard(*getApp());
175 myCoordinatesTextField->setText(geoPosStr.c_str());
176 // remove spaces, update cartesian value
177 onCmdSetCoordinates(0, 0, 0);
178 geoPosStr = myCoordinatesTextField->getText().text();
179 myCoordinatesTextField->setText("");
180 myCreateGEOPOIButton->setText(TL("Create GEO POI (clipboard)"));
181 }
182 if (GNEAttributeCarrier::canParse<Position>(geoPosStr)) {
183 // create baseShape object
184 myShapeFrameParent->createBaseShapeObject(SUMO_TAG_POI);
185 // obtain shape attributes and values
186 myShapeFrameParent->myShapeAttributes->getAttributesAndValues(myShapeFrameParent->myBaseShape, true);
187 // obtain netedit attributes and values
188 myShapeFrameParent->myNeteditAttributes->getNeteditAttributesAndValues(myShapeFrameParent->myBaseShape, nullptr);
189 // Check if ID has to be generated
190 if (!myShapeFrameParent->myBaseShape->hasStringAttribute(SUMO_ATTR_ID)) {
191 myShapeFrameParent->myBaseShape->addStringAttribute(SUMO_ATTR_ID, myShapeFrameParent->myViewNet->getNet()->getAttributeCarriers()->generateAdditionalID(SUMO_TAG_POI));
192 }
193 // force GEO attribute to true and obtain position
194 myShapeFrameParent->myBaseShape->addBoolAttribute(SUMO_ATTR_GEO, true);
195 Position geoPos = GNEAttributeCarrier::parse<Position>(geoPosStr);
196 // convert coordinates into lon-lat
197 if (myLatLonRadioButton->getCheck() == TRUE) {
198 geoPos.swapXY();
199 }
200 // add lon/lat
201 myShapeFrameParent->myBaseShape->addDoubleAttribute(SUMO_ATTR_LON, geoPos.x());
202 myShapeFrameParent->myBaseShape->addDoubleAttribute(SUMO_ATTR_LAT, geoPos.y());
203 // set GEO Position as true
204 myShapeFrameParent->myBaseShape->addBoolAttribute(SUMO_ATTR_GEO, true);
205 // add shape
206 myShapeFrameParent->addShape();
207 // check if view has to be centered over created GEO POI
208 if (myCenterViewAfterCreationCheckButton->getCheck() == TRUE) {
209 // create a boundary over given GEO Position and center view over it
210 Boundary centerPosition;
212 centerPosition.add(geoPos);
213 centerPosition = centerPosition.grow(10);
214 myShapeFrameParent->myViewNet->getViewParent()->getView()->centerTo(centerPosition);
215 }
216 }
217 // refresh shape attributes
218 myShapeFrameParent->myShapeAttributes->refreshAttributesCreator();
219 }
220 return 1;
221}
222
223
224// ---------------------------------------------------------------------------
225// GNEShapeFrame - methods
226// ---------------------------------------------------------------------------
227
229 GNEFrame(viewParent, viewNet, TL("Shapes")),
230 myBaseShape(nullptr) {
231
232 // create item Selector module for shapes
234
235 // Create shape parameters
237
238 // Create Netedit parameter
240
241 // Create drawing controls
243
245 myGEOPOICreator = new GEOPOICreator(this);
246}
247
248
250 // check if we have to delete base additional object
251 if (myBaseShape) {
252 delete myBaseShape;
253 }
254}
255
256
257void
259 // refresh tag selector
261 // show frame
263}
264
265
266bool
267GNEShapeFrame::processClick(const Position& clickedPosition, const GNEViewNetHelper::ViewObjectsSelector& viewObjects, bool& updateTemporalShape) {
268 // reset updateTemporalShape
269 updateTemporalShape = false;
270 // check if current selected shape is valid
271 if (myShapeTagSelector->getCurrentTemplateAC() != nullptr) {
272 // get tag
274 // continue depending of tag
275 switch (shapeTag) {
276 case SUMO_TAG_POI:
277 return processClickPOI(shapeTag, clickedPosition, viewObjects);
278 case GNE_TAG_POIGEO:
279 return processClickPOIGeo(clickedPosition, viewObjects);
280 case GNE_TAG_POILANE:
281 return processClickPOILanes(viewObjects);
282 case SUMO_TAG_POLY:
285 return processClickPolygons(clickedPosition, updateTemporalShape);
286 default:
287 break;
288 }
289 }
290 myViewNet->setStatusBarText(TL("Current selected shape isn't valid."));
291 return false;
292}
293
294
295std::string
296GNEShapeFrame::getIdsSelected(const FXList* list) {
297 // Obtain Id's of list
298 std::string vectorOfIds;
299 for (int i = 0; i < list->getNumItems(); i++) {
300 if (list->isItemSelected(i)) {
301 if (vectorOfIds.size() > 0) {
302 vectorOfIds += " ";
303 }
304 vectorOfIds += (list->getItem(i)->getText()).text();
305 }
306 }
307 return vectorOfIds;
308}
309
310
315
316
317void
319 // check if baseShape exist, and if yes, delete it
320 if (myBaseShape) {
321 // delete baseShape (and all children)
322 delete myBaseShape;
323 }
324 // just create a base shape
326 // set tag
327 myBaseShape->setTag(shapeTag);
328}
329
330
331bool
333 // show warning dialogbox and stop check if input parameters are valid
336 return false;
337 } else if (myDrawingShape->getTemporalShape().size() == 0) {
338 WRITE_WARNING(TL("Polygon shape cannot be empty"));
339 return false;
340 } else {
341 // get tag
343 // create baseShape object
344 createBaseShapeObject(shapeTag);
345 // obtain shape attributes and values
347 // obtain netedit attributes and values
349 // Check if ID has to be generated
352 }
353 // obtain shape and check if has to be closed
356 (shapeTag == GNE_TAG_JPS_WALKABLEAREA) || (shapeTag == GNE_TAG_JPS_OBSTACLE)) {
357 temporalShape.closePolygon();
358 }
360 // obtain geo (by default false)
362 // add shape
363 addShape();
364 // refresh shape attributes
366 // shape added, then return true;
367 return true;
368 }
369}
370
371
372void
375 // if there are parameters, show and Recalc groupBox
377 // show netedit attributes
379 // get shape tag
381 // Check if drawing mode has to be shown
382 if ((shapeTag == SUMO_TAG_POLY) || (shapeTag == GNE_TAG_JPS_WALKABLEAREA) || (shapeTag == GNE_TAG_JPS_OBSTACLE)) {
384 } else {
386 }
387 // Check if GEO POI Creator has to be shown
388 if (shapeTag == GNE_TAG_POIGEO) {
390 } else {
392 }
393 } else {
394 // hide all widgets
399 }
400}
401
402
403void
405 // declare additional handler
407 // build shape
408 additionalHandler.parseSumoBaseObject(myBaseShape);
409}
410
411
412bool
413GNEShapeFrame::processClickPolygons(const Position& clickedPosition, bool& updateTemporalShape) {
414 if (myDrawingShape->isDrawing()) {
415 // add or delete a new point depending of flag "delete last created point"
418 } else {
419 myDrawingShape->addNewPoint(clickedPosition);
420 }
421 // set temporal shape
422 updateTemporalShape = true;
423 return true;
424 } else {
425 return false;
426 }
427}
428
429
430bool
432 // show warning dialogbox and stop if input parameters are invalid
435 return false;
436 }
437 // create baseShape object
438 createBaseShapeObject(POITag);
439 // obtain shape attributes and values
441 // obtain netedit attributes and values
443 // Check if ID has to be generated
446 }
447 // add X-Y
448 myBaseShape->addDoubleAttribute(SUMO_ATTR_X, clickedPosition.x());
449 myBaseShape->addDoubleAttribute(SUMO_ATTR_Y, clickedPosition.y());
450 // set GEO Position as false (because we have created POI clicking over View
452 // add shape
453 addShape();
454 // refresh shape attributes
456 // shape added, then return true
457 return true;
458}
459
460
461bool
463 // show warning dialogbox and stop if input parameters are invalid
466 return false;
467 }
468 // create baseShape object
470 // obtain shape attributes and values
472 // obtain netedit attributes and values
474 // Check if ID has to be generated
477 }
478 // convert position to cartesian
479 Position GEOPos = clickedPosition;
481 // add X-Y in geo format
484 // set GEO Position as false (because we have created POI clicking over View
486 // add shape
487 addShape();
488 // refresh shape attributes
490 // shape added, then return true
491 return true;
492}
493
494
495bool
497 // abort if lane is nullptr
498 if (viewObjects.getLaneFront() == nullptr) {
499 WRITE_WARNING(TL("POILane can be only placed over lanes"));
500 return false;
501 }
502 // show warning dialogbox and stop if input parameters are invalid
505 return false;
506 }
507 // create baseShape object
509 // obtain shape attributes and values
511 // obtain netedit attributes and values
513 // Check if ID has to be generated
516 }
517 // obtain Lane
519 // obtain position over lane
521 // add shape
522 addShape();
523 // refresh shape attributes
525 // shape added, then return true
526 return true;
527}
528
529/****************************************************************************/
FXDEFMAP(GNEShapeFrame::GEOPOICreator) GEOPOICreatorMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition GUIAppEnum.h:939
@ MID_CHOOSEN_OPERATION
set type of selection
Definition GUIAppEnum.h:597
@ MID_GNE_CREATE
create element
Definition GUIAppEnum.h:941
#define GUIDesignButton
Definition GUIDesigns.h:82
#define GUIDesignTextField
Definition GUIDesigns.h:59
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:74
#define GUIDesignCheckButton
checkButton placed in left position
Definition GUIDesigns.h:192
#define GUIDesignRadioButton
Definition GUIDesigns.h:229
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition GUIDesigns.h:279
#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:343
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:115
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
double getLengthGeometryFactor() const
get length geometry factor
Definition GNELane.cpp:1974
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:127
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
bool processClickPOILanes(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click for POILanes
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.
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
GNEViewParent * getViewParent() const
get the net object
void setStatusBarText(const std::string &text)
set statusBar text
A single child window which contains a view of the simulation area.
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
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
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
static std::string copyFromClipboard(const FXApp &app)
Copies text from the clipboard.
Definition GUIUserIO.cpp:44
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
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.
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:312
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