59 undoList->
p_begin(
"apply distance along route");
63 dist += edge->getNBEdge()->getFinalLength();
75 {}, {}, {}, {}, {}, {}, {}, {}),
86 {}, routeParameters.edges, {}, {}, {}, {}, {}, {}),
88 myColor(routeParameters.color),
89 myVClass(routeParameters.vClass) {
97 {}, routeParameters.edges, {}, {}, {}, {}, {vehicleParent}, {}),
99 myColor(routeParameters.color),
100 myVClass(routeParameters.vClass) {
108 {}, route->getParentEdges(), {}, {}, {}, {}, {}, {}),
110 myColor(route->getColor()),
111 myVClass(route->getVClass()) {
131 new FXMenuSeparator(ret);
138 new FXMenuSeparator(ret);
141 new FXMenuSeparator(ret);
157 if (stop->getTagProperty().isStop()) {
158 stop->writeDemandElement(device);
240 if (!i->getTagProperty().isPersonStop() && !i->getTagProperty().isStop()) {
282 routeBoundary.
add(i->getCenteringBoundary());
286 return routeBoundary;
288 return Boundary(-0.1, -0.1, 0.1, 0.1);
298 if (newRouteEdges.size() > 0) {
329 if (segment.isLaneSegment() && (segment.getLane() == lane)) {
351 if (segment.isLaneSegment() && (segment.getLane() == lane)) {
353 if (firstLane == lane) {
356 }
else if (lastLane == lane) {
384 glTranslated(0, 0,
getType() + offsetFront);
465 return canParse<RGBColor>(value);
467 return canParse<bool>(value);
506 const std::map<std::string, std::string>&
514 if (edges.size() == 0) {
516 return (
"list of route edges cannot be empty");
517 }
else if (edges.size() == 1) {
522 auto it = edges.begin();
523 while (it != edges.end() - 1) {
524 const GNEEdge* currentEdge = *it;
525 const GNEEdge* nextEdge = *(it + 1);
527 if (currentEdge->
getID() == nextEdge->
getID()) {
528 return (
"consecutive duplicated edges (" + currentEdge->
getID() +
") aren't allowed in a route");
531 const std::vector<GNEEdge*>& outgoingEdges = currentEdge->
getParentJunctions().back()->getGNEOutgoingEdges();
533 if (std::find(outgoingEdges.begin(), outgoingEdges.end(), nextEdge) == outgoingEdges.end()) {
534 return (
"Edges '" + currentEdge->
getID() +
"' and '" + nextEdge->
getID() +
"' aren't consecutives");
559 myColor = parse<RGBColor>(value);
562 if (parse<bool>(value)) {
FXDEFMAP(GNERoute::GNERoutePopupMenu) GNERoutePopupMenuMap[]
@ MID_COPY_TYPED_NAME
Copy typed object name - popup entry.
@ MID_OPEN_ADDITIONAL_DIALOG
open additional dialog (used in netedit)
@ MID_COPY_NAME
Copy object name - popup entry.
@ MID_GNE_ROUTE_APPLY_DISTANCE
apply distance
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ GNE_TAG_ROUTE_EMBEDDED
embedded route (used in NETEDIT)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_EDGES
the edges of a route
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_COLOR
A color information.
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
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
friend class GNEChange_Attribute
declare friend class
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
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
FXIcon * getIcon() const
get FXIcon associated to this AC
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
GNENet * myNet
pointer to net
static std::string parseIDs(const std::vector< T > &ACs)
parses a list of specific Attribute Carriers into a string of IDs
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
const GNETagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
An Element which don't belongs to GNENet but has influency in the simulation.
GNEGeometry::SegmentGeometry myDemandElementSegmentGeometry
demand element segment geometry (also called "stacked geometry")
void replaceDemandParentEdges(const std::string &value)
replace demand parent edges
GNELane * getLastAllowedVehicleLane() const
get first allowed vehicle lane
GNELane * getFirstAllowedVehicleLane() const
get first allowed vehicle lane
bool isValidDemandElementID(const std::string &newID) const
check if a new demand element ID is valid
const std::string & getID() const
get ID
A road/street connecting two junctions (netedit-version)
class for pack all variables related with DottedGeometry
class for NETEDIT geometries over lanes
bool exist(const GNELane *toLane) const
check if exist a lane2lane geometry for the given tolane
const GNEGeometry::Geometry & getLane2laneGeometry(const GNELane *toLane) const
get lane2lane geometry
const GNEGeometry::DottedGeometry & getLane2laneDottedGeometry(const GNELane *toLane) const
get lane2lane dotted geometry
const std::vector< GNEJunction * > & getParentJunctions() const
get parent junctions
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
std::string getNewListOfParents(const GNENetworkElement *currentElement, const GNENetworkElement *newNextElement) const
if use edge/parent lanes as a list of consecutive elements, obtain a list of IDs of elements after in...
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const GNEGeometry::DottedGeometry & getDottedLaneGeometry() const
get dotted lane geometry
const GNEGeometry::Lane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
void updateID(GNEAttributeCarrier *AC, const std::string newID)
update ID
A NBNetBuilder extended by visualisation and editing capabilities.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
GNEViewNet * getViewNet() const
get view net
const std::string & getID() const
get ID
void calculateConsecutivePathLanes(SUMOVehicleClass vClass, const bool allowedVClass, const std::vector< GNEEdge * > &edges)
calculate consecutive path lanes (used by routes)
const std::vector< GNEPathElements::PathElement > & getPath() const
get path edges
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute)
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
void endGeometryMoving()
end geometry movement
void computePath()
compute path
Position getPositionInView() const
Returns position of additional in view.
SUMOVehicleClass myVClass
SUMOVehicleClass (Only used for drawing)
std::string getParentName() const
Returns the name of the parent object.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const double offsetFront) const
Draws partial object.
void invalidatePath()
invalidate path
void updateGeometry()
update pre-computed geometry information
bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void startGeometryMoving()
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
double getAttributeDouble(SumoXMLAttr key) const
SUMOVehicleClass getVClass() const
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GNERoute(GNENet *net)
default constructor
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
static std::string isRouteValid(const std::vector< GNEEdge * > &edges)
check if a route is valid
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
RGBColor myColor
route color
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
bool isAttributeEnabled(SumoXMLAttr key) const
const RGBColor & getColor() const
get color
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
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...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
GNEUndoList * getUndoList() const
get the undoList object
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
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, GUIGlObjectType objectType, const double extraOffset=0)
draw front attributeCarrier
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
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.
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.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
Stores the information about how to visualize structures.
GUIVisualizationTextSettings addName
GUIVisualizationSizeSettings vehicleSize
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
GUIVisualizationWidthSettings widthSettings
width settings
bool drawDottedContour() const
check if dotted contour can be drawn
GUIVisualizationColorSettings colorSettings
color settings
double scale
information about a lane's width (temporary, used for a single view)
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
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.
static bool areParametersValid(const std::string &value, bool report=false, ParameterisedAttrType attrType=ParameterisedAttrType::STRING, 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"
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
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.
A point in 2D or 3D with translation and scaling methods.
static const RGBColor YELLOW
struct for variables used in Geometry extremes
static void drawDottedContourLane(const DottedContourType type, const GUIVisualizationSettings &s, const DottedGeometry &dottedGeometry, const double width, const bool drawFirstExtrem, const bool drawLastExtrem)
draw dotted contour for the given dottedGeometry (used by lanes, routes, etc.)
static void calculateLaneGeometricPath(GNEGeometry::SegmentGeometry &segmentGeometry, const std::vector< GNEPathElements::PathElement > &path, GNEGeometry::ExtremeGeometry &extremeGeometry)
calculate route between lanes
static void drawSegmentGeometry(const GNEViewNet *viewNet, const SegmentGeometry::Segment &segment, const double width)
draw geometry segment
static void drawGeometry(const GNEViewNet *viewNet, const Geometry &geometry, const double width)
draw geometry
struct for saving route parameters
bool showDemandElements() const
check if show demand elements checkbox is enabled
bool showNonInspectedDemandElements(const GNEDemandElement *demandElement) const
check if non inspected element has to be hidden
bool showDemandElements() const
check if show demand elements checkbox is enabled
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
static const double route
width for routes