44 PointOfInterest(
"",
"",
RGBColor::BLACK,
Position(0, 0), false,
"", 0, false, 0, 0, 0,
"", false, 0, 0,
"", std::map<std::string, std::string>()),
45 GNEShape(
"", net,
GLO_POI, tag, {}, {}, {}, {}, {}, {}, {}, {}) {
52 const double yLat,
const bool geo,
const double layer,
const double angle,
const std::string& imgFile,
53 const bool relativePath,
const double width,
const double height,
const std::string& name,
54 const std::map<std::string, std::string>& parameters) :
55 PointOfInterest(id, type, color,
Position(xLon, yLat), geo,
"", 0, false, 0, layer, angle, imgFile, relativePath, width, height, name, parameters),
56 GNEShape(id, net,
GLO_POI, geo ?
GNE_TAG_POIGEO :
SUMO_TAG_POI, {}, {}, {}, {}, {}, {}, {}, {}) {
61 set(cartesian.x(), cartesian.y());
64 updateCenteringBoundary(
false);
69 const bool friendlyPos,
const double posLat,
const double layer,
const double angle,
const std::string& imgFile,
const bool relativePath,
const double width,
70 const double height,
const std::string& name,
const std::map<std::string, std::string>& parameters) :
71 PointOfInterest(id, type, color,
Position(), false, lane->getID(), posOverLane, friendlyPos, posLat, layer, angle, imgFile, relativePath, width, height, name, parameters),
73 {}, {}, {lane}, {}, {}, {}, {}, {}
78 updateCenteringBoundary(
false);
97 }
else if (
myShapeHeight.front().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius)) {
100 }
else if (
myShapeHeight.back().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius)) {
103 }
else if (
myShapeWidth.front().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius)) {
106 }
else if (
myShapeWidth.back().distanceSquaredTo2D(mousePosition) <= (snap_radius * snap_radius)) {
156 return POIBaseObject;
306 glTranslated(
x(),
y(),
getType() + 0.01);
462 return canParse<RGBColor>(value);
467 return canParse<double>(value);
469 return canParse<Position>(value);
472 return canParse<bool>(value);
474 return canParse<double>(value);
476 return canParse<double>(value);
478 return canParse<double>(value);
482 if (value ==
"default") {
485 return canParse<double>(value);
495 return canParse<bool>(value);
497 return canParse<double>(value) && (parse<double>(value) > 0);
499 return canParse<double>(value) && (parse<double>(value) > 0);
501 return canParse<double>(value);
505 return canParse<bool>(value);
525 const std::map<std::string, std::string>&
553 if (canParse<double>(value)) {
558 set(parse<Position>(value));
604 if (value ==
"default") {
612 if (
getID().size() > 0) {
619 if (
getID().size() > 0) {
630 if (
getID().size() > 0) {
639 if (
getID().size() > 0) {
651 if (parse<bool>(value)) {
@ NETWORK_MOVE
mode for moving network elements
@ MID_GNE_POI_TRANSFORM
Transform POI to POILane, and viceversa.
@ GLO_DOTTEDCONTOUR_FRONT
dotted contour front element (used in NETEDIT)
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.
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ 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 void drawRightGeometryPoint(const GNEViewNet *viewNet, const Position &pos, const double rot, const RGBColor &baseColor)
draw right geometry point
static void drawDownGeometryPoint(const GNEViewNet *viewNet, const Position &pos, const double rot, const RGBColor &baseColor)
draw down geometry point
static void drawUpGeometryPoint(const GNEViewNet *viewNet, const Position &pos, const double rot, const RGBColor &baseColor)
draw up geometry point
static void drawLeftGeometryPoint(const GNEViewNet *viewNet, const Position &pos, const double rot, const RGBColor &baseColor)
draw left geometry point
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
GNEShape * retrieveShape(SumoXMLTag, const std::string &id, bool hardFail=true) const
Returns the named shape.
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
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
PositionVector myShapeWidth
shape width of POI
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
GUIGlID getGlID() const
Returns the numerical id of the object.
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
std::string getParentName() const
Returns the name of the parent object.
bool isAttributeEnabled(SumoXMLAttr key) const
Position getPositionInView() const
Returns position of shape in view.
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void writeShape(OutputDevice &device)
writte shape element into a xml file
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
PositionVector myShapeHeight
shape height of POI
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
const std::string & getID() const
needed to avoid diamond problem between PointOfInterest and GNEShape
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspond attribute are valids
GNEPOI(SumoXMLTag tag, GNENet *net)
Constructor.
void updateGeometry()
update pre-computed geometry information
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
GNEMoveOperation * getMoveOperation()
get move operation
std::string getAttribute(SumoXMLAttr key) const
method for getting the Attribute of an XML key
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all POIattributes
Boundary myBoundary
object boundary
void shiftLaneIndex()
shift lane index
void replaceShapeParentLanes(const std::string &value)
replace shape parent lanes
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
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 modul
GNEViewParent * getViewParent() const
get the net object
const GNEViewNetHelper::TestingMode & getTestingMode() const
get testing mode
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 DottedContourType type, const GUIVisualizationSettings &s, 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 DottedContourType type, const GUIVisualizationSettings &s, const Position &pos, const double radius, const double exaggeration)
draw dotted contour for the given Position and radius (used by Juctions and POIs)
virtual 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.
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
A window containing a gl-object's parameter.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
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() )
GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings
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
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
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 storage of an output device and its base (abstract) implementation.
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|....
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"
virtual void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
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".
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
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)
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.)
double getWidth() const
Returns the image width of the POI.
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.
const RGBColor & getShapeColor() const
Returns the color of the Shape.
static const double DEFAULT_LAYER_POI
void setShapeName(const std::string &name)
Sets a new shape name.
const std::string & getShapeImgFile() const
Returns the imgFile of the Shape.
void setShapeLayer(const double layer)
Sets a new layer.
bool getShapeRelativePath() const
Returns the relativePath 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.
double getShapeNaviDegree() const
Returns the angle of the Shape in navigational degrees.
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.
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
bool isTestingEnabled() const
check if testing mode is enabled
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