Eclipse SUMO - Simulation of Urban MObility
GNEPolygonFrame.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2020 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 #pragma once
22 
23 // ===========================================================================
24 // class definitions
25 // ===========================================================================
30 class GNEPolygonFrame : public GNEFrame {
31 
32 public:
33 
35  enum class AddShape {
36  SUCCESS, // Shape was successfully created
37  UPDATEDTEMPORALSHAPE, // Added or removed a new point to temporal shape
38  INVALID, // Shape wasn't created
39  NOTHING // Nothing to do
40  };
41 
42  // ===========================================================================
43  // class GEOPOICreator
44  // ===========================================================================
45 
46  class GEOPOICreator : protected FXGroupBox {
49 
50  public:
52  GEOPOICreator(GNEPolygonFrame* polygonFrameParent);
53 
56 
59 
62 
66  long onCmdSetCoordinates(FXObject*, FXSelector, void*);
67 
69  long onCmdSetFormat(FXObject*, FXSelector, void*);
70 
72  long onCmdCreateGEOPOI(FXObject*, FXSelector, void*);
74 
75  protected:
76  FOX_CONSTRUCTOR(GEOPOICreator)
77 
78  private:
81 
83  FXRadioButton* myLonLatRadioButton;
84 
86  FXRadioButton* myLatLonRadioButton;
87 
89  FXTextField* myCoordinatesTextField;
90 
93 
96 
99  };
100 
105  GNEPolygonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
106 
109 
111  void show();
112 
118  GNEPolygonFrame::AddShape processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
119 
121  static std::string getIdsSelected(const FXList* list);
122 
125 
126 protected:
131  bool shapeDrawed();
132 
134  void tagSelected();
135 
137  bool addPolygon(const std::map<SumoXMLAttr, std::string>& POIValues);
138 
140  bool addPOI(const std::map<SumoXMLAttr, std::string>& POIValues);
141 
143  bool addPOILane(const std::map<SumoXMLAttr, std::string>& POIValues);
144 
145 private:
148 
151 
154 
157 
160 };
GEOPOICreator(GNEPolygonFrame *polygonFrameParent)
FOX-declaration.
FXRadioButton * myLonLatRadioButton
radio button for the configuration lon-lat
void showGEOPOICreatorModul()
Show list of GEOPOICreator Modul.
FXCheckButton * myCenterViewAfterCreationCheckButton
button for enable or disable certer view after creation of GEO POI
FXRadioButton * myLatLonRadioButton
radio button for the configuration lat-lon
GNEPolygonFrame * myPolygonFrameParent
pointer to Shape frame parent
long onCmdCreateGEOPOI(FXObject *, FXSelector, void *)
called when user type in search box
void hideGEOPOICreatorModul()
hide GEOPOICreator Modul
FXTextField * myCoordinatesTextField
text field for given geo coordinates
FXButton * myCreateGEOPOIButton
button for create GEO Coordinates
FXLabel * myLabelCartesianPosition
FXLabel for the equivalent position of GEO Position in Cartesian Position.
long onCmdSetFormat(FXObject *, FXSelector, void *)
called when user select a format radio button
long onCmdSetCoordinates(FXObject *, FXSelector, void *)
GNEFrameAttributesModuls::NeteditAttributes * myNeteditAttributes
Netedit parameter.
bool addPOI(const std::map< SumoXMLAttr, std::string > &POIValues)
add POI
void show()
show Frame
GNEFrameModuls::TagSelector * myShapeTagSelector
shape tag selector
GNEFrameModuls::DrawingShape * getDrawingShapeModul() const
get drawing mode editor
static std::string getIdsSelected(const FXList *list)
get list of selecte id's in string format
void tagSelected()
Tag selected in TagSelector.
~GNEPolygonFrame()
Destructor.
AddShape
enum with all possible values after try to create an shape using frame
GNEPolygonFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
GEOPOICreator * myGEOPOICreator
GEOPOICreator.
GNEFrameAttributesModuls::AttributesCreator * myShapeAttributes
shape internal attributes
bool shapeDrawed()
build a shaped element using the drawed shape return true if was successfully created
GNEFrameModuls::DrawingShape * myDrawingShape
Drawing shape.
bool addPOILane(const std::map< SumoXMLAttr, std::string > &POIValues)
add POILane
GNEPolygonFrame::AddShape processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
bool addPolygon(const std::map< SumoXMLAttr, std::string > &POIValues)
add Polygon
class used to group all variables related with objects under cursor after a click over view
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36