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-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 #ifndef GNEPolygonFrame_h
18 #define GNEPolygonFrame_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 
25 #include "GNEFrame.h"
26 
27 // ===========================================================================
28 // class definitions
29 // ===========================================================================
34 class GNEPolygonFrame : public GNEFrame {
35 
36 public:
37 
40  ADDSHAPE_SUCCESS, // Shape was successfully created
41  ADDSHAPE_UPDATEDTEMPORALSHAPE, // Added or removed a new point to temporal shape
42  ADDSHAPE_INVALID, // Shape wasn't created
43  ADDSHAPE_NOTHING // Nothing to do
44  };
45 
46  // ===========================================================================
47  // class GEOPOICreator
48  // ===========================================================================
49 
50  class GEOPOICreator : protected FXGroupBox {
53 
54  public:
56  GEOPOICreator(GNEPolygonFrame* polygonFrameParent);
57 
60 
63 
66 
70  long onCmdSetCoordinates(FXObject*, FXSelector, void*);
71 
73  long onCmdSetFormat(FXObject*, FXSelector, void*);
74 
76  long onCmdCreateGEOPOI(FXObject*, FXSelector, void*);
78 
79  protected:
82 
83  private:
86 
88  FXRadioButton* myLonLatRadioButton;
89 
91  FXRadioButton* myLatLonRadioButton;
92 
94  FXTextField* myCoordinatesTextField;
95 
98 
101 
104  };
105 
110  GNEPolygonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
111 
114 
116  void show();
117 
123  AddShapeResult processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
124 
126  static std::string getIdsSelected(const FXList* list);
127 
130 
131 protected:
136  bool shapeDrawed();
137 
139  void tagSelected();
140 
142  bool addPolygon(const std::map<SumoXMLAttr, std::string>& POIValues);
143 
145  bool addPOI(const std::map<SumoXMLAttr, std::string>& POIValues);
146 
148  bool addPOILane(const std::map<SumoXMLAttr, std::string>& POIValues);
149 
150 private:
153 
156 
159 
162 
165 };
166 
167 
168 #endif
169 
170 /****************************************************************************/
long onCmdSetCoordinates(FXObject *, FXSelector, void *)
~GNEPolygonFrame()
Destructor.
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
GNEPolygonFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
long onCmdSetFormat(FXObject *, FXSelector, void *)
called when user select a format radio button
GNEFrameAttributesModuls::AttributesCreator * myShapeAttributes
shape internal attributes
GEOPOICreator * myGEOPOICreator
GEOPOICreator.
FXLabel * myLabelCartesianPosition
FXLabel for the equivalent position of GEO Position in Cartesian Position.
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
void showGEOPOICreatorModul()
Show list of GEOPOICreator Modul.
void tagSelected()
Tag selected in TagSelector.
void hideGEOPOICreatorModul()
hide GEOPOICreator Modul
GNEFrameModuls::DrawingShape * getDrawingShapeModul() const
get drawing mode editor
GNEFrameAttributesModuls::NeteditAttributes * myNeteditAttributes
Netedit parameter.
GNEFrameModuls::DrawingShape * myDrawingShape
Drawing shape.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
FXTextField * myCoordinatesTextField
text field for given geo coordinates
bool addPOILane(const std::map< SumoXMLAttr, std::string > &POIValues)
add POILane
class used to group all variables related with objects under cursor after a click over view ...
FXRadioButton * myLatLonRadioButton
radio button for the configuration lat-lon
void show()
show Frame
bool shapeDrawed()
build a shaped element using the drawed shape return true if was sucesfully created ...
static std::string getIdsSelected(const FXList *list)
get list of selecte id&#39;s in string format
GNEPolygonFrame * myPolygonFrameParent
pointer to Shape frame parent
GNEFrameModuls::TagSelector * myShapeTagSelector
shape tag selector
FXButton * myCreateGEOPOIButton
button for create GEO Coordinates
FXRadioButton * myLonLatRadioButton
radio button for the configuration lon-lat
long onCmdCreateGEOPOI(FXObject *, FXSelector, void *)
called when user type in search box