60 myPolygonFrameParent(polygonFrameParent) {
65 myLatLonRadioButton->setCheck(TRUE);
73 myLabelCartesianPosition =
new FXLabel(
this,
"Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude", 0,
GUIDesignLabelFrameInformation);
107 std::string inputWithoutSpaces;
108 for (
const auto &i : input) {
110 inputWithoutSpaces.push_back(i);
114 if (input.size() != inputWithoutSpaces.size()) {
117 if (inputWithoutSpaces.size() > 0) {
164 if (geoPosStr.empty()) {
175 if (GNEAttributeCarrier::canParse<Position>(geoPosStr)) {
184 Position geoPos = GNEAttributeCarrier::parse<Position>(geoPosStr);
197 centerPosition.
add(geoPos);
198 centerPosition = centerPosition.
grow(10);
215 GNEFrame(horizontalFrameParent, viewNet,
"Shapes") {
253 std::map<SumoXMLAttr, std::string> valuesOfElement;
272 if (
addPOI(valuesOfElement)) {
327 std::string vectorOfIds;
328 for (
int i = 0; i < list->getNumItems(); i++) {
329 if (list->isItemSelected(i)) {
330 if (vectorOfIds.size() > 0) {
333 vectorOfIds += (list->getItem(i)->getText()).text();
419 double angle = GNEAttributeCarrier::parse<double>(polyValues.at(
SUMO_ATTR_ANGLE));
423 bool fill = GNEAttributeCarrier::parse<bool>(polyValues.at(
SUMO_ATTR_FILL));
426 double layer = GNEAttributeCarrier::canParse<double>(layerStr) ? GNEAttributeCarrier::parse<double>(layerStr) :
Shape::DEFAULT_LAYER;
429 if ((shape.size() > 0) &&
myViewNet->
getNet()->
addPolygon(
id, type, color, layer, angle, imgFile, relativePath, shape,
false, fill, lineWidth)) {
452 double angle = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_ANGLE));
455 double widthPOI = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_WIDTH));
456 double heightPOI = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_HEIGHT));
457 double layer = GNEAttributeCarrier::canParse<double>(layerStr) ? GNEAttributeCarrier::parse<double>(layerStr) :
Shape::DEFAULT_LAYER_POI;
458 bool geo = GNEAttributeCarrier::parse<bool>(POIValues.at(
SUMO_ATTR_GEO));
461 if (
myViewNet->
getNet()->
addPOI(
id, type, color, pos, geo,
"", 0, 0, layer, angle, imgFile, relativePath, widthPOI, heightPOI)) {
482 double angle = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_ANGLE));
486 double posLane = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_POSITION));
488 double widthPOI = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_WIDTH));
489 double heightPOI = GNEAttributeCarrier::parse<double>(POIValues.at(
SUMO_ATTR_HEIGHT));
491 double layer = GNEAttributeCarrier::canParse<double>(layerStr) ? GNEAttributeCarrier::parse<double>(layerStr) :
Shape::DEFAULT_LAYER_POI;
494 if (
myViewNet->
getNet()->
addPOI(
id, type, color,
Position(),
false, lane->getID(), posLane, posLat, layer, angle, imgFile, relativePath, widthPOI, heightPOI)) {
GUISUMOAbstractView * getView() const
void hideNeteditAttributesModul()
hide Netedit attributes modul
long onCmdSetCoordinates(FXObject *, FXSelector, void *)
static RGBColor parseColor(std::string coldef)
Parses a color information.
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
ItemSelector * myItemSelector
item selector
std::map< SumoXMLAttr, std::string > getAttributesAndValues() const
get attributes and their values
~GNEPolygonFrame()
Destructor.
void enableModuls(const GNEAttributeCarrier::TagProperties &tagProperties)
enable moduls depending of item selected in ItemSelector
block shape of a graphic element (Used mainly in GNEShapes)
AddShapeResult
enum with all possible values after try to create an shape using frame
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.
struct with the attribute Properties
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
void removeLastPoint()
remove last added point
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
void hideDrawingShape()
hide Drawing mode
GNEPoly * retrievePolygon(const std::string &id, bool failHard=true) const
get Polygon by id
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn't)
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...
GEOPOICreator * myGEOPOICreator
GEOPOICreator.
begin/end of the description of a Point of interest
void refreshTagProperties()
due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show ...
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.
void showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties &tagValue)
show Netedit attributes modul
std::string generateShapeID(SumoXMLTag shapeTag) const
generate Shape ID
GNEViewNet * myViewNet
View Net for changes.
AddShapeResult processClick(const Position &clickedPosition, const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
const GNEAttributeCarrier::TagProperties & getCurrentTagProperties() const
get current type tag
GNEUndoList * getUndoList() const
get the undoList object
void hideGEOPOICreatorModul()
hide GEOPOICreator Modul
#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[]
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.
FXTextField * myCoordinatesTextField
text field for given geo coordinates
DrawingShape * getDrawingShapeModul() const
get drawing mode editor
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
void showDrawingShape()
show Drawing mode
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
void showACAttributesModul(const GNEAttributeCarrier::TagProperties &myTagProperties)
show ACAttributes modul
bool addPOILane(const std::map< SumoXMLAttr, std::string > &POIValues)
add POILane
void swapXY()
swap position X and Y
DrawingShape * myDrawingShape
Drawing shape.
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
FXRadioButton * myLatLonRadioButton
radio button for the configuration lat-lon
edge: the shape in xml-definition
const PositionVector & getTemporalShape() const
get Temporal shape
Boundary & grow(double by)
extends the boundary by the given amount
const std::string getID() const
function to support debugging
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
NeteditAttributes * myNeteditAttributes
Netedit parameter.
bool getNeteditAttributesAndValues(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane) const
fill valuesMap with netedit attributes
#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
void addNewPoint(const Position &P)
add new point to temporal shape
~GEOPOICreator()
destructor
bool isDrawing() const
return true if currently a shape is drawed
#define GUIDesignTextFieldNCol
Num of column of text field.
void disableModuls()
disable moduls if element selected in itemSelector isn't valid
const PositionVector & getShape() const
returns the shape of the lane
virtual void show()
show Frame
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
ACAttributes * myShapeAttributes
shape internal attributes
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
virtual void hide()
hide Frame
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. ...
bool areValuesValid() const
check if parameters of attributes are valid
bool buildShape()
build a shaped element using the drawed shape return true if was sucesfully created ...
bool getDeleteLastCreatedPoint()
get flag delete last created point
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
void setCurrentTypeTag(SumoXMLTag typeTag)
set current type manually
static std::string copyFromClipboard(const FXApp &app)
Copies text from the clipboard.
void hideACAttributesModul()
hide group box
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