61 const Position& pos,
bool geo,
double layer,
double angle,
const std::string& imgFile,
62 bool relativePath,
double width,
double height,
bool movementBlocked) :
63 GUIPointOfInterest(id, type, color, pos, geo,
"", 0, 0, layer, angle, imgFile, relativePath, width, height),
73 double layer,
double angle,
const std::string& imgFile,
bool relativePath,
GNELane* lane,
double posOverLane,
double posLat,
74 double width,
double height,
bool movementBlocked) :
75 GUIPointOfInterest(id, type, color,
Position(), false, lane->
getID(), posOverLane, posLat, layer, angle, imgFile, relativePath, width, height),
125 newPosition.
add(offset);
252 glTranslated(
x(),
y(),
getType() + 0.01);
264 glTranslated(
x(),
y(),
getType() + 0.01);
362 return canParse<RGBColor>(value);
367 canParse<double>(value);
373 return canParse<double>(value);
379 return canParse<bool>(value);
383 if (value ==
"default") {
386 return canParse<double>(value);
396 return canParse<bool>(value);
398 return canParse<double>(value) && (parse<double>(value) >= 0);
400 return canParse<double>(value) && (parse<double>(value) >= 0);
402 return canParse<double>(value);
404 return canParse<bool>(value);
406 return canParse<bool>(value);
466 result += i.first +
"=" + i.second +
"|";
469 if (!result.empty()) {
476 std::vector<std::pair<std::string, std::string> >
478 std::vector<std::pair<std::string, std::string> > result;
481 result.push_back(std::make_pair(i.first, i.second));
492 std::vector<std::string> parsedValues;
495 parsedValues.push_back(stValues.
next());
498 for (
auto i : parsedValues) {
499 std::vector<std::string> parsedParameters;
502 parsedParameters.push_back(stParam.
next());
506 setParameter(parsedParameters.front(), parsedParameters.back());
519 std::string oldID =
myID;
571 myGeo = parse<bool>(value);
577 if (value ==
"default") {
616 if (parse<bool>(value)) {
const GNEAttributeCarrier * getACUnderCursor() const
get AttributeCarrier under cursor
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 ...
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.
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.
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.
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.
void unsetParameter(const std::string &key)
Removes a parameter.
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
double x() const
Returns the x-position.
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.
GNELane * getLane() const
get GNELane
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)
void mouseOverObject(const GUIVisualizationSettings &s) const
method for check if mouse is over objects
static OptionsCont & getOptions()
Retrieves the options.
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.
void drawLockIcon(const Position &pos, double layer, double size=0.5) const
draw lock icon
double myPosLat
latereal position over lane in which this POI is placed (main used by netedit)
bool addGenericParameter(const std::string &key, const std::string &value)
add generic parameter
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
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.
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
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.
void addShapeChild(GNEShape *shape)
add shape child to this lane
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
double getLengthGeometryFactor() const
get lenght geometry factor
std::string getParentName() const
Returns the name of the parent object.
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
void changeShapeID(GNEShape *s, const std::string &OldID)
change Shape ID
double getLaneShapeLength() const
returns the length of the lane's shape
double getShapeLayer() const
Returns the layer of the Shape.
double getWidth() const
Returns the image width of the POI.
void updateGeometry(bool updateGrid)
update pre-computed geometry information
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool updateGenericParameterValue(const std::string &key, const std::string &newValue)
update value generic parameter
GUIVisualizationSizeSettings poiSize
void reset()
Resets the boundary.
std::string myID
The name of the object.
const PositionVector & getShape() const
returns the shape of the lane
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
double length() const
Returns the length.
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
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
static void drawShapeDottedContour(const int type, const PositionVector &shape, const double width)
draw a dotted contour around the given Non closed shape with certain width
bool updateGenericParameter(const std::string &oldKey, const std::string &newKey)
update generic parameter
void setWidth(double width)
set the image width of the POI
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
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
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.
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
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. ...
void removeShapeChild(GNEShape *shape)
remove shape child of this lane
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
GNELane * myGNELane
GNElane in which this POILane is placed (Only used by POIs placed over lanes)
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
begin/end of the description of a Point of interest over Lane (used by Netedit)
bool myGeo
flag to check if POI was loaded as GEO Position (main used by netedit)
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Position()
default constructor
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
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
void setShapeLayer(const double layer)
Sets a new layer.
static PositionVector parseShapeReporting(const std::string &shpdef, const std::string &objecttype, const char *objectid, bool &ok, bool allowEmpty, bool report=true)
Builds a PositionVector from a string representation, reporting occurred errors.
void endGeometryMoving()
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
bool removeGenericParameter(const std::string &key)
remove generic parameter
double getShapeNaviDegree() const
Returns the angle of the Shape in navigational degrees.
GNEViewNet * getViewNet() const
get view net
void setShapeNaviDegree(const double angle)
Sets a new angle in navigational degrees.
void clearParameter()
Clears the parameter map.
SumoXMLTag getTag() const
get XML Tag assigned to this object