66 undoList->
p_begin(
"apply distance along route");
70 dist += edge->getNBEdge()->getFinalLength();
82 {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
91 routeParameters.edges, {}, {}, {}, {}, {}, {}, {}, {}, {}),
100 routeParameters.edges, {}, {}, {}, {vehicleParent}, {}, {}, {}, {}, {}),
102 myColor(routeParameters.color),
109 route->
getEdgeParents(), {}, {}, {}, {}, {}, {}, {}, {}, {}),
128 new FXMenuCommand(ret, (
"Copy " +
getTagStr() +
" name to clipboard").c_str(),
nullptr, ret,
MID_COPY_NAME);
130 new FXMenuSeparator(ret);
137 new FXMenuSeparator(ret);
140 new FXMenuSeparator(ret);
156 if (i->getTagProperty().isStop()) {
157 i->writeDemandElement(device);
190 return (
"A route need at least one edge");
195 return (
"Edge '" +
getEdgeParents().at((
int)i - 1)->getID() +
"' and edge '" +
getEdgeParents().at(i)->getID() +
"' aren't consecutives");
271 std::vector<std::pair<GNEEdge*, GNENetElement::NetElementGeometry> > laneGeometries;
272 std::vector<PositionVector> connectionShapes;
275 laneGeometries.push_back(std::make_pair(i, i->getLaneByVClass(
myVClass)->getGeometry()));
278 connectionShapes.resize(laneGeometries.size());
285 bool connectionFound =
false;
291 if (c.customShape.size() != 0) {
292 connectionShapes.at(i) = c.customShape;
294 if (c.shape.size() != 0) {
295 connectionShapes.at(i) = c.shape;
298 connectionShapes.at(i).append(c.viaShape);
303 PositionVector laneShapeTo = c.toEdge->getLanes().at(c.toLane).shape;
310 (double) 5. * (
double) c.toEdge->getNumLanes());
314 connectionFound =
true;
319 for (
int i = 0; i < (int)laneGeometries.size(); i++) {
321 for (
int j = 0; j < (int)laneGeometries.at(i).second.shape.size(); j++) {
323 if (j < (
int)laneGeometries.at(i).second.shape.size() - 1) {
325 laneGeometries.at(i).second.shape[j], laneGeometries.at(i).second.shapeLengths[j],
326 laneGeometries.at(i).second.shapeRotations[j],
true,
true);
329 laneGeometries.at(i).second.shape[j],
true,
true);
333 for (
const auto& connectionShapePos : connectionShapes.at(i)) {
366 routeBoundary.
add(i->getCenteringBoundary());
370 return routeBoundary;
372 return Boundary(-0.1, -0.1, 0.1, 0.1);
471 return canParse<RGBColor>(value);
473 return canParse<bool>(value);
511 result += i.first +
"=" + i.second +
"|";
514 if (!result.empty()) {
521 std::vector<std::pair<std::string, std::string> >
523 std::vector<std::pair<std::string, std::string> > result;
526 result.push_back(std::make_pair(i.first, i.second));
537 std::vector<std::string> parsedValues;
540 parsedValues.push_back(stValues.
next());
543 for (
auto i : parsedValues) {
544 std::vector<std::string> parsedParameters;
547 parsedParameters.push_back(stParam.
next());
551 setParameter(parsedParameters.front(), parsedParameters.back());
572 myColor = parse<RGBColor>(value);
575 if (parse<bool>(value)) {
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
const TagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
static bool isRouteValid(const std::vector< GNEEdge *> &edges, bool report)
check if a route is valid
Copy object name - popup entry.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
A structure which describes a connection between edges or lanes.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
double getAttributeDouble(SumoXMLAttr key) const
void addedLockedObject(const GUIGlObjectType type)
set object selected
Position getPositionInView() const
Returns position of additional in view.
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
struct for saving route parameters
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
Stores the information about how to visualize structures.
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
GNEViewParent * getViewParent() const
get the net object
const RGBColor & getColor() const
get color
The representation of a single edge during network building.
bool geometryDeprecated
mark geometry as deprecated (used to avoid multiple updates)
void startGeometryMoving()
static std::string parseIDs(const std::vector< T > &ACs)
parses a list of specific Attribute Carriers into a string of IDs
void insertEdgeLengthRotSegment(const GNEDemandElement *element, const GNEEdge *edge, const Position pos, double length, double rotation, const bool visible, const bool valid)
insert edge segment with length and rotation (used to avoid unnecessary calculation in calculateParti...
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
FXIcon * getIcon() const
get FXIcon associated to this AC
NBEdge * getTurnDestination(bool possibleDestination=false) const
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...
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
FXDEFMAP(GNERoute::GNERoutePopupMenu) GNERoutePopupMenuMap[]
void changeDemandElementID(const std::string &newID)
change ID of demand element
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
bool hasNext()
returns the information whether further substrings exist
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) ...
A class that stores a 2D geometrical boundary.
static RouteCalculator * getRouteCalculatorInstance()
obtain instance of RouteCalculator
begin/end of the description of a route
const std::vector< GNEEdge * > & getEdgeParents() const
get edge parents
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
GNEEdge * getToEdge() const
obtain to edge of this demand element
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
double area() const
Returns the area (0 for non-closed)
void endGeometryMoving()
end geometry movement
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
std::string getAttribute(SumoXMLAttr key) const
GNEUndoList * getUndoList() const
get the undoList object
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
int getNumLanes() const
Returns the number of lanes.
A point in 2D or 3D with translation and scaling methods.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
DemandElementSegmentGeometry myDemandElementSegmentGeometry
demand element segment geometry
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
void removeLockedObject(const GUIGlObjectType type)
set object unselected
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
friend class GNEChange_Attribute
declare friend class
bool isValidDemandElementID(const std::string &newID) const
check if a new demand element ID is valid
void calculatePartialShapeRotationsAndLengths()
calculate partial shape, rotations and lengths
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes ...
const std::string & getDemandElementID() const
returns DemandElement ID
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children) ...
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_NMODE_SELECT
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void insertEdgeSegment(const GNEDemandElement *element, const GNEEdge *edge, const Position pos, const bool visible, const bool valid)
insert edge segment
void clearDemandElementSegmentGeometry()
clear demand element geometry
SUMOVehicleClass myVClass
SUMOVehicleClass (Only used for drawing)
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
vehicle is a passenger car (a "normal" car)
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
bool areEdgesConsecutives(SUMOVehicleClass vClass, GNEEdge *from, GNEEdge *to) const
check if exist a route between the two given consecutives edges
const PositionVector & getShape() const
retrieve the junction shape
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
A road/street connecting two junctions (netedit-version)
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
GNEEdge * getFromEdge() const
static const RGBColor YELLOW
void deselect(GUIGlID id)
Deselects the object with the given id.
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
const std::string & getTagStr() const
get tag assigned to this object in string format
bool isInitialised() const
check if Boundary is Initialised
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
void updateGeometry()
update pre-computed geometry information
open additional dialog (used in netedit)
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
Parameterised()
Constructor.
GNENet * getNet() const
get the net object
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
begin/end of the description of a embedded route (used in NETEDIT)
GUIGlID getGlID() const
Returns the numerical id of the object.
std::vector< Connection > getConnectionsFromLane(int lane, NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
GNERoute(GNEViewNet *viewNet)
default constructor
void changeEdgeParents(GNEShape *elementChild, const std::string &newEdgeIDs)
change edge parents of a shape
bool isAttributeEnabled(SumoXMLAttr key) const
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GNEViewNet * myViewNet
The GNEViewNet this demand element element belongs.
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which demand element element is located.
Static storage of an output device and its base (abstract) implementation.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
RGBColor myColor
route color
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
PositionVector computeSmoothShape(const PositionVector &begShape, const PositionVector &endShape, int numPoints, bool isTurnaround, double extrapolateBeg, double extrapolateEnd, NBNode *recordError=0, int shapeFlag=0) const
Compute a smooth curve between the given geometries.
void compute()
compute demand element
GUISelectedStorage gSelected
A global holder of selected objects.
Copy typed object name - popup entry.
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc.)
NBNode * getToNode() const
Returns the destination node of the edge.
void selectAttributeCarrier(bool changeFlag=true)
inherited from GNEAttributeCarrier
void insertJunctionSegment(const GNEDemandElement *element, const GNEJunction *junction, const Position pos, const bool visible, const bool valid)
insert junction segment
std::string getGenericParametersStr() const
return generic parameters in string format
std::string getParentName() const
Returns the name of the parent object.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
An Element which don't belongs to GNENet but has influency in the simulation.
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
void clearParameter()
Clears the parameter map.