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),
57 double layer,
double angle,
const std::string& imgFile,
bool relativePath,
GNELane* lane,
double posOverLane,
double posLat,
58 double width,
double height,
bool movementBlocked) :
59 GUIPointOfInterest(id, type, color,
Position(), false, lane->
getID(), posOverLane, posLat, layer, angle, imgFile, relativePath, width, height),
111 newPosition.
add(offset);
247 glTranslated(
x(),
y(),
getType() + 0.01);
259 glTranslated(
x(),
y(),
getType() + 0.01);
358 return canParse<RGBColor>(value);
363 return canParse<double>(value);
365 return canParse<Position>(value);
368 return canParse<double>(value);
370 return canParse<Position>(value);
373 return canParse<bool>(value);
377 if (value ==
"default") {
380 return canParse<double>(value);
390 return canParse<bool>(value);
392 return canParse<double>(value) && (parse<double>(value) >= 0);
394 return canParse<double>(value) && (parse<double>(value) >= 0);
396 return canParse<double>(value);
398 return canParse<bool>(value);
400 return canParse<bool>(value);
414 result += i.first +
"=" + i.second +
"|";
417 if (!result.empty()) {
424 std::vector<std::pair<std::string, std::string> >
426 std::vector<std::pair<std::string, std::string> > result;
429 result.push_back(std::make_pair(i.first, i.second));
440 std::vector<std::string> parsedValues;
443 parsedValues.push_back(stValues.
next());
446 for (
auto i : parsedValues) {
447 std::vector<std::string> parsedParameters;
450 parsedParameters.push_back(stParam.
next());
454 setParameter(parsedParameters.front(), parsedParameters.back());
467 std::string oldID =
myID;
489 set(parse<Position>(value));
517 myGeo = parse<bool>(value);
523 if (value ==
"default") {
562 if (parse<bool>(value)) {
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.
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.
void drawInnerPOI(const GUIVisualizationSettings &s) const
draw inner POI (before pushName() )
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.
Position snapToActiveGrid(const Position &pos) const
Returns a position that is mapped to the closest grid point if the grid is active.
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.
GNELane * getLane() const
get GNELane
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
Transform POI to POILane, and viceversa.
Position myOriginalViewPosition
position used for move POILanes
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.
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
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.
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
bool checkDraw(const GUIVisualizationSettings &s) const
check if POI can be drawn
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
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
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
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
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. ...
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.
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)
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.
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.