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-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 #ifndef GNEPolygonFrame_h
18 #define GNEPolygonFrame_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include "GNEFrame.h"
25 
26 // ===========================================================================
27 // class definitions
28 // ===========================================================================
33 class GNEPolygonFrame : public GNEFrame {
34 
35 public:
36 
39  ADDSHAPE_SUCCESS, // Shape was successfully created
40  ADDSHAPE_UPDATEDTEMPORALSHAPE, // Added or removed a new point to temporal shape
41  ADDSHAPE_INVALID, // Shape wasn't created
42  ADDSHAPE_NOTHING // Nothing to do
43  };
44 
45  // ===========================================================================
46  // class GEOPOICreator
47  // ===========================================================================
48 
49  class GEOPOICreator : protected FXGroupBox {
52 
53  public:
55  GEOPOICreator(GNEPolygonFrame* polygonFrameParent);
56 
59 
62 
65 
69  long onCmdSetCoordinates(FXObject*, FXSelector, void*);
70 
72  long onCmdSetFormat(FXObject*, FXSelector, void*);
73 
75  long onCmdCreateGEOPOI(FXObject*, FXSelector, void*);
77 
78  protected:
81 
82  private:
85 
87  FXRadioButton* myLonLatRadioButton;
88 
90  FXRadioButton* myLatLonRadioButton;
91 
93  FXTextField* myCoordinatesTextField;
94 
97 
100 
103  };
104 
109  GNEPolygonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
110 
113 
115  void show();
116 
122  AddShapeResult processClick(const Position& clickedPosition, const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor);
123 
125  static std::string getIdsSelected(const FXList* list);
126 
129 
130 protected:
135  bool buildShape();
136 
138  void enableModuls(const GNEAttributeCarrier::TagProperties &tagProperties);
139 
141  void disableModuls();
142 
144  bool addPolygon(const std::map<SumoXMLAttr, std::string>& POIValues);
145 
147  bool addPOI(const std::map<SumoXMLAttr, std::string>& POIValues);
148 
150  bool addPOILane(const std::map<SumoXMLAttr, std::string>& POIValues);
151 
152 private:
154  ItemSelector* myItemSelector;
155 
158 
160  NeteditAttributes* myNeteditAttributes;
161 
164 
167 };
168 
169 
170 #endif
171 
172 /****************************************************************************/
long onCmdSetCoordinates(FXObject *, FXSelector, void *)
ItemSelector * myItemSelector
item selector
~GNEPolygonFrame()
Destructor.
void enableModuls(const GNEAttributeCarrier::TagProperties &tagProperties)
enable moduls depending of item selected in ItemSelector
AddShapeResult
enum with all possible values after try to create an shape using frame
GNEPolygonFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
struct with the attribute Properties
long onCmdSetFormat(FXObject *, FXSelector, void *)
called when user select a format radio button
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.
AddShapeResult processClick(const Position &clickedPosition, const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
void hideGEOPOICreatorModul()
hide GEOPOICreator Modul
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
FXTextField * myCoordinatesTextField
text field for given geo coordinates
DrawingShape * getDrawingShapeModul() const
get drawing mode editor
bool addPOILane(const std::map< SumoXMLAttr, std::string > &POIValues)
add POILane
DrawingShape * myDrawingShape
Drawing shape.
FXRadioButton * myLatLonRadioButton
radio button for the configuration lat-lon
NeteditAttributes * myNeteditAttributes
Netedit parameter.
void disableModuls()
disable moduls if element selected in itemSelector isn&#39;t valid
void show()
show Frame
ACAttributes * myShapeAttributes
shape internal attributes
static std::string getIdsSelected(const FXList *list)
get list of selecte id&#39;s in string format
GNEPolygonFrame * myPolygonFrameParent
pointer to Shape frame parent
bool buildShape()
build a shaped element using the drawed shape return true if was sucesfully created ...
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