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 /****************************************************************************/
14 // The Widget for add polygons
15 /****************************************************************************/
16 #ifndef GNEPolygonFrame_h
17 #define GNEPolygonFrame_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
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:
80 
81  private:
84 
86  FXRadioButton* myLonLatRadioButton;
87 
89  FXRadioButton* myLatLonRadioButton;
90 
92  FXTextField* myCoordinatesTextField;
93 
96 
99 
102  };
103 
108  GNEPolygonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
109 
112 
114  void show();
115 
121  AddShapeResult processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor);
122 
124  static std::string getIdsSelected(const FXList* list);
125 
128 
129 protected:
134  bool shapeDrawed();
135 
137  void tagSelected();
138 
140  bool addPolygon(const std::map<SumoXMLAttr, std::string>& POIValues);
141 
143  bool addPOI(const std::map<SumoXMLAttr, std::string>& POIValues);
144 
146  bool addPOILane(const std::map<SumoXMLAttr, std::string>& POIValues);
147 
148 private:
151 
154 
157 
160 
163 };
164 
165 
166 #endif
167 
168 /****************************************************************************/
GNEPolygonFrame::GEOPOICreator::myCoordinatesTextField
FXTextField * myCoordinatesTextField
text field for given geo coordinates
Definition: GNEPolygonFrame.h:92
GNEPolygonFrame::GEOPOICreator::myCreateGEOPOIButton
FXButton * myCreateGEOPOIButton
button for create GEO Coordinates
Definition: GNEPolygonFrame.h:98
GNEPolygonFrame::GEOPOICreator::hideGEOPOICreatorModul
void hideGEOPOICreatorModul()
hide GEOPOICreator Modul
Definition: GNEPolygonFrame.cpp:98
GNEPolygonFrame::addPOI
bool addPOI(const std::map< SumoXMLAttr, std::string > &POIValues)
add POI
Definition: GNEPolygonFrame.cpp:457
GNEPolygonFrame::GEOPOICreator::myCenterViewAfterCreationCheckButton
FXCheckButton * myCenterViewAfterCreationCheckButton
button for enable or disable certer view after creation of GEO POI
Definition: GNEPolygonFrame.h:95
GNEPolygonFrame::GEOPOICreator::myLatLonRadioButton
FXRadioButton * myLatLonRadioButton
radio button for the configuration lat-lon
Definition: GNEPolygonFrame.h:89
GNEPolygonFrame::myDrawingShape
GNEFrameModuls::DrawingShape * myDrawingShape
Drawing shape.
Definition: GNEPolygonFrame.h:159
GNEFrameAttributesModuls::NeteditAttributes
Definition: GNEFrameAttributesModuls.h:714
GNEPolygonFrame::addPolygon
bool addPolygon(const std::map< SumoXMLAttr, std::string > &POIValues)
add Polygon
Definition: GNEPolygonFrame.cpp:425
GNEPolygonFrame::GNEPolygonFrame
GNEPolygonFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
Definition: GNEPolygonFrame.cpp:218
GNEFrameAttributesModuls::AttributesCreator
Definition: GNEFrameAttributesModuls.h:148
GNEPolygonFrame::getIdsSelected
static std::string getIdsSelected(const FXList *list)
get list of selecte id's in string format
Definition: GNEPolygonFrame.cpp:337
GNEFrame
Definition: GNEFrame.h:34
GNEViewNet
Definition: GNEViewNet.h:42
GNEPolygonFrame::shapeDrawed
bool shapeDrawed()
build a shaped element using the drawed shape return true if was successfully created
Definition: GNEPolygonFrame.cpp:359
GNEPolygonFrame::myShapeAttributes
GNEFrameAttributesModuls::AttributesCreator * myShapeAttributes
shape internal attributes
Definition: GNEPolygonFrame.h:153
GNEPolygonFrame::show
void show()
show Frame
Definition: GNEPolygonFrame.cpp:246
GNEPolygonFrame::GEOPOICreator::GEOPOICreator
GEOPOICreator(GNEPolygonFrame *polygonFrameParent)
FOX-declaration.
Definition: GNEPolygonFrame.cpp:58
GNEPolygonFrame::myGEOPOICreator
GEOPOICreator * myGEOPOICreator
GEOPOICreator.
Definition: GNEPolygonFrame.h:162
GNEPolygonFrame::myShapeTagSelector
GNEFrameModuls::TagSelector * myShapeTagSelector
shape tag selector
Definition: GNEPolygonFrame.h:150
GNEPolygonFrame::GEOPOICreator::onCmdSetCoordinates
long onCmdSetCoordinates(FXObject *, FXSelector, void *)
Definition: GNEPolygonFrame.cpp:104
GNEViewNetHelper::ObjectsUnderCursor
class used to group all variables related with objects under cursor after a click over view
Definition: GNEViewNetHelper.h:148
GNEFrameModuls::TagSelector
Definition: GNEFrameModuls.h:44
GNEPolygonFrame::AddShapeResult
AddShapeResult
enum with all possible values after try to create an shape using frame
Definition: GNEPolygonFrame.h:38
GNEPolygonFrame::ADDSHAPE_INVALID
@ ADDSHAPE_INVALID
Definition: GNEPolygonFrame.h:41
GNEFrameModuls::DrawingShape
Definition: GNEFrameModuls.h:393
FOX_CONSTRUCTOR
#define FOX_CONSTRUCTOR(classname)
Definition: config.h:13
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNEPolygonFrame::~GNEPolygonFrame
~GNEPolygonFrame()
Destructor.
Definition: GNEPolygonFrame.cpp:241
GNEPolygonFrame::myNeteditAttributes
GNEFrameAttributesModuls::NeteditAttributes * myNeteditAttributes
Netedit parameter.
Definition: GNEPolygonFrame.h:156
GNEPolygonFrame::GEOPOICreator
Definition: GNEPolygonFrame.h:49
GNEPolygonFrame::ADDSHAPE_NOTHING
@ ADDSHAPE_NOTHING
Definition: GNEPolygonFrame.h:42
GNEPolygonFrame::addPOILane
bool addPOILane(const std::map< SumoXMLAttr, std::string > &POIValues)
add POILane
Definition: GNEPolygonFrame.cpp:488
GNEPolygonFrame::GEOPOICreator::~GEOPOICreator
~GEOPOICreator()
destructor
Definition: GNEPolygonFrame.cpp:77
GNEPolygonFrame::processClick
AddShapeResult processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
Definition: GNEPolygonFrame.cpp:255
GNEPolygonFrame
Definition: GNEPolygonFrame.h:33
GNEPolygonFrame::ADDSHAPE_SUCCESS
@ ADDSHAPE_SUCCESS
Definition: GNEPolygonFrame.h:39
GNEPolygonFrame::getDrawingShapeModul
GNEFrameModuls::DrawingShape * getDrawingShapeModul() const
get drawing mode editor
Definition: GNEPolygonFrame.cpp:353
GNEPolygonFrame::GEOPOICreator::myLabelCartesianPosition
FXLabel * myLabelCartesianPosition
FXLabel for the equivalent position of GEO Position in Cartesian Position.
Definition: GNEPolygonFrame.h:101
GNEPolygonFrame::ADDSHAPE_UPDATEDTEMPORALSHAPE
@ ADDSHAPE_UPDATEDTEMPORALSHAPE
Definition: GNEPolygonFrame.h:40
GNEPolygonFrame::GEOPOICreator::myLonLatRadioButton
FXRadioButton * myLonLatRadioButton
radio button for the configuration lon-lat
Definition: GNEPolygonFrame.h:86
GNEFrame.h
GNEPolygonFrame::tagSelected
void tagSelected()
Tag selected in TagSelector.
Definition: GNEPolygonFrame.cpp:396
GNEPolygonFrame::GEOPOICreator::myPolygonFrameParent
GNEPolygonFrame * myPolygonFrameParent
pointer to Shape frame parent
Definition: GNEPolygonFrame.h:83
GNEPolygonFrame::GEOPOICreator::onCmdSetFormat
long onCmdSetFormat(FXObject *, FXSelector, void *)
called when user select a format radio button
Definition: GNEPolygonFrame.cpp:144
GNEPolygonFrame::GEOPOICreator::showGEOPOICreatorModul
void showGEOPOICreatorModul()
Show list of GEOPOICreator Modul.
Definition: GNEPolygonFrame.cpp:81
GNEPolygonFrame::GEOPOICreator::onCmdCreateGEOPOI
long onCmdCreateGEOPOI(FXObject *, FXSelector, void *)
called when user type in search box
Definition: GNEPolygonFrame.cpp:160