48 PointOfInterest(
"",
"",
RGBColor::BLACK,
Position(0, 0), false,
"", 0, false, 0, 0, 0,
"", false, 0, 0,
"",
Parameterised::
Map()),
49 GNEAdditional(
"", net,
GLO_POI, tag,
GUIIconSubSys::getIcon(
GUIIcon::
POI),
"", {}, {}, {}, {}, {}, {}) {
56 const double yLat,
const bool geo,
const double layer,
const double angle,
const std::string& imgFile,
57 const bool relativePath,
const double width,
const double height,
const std::string& name,
59 PointOfInterest(id, type, color,
Position(xLon, yLat), geo,
"", 0, false, 0, layer, angle, imgFile, relativePath, width, height, name, parameters),
61 "", {}, {}, {}, {}, {}, {}) {
66 set(cartesian.x(), cartesian.y());
69 updateCenteringBoundary(
false);
74 const bool friendlyPos,
const double posLat,
const double layer,
const double angle,
const std::string& imgFile,
const bool relativePath,
const double width,
76 PointOfInterest(id, type, color,
Position(), false, lane->getID(), posOverLane, friendlyPos, posLat, layer, angle, imgFile, relativePath, width, height, name, parameters),
77 GNEAdditional(id, net,
GLO_POI,
GNE_TAG_POILANE,
GUIIconSubSys::getIcon(
GUIIcon::
POILANE),
"", {}, {}, {lane}, {}, {}, {}) {
81 updateCenteringBoundary(
false);
100 }
else if (
myShapeHeight.front().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius)) {
103 }
else if (
myShapeHeight.back().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius)) {
106 }
else if (
myShapeWidth.front().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius)) {
109 }
else if (
myShapeWidth.back().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius)) {
153 return POIBaseObject;
189 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
195 std::string errorPosition;
203 return errorPosition;
355 glTranslated(
x(),
y(),
getType() + 0.01);
524 if (value ==
getID()) {
536 return canParse<RGBColor>(value);
541 return canParse<double>(value);
543 return canParse<Position>(value);
546 return canParse<bool>(value);
548 return canParse<double>(value);
550 return canParse<double>(value);
552 return canParse<double>(value);
556 if (value ==
"default") {
559 return canParse<double>(value);
569 return canParse<bool>(value);
571 return canParse<double>(value) && (parse<double>(value) > 0);
573 return canParse<double>(value) && (parse<double>(value) > 0);
575 return canParse<double>(value);
579 return canParse<bool>(value);
633 if (canParse<double>(value)) {
638 set(parse<Position>(value));
684 if (value ==
"default") {
692 if (
getID().size() > 0) {
699 if (
getID().size() > 0) {
710 if (
getID().size() > 0) {
719 if (
getID().size() > 0) {
731 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)
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)
void addColorAttribute(const SumoXMLAttr attr, const RGBColor &value)
add color attribute into current SumoBaseObject node
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void pushName(unsigned int name)
push Name
static void popMatrix()
pop matrix
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
static void popName()
pop Name
static void pushMatrix()
push matrix
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.
static void drawRightGeometryPoint(const GNEViewNet *viewNet, const Position &pos, const double rot, const RGBColor &baseColor, const bool ignoreShift=false)
draw right geometry point
void replaceAdditionalParentLanes(const std::string &value)
replace additional parent lanes
void shiftLaneIndex()
shift lane index
static void drawUpGeometryPoint(const GNEViewNet *viewNet, const Position &pos, const double rot, const RGBColor &baseColor, const bool ignoreShift=false)
draw up geometry point
static void drawDownGeometryPoint(const GNEViewNet *viewNet, const Position &pos, const double rot, const RGBColor &baseColor, const bool ignoreShift=false)
draw down geometry point
Boundary myAdditionalBoundary
Additional Boundary.
static void drawLeftGeometryPoint(const GNEViewNet *viewNet, const Position &pos, const double rot, const RGBColor &baseColor, const bool ignoreShift=false)
draw left geometry point
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
friend class GNEChange_Attribute
declare friend class
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
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
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
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
PositionVector myShapeWidth
shape width of POI
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList) override
commit move shape
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
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
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
void updateGeometry() override
update pre-computed geometry information
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 writed into XML (must be reimplemented in all detector chi...
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.
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all POIattributes
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
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...
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
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::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed module
bool drawSelectContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw select contour
bool drawDeleteContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw delete contour
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
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)
build menu command
static void drawDottedSquaredShape(const GUIVisualizationSettings &s, const DottedContourType type, const Position &pos, const double width, const double height, const double offsetX, const double offsetY, const double rot, const double exaggeration)
draw dotted squared contour (used by additionals and demand elements)
static void drawDottedContourCircle(const GUIVisualizationSettings &s, const DottedContourType type, const Position &pos, const double radius, const double exaggeration)
draw dotted contour for the given Position and radius (used by Juctions and POIs)
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.
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
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.
bool mouseWithinGeometry(const Position center, const double radius) const
check if mouse is within elements geometry (for circles)
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 drawBoundaries
enable or disable draw boundaries
GUIVisualizationSizeSettings poiSize
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 OptionsCont & getOptions()
Retrieves the options.
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
latereal 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)
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.
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.
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 ammount
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
static const RGBColor ORANGE
static bool isValidTypeID(const std::string &value)
whether the given string is a valid id for an edge or vehicle type
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 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
static void drawLockIcon(const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position viewPosition, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
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