45 const Position& pos,
bool geo,
double layer,
double angle,
const std::string& imgFile,
46 bool relativePath,
double width,
double height,
bool movementBlocked) :
47 GUIPointOfInterest(id, type, color, pos, geo,
"", 0, 0, layer, angle, imgFile, relativePath, width, height),
48 GNEShape(net,
SUMO_TAG_POI, movementBlocked, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}) {
56 double layer,
double angle,
const std::string& imgFile,
bool relativePath,
GNELane* lane,
double posOverLane,
double posLat,
57 double width,
double height,
bool movementBlocked) :
58 GUIPointOfInterest(id, type, color,
Position(), false, lane->
getID(), posOverLane, posLat, layer, angle, imgFile, relativePath, width, height),
59 GNEShape(net,
SUMO_TAG_POILANE, movementBlocked, {}, {lane}, {}, {}, {}, {}, {}, {}, {}, {}) {
104 newPosition.
add(offset);
128 double originalPosOverLane =
getLaneParents().at(0)->getGeometry().shape.nearest_offset_to_point2D(oldPos,
false);
232 glTranslated(
x(),
y(),
getType() + 0.01);
244 glTranslated(
x(),
y(),
getType() + 0.01);
344 return canParse<RGBColor>(value);
349 return canParse<double>(value);
351 return canParse<Position>(value);
354 return canParse<double>(value);
356 return canParse<Position>(value);
359 return canParse<bool>(value);
363 if (value ==
"default") {
366 return canParse<double>(value);
376 return canParse<bool>(value);
378 return canParse<double>(value) && (parse<double>(value) > 0);
380 return canParse<double>(value) && (parse<double>(value) > 0);
382 return canParse<double>(value);
384 return canParse<bool>(value);
386 return canParse<bool>(value);
400 result += i.first +
"=" + i.second +
"|";
403 if (!result.empty()) {
410 std::vector<std::pair<std::string, std::string> >
412 std::vector<std::pair<std::string, std::string> > result;
415 result.push_back(std::make_pair(i.first, i.second));
426 std::vector<std::string> parsedValues;
429 parsedValues.push_back(stValues.
next());
432 for (
auto i : parsedValues) {
433 std::vector<std::string> parsedParameters;
436 parsedParameters.push_back(stParam.
next());
440 setParameter(parsedParameters.front(), parsedParameters.back());
453 std::string oldID =
myID;
473 set(parse<Position>(value));
498 myGeo = parse<bool>(value);
504 if (value ==
"default") {
555 if (parse<bool>(value)) {
SumoXMLTag
Numbers representing SUMO-XML - element names.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
void startGeometryMoving()
Position getPositionInView() const
Returns position of additional in view.
void buildShapePopupOptions(GUIMainWindow &app, GUIGLObjectPopupMenu *ret, const std::string &type)
build basic shape popup options. Used to unify pop-ups menu in netedit and SUMO-GUI ...
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
static const std::string DEFAULT_IMG_FILE
const std::string & getShapeImgFile() const
Returns the imgFile of the Shape.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
begin/end of the description of a single lane
void add(const Position &pos)
Adds the given position to this one.
void setShapeColor(const RGBColor &col)
Sets a new color.
void setShapeRelativePath(bool relativePath)
Sets a new relativePath value.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
int size() const
Returns the number of stored items within the container.
GUIGlID getGlID() const
Returns the numerical id of the object.
static const double DEFAULT_LAYER_POI
Boundary myMovingGeometryBoundary
boundary used during moving of elements
double myPosOverLane
position over lane in which this POI is placed (main used by netedit)
Stores the information about how to visualize structures.
void setShapeType(const std::string &type)
Sets a new type.
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
double y() const
Returns the y-position.
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
double x() const
Returns the x-position.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
static const RGBColor ORANGE
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
GNEPOI(GNENet *net, const std::string &id, const std::string &type, const RGBColor &color, const Position &pos, bool geo, double layer, double angle, const std::string &imgFile, bool relativePath, double width, double height, bool movementBlocked)
Constructor.
A NBNetBuilder extended by visualisation and editing capabilities.
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...
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
begin/end of the description of a Point of interest
double getHeight() const
Returns the image height of the POI.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
bool hasNext()
returns the information whether further substrings exist
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
Transform POI to POILane, and viceversa.
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
GNENet * myNet
the net to inform about updates
A class that stores a 2D geometrical boundary.
void selectAttributeCarrier(bool changeFlag=true)
static OptionsCont & getOptions()
Retrieves the options.
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.
double myPosLat
latereal position over lane in which this POI is placed (main used by netedit)
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
void setShapeImgFile(const std::string &imgFile)
Sets a new imgFile.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
void writeXML(OutputDevice &out, const bool geo=false, const double zOffset=0., const std::string laneID="", const double pos=0., const double posLat=0.)
static void clearTextures()
clears loaded textures
double myHalfImgHeight
The half height of the image when rendering this POI.
std::string myLane
ID of lane in which this POI is placed (main used by netedit)
std::string getGenericParametersStr() const
return generic parameters in string format
bool getShapeRelativePath() const
Returns the relativePath of the Shape.
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspond attribute are valids
bool myBlockMovement
flag to block movement
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.
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
friend class GNEChange_Attribute
declare friend class
const RGBColor & getShapeColor() const
Returns the color of the Shape.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
const std::vector< GNELane * > & getLaneParents() const
get lanes of VSS
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
block movement of a graphic element
std::string getParentName() const
Returns the name of the parent object.
static void drawShapeDottedContourAroundClosedShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape)
draw a dotted contour around the given closed shape with certain width
double myHalfImgWidth
The half width of the image when rendering this POI.
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
const std::string getID() const
function to support debugging
bool checkDraw(const GUIVisualizationSettings &s) const
check if POI can be drawn
const GUIGlObject * getGUIGlObject() const
get GUIGlObject associated to this GNEShape
void changeShapeID(GNEShape *s, const std::string &OldID)
change Shape ID
bool showShapes() const
check if shapes has to be hide
double getShapeLayer() const
Returns the layer of the Shape.
double getWidth() const
Returns the image width of the POI.
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
static void drawShapeDottedContourRectangle(const GUIVisualizationSettings &s, const int type, const Position ¢er, const double width, const double height, const double rotation=0, const double offsetX=0, const double offsetY=0)
draw a dotted contour around the given Position with certain width and height
void drawInnerPOI(const GUIVisualizationSettings &s, bool forceSelectionColor) const
draw inner POI (before pushName() )
GUIVisualizationSizeSettings poiSize
void changeLaneParents(GNEShape *elementChild, const std::string &newLaneIDs)
change edge parents of a shape
std::string myID
The name of the object.
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
Position myGEOPosition
Position of POI in GEO coordinates (Only used by POIs that aren't placed over lanes) ...
void setHeight(double height)
set the image height of the POI
void updateGeometry()
update pre-computed geometry information
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
void setWidth(double width)
set the image width of the POI
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
const std::string & getTagStr() const
get tag assigned to this object in string format
static std::vector< Position > myPOIVertices
after every iteration of drawgl, position of vertices that make the circle are saved here...
bool isInitialised() const
check if Boundary is Initialised
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
std::string getAttribute(SumoXMLAttr key) const
method for getting the Attribute of an XML key
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
GUIGlID getGlID() const
Returns the numerical id of the object.
void writeShape(OutputDevice &device)
writte shape element into a xml file
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
Static storage of an output device and its base (abstract) implementation.
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation. ...
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
begin/end of the description of a Point of interest over Lane (used by Netedit)
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
bool myGeo
flag to check if POI was loaded as GEO Position (main used by netedit)
Position()
default constructor
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
A window containing a gl-object's parameter.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
bool drawBoundaries
enable or disable draw boundaries
void setShapeLayer(const double layer)
Sets a new layer.
void endGeometryMoving()
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
double getShapeNaviDegree() const
Returns the angle of the Shape in navigational degrees.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GNEViewNet * getViewNet() const
get view net
void setShapeNaviDegree(const double angle)
Sets a new angle in navigational degrees.
void clearParameter()
Clears the parameter map.
const POIs & getPOIs() const
Returns all pois.