40 {}, {}, {}, {}, {}, {}, {}, {}) {
48 {}, {}, {}, {stoppingPlace}, {}, {}, {stopParent}, {}),
63 {}, {}, {lane}, {}, {}, {}, {stopParent}, {}),
72 {}, {edge}, {}, {}, {}, {}, {stopParent}, {}),
168 write(device,
true,
false);
183 }
else if (firstLane !=
nullptr) {
189 if ((endPosFixed <=
getParentEdges().front()->getNBEdge()->getFinalLength()) && (endPosFixed > 0)) {
206 double laneLength =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() *
getParentLanes().front()->getLengthGeometryFactor();
209 double endPosCopy =
endPos;
211 if (startPosCopy < 0) {
212 startPosCopy += laneLength;
214 if (endPosCopy < 0) {
215 endPosCopy += laneLength;
218 if ((startPosCopy >= 0) && (endPosCopy <=
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) && ((endPosCopy - startPosCopy) >= POSITION_EPS)) {
235 const double laneLength =
getParentEdges().front()->getNBEdge()->getFinalLength();
239 if (endPosFixed < 0) {
241 }
else if (endPosFixed >
getParentEdges().front()->getNBEdge()->getFinalLength()) {
250 double endPosCopy =
endPos;
252 double laneLength =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
254 if (startPosCopy < 0) {
255 startPosCopy += laneLength;
257 if (endPosCopy < 0) {
258 endPosCopy += laneLength;
261 std::string errorStart, separator, errorEnd;
263 if (startPosCopy < 0) {
265 }
else if (startPosCopy >
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
268 if (endPosCopy < 0) {
270 }
else if (endPosCopy >
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
274 if ((errorStart.size() > 0) && (errorEnd.size() > 0)) {
277 return errorStart + separator + errorEnd;
604 return laneShape.front();
606 return laneShape.back();
649 if (nextPersonPlan) {
664 if (nextPersonPlan) {
684 if (nextPersonPlan) {
732 if (canParse<SUMOTime>(value)) {
733 return parse<SUMOTime>(value) >= 0;
741 const std::set<std::string> expectedValues = {
"true",
"false",
"person",
"container",
"join"};
742 const std::vector<std::string> triggeredValues = parse<std::vector<std::string> >(value);
743 for (
const auto& triggeredValue : triggeredValues) {
744 if (expectedValues.find(triggeredValue) == expectedValues.end()) {
754 const std::vector<std::string> expectedValues = parse<std::vector<std::string> >(value);
755 for (
const auto& expectedValue : expectedValues) {
763 return canParse<bool>(value);
792 if (canParse<double>(value)) {
799 return canParse<double>(value) && fabs(parse<double>(value)) <
getParentEdges().front()->getNBEdge()->getFinalLength();
800 }
else if (canParse<double>(value)) {
806 return canParse<bool>(value);
811 return canParse<double>(value);
815 return canParse<bool>(value);
899 const std::map<std::string, std::string>&
907 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
911 return fixedPos *
getParentLanes().front()->getLengthGeometryFactor();
918 const double len =
getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
922 return fixedPos *
getParentLanes().front()->getLengthGeometryFactor();
935 if (pLane->allowPedestrians()) {
966 const double width = stopLane ? stopLane->getParentEdge()->getNBEdge()->getLaneWidth(stopLane->getIndex()) * 0.5 : exaggeration * 0.8;
981 exaggeration * 0.1, 0, width);
985 exaggeration * 0.1, 0, width * -1);
995 glTranslated(0, exaggeration * 0.5, 0);
999 glTranslated(0, 1, 0.1);
1008 glTranslated(0, 1.4, 0);
1029 width, exaggeration,
true,
true);
1033 width, exaggeration,
true,
true);
1055 glTranslated(0, 0, .1);
1071 glRotated(180, 0, 0, 1);
1080 glRotated(22.5, 0, 0, 1);
1084 glTranslated(0, 0, 0);
1097 exaggeration, 1, 1);
1101 exaggeration, 1, 1);
1131 glRotated(-90, 0, 0, 1);
1140 glRotated(22.5, 0, 0, 1);
1144 glTranslated(0, 0, 0);
1157 exaggeration, 1, 1);
1161 exaggeration, 1, 1);
1173 if (value.empty()) {
1181 if (value.empty()) {
1189 if (value.empty()) {
1197 if (value ==
"join") {
1200 }
else if ((value ==
"person") || (value ==
"true")) {
1203 }
else if (value ==
"container") {
1225 if (value.empty()) {
1265 endPos = parse<double>(value);
1272 if (value.empty()) {
1277 posLat = parse<double>(value);
1282 if (parse<bool>(value)) {
1427 glTranslated(0, 0, 0.1);
@ DEMAND_MOVE
mode for moving demand elements
std::string time2string(SUMOTime t)
convert SUMOTime to string
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PEDESTRIAN
pedestrian
const int STOP_DURATION_SET
const int STOP_POSLAT_SET
const int STOP_EXPECTED_SET
const int STOP_PARKING_SET
const int STOP_CONTAINER_TRIGGER_SET
const int STOP_EXTENSION_SET
const int STOP_TRIGGER_SET
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_STOP_LANE
stop placed over a lane (used in netedit)
@ GNE_TAG_STOPCONTAINER_EDGE
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_STOP
stop for vehicles
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_STOP_PARKINGAREA
stop placed over a parking area (used in netedit)
@ GNE_TAG_STOPPERSON_EDGE
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_CONTAINER_STOP
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_CHARGING_STATION
@ SUMO_ATTR_EXPECTED_CONTAINERS
const double INVALID_DOUBLE
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
bool isInitialised() const
check if Boundary is Initialised
Boundary & grow(double by)
extends the boundary by the given amount
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
static void pushName(unsigned int name)
push Name
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 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 drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, const int align=0, double width=-1)
An Element which don't belongs to GNENet but has influency in the simulation.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
friend class GNEChange_EnableAttribute
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
An Element which don't belongs to GNENet but has influency in the simulation.
void replaceDemandParentEdges(const std::string &value)
replace demand parent edges
Problem isPersonPlanValid() const
check if person plan is valid
GUIGeometry myDemandElementGeometry
demand element geometry (also called "stacked geometry")
std::string getPersonPlanProblem() const
get person plan problem
void replaceDemandParentLanes(const std::string &value)
replace demand parent lanes
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform demand element changes
void replaceAdditionalParent(SumoXMLTag tag, const std::string &value)
replace additional parent
Problem
enum class for demandElement problems
bool drawPersonPlan() const
const std::string & getID() const
get ID
A road/street connecting two junctions (netedit-version)
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
const double halfWidth
Draw as a normal lane, and reduce width to make sure that a selected edge can still be seen.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const PositionVector & getLaneShape() const
get elements shape
double getLengthGeometryFactor() const
get length geometry factor
double myMoveElementLateralOffset
move element lateral offset (used by elements placed over lanes
bool getAllowChangeLane() const
allow change lane
bool getLeaveStopPersonsConnected() const
check if leave stopPersonConnected is enabled
DemandModeOptions * getDemandModeOptions() const
get demand mode options
CommonModeOptions * getCommonModeOptions() const
get common mode options
const GNELane * newFirstLane
new first Lane
double newFirstPos
new first position
const GNEMoveOperation::OperationType operationType
move operation
double firstLaneOffset
lane offset
double newSecondPos
new second position
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.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
A NBNetBuilder extended by visualisation and editing capabilities.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEViewNet * getViewNet() const
get view net
const std::string & getID() const
get ID
const RGBColor & getColor() const
get color
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters)
method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute)
std::string getBegin() const
get begin time of demand element
SUMOVehicleClass getVClass() const
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
GNEStop(SumoXMLTag tag, GNENet *net)
default constructor
GNELane * getFirstPathLane() const
get first path lane
Position getAttributePosition(SumoXMLAttr key) const
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Position getPositionInView() const
Returns position of demand element in view.
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
bool isAttributeEnabled(SumoXMLAttr key) const
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object.
GNELane * getLastPathLane() const
get last path lane
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
GNEMoveOperation * getMoveOperation()
get move operation
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Boundary myMovingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE)
std::string getParentName() const
Returns the name of the parent object.
void drawStopPersonOverBusStop(const GUIVisualizationSettings &s, const double exaggeration) const
draw stopPerson over busStop
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
double getAttributeDouble(SumoXMLAttr key) const
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
void drawGeometryPoints(const GUIVisualizationSettings &s, const RGBColor &baseColor) const
draw geometry points
Problem isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
void computePathElement()
compute pathElement
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
void drawStopPersonOverEdge(const GUIVisualizationSettings &s, const double exaggeration) const
draw stopPerson over lane
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
void drawVehicleStop(const GUIVisualizationSettings &s, const double exaggeration) const
draw vehicle stop
double getStartGeometryPositionOverLane() const
get start position over lane that is applicable to the shape
bool canDrawVehicleStop() const
check if vehicle stop can be draw
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
void updateGeometry()
update pre-computed geometry information
double getEndGeometryPositionOverLane() const
get end position over lane that is applicable to the shape
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
const GNELane * getFirstAllowedLane() const
get first valid lane
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool isStopPerson() const
return true if tag correspond to a person stop element
bool isStopContainer() const
return true if tag correspond to a container stop element
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute "attr"
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 add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed modul
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
GNEViewParent * getViewParent() const
get the net 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 void drawDottedContourShape(const DottedContourType type, const GUIVisualizationSettings &s, const PositionVector &shape, const double width, const double exaggeration, const bool drawFirstExtrem, const bool drawLastExtrem, const double lineWidth=-1)
draw dotted contour for the given shape (used by additionals)
static void rotateOverLane(const double rot)
rotate over lane (used by Lock icons, detector logos, etc.)
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
static void drawGeometry(const GUIVisualizationSettings &s, const Position &mousePos, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
const std::vector< double > & getShapeLengths() const
The lengths of the single shape parts.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
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
GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings addName
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
GUIVisualizationDetailSettings detailSettings
detail settings
GUIVisualizationSizeSettings addSize
GUIVisualizationColorSettings colorSettings
color settings
double scale
information about a lane's width (temporary, used for a single view)
GUIVisualizationStoppingPlaceSettings stoppingPlaceSettings
StoppingPlace settings.
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
GUIVisualizationAdditionalSettings additionalSettings
Additional settings.
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
Static storage of an output device and its base (abstract) implementation.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
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.
double length2D() const
Returns the length.
double distance2D(const Position &p, bool perpendicular=false) const
closest 2D-distance to point p (or -1 if perpendicular is true and the point is beyond this vector)
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
Position getLineCenter() const
get line center
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
static const RGBColor WHITE
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
static bool isStopPosValid(const double startPos, const double endPos, const double laneLength, const double minLength, const bool friendlyPos)
check if start and end position of a stop is valid
Definition of vehicle stop (position and duration)
std::string edge
The edge to stop at (used only in NETEDIT)
SUMOTime extension
The maximum time extension for boarding / loading.
bool friendlyPos
enable or disable friendly position (used by NETEDIT)
double startPos
The stopping position start.
double posLat
the lateral offset when stopping
int parametersSet
Information for the output which parameter were set.
SUMOTime until
The time at which the vehicle may continue its journey.
std::string actType
act Type (only used by Persons) (used by NETEDIT)
bool triggered
whether an arriving person lets the vehicle continue
void write(OutputDevice &dev, const bool close=true, const bool writeTagAndParents=true) const
Writes the stop as XML.
double endPos
The stopping position end.
bool parking
whether the vehicle is removed from the net while stopping
std::set< std::string > awaitedPersons
IDs of persons the vehicle has to wait for until departing.
std::string tripId
id of the trip within a cyclical public transport route
bool containerTriggered
whether an arriving container lets the vehicle continue
SUMOTime duration
The stopping duration.
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
bool showAllTrips() const
check if trips has to be drawn
DemandEditMode demandEditMode
the current Demand edit mode
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
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 vaporizerSize
Vaporizer size.
RGBColor selectedPersonPlanColor
person plan selection color (Rides, Walks, stopPersons...)
RGBColor stopPersonColor
color for stopPersons
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
RGBColor stopColor
color for Stops
static const double laneTextures
details for lane textures
static const double stopsText
details for stop texts
static const double stopsDetails
details for stops
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
static const double busStopWidth
busStop width