 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
46 edges, {}, {}, {}, {personParent}, {}, {}, {}, {}, {}),
48 myArrivalPosition(arrivalPosition) {
54 edges, {}, {}, {busStop}, {personParent}, {}, {}, {}, {}, {}),
56 myArrivalPosition(-1) {
62 {}, {}, {}, {}, {personParent, routeParent}, {}, {}, {}, {}, {}),
64 myArrivalPosition(arrivalPosition) {
80 new FXMenuCommand(ret, (
"Copy " +
getTagStr() +
" name to clipboard").c_str(),
nullptr, ret,
MID_COPY_NAME);
82 new FXMenuSeparator(ret);
89 new FXMenuSeparator(ret);
152 return (
"A walk need at least one edge");
157 return (
"Edge '" +
getEdgeParents().at((
int)i - 1)->getID() +
"' and edge '" +
getEdgeParents().at(i)->getID() +
"' aren't consecutives");
242 newPosition.
add(offset);
249 std::cout << offsetLane << std::endl;
297 walkBoundary.
add(i->getCenteringBoundary());
303 return Boundary(-0.1, -0.1, 0.1, 0.1);
417 return canParse<std::vector<GNEEdge*> >(
myViewNet->
getNet(), value,
false);
424 if (canParse<double>(value)) {
425 double parsedValue = canParse<double>(value);
427 if (parsedValue == -1) {
430 return parsedValue >= 0;
436 return canParse<bool>(value);
480 result += i.first +
"=" + i.second +
"|";
483 if (!result.empty()) {
490 std::vector<std::pair<std::string, std::string> >
492 std::vector<std::pair<std::string, std::string> > result;
495 result.push_back(std::make_pair(i.first, i.second));
506 std::vector<std::string> parsedValues;
509 parsedValues.push_back(stValues.
next());
512 for (
auto i : parsedValues) {
513 std::vector<std::string> parsedParameters;
516 parsedParameters.push_back(stParam.
next());
520 setParameter(parsedParameters.front(), parsedParameters.back());
534 std::vector<std::string> FromViaToEdges;
536 FromViaToEdges.push_back(value);
538 FromViaToEdges.insert(FromViaToEdges.end(),
myVia.begin(),
myVia.end());
549 std::vector<std::string> FromViaToEdges;
553 FromViaToEdges.insert(FromViaToEdges.end(),
myVia.begin(),
myVia.end());
555 FromViaToEdges.push_back(value);
563 if (!value.empty()) {
565 myVia = parse< std::vector<std::string> >(value);
571 std::vector<std::string> FromViaToEdges;
575 FromViaToEdges.insert(FromViaToEdges.end(),
myVia.begin(),
myVia.end());
594 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.
GNEWalk(GNEViewNet *viewNet, GNEDemandElement *personParent, SumoXMLTag walkTag, const std::vector< GNEEdge * > &edges, double arrivalPosition)
parameter constructor
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
FXIcon * getIcon() const
get FXIcon associated to this AC
An Element which don't belongs to GNENet but has influency in the simulation.
An Element which don't belongs to GNENet but has influency in the simulation.
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
const std::string getID() const
function to support debugging
An upper class for objects with additional parameters.
static RouteCalculator * getRouteCalculatorInstance()
obtain instance of RouteCalculator
std::string firstOriginalLanePosition
value for saving first original position over lane before moving
std::string getAttribute(SumoXMLAttr key) const
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Static storage of an output device and its base (abstract) implementation.
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute)
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void changeAdditionalParent(GNEShape *shapeTobeChanged, const std::string &newAdditionalParentID, int additionalParentIndex)
change additional parent of a shape
static std::string parseIDs(const std::vector< T > &ACs)
parses a list of specific Attribute Carriers into a string of IDs
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
bool hasNext()
returns the information whether further substrings exist
bool isAttributeEnabled(SumoXMLAttr key) const
void compute()
compute demand element
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
const std::vector< GNEEdge * > & getEdgeParents() const
get edge parents
open additional dialog (used in netedit)
Copy object name - popup entry.
std::string getGenericParametersStr() const
return generic parameters in string format
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
Position originalViewPosition
value for saving first original position over lane before moving
DemandElementMove myWalkMove
variable for move walks
SumoXMLTag
Numbers representing SUMO-XML - element names.
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
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 writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
GNENet * getNet() const
get the net object
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
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.
void reset()
Resets the boundary.
bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
double getAttributeDouble(SumoXMLAttr key) const
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
const RGBColor & getColor() const
get color
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
GUIGlID getGlID() const
Returns the numerical id of the object.
A class that stores a 2D geometrical boundary.
void changeDemandElementParent(GNEShape *shapeTobeChanged, const std::string &newDemandElementParentID, int demandElementParentIndex)
change first demand element parent of a shape
A point in 2D or 3D with translation and scaling methods.
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
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Position getPositionInView() const
Returns position of additional in view.
void startGeometryMoving()
void updateGeometry()
update pre-computed geometry information
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
void selectAttributeCarrier(bool changeFlag=true)
inherited from GNEAttributeCarrier
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
bool areEdgesConsecutives(SUMOVehicleClass vClass, GNEEdge *from, GNEEdge *to) const
check if exist a route between the two given consecutives edges
double myArrivalPosition
arrival position
const std::vector< GNEDemandElement * > & getDemandElementParents() const
return vector of demand elements that have as Parent this edge (For example, Calibrators)
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parent this edge (For example, Calibrators)
std::vector< std::string > myVia
List of the via-edges that Person must visit.
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
GNEEdge * getToEdge() const
obtain to edge of this demand element
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
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,...
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
begin/end of the description of a route
void clearParameter()
Clears the parameter map.
void endGeometryMoving()
end geometry movement
void add(const Position &pos)
Adds the given position to this one.
bool isInitialised() const
check if Boundary is Initialised
std::vector< GNEEdge * > calculateDijkstraRoute(SUMOVehicleClass vClass, const std::vector< GNEEdge * > &partialEdges) const
calculate Dijkstra route between a list of partial edges
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
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Copy typed object name - popup entry.
Stores the information about how to visualize structures.
void changeEdgeParents(GNEShape *elementChild, const std::string &newEdgeIDs)
change edge parents of a shape
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators)
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.
GNEEdge * getFromEdge() const
Boundary movingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE)
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
std::string getParentName() const
Returns the name of the parent object.
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
parent of an additional element
void addedLockedObject(const GUIGlObjectType type)
set object selected