61 myPolygonFrameParent(polygonFrameParent) {
66 myLatLonRadioButton->setCheck(TRUE);
74 myLabelCartesianPosition =
new FXLabel(
this,
"Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude", 0,
GUIDesignLabelFrameInformation);
108 std::string inputWithoutSpaces;
109 for (
const auto& i : input) {
111 inputWithoutSpaces.push_back(i);
115 if (input.size() != inputWithoutSpaces.size()) {
118 if (inputWithoutSpaces.size() > 0) {
165 if (geoPosStr.empty()) {
176 if (GNEAttributeCarrier::canParse<Position>(geoPosStr)) {
185 Position geoPos = GNEAttributeCarrier::parse<Position>(geoPosStr);
198 centerPosition.
add(geoPos);
199 centerPosition = centerPosition.
grow(10);
216 GNEFrame(horizontalFrameParent, viewNet,
"Shapes") {
254 std::map<SumoXMLAttr, std::string> valuesOfElement;
273 if (
addPOI(valuesOfElement)) {
328 std::string vectorOfIds;
329 for (
int i = 0; i < list->getNumItems(); i++) {
330 if (list->isItemSelected(i)) {
331 if (vectorOfIds.size() > 0) {
334 vectorOfIds += (list->getItem(i)->getText()).text();
418 double angle = GNEAttributeCarrier::parse<double>(polyValues.at(
SUMO_ATTR_ANGLE));
422 bool fill = GNEAttributeCarrier::parse<bool>(polyValues.at(
SUMO_ATTR_FILL));
425 double layer = GNEAttributeCarrier::canParse<double>(layerStr) ? GNEAttributeCarrier::parse<double>(layerStr) :
Shape::DEFAULT_LAYER;
428 if ((shape.size() > 0) &&
myViewNet->
getNet()->
addPolygon(
id, type, color, layer, angle, imgFile, relativePath, shape,
false, fill, lineWidth)) {
451 double angle = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_ANGLE));
454 double widthPOI = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_WIDTH));
455 double heightPOI = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_HEIGHT));
456 double layer = GNEAttributeCarrier::canParse<double>(layerStr) ? GNEAttributeCarrier::parse<double>(layerStr) :
Shape::DEFAULT_LAYER_POI;
457 bool geo = GNEAttributeCarrier::parse<bool>(POIValues.at(
SUMO_ATTR_GEO));
460 if (
myViewNet->
getNet()->
addPOI(
id, type, color, pos, geo,
"", 0, 0, layer, angle, imgFile, relativePath, widthPOI, heightPOI)) {
481 double angle = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_ANGLE));
485 double posLane = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_POSITION));
487 double widthPOI = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_WIDTH));
488 double heightPOI = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_HEIGHT));
490 double layer = GNEAttributeCarrier::canParse<double>(layerStr) ? GNEAttributeCarrier::parse<double>(layerStr) :
Shape::DEFAULT_LAYER_POI;
493 if (
myViewNet->
getNet()->
addPOI(
id, type, color,
Position(),
false, lane->getID(), posLane, posLat, layer, angle, imgFile, relativePath, widthPOI, heightPOI)) {
long onCmdSetCoordinates(FXObject *, FXSelector, void *)
static RGBColor parseColor(std::string coldef)
Parses a color information.
PositionVector shape
The shape of the netElement element.
~GNEPolygonFrame()
Destructor.
void hideAttributesCreatorModul()
hide group box
block shape of a graphic element (Used mainly in GNEShapes)
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
bool isDrawing() const
return true if currently a shape is drawed
bool getDeleteLastCreatedPoint()
get flag delete last created point
static const double DEFAULT_LAYER_POI
GNEPolygonFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
GNEViewParent * getViewParent() const
get the net object
double y() const
Returns the y-position.
void showAttributesCreatorModul(const GNEAttributeCarrier::TagProperties &myTagProperties)
show AttributesCreator modul
void showDrawingShape()
show Drawing mode
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
void addNewPoint(const Position &P)
add new point to temporal shape
double x() const
Returns the x-position.
Close shape of a polygon (Used by GNEPolys)
long onCmdSetFormat(FXObject *, FXSelector, void *)
called when user select a format radio button
GNEPoly * retrievePolygon(const std::string &id, bool failHard=true) const
get Polygon by id
GNEFrameAttributesModuls::AttributesCreator * myShapeAttributes
shape internal attributes
void removeLastPoint()
remove last added point
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
void hideNeteditAttributesModul()
hide Netedit attributes modul
GEOPOICreator * myGEOPOICreator
GEOPOICreator.
begin/end of the description of a Point of interest
std::map< SumoXMLAttr, std::string > getAttributesAndValues(bool includeAll) const
get attributes and their values
FXLabel * myLabelCartesianPosition
FXLabel for the equivalent position of GEO Position in Cartesian Position.
A class that stores a 2D geometrical boundary.
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
#define WRITE_WARNING(msg)
void showGEOPOICreatorModul()
Show list of GEOPOICreator Modul.
bool areValuesValid() const
check if parameters of attributes are valid
std::string generateShapeID(SumoXMLTag shapeTag) const
generate Shape ID
GNEViewNet * myViewNet
View Net.
void hideDrawingShape()
hide Drawing mode
void showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties &tagValue)
show Netedit attributes modul
void tagSelected()
Tag selected in TagSelector.
GNEUndoList * getUndoList() const
get the undoList object
void hideGEOPOICreatorModul()
hide GEOPOICreator Modul
GNEFrameModuls::DrawingShape * getDrawingShapeModul() const
get drawing mode editor
GNEFrameAttributesModuls::NeteditAttributes * myNeteditAttributes
Netedit parameter.
#define GUIDesignTextField
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
FXDEFMAP(GNEPolygonFrame::GEOPOICreator) GEOPOICreatorMap[]
GNEFrameModuls::DrawingShape * myDrawingShape
Drawing shape.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
A point in 2D or 3D with translation and scaling methods.
#define GUIDesignCheckButton
checkButton placed in left position
FXTextField * myCoordinatesTextField
text field for given geo coordinates
void refreshTagProperties()
due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show ...
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
bool addPOI(const std::string &id, const std::string &type, const RGBColor &color, const Position &pos, bool geo, const std::string &lane, double posOverLane, double posLat, double layer, double angle, const std::string &imgFile, bool relativePath, double width, double height, bool ignorePruning=false)
Builds a POI using the given values and adds it to the container.
block movement of a graphic element
bool addPOILane(const std::map< SumoXMLAttr, std::string > &POIValues)
add POILane
void swapXY()
swap position X and Y
class used to group all variables related with objects under cursor after a click over view ...
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn't)
FXRadioButton * myLatLonRadioButton
radio button for the configuration lat-lon
edge: the shape in xml-definition
Boundary & grow(double by)
extends the boundary by the given amount
const std::string getID() const
function to support debugging
const NetElementGeometry & getGeometry() const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
void p_abort()
reverts and discards ALL active command groups
~GEOPOICreator()
destructor
const PositionVector & getTemporalShape() const
get Temporal shape
bool getNeteditAttributesAndValues(std::map< SumoXMLAttr, std::string > &valuesMap, const GNELane *lane) const
fill valuesMap with netedit attributes
#define GUIDesignTextFieldNCol
Num of column of text field.
virtual void show()
show Frame
GUISUMOAbstractView * getView() const
return GUISUMOAbstractView
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
const GNEAttributeCarrier::TagProperties & getCurrentTagProperties() const
get current type tag
bool shapeDrawed()
build a shaped element using the drawed shape return true if was sucesfully created ...
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
virtual void hide()
hide Frame
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
static std::string getIdsSelected(const FXList *list)
get list of selecte id's in string format
GNENet * getNet() const
get the net object
GNEPolygonFrame * myPolygonFrameParent
pointer to Shape frame parent
void setStatusBarText(const std::string &text)
set staturBar text
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation. ...
GNEFrameModuls::TagSelector * myShapeTagSelector
shape tag selector
void setCurrentTag(SumoXMLTag newTag)
set current type manually
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
begin/end of the description of a Point of interest over Lane (used by Netedit)
#define GUIDesignRadioButton
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
void closePolygon()
ensures that the last position equals the first
C++ TraCI client API implementation.
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
FXButton * myCreateGEOPOIButton
button for create GEO Coordinates
static std::string copyFromClipboard(const FXApp &app)
Copies text from the clipboard.
bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, bool relativePath, const PositionVector &shape, bool geo, bool fill, double lineWidth, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
FXRadioButton * myLonLatRadioButton
radio button for the configuration lon-lat
long onCmdCreateGEOPOI(FXObject *, FXSelector, void *)
called when user type in search box
begin/end of the description of a polygon
static const double DEFAULT_LAYER