42 const double width,
const double length,
const double angle,
43 const double slope,
const std::string& name,
132 const auto& editModes =
myNet->getViewNet()->getEditModes();
134 if (!
myNet->getViewNet()->isCurrentlyMovingElements() && editModes.isCurrentSupermodeNetwork() &&
135 !
myNet->getViewNet()->getEditNetworkElementShapes().getEditedNetworkElement() &&
138 return myNet->getViewNet()->getViewObjectsSelector().getGUIGlObjectFront() ==
this;
179 myNet->removeGLObjectFromGrid(
this);
199 myNet->addGLObjectIntoGrid(
this);
219 if (
myNet->getViewNet()->getDataViewOptions().showAdditionals()) {
233 drawSpace(s, d, parkingSpaceWidth, movingGeometryPoints);
243 if (movingGeometryPoints) {
245 const double snapRadius =
myNet->getViewNet()->getVisualisationSettings().neteditSizeSettings.additionalGeometryPointRadius;
246 const double snapRadiusSquared = snapRadius * snapRadius;
248 const Position mousePosition =
myNet->getViewNet()->getPositionInformation();
382 const double width,
const bool movingGeometryPoints)
const {
406 glTranslated(0, 0, 0.1);
413 if (movingGeometryPoints) {
429 const double width,
const double exaggeration,
const bool movingGeometryPoints)
const {
431 if (movingGeometryPoints) {
433 getType(), exaggeration,
nullptr);
435 exaggeration,
nullptr);
437 exaggeration,
nullptr);
439 myAdditionalContour.calculateContourExtrudedShape(s, d,
this,
myMoveElementViewResizable->myShapeHeight,
getType(), width, exaggeration,
true,
true, 0,
nullptr,
nullptr);
@ NETWORK_MOVE
mode for moving network elements
@ GLO_PARKING_SPACE
a ParkingSpace
const std::string invalid_return< std::string >::value
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_PARKING_SPACE
A parking space for a single vehicle within a parking area.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_PARENT
parent of an additional element
const double INVALID_DOUBLE
invalid double
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void popMatrix()
pop matrix
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
static void drawBoundary(const GUIVisualizationSettings &s, const Boundary &b)
Draw a boundary (used for debugging).
static void pushMatrix()
push matrix
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
void replaceAdditionalParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace additional parent
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
GNEContour myAdditionalContour
variable used for draw additional contours
void drawAdditionalID(const GUIVisualizationSettings &s) const
draw additional ID
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
std::string myAdditionalName
name of additional
void drawAdditionalName(const GUIVisualizationSettings &s) const
draw additional name
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
void drawParentChildLines(const GUIVisualizationSettings &s, const RGBColor &color, const bool onlySymbols=false) const
draw parent and child lines
bool drawMovingGeometryPoints() const
check if draw moving geometry points
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
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....
const std::string & getTagStr() const
get tag assigned to this object in string format
bool isTemplate() const
check if this AC is template
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
void drawInLayer(const double typeOrLayer, const double extraOffset=0) const
draw element in the given layer, or in front if corresponding flag is enabled
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
const GNEHierarchicalContainerParents< GNEAdditional * > & getParentAdditionals() const
get parent additionals
void setParent(ParentType parent)
edit parent and childrens without maintain integrity (use carefully)
A NBNetBuilder extended by visualisation and editing capabilities.
Position myPosOverView
position over view
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this space
void calculateSpaceContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double width, const double exaggeration, const bool movingGeometryPoints) const
calculate space contour
std::string getAdditionalProblem() const override
return a string with the current additional problem (must be reimplemented in all detector children)
std::string getParentName() const override
Returns the name of the parent object.
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
void drawSpace(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double width, const bool movingGeometryPoints) const
draw space
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
void updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
Position getPositionInView() const override
Returns position of additional in view.
std::string getAttribute(SumoXMLAttr key) const override
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
double mySlope
Slope of Parking Space.
~GNEParkingSpace()
Destructor.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Position getAttributePosition(SumoXMLAttr key) const override
Parameterised * getParameters() override
get parameters associated with this space
GNEParkingSpace(GNENet *net)
Constructor.
bool isAdditionalValid() const override
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
bool checkDrawMoveContour() const override
check if draw move contour (red)
GNEMoveElementViewResizable * myMoveElementViewResizable
move element view resizable
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
void fixAdditionalProblem() override
fix additional problem (must be reimplemented in all detector children)
double myAngle
Angle of Parking Space.
void updateGeometry() override
update pre-computed geometry information
double getAttributeDouble(SumoXMLAttr key) const override
bool isValid(SumoXMLAttr key, const std::string &value) override
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Stores the information about how to visualize structures.
bool checkDrawAdditional(Detail d, const bool selected) const
check if draw additionals
Detail getDetailLevel(const double exaggeration) const
return the detail level
GUIVisualizationColorSettings colorSettings
color settings
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
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.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
A point in 2D or 3D with translation and scaling methods.
void scaleAbsolute(double offset)
enlarges/shrinks the polygon by an absolute offset based at the centroid
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 bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
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 RGBColor connectionColor
connection color
RGBColor parkingSpaceColorContour
color for parkingSpace contour
RGBColor parkingSpaceColor
color for parkingSpace innen
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
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