 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
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),
48 GNEShape(net,
SUMO_TAG_POI, movementBlocked, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}) {
56 double layer,
double angle,
const std::string& imgFile,
bool relativePath,
GNELane* lane,
double posOverLane,
double posLat,
57 double width,
double height,
bool movementBlocked) :
58 GUIPointOfInterest(id, type, color,
Position(), false, lane->getID(), posOverLane, posLat, layer, angle, imgFile, relativePath, width, height),
59 GNEShape(net,
SUMO_TAG_POILANE, movementBlocked, {}, {lane}, {}, {}, {}, {}, {}, {}, {}, {}) {
104 newPosition.
add(offset);
128 double originalPosOverLane =
getParentLanes().at(0)->getLaneShape().nearest_offset_to_point2D(oldPos,
false);
232 glTranslated(
x(),
y(),
getType() + 0.01);
244 glTranslated(
x(),
y(),
getType() + 0.01);
344 return canParse<RGBColor>(value);
349 return canParse<double>(value);
351 return canParse<Position>(value);
354 return canParse<double>(value);
356 return canParse<Position>(value);
359 return canParse<bool>(value);
363 if (value ==
"default") {
366 return canParse<double>(value);
376 return canParse<bool>(value);
378 return canParse<double>(value) && (parse<double>(value) > 0);
380 return canParse<double>(value) && (parse<double>(value) > 0);
382 return canParse<double>(value);
384 return canParse<bool>(value);
386 return canParse<bool>(value);
413 std::string oldID =
myID;
433 set(parse<Position>(value));
460 myGeo = parse<bool>(value);
466 if (value ==
"default") {
517 if (parse<bool>(value)) {
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Boundary myMovingGeometryBoundary
boundary used during moving of elements
void setShapeType(const std::string &type)
Sets a new type.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
A window containing a gl-object's parameter.
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
const std::string getID() const
function to support debugging
GNEPOI * retrievePOI(const std::string &id, bool failHard=true) const
get POI by id
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation.
bool isAttributeEnabled(SumoXMLAttr key) const
Static storage of an output device and its base (abstract) implementation.
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.
bool myGeo
flag to check if POI was loaded as GEO Position (main used by netedit)
void selectAttributeCarrier(bool changeFlag=true)
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
double z() const
Returns the z-position.
bool drawBoundaries
enable or disable draw boundaries
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
A NBNetBuilder extended by visualisation and editing capabilities.
void setx(double x)
set position x
double getHeight() const
Returns the image height of the POI.
void writeXML(OutputDevice &out, const bool geo=false, const double zOffset=0., const std::string laneID="", const double pos=0., const double posLat=0.)
begin/end of the description of a single lane
bool checkDraw(const GUIVisualizationSettings &s) const
check if POI can be drawn
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
begin/end of the description of a Point of interest
void setShapeImgFile(const std::string &imgFile)
Sets a new imgFile.
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
const std::string & getShapeImgFile() const
Returns the imgFile of the Shape.
void changeShapeID(GNEShape *s, const std::string &OldID)
change Shape ID
double myPosOverLane
position over lane in which this POI is placed (main used by netedit)
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
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
const RGBColor & getShapeColor() const
Returns the color of the Shape.
SumoXMLTag
Numbers representing SUMO-XML - element names.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
void setShapeRelativePath(bool relativePath)
Sets a new relativePath value.
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
friend class GNEChange_Attribute
declare friend class
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
bool isTestingEnabled() const
check if testing mode is enabled
double myHalfImgWidth
The half width of the image when rendering this POI.
int size() const
Returns the number of stored items within the container.
GUIVisualizationSizeSettings poiSize
double getShapeLayer() const
Returns the layer of the Shape.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
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 Point of interest over Lane (used by Netedit)
const GUIGlObject * getGUIGlObject() const
get GUIGlObject associated to this GNEShape
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.
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
void set(double x, double y)
set positions x and y
void drawInnerPOI(const GUIVisualizationSettings &s, bool forceSelectionColor) const
draw inner POI (before pushName() )
GNENet * myNet
the net to inform about updates
void setWidth(double width)
set the image width of the POI
GUIGlID getGlID() const
Returns the numerical id of the object.
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
A class that stores a 2D geometrical boundary.
void replaceParentLanes(GNEShape *elementChild, const std::string &newLaneIDs)
replace the parent edges of a shape
static void drawShapeDottedContourAroundClosedShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape)
draw a dotted contour around the given closed shape with certain width
parameters "key1=value1|key2=value2|...|keyN=valueN"
static void drawShapeDottedContourRectangle(const GUIVisualizationSettings &s, const int type, const Position ¢er, const double width, const double height, const double rotation=0, const double offsetX=0, const double offsetY=0)
draw a dotted contour around the given Position with certain width and height
Network mode (Edges, junctions, etc..)
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
Supermode currentSupermode
the current supermode
double myHalfImgHeight
The half height of the image when rendering this POI.
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
void setHeight(double height)
set the image height of the POI
A point in 2D or 3D with translation and scaling methods.
void updateGeometry()
update pre-computed geometry information
double x() const
Returns the x-position.
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.
std::string myLane
ID of lane in which this POI is placed (main used by netedit)
bool getShapeRelativePath() const
Returns the relativePath of the Shape.
bool showShapes() const
check if shapes has to be hide
static std::vector< Position > myPOIVertices
after every iteration of drawgl, position of vertices that make the circle are saved here....
bool myBlockMovement
flag to block movement
void writeShape(OutputDevice &device)
writte shape element into a xml file
GNEViewNet * getViewNet() const
get view net
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
double myPosLat
latereal position over lane in which this POI is placed (main used by netedit)
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
const POIs & getPOIs() const
Returns all pois.
std::string getAttribute(SumoXMLAttr key) const
method for getting the Attribute of an XML key
void setParametersStr(const std::string ¶msString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const GNEViewNetHelper::TestingMode & getTestingMode() const
get testing mode
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
Transform POI to POILane, and viceversa.
double y() const
Returns the y-position.
static bool isValidTypeID(const std::string &value)
whether the given string is a valid id for an edge or vehicle type
std::string getParentName() const
Returns the name of the parent object.
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
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
void setShapeLayer(const double layer)
Sets a new layer.
block movement of a graphic element
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.
double getWidth() const
Returns the image width of the POI.
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
static void clearTextures()
clears loaded textures
void add(const Position &pos)
Adds the given position to this one.
bool isInitialised() const
check if Boundary is Initialised
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
virtual void setShapeNaviDegree(const double angle)
Sets a new angle in navigational degrees.
const std::string & getTagStr() const
get tag assigned to this object in string format
static const std::string DEFAULT_IMG_FILE
Stores the information about how to visualize structures.
Position myGEOPosition
Position of POI in GEO coordinates (Only used by POIs that aren't placed over lanes)
void startGeometryMoving()
void sety(double y)
set position y
Position getPositionInView() const
Returns position of additional in view.
std::string myID
The name of the object.
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.
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void setz(double z)
set position z
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
GUIGlID getGlID() const
Returns the numerical id of the object.
static const double DEFAULT_LAYER_POI
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
void setShapeColor(const RGBColor &col)
Sets a new color.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Position()
default constructor