49 PointOfInterest(
"",
"",
RGBColor::BLACK,
Position(0, 0), false,
"", 0, false, 0,
SUMOXMLDefinitions::
POIIcons.getString(
POIIcon::
NONE), 0, 0,
"", false, 0, 0,
"",
Parameterised::
Map()),
50 GNEAdditional(
"", net,
GLO_POI, tag,
GUIIconSubSys::getIcon(
GUIIcon::
POI),
"", {}, {}, {}, {}, {}, {}) {
57 const double yLat,
const bool geo,
const std::string& icon,
const double layer,
const double angle,
58 const std::string& imgFile,
const bool relativePath,
const double width,
const double height,
60 PointOfInterest(id, type, color,
Position(xLon, yLat), geo,
"", 0, false, 0, icon, layer, angle, imgFile, relativePath, width, height, name, parameters),
62 "", {}, {}, {}, {}, {}, {}) {
67 set(cartesian.x(), cartesian.y());
72 updateCenteringBoundary(
false);
77 const bool friendlyPos,
const double posLat,
const std::string& icon,
const double layer,
const double angle,
78 const std::string& imgFile,
const bool relativePath,
const double width,
const double height,
80 PointOfInterest(id, type, color,
Position(), false, lane->getID(), posOverLane, friendlyPos, posLat, icon, layer, angle, imgFile, relativePath, width, height, name, parameters),
81 GNEAdditional(id, net,
GLO_POI,
GNE_TAG_POILANE,
GUIIconSubSys::getIcon(
GUIIcon::
POILANE),
"", {}, {}, {lane}, {}, {}, {}) {
85 updateCenteringBoundary(
false);
99 const double snapRadiusSquared = snapRadius * snapRadius;
105 }
else if (
myShapeHeight.front().distanceSquaredTo2D(mousePosition) <= snapRadiusSquared) {
108 }
else if (
myShapeHeight.back().distanceSquaredTo2D(mousePosition) <= snapRadiusSquared) {
111 }
else if (
myShapeWidth.front().distanceSquaredTo2D(mousePosition) <= snapRadiusSquared) {
114 }
else if (
myShapeWidth.back().distanceSquaredTo2D(mousePosition) <= snapRadiusSquared) {
159 return POIBaseObject;
195 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
201 std::string errorPosition;
209 return errorPosition;
339 new FXMenuSeparator(ret);
372 drawPOI(s, d, movingGeometryPoints);
376 if (movingGeometryPoints) {
379 const double snapRadiusSquared = snapRadius * snapRadius;
383 if ((
myShapeHeight.front().distanceSquaredTo2D(mousePosition) <= snapRadiusSquared) ||
384 (
myShapeHeight.back().distanceSquaredTo2D(mousePosition) <= snapRadiusSquared)) {
387 }
else if ((
myShapeWidth.front().distanceSquaredTo2D(mousePosition) <= snapRadiusSquared) ||
388 (
myShapeWidth.back().distanceSquaredTo2D(mousePosition) <= snapRadiusSquared)) {
518 return canParse<RGBColor>(value);
523 return canParse<double>(value);
525 return canParse<Position>(value);
528 return canParse<bool>(value);
530 return canParse<double>(value);
532 return canParse<double>(value);
534 return canParse<double>(value);
540 if (value ==
"default") {
543 return canParse<double>(value);
553 return canParse<bool>(value);
555 return canParse<double>(value) && (parse<double>(value) > 0);
557 return canParse<double>(value) && (parse<double>(value) > 0);
559 return canParse<double>(value);
563 return canParse<bool>(value);
600 const bool movingGeometryPoints)
const {
611 if (movingGeometryPoints) {
627 const double exaggeration,
const bool movingGeometryPoints)
const {
629 if (movingGeometryPoints) {
638 myAdditionalContour.
calculateContourRectangleShape(s, d,
this, *
this,
getHeight() * 0.5,
getWidth() * 0.5,
getShapeLayer(), 0, 0,
getShapeNaviDegree(), exaggeration);
662 if (canParse<double>(value)) {
667 set(parse<Position>(value));
716 if (value ==
"default") {
724 if (
getID().size() > 0) {
731 if (
getID().size() > 0) {
742 if (
getID().size() > 0) {
751 if (
getID().size() > 0) {
763 if (parse<bool>(value)) {
@ NETWORK_MOVE
mode for moving network elements
@ MID_GNE_POI_TRANSFORM
Transform POI to POILane, and viceversa.
@ GLO_FRONTELEMENT
front element (used in netedit)
@ GLO_POI
poi (over view, geo and lane)
GUIIcon
An enumeration of icons used by the gui applications.
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_POI
begin/end of the description of a Point of interest
@ GNE_TAG_POIGEO
Point of interest over view with GEO attributes.
@ GNE_TAG_POILANE
Point of interest over Lane.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_SELECTED
element is selected
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_LAYER
A layer number.
@ SUMO_ATTR_COLOR
A color information.
@ GNE_ATTR_SHIFTLANEINDEX
shift lane index (only used by elements over lanes)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
void reset()
Resets the boundary.
Boundary & grow(double by)
extends the boundary by the given amount
void setTag(const SumoXMLTag tag)
set SumoBaseObject tag
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
void addColorAttribute(const SumoXMLAttr attr, const RGBColor &value)
add color attribute into current SumoBaseObject node
static void drawBoundary(const GUIVisualizationSettings &s, const Boundary &b)
Draw a boundary (used for debugging)
static bool checkLanePosition(double pos, const double length, const double laneLength, const bool friendlyPos)
check if the given position over a lane is valid
static void fixLanePosition(double &pos, double &length, const double laneLength)
fix given position over lane
An Element which don't belong to GNENet but has influence in the simulation.
bool isValidAdditionalID(const std::string &value) const
check if a new additional ID is valid
void drawRightGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const Position &pos, const double rot, const RGBColor &baseColor, const bool ignoreShift=false) const
draw right geometry point
void setAdditionalID(const std::string &newID)
set additional ID
GNEContour myAdditionalContour
variable used for draw additional contours
void drawUpGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const Position &pos, const double rot, const RGBColor &baseColor, const bool ignoreShift=false) const
draw up geometry point
void replaceAdditionalParentLanes(const std::string &value)
replace additional parent lanes
void shiftLaneIndex()
shift lane index
bool drawMovingGeometryPoints(const bool ignoreShift) const
check if draw additional extrem geometry points
void drawDownGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const Position &pos, const double rot, const RGBColor &baseColor, const bool ignoreShift=false) const
draw down geometry point
Boundary myAdditionalBoundary
Additional Boundary (used only by additionals placed over grid)
void drawLeftGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const Position &pos, const double rot, const RGBColor &baseColor, const bool ignoreShift=false) const
draw left geometry point
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GNENet * myNet
pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
const GNETagProperties & myTagProperty
reference to tagProperty associated with this attribute carrier
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void calculateContourCircleShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const Position &pos, double radius, const double layer, const double scale) const
calculate contour (circle elements)
void calculateContourRectangleShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const Position &pos, const double width, const double height, const double layer, const double offsetX, const double offsetY, const double rot, const double scale) const
calculate contour (for rectangled elements)
void drawDottedContours(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const double lineWidth, const bool addOffset) const
draw dotted contours (basics, select, delete, inspect...)
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
bool getAllowChangeLane() const
allow change lane
CommonModeOptions * getCommonModeOptions() const
get common mode options
double newFirstPos
new first position
const GNEMoveOperation::OperationType operationType
move operation
PositionVector shapeToUpdate
shape to update (edited in moveElement)
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
A NBNetBuilder extended by visualisation and editing capabilities.
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEViewNet * getViewNet() const
get view net
bool isValid(SumoXMLAttr key, const std::string &value) override
method for checking if the key and their correspond attribute are valids
Position getPositionInView() const override
Returns position of shape in view.
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
const Parameterised::Map & getACParametersMap() const override
get parameters map
GNEContour myMovingContourRight
variable used for moving contour right
PositionVector myShapeWidth
shape width of POI
void drawPOI(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const bool movingGeometryPoints) const
draw POI
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList) override
commit move shape
void calculatePOIContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double exaggeration, const bool movingGeometryPoints) const
calculate contour
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
GNEContour myMovingContourLeft
variable used for moving contour left
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
std::string getParentName() const override
Returns the name of the parent object.
void fixAdditionalProblem() override
fix additional problem (must be reimplemented in all detector children)
std::string getAttribute(SumoXMLAttr key) const override
method for getting the Attribute of an XML key
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
GUIGlID getGlID() const
Returns the numerical id of the object.
std::string getAdditionalProblem() const override
return a string with the current additional problem (must be reimplemented in all detector children)
GNEMoveOperation * getMoveOperation() override
get move operation
bool isAttributeEnabled(SumoXMLAttr key) const override
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList) override
remove geometry point in the clicked position
double getAttributeDouble(SumoXMLAttr key) const override
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
GNEContour myMovingContourDown
variable used for moving contour down
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
void updateGeometry() override
update pre-computed geometry information
bool checkDrawMoveContour() const override
check if draw move contour (red)
PositionVector myShapeHeight
shape height of POI
void setMoveShape(const GNEMoveResult &moveResult) override
set move shape
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
bool isAdditionalValid() const override
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
method for setting the attribute and letting the object perform additional changes
GNEPOI(SumoXMLTag tag, GNENet *net)
Constructor.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
GNEContour myMovingContourUp
variable used for moving contour up
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all POIattributes
bool isJuPedSimElement() const
return true if tag correspond to a JuPedSim element
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
const GUIGlObject * getGUIGlObjectFront() const
get front GUIGLObject or a pointer to nullptr
bool isCurrentlyMovingElements() const
check if an element is being moved
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed module
GNEViewParent * getViewParent() const
get the net object
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
GNEUndoList * getUndoList() const
get the undoList object
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
GNEMoveFrame * getMoveFrame() const
get frame for move elements
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app) const
Builds an entry which allows to copy the cursor position if geo projection is used,...
GUIGlID getGlID() const
Returns the numerical id of the object.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static bool checkDraw(const GUIVisualizationSettings &s, const GUIGlObject *o)
check if POI can be drawn
static void drawInnerPOI(const GUIVisualizationSettings &s, const PointOfInterest *POI, const GUIGlObject *o, const bool disableSelectionColor, const double layer, const double width, const double height)
draw inner POI (before pushName() )
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
static void clearTextures()
clears loaded textures
Stores the information about how to visualize structures.
bool poiUseCustomLayer
whether the rendering layer of POIs should be overriden
GUIVisualizationSizeSettings poiSize
bool checkDrawPOI(const double w, const double h, const Detail d, const bool selected) const
check if draw POI
Detail getDetailLevel(const double exaggeration) const
return the detail level
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
double poiCustomLayer
the custom layer for POIs
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation.
std::string myID
The name of the object.
static const std::vector< SumoXMLTag > POIs
POIs namespace.
Static storage of an output device and its base (abstract) implementation.
C++ TraCI client API implementation.
An upper class for objects with additional parameters.
static bool areParametersValid(const std::string &value, bool report=false, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
std::map< std::string, std::string > Map
parameters map
void setParametersStr(const std::string ¶msString, const std::string kvsep="=", const std::string sep="|")
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
std::string getParametersStr(const std::string kvsep="=", const std::string sep="|") const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
bool myGeo
flag to check if POI was loaded as GEO Position (main used by netedit)
bool getFriendlyPos() const
returns friendly position
void setHeight(double height)
set the image height of the POI
void setFriendlyPos(const bool friendlyPos)
set friendly position
double myPosLat
lateral position over lane in which this POI is placed (main used by netedit)
void setWidth(double width)
set the image width of the POI
double getHeight() const
Returns the image height of the POI.
bool myFriendlyPos
friendlyPos enable or disable friendly position for position over lane
std::string myLane
ID of lane in which this POI is placed (main used by netedit)
void setIcon(const std::string &icon)
set icon
double myPosOverLane
position over lane in which this POI is placed (main used by netedit)
double getWidth() const
Returns the image width of the POI.
const std::string & getIconStr() const
get icon(in string format)
void writeXML(OutputDevice &out, const bool geo=false, const double zOffset=0., const std::string laneID="", const double pos=0., const bool friendlyPos=false, const double posLat=0.) const
A point in 2D or 3D with translation and scaling methods.
double length() const
Computes the length of the given vector.
Position()
default constructor
void set(double x, double y)
set positions x and y
double x() const
Returns the x-position.
double y() const
Returns the y-position.
double length2D() const
Returns the length.
void add(double xoff, double yoff, double zoff)
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
static const RGBColor ORANGE
class for maintaining associations between enums and xml-strings
static StringBijection< POIIcon > POIIcons
POI icon values.
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
const std::string getShapeName() const
Returns the name of the Shape.
static const double DEFAULT_LAYER_POI
void setShapeName(const std::string &name)
Sets a new shape name.
void setShapeLayer(const double layer)
Sets a new layer.
bool getShapeRelativePath() const
Returns the relativePath of the Shape.
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.
void setShapeType(const std::string &type)
Sets a new type.
void setShapeRelativePath(bool relativePath)
Sets a new relativePath value.
virtual void setShapeNaviDegree(const double angle)
Sets a new angle in navigational degrees.
void setShapeImgFile(const std::string &imgFile)
Sets a new imgFile.
void setShapeColor(const RGBColor &col)
Sets a new color.
double getShapeLayer() const
Returns the layer of the Shape.
const std::string & getShapeImgFile() const
Returns the imgFile of the Shape.
const RGBColor & getShapeColor() const
Returns the color of the Shape.
double getShapeNaviDegree() const
Returns the angle of the Shape in navigational degrees.
bool hasString(const std::string &str) const
bool showShapes() const
check if shapes has to be drawn
bool showShapes() const
check if shapes has to be drawn
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
static void drawLockIcon(const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position position, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
static const double segmentWidthSmall
width of small dotted contour segments
static const double segmentWidth
width of dotted contour segments
static const double additionalGeometryPointRadius
moving additional geometry point radius
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values