51 const bool geo,
POIIcon icon,
const double layer,
const double angle,
const std::string& imgFile,
const double width,
53 Shape(id, type, color, layer, angle, imgFile,
""),
75 const bool friendlyPos,
const double posLat,
POIIcon icon,
const double layer,
const double angle,
const std::string& imgFile,
const double width,
77 Shape(id, type, color, layer, angle, imgFile, name),
145 return POIBaseObject;
263 myNet->removeGLObjectFromGrid(
this);
283 myNet->addGLObjectIntoGrid(
this);
303 const auto& editModes =
myNet->getViewNet()->getEditModes();
305 if (!
myNet->getViewNet()->isCurrentlyMovingElements() && editModes.isCurrentSupermodeNetwork() &&
306 !
myNet->getViewNet()->getEditNetworkElementShapes().getEditedNetworkElement() &&
309 return myNet->getViewNet()->getViewObjectsSelector().getGUIGlObjectFront() ==
this;
321 return myNet->getMicrosimID();
358 if (
myNet->getViewNet()->getDemandViewOptions().showShapes() &&
359 myNet->getViewNet()->getDataViewOptions().showShapes()) {
371 drawPOI(s, d, movingGeometryPoints);
375 if (movingGeometryPoints) {
377 const double snapRadius =
myNet->getViewNet()->getVisualisationSettings().neteditSizeSettings.additionalGeometryPointRadius;
378 const double snapRadiusSquared = snapRadius * snapRadius;
380 const Position mousePosition =
myNet->getViewNet()->getPositionInformation();
414 return TL(
"No geo-conversion defined");
420 return TL(
"No geo-conversion defined");
461 return GEOPosition.
x();
471 return GEOPosition.
y();
621 const bool movingGeometryPoints)
const {
653 glTranslated(0, 0, 0.1);
655 glRotated(180, 0, 0, 1);
671 glTranslated(namePos.
x(), namePos.
y(), 0);
675 glRotated(-s.
angle, 0, 0, 1);
677 glRotated(s.
angle, 0, 0, 1);
681 const int align = (lines.size() > 1 ? 1 : 2) | 16;
682 for (std::string& line : lines) {
684 glRotated(-s.
angle, 0, 0, 1);
686 glRotated(s.
angle, 0, 0, 1);
693 if (movingGeometryPoints) {
709 const double exaggeration,
const bool movingGeometryPoints)
const {
711 if (movingGeometryPoints) {
725 myAdditionalContour.calculateContourRectangleShape(s, d,
this,
getPositionInView(),
myHeight * 0.5,
myWidth * 0.5,
getShapeLayer(), 0, 0,
getShapeNaviDegree(), exaggeration, parentEdgeBoundary);
791 if (
getID().size() > 0) {
792 myNet->removeGLObjectFromGrid(
this);
798 if (
getID().size() > 0) {
799 myNet->addGLObjectIntoGrid(
this);
827 if (
getID().size() > 0) {
@ NETWORK_MOVE
mode for moving network elements
@ MID_GNE_POI_ATTACH
attach POI to lane
@ MID_GNE_POI_TRANSFORM_POIGEO
Transform to POI Geo.
@ MID_GNE_POI_RELEASE
release POI from lane
@ MID_GNE_POI_TRANSFORM_POI
Transform to POI.
@ GLO_FRONTELEMENT
front element (used in netedit)
const std::string invalid_return< std::string >::value
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.
@ 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 setTag(const SumoXMLTag tag)
set SumoBaseObject tag
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 drawFilledCircle(const double widradiusth, const int steps=8)
Draws a filled circle around (0,0).
static void popMatrix()
pop matrix
static void drawBoundary(const GUIVisualizationSettings &s, const Boundary &b)
Draw a boundary (used for debugging).
static void drawRectangle(const Position ¢er, const double width, const double height)
Draws a rectangle line.
static void pushMatrix()
push matrix
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
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
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
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
std::string myAdditionalName
name of additional
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
void writeAdditionalAttributes(OutputDevice &device) const
write common additional attributes
Boundary myAdditionalBoundary
Additional Boundary (used only by additionals placed over grid).
GNEAdditional(const std::string &id, GNENet *net, const std::string &filename, SumoXMLTag tag, const std::string &additionalName)
Constructor.
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
bool drawMovingGeometryPoints() const
check if draw moving geometry points
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
bool myDrawInFront
boolean to check if drawn this AC over other elements
bool mySelected
boolean to check if this AC is selected (more quickly as checking GUIGlObjectStorage)
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
PositionVector getCommonAttributePositionVector(SumoXMLAttr key) const
const std::string & getTagStr() const
get tag assigned to this object in string format
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNENet * myNet
pointer to net
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 setParent(ParentType parent)
edit parent and childrens without maintain integrity (use carefully)
const GNEHierarchicalContainerParents< GNELane * > & getParentLanes() const
get parent lanes
A NBNetBuilder extended by visualisation and editing capabilities.
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.
void drawPOI(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const bool movingGeometryPoints) const
draw POI
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)
Position getAttributePosition(SumoXMLAttr key) const override
Parameterised * getParameters() override
get parameters associated with this POI
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)
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
const std::string getID() const override
get ID (all Attribute Carriers have one)
GNEMoveElementLaneSingle * myMoveElementLaneSingle
move element over single lane
bool isAttributeEnabled(SumoXMLAttr key) const override
GNEMoveElementViewResizable * myMoveElementViewResizable
move element view resizable
double myPosLat
lateral position;
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this POI
double getAttributeDouble(SumoXMLAttr key) const override
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
POIIcon myPOIIcon
POI icon.
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)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
Position myPosOverView
position over view
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.
CommonXMLStructure::SumoBaseObject * getSumoBaseObject() const
get SUMOBaseObject with all POIattributes
bool myFriendlyPos
friendly position
double myPosOverLane
position over lane
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void buildPopUpMenuCommonOptions(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, GUISUMOAbstractView *parent, const SumoXMLTag tag, const bool selected, bool addSeparator=true)
GUIGlID getGlID() const
Returns the numerical id of the object.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static void setPOIColor(const GUIVisualizationSettings &s, const RGBColor &shapeColor, const GUIGlObject *o, const bool forceSelectionColor)
set POI color
static bool checkDraw(const GUIVisualizationSettings &s, const GUIGlObject *o)
check if POI can be drawn
static GUIGlID getPOITexture(POIIcon POIIcon)
returns texture associated to the given POI image
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
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
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
GUIVisualizationTextSettings poiType
GUIVisualizationSizeSettings poiSize
GUIVisualizationTextSettings poiName
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
double scale
information about a lane's width (temporary, used for a single view)
GUIVisualizationTextSettings poiText
std::string poiTextParam
key for rendering poi textual parameter
int poiDetail
The detail level for drawing POIs.
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
double angle
The current view rotation angle.
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.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
An upper class for objects with additional parameters.
std::map< std::string, std::string > Map
parameters map
Parameterised()
Default constructor.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
double y() const
Returns the y-position.
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
static const RGBColor RED
named colors
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)
static const double DEFAULT_LAYER_POI
void setShapeLayer(const double layer)
Sets a new layer.
void writeShapeAttributes(OutputDevice &device, const RGBColor &defaultColor, const double defaultLayer) const
write shape attributes in a xml file
static const double DEFAULT_IMG_WIDTH
static const std::string DEFAULT_IMG_FILE
const std::string & getShapeType() const
Returns the (abstract) type of the Shape.
void setShapeType(const std::string &type)
Sets a new type.
virtual void setShapeNaviDegree(const double angle)
Sets a new angle in navigational degrees.
void setShapeImgFile(const std::string &imgFile)
Sets a new imgFile.
static const double DEFAULT_IMG_HEIGHT
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.
Shape(const std::string &id)
default consructor
const RGBColor & getShapeColor() const
Returns the color of the Shape.
double getShapeNaviDegree() const
Returns the angle of the Shape in navigational degrees.
static const int NEWLINE
identifier for splitting the given string at all newline characters
std::vector< std::string > getVector()
return vector of strings
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
bool show(const GUIGlObject *o) const
whether to show the text
double scaledSize(double scale, double constFactor=0.1) const
get scale size