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 /****************************************************************************/
GNEPolygonFrame::GEOPOICreator::myCoordinatesTextField
FXTextField * myCoordinatesTextField
text field for given geo coordinates
Definition: GNEPolygonFrame.h:94
GNEPolygonFrame::GEOPOICreator::myCreateGEOPOIButton
FXButton * myCreateGEOPOIButton
button for create GEO Coordinates
Definition: GNEPolygonFrame.h:100
GNEPolygonFrame::GEOPOICreator::hideGEOPOICreatorModul
void hideGEOPOICreatorModul()
hide GEOPOICreator Modul
Definition: GNEPolygonFrame.cpp:99
GNEPolygonFrame::addPOI
bool addPOI(const std::map< SumoXMLAttr, std::string > &POIValues)
add POI
Definition: GNEPolygonFrame.cpp:444
GNEPolygonFrame::GEOPOICreator::myCenterViewAfterCreationCheckButton
FXCheckButton * myCenterViewAfterCreationCheckButton
button for enable or disable certer view after creation of GEO POI
Definition: GNEPolygonFrame.h:97
GNEPolygonFrame::GEOPOICreator::myLatLonRadioButton
FXRadioButton * myLatLonRadioButton
radio button for the configuration lat-lon
Definition: GNEPolygonFrame.h:91
GNEPolygonFrame::myDrawingShape
GNEFrameModuls::DrawingShape * myDrawingShape
Drawing shape.
Definition: GNEPolygonFrame.h:161
GNEFrameAttributesModuls::NeteditAttributes
Definition: GNEFrameAttributesModuls.h:548
GNEPolygonFrame::addPolygon
bool addPolygon(const std::map< SumoXMLAttr, std::string > &POIValues)
add Polygon
Definition: GNEPolygonFrame.cpp:412
GNEPolygonFrame::GNEPolygonFrame
GNEPolygonFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
Definition: GNEPolygonFrame.cpp:215
GNEFrameAttributesModuls::AttributesCreator
Definition: GNEFrameAttributesModuls.h:157
GNEPolygonFrame::getIdsSelected
static std::string getIdsSelected(const FXList *list)
get list of selecte id's in string format
Definition: GNEPolygonFrame.cpp:326
GNEFrame
Definition: GNEFrame.h:35
GNEViewNet
Definition: GNEViewNet.h:43
GNEPolygonFrame::shapeDrawed
bool shapeDrawed()
build a shaped element using the drawed shape return true if was sucesfully created
Definition: GNEPolygonFrame.cpp:348
GNEPolygonFrame::myShapeAttributes
GNEFrameAttributesModuls::AttributesCreator * myShapeAttributes
shape internal attributes
Definition: GNEPolygonFrame.h:155
GNEPolygonFrame::show
void show()
show Frame
Definition: GNEPolygonFrame.cpp:243
GNEPolygonFrame::myGEOPOICreator
GEOPOICreator * myGEOPOICreator
GEOPOICreator.
Definition: GNEPolygonFrame.h:164
GNEPolygonFrame::myShapeTagSelector
GNEFrameModuls::TagSelector * myShapeTagSelector
shape tag selector
Definition: GNEPolygonFrame.h:152
GNEPolygonFrame::GEOPOICreator::onCmdSetCoordinates
long onCmdSetCoordinates(FXObject *, FXSelector, void *)
Definition: GNEPolygonFrame.cpp:105
GNEViewNetHelper::ObjectsUnderCursor
class used to group all variables related with objects under cursor after a click over view
Definition: GNEViewNetHelper.h:149
GNEFrameModuls::TagSelector
Definition: GNEFrameModuls.h:45
GNEPolygonFrame::AddShapeResult
AddShapeResult
enum with all possible values after try to create an shape using frame
Definition: GNEPolygonFrame.h:39
GNEPolygonFrame::ADDSHAPE_INVALID
Definition: GNEPolygonFrame.h:42
GNEFrameModuls::DrawingShape
Definition: GNEFrameModuls.h:398
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GNEPolygonFrame::~GNEPolygonFrame
~GNEPolygonFrame()
Destructor.
Definition: GNEPolygonFrame.cpp:238
GNEPolygonFrame::myNeteditAttributes
GNEFrameAttributesModuls::NeteditAttributes * myNeteditAttributes
Netedit parameter.
Definition: GNEPolygonFrame.h:158
GNEPolygonFrame::GEOPOICreator
Definition: GNEPolygonFrame.h:50
GNEPolygonFrame::ADDSHAPE_NOTHING
Definition: GNEPolygonFrame.h:43
GNEPolygonFrame::GEOPOICreator::GEOPOICreator
GEOPOICreator()
FOX needs this.
Definition: GNEPolygonFrame.h:81
GNEPolygonFrame::addPOILane
bool addPOILane(const std::map< SumoXMLAttr, std::string > &POIValues)
add POILane
Definition: GNEPolygonFrame.cpp:475
GNEPolygonFrame::GEOPOICreator::~GEOPOICreator
~GEOPOICreator()
destructor
Definition: GNEPolygonFrame.cpp:78
GNEPolygonFrame::processClick
AddShapeResult processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
Definition: GNEPolygonFrame.cpp:252
GNEPolygonFrame
Definition: GNEPolygonFrame.h:34
GNEPolygonFrame::ADDSHAPE_SUCCESS
Definition: GNEPolygonFrame.h:40
GNEPolygonFrame::getDrawingShapeModul
GNEFrameModuls::DrawingShape * getDrawingShapeModul() const
get drawing mode editor
Definition: GNEPolygonFrame.cpp:342
GNEPolygonFrame::GEOPOICreator::myLabelCartesianPosition
FXLabel * myLabelCartesianPosition
FXLabel for the equivalent position of GEO Position in Cartesian Position.
Definition: GNEPolygonFrame.h:103
GNEPolygonFrame::ADDSHAPE_UPDATEDTEMPORALSHAPE
Definition: GNEPolygonFrame.h:41
GNEPolygonFrame::GEOPOICreator::myLonLatRadioButton
FXRadioButton * myLonLatRadioButton
radio button for the configuration lon-lat
Definition: GNEPolygonFrame.h:88
GNEFrame.h
GNEPolygonFrame::tagSelected
void tagSelected()
Tag selected in TagSelector.
Definition: GNEPolygonFrame.cpp:383
GNEPolygonFrame::GEOPOICreator::myPolygonFrameParent
GNEPolygonFrame * myPolygonFrameParent
pointer to Shape frame parent
Definition: GNEPolygonFrame.h:85
GNEPolygonFrame::GEOPOICreator::onCmdSetFormat
long onCmdSetFormat(FXObject *, FXSelector, void *)
called when user select a format radio button
Definition: GNEPolygonFrame.cpp:145
GNEPolygonFrame::GEOPOICreator::showGEOPOICreatorModul
void showGEOPOICreatorModul()
Show list of GEOPOICreator Modul.
Definition: GNEPolygonFrame.cpp:82
GNEPolygonFrame::GEOPOICreator::onCmdCreateGEOPOI
long onCmdCreateGEOPOI(FXObject *, FXSelector, void *)
called when user type in search box
Definition: GNEPolygonFrame.cpp:161