 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
62 GNERoute* route = static_cast<GNERoute*>(myObject);
63 GNEViewNet* viewNet = static_cast<GNEViewNet*>(myParent);
65 undoList->
p_begin(
"apply distance along route");
69 dist += edge->getNBEdge()->getFinalLength();
81 {}, {}, {}, {}, {}, {}, {}, {}, {}, {}),
90 routeParameters.edges, {}, {}, {}, {}, {}, {}, {}, {}, {}),
92 myColor(routeParameters.color),
93 myVClass(routeParameters.vClass) {
99 routeParameters.edges, {}, {}, {}, {vehicleParent}, {}, {}, {}, {}, {}),
101 myColor(routeParameters.color),
102 myVClass(routeParameters.vClass) {
108 route->getParentEdges(), {}, {}, {}, {}, {}, {}, {}, {}, {}),
110 myColor(route->getColor()),
111 myVClass(route->getVClass()) {
127 new FXMenuCommand(ret, (
"Copy " +
getTagStr() +
" name to clipboard").c_str(),
nullptr, ret,
MID_COPY_NAME);
129 new FXMenuSeparator(ret);
136 new FXMenuSeparator(ret);
139 new FXMenuSeparator(ret);
155 if (i->getTagProperty().isStop()) {
156 i->writeDemandElement(device);
189 return (
"A route need at least one edge");
194 return (
"Edge '" +
getParentEdges().at((
int)i - 1)->getID() +
"' and edge '" +
getParentEdges().at(i)->getID() +
"' aren't consecutives");
264 if (!i->getTagProperty().isPersonStop() && !i->getTagProperty().isStop()) {
277 if (!i->getTagProperty().isPersonStop() && !i->getTagProperty().isStop()) {
278 i->updatePartialGeometry(edge);
313 routeBoundary.
add(i->getCenteringBoundary());
317 return routeBoundary;
319 return Boundary(-0.1, -0.1, 0.1, 0.1);
332 if (newRouteEdges.size() > 0) {
433 return canParse<RGBColor>(value);
435 return canParse<bool>(value);
489 myColor = parse<RGBColor>(value);
492 if (parse<bool>(value)) {
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_NMODE_SELECT
GNEViewNet * myViewNet
The GNEViewNet this demand element element belongs.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
GNELane * getLastAllowedVehicleLane() const
get first allowed vehicle lane
FXIcon * getIcon() const
get FXIcon associated to this AC
An Element which don't belongs to GNENet but has influency in the simulation.
void updateGeometry()
update pre-computed geometry information
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
void replaceParentEdges(GNEShape *elementChild, const std::string &newEdgeIDs)
replace the parent edges of a shape
static void calculateEdgeGeometricPath(const GNEAttributeCarrier *AC, GNEGeometry::SegmentGeometry &segmentGeometry, const std::vector< GNEEdge * > &edges, const SUMOVehicleClass vClass, GNELane *fromLane, GNELane *toLane, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
calculate route between edges
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute)
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
bool isValidDemandElementID(const std::string &newID) const
check if a new demand element ID is valid
An upper class for objects with additional parameters.
static RouteCalculator * getRouteCalculatorInstance()
obtain instance of RouteCalculator
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
void selectAttributeCarrier(bool changeFlag=true)
inherited from GNEAttributeCarrier
Static storage of an output device and its base (abstract) implementation.
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
FXDEFMAP(GNERoute::GNERoutePopupMenu) GNERoutePopupMenuMap[]
void endGeometryMoving()
end geometry movement
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
static std::string parseIDs(const std::vector< T > &ACs)
parses a list of specific Attribute Carriers into a string of IDs
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
void invalidatePath()
invalidate path
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
static const RGBColor YELLOW
GNELane * getFirstAllowedVehicleLane() const
get first allowed vehicle lane
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
open additional dialog (used in netedit)
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
Copy object name - popup entry.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
Position getPositionInView() const
Returns position of additional in view.
GNEGeometry::SegmentGeometry myDemandElementSegmentGeometry
demand element segment geometry
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
A road/street connecting two junctions (netedit-version)
friend class GNEChange_Attribute
declare friend class
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void changeDemandElementID(const std::string &newID)
change ID of demand element
GNENet * getNet() const
get the net object
SUMOVehicleClass myVClass
SUMOVehicleClass (Only used for drawing)
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
struct for saving route parameters
void startGeometryMoving()
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
vehicle is a passenger car (a "normal" car)
GNEEdge * getFromEdge() const
GUIGlID getGlID() const
Returns the numerical id of the object.
A class that stores a 2D geometrical boundary.
begin/end of the description of an edge
parameters "key1=value1|key2=value2|...|keyN=valueN"
GNEEdge * getToEdge() const
obtain to edge of this demand element
bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
A point in 2D or 3D with translation and scaling methods.
void computePath()
compute path
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
const TagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
GNEUndoList * getUndoList() const
get the undoList object
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
static void updateGeometricPath(GNEGeometry::SegmentGeometry &segmentGeometry, const GNEEdge *edge, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
calculate route between edges
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
std::string getAttribute(SumoXMLAttr key) const
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
std::string getNewListOfParents(const GNENetElement *currentElement, const GNENetElement *newNextElement) const
if use edge/parent lanes as a list of consecutive elements, obtain a list of IDs of elements after in...
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
void updatePartialGeometry(const GNEEdge *edge)
partial update pre-computed geometry information
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
void setParametersStr(const std::string ¶msString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
bool isAttributeEnabled(SumoXMLAttr key) const
bool areEdgesConsecutives(SUMOVehicleClass vClass, GNEEdge *from, GNEEdge *to) const
check if exist a route between the two given consecutives edges
RGBColor myColor
route color
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
std::string getParentName() const
Returns the name of the parent object.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
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 getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
GUISelectedStorage gSelected
A global holder of selected objects.
const std::string & getDemandElementID() const
returns DemandElement ID
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
static bool isRouteValid(const std::vector< GNEEdge * > &edges, bool report)
check if a route is valid
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
begin/end of the description of a route
bool isInitialised() const
check if Boundary is Initialised
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void removeLockedObject(const GUIGlObjectType type)
set object unselected
const std::string & getTagStr() const
get tag assigned to this object in string format
Copy typed object name - popup entry.
Stores the information about how to visualize structures.
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...
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
begin/end of the description of a embedded route (used in NETEDIT)
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GNERoute(GNEViewNet *viewNet)
default constructor
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
void deselect(GUIGlID id)
Deselects the object with the given id.
GNEViewParent * getViewParent() const
get the net object
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
const RGBColor & getColor() const
get color
void addedLockedObject(const GUIGlObjectType type)
set object selected