 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
45 double arrivalPosition,
const std::vector<std::string>& types,
const std::vector<std::string>& modes) :
48 }, {}, {}, {}, {personParent}, {}, {}, {}, {}, {}),
50 myArrivalPosition(arrivalPosition),
54 replaceMiddleParentEdges(
this, via,
false);
61 const std::vector<std::string>& types,
const std::vector<std::string>& modes) :
64 }, {}, {}, {busStop}, {personParent}, {}, {}, {}, {}, {}),
66 myArrivalPosition(-1),
70 replaceMiddleParentEdges(
this, via,
false);
88 new FXMenuCommand(ret, (
"Copy " +
getTagStr() +
" name to clipboard").c_str(),
nullptr, ret,
MID_COPY_NAME);
90 new FXMenuSeparator(ret);
97 new FXMenuSeparator(ret);
159 return (
"A person trip need at least one edge");
164 return (
"Edge '" +
getParentEdges().at((
int)i - 1)->getID() +
"' and edge '" +
getParentEdges().at(i)->getID() +
"' aren't consecutives");
243 newPosition.
add(offset);
250 std::cout << offsetLane << std::endl;
273 double departPosLane = -1;
274 double arrivalPosLane = -1;
300 double departPosLane = -1;
301 double arrivalPosLane = -1;
313 i->updatePartialGeometry(edge);
371 personTripBoundary.
add(i->getCenteringBoundary());
375 return personTripBoundary;
377 return Boundary(-0.1, -0.1, 0.1, 0.1);
508 return canParse<std::vector<GNEEdge*> >(
myViewNet->
getNet(), value,
false);
514 std::string dummyError;
518 return canParse<std::vector<std::string> >(value);
522 }
else if (canParse<double>(value)) {
523 const double parsedValue = canParse<double>(value);
533 return canParse<bool>(value);
610 myModes = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
613 myVTypes = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
624 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.
void replaceMiddleParentEdges(GNEDemandElement *elementChild, const std::vector< GNEEdge * > &newMiddleEdges, const bool updateChildReferences)
replace middle (via) parent edges
GNELane * getLastAllowedVehicleLane() const
get first allowed vehicle lane
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.
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
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
const std::vector< GNEEdge * > & getPathEdges() const
get path edges
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
const std::string getID() const
function to support debugging
void selectAttributeCarrier(bool changeFlag=true)
inherited from GNEAttributeCarrier
void replaceLastParentEdge(GNEDemandElement *elementChild, GNEEdge *newLastEdge)
replace the last parent edge (used by demand elements)
An upper class for objects with additional parameters.
void replacePathEdges(GNEDemandElement *elementChild, const std::vector< GNEEdge * > &routeEdges)
replace edge route Parents
void replaceFirstParentEdge(GNEDemandElement *elementChild, GNEEdge *newFirstEdge)
replace the first parent edge (used by demand elements)
static RouteCalculator * getRouteCalculatorInstance()
obtain instance of RouteCalculator
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
std::string firstOriginalLanePosition
value for saving first original position over lane before moving
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
Static storage of an output device and its base (abstract) implementation.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
Position getPositionInView() const
Returns position of additional in view.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
static const Position INVALID
used to indicate that a position is valid
GNELane * getFirstAllowedVehicleLane() const
get first allowed vehicle lane
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::vector< GNELane * > & getParentLanes() const
get parent lanes
DemandElementMove myPersonTripMove
variable for move person trips
open additional dialog (used in netedit)
Copy object name - popup entry.
GNEPersonTrip(GNEViewNet *viewNet, GNEDemandElement *personParent, GNEEdge *fromEdge, GNEEdge *toEdge, const std::vector< GNEEdge * > &via, double arrivalPosition, const std::vector< std::string > &types, const std::vector< std::string > &modes)
parameter constructor for person tripEdges
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
static bool parsePersonModes(const std::string &modes, const std::string &element, const std::string &id, SVCPermissions &modeSet, std::string &error)
Validates a given person modes value.
Position originalViewPosition
value for saving first original position over lane before moving
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
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
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
GNEGeometry::SegmentGeometry myDemandElementSegmentGeometry
demand element segment geometry
A road/street connecting two junctions (netedit-version)
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute)
friend class GNEChange_Attribute
declare friend class
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
GNENet * getNet() const
get the net object
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
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
GNEEdge * getFromEdge() const
void reset()
Resets the boundary.
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
GUIGlID getGlID() const
Returns the numerical id of the object.
A class that stores a 2D geometrical boundary.
parameters "key1=value1|key2=value2|...|keyN=valueN"
std::vector< std::string > myVTypes
valid line or vehicle types
void updatePartialGeometry(const GNEEdge *edge)
partial update pre-computed geometry information
void calculatePersonPlanPositionStartEndPos(Position &startPos, Position &endPos) const
calculate personPlan start and end positions
A point in 2D or 3D with translation and scaling methods.
std::vector< GNEEdge * > getMiddleParentEdges() const
get middle (via) parent edges
void startGeometryMoving()
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
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
~GNEPersonTrip()
destructor
std::string getAttribute(SumoXMLAttr key) const
void replaceParentAdditional(GNEShape *shapeTobeChanged, const std::string &newParentAdditionalID, int additionalParentIndex)
replace the parent additional of a shape
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
void setParametersStr(const std::string ¶msString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void calculatePersonPlanLaneStartEndPos(double &startPos, double &endPos) const
calculate personPlan start and end positions over lanes
void endGeometryMoving()
end geometry movement
bool areEdgesConsecutives(SUMOVehicleClass vClass, GNEEdge *from, GNEEdge *to) const
check if exist a route between the two given consecutives edges
void invalidatePath()
invalidate path
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
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|....
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
GUISelectedStorage gSelected
A global holder of selected objects.
const std::string & getDemandElementID() const
returns DemandElement ID
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
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,...
std::string getParentName() const
Returns the name of the parent object.
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
void computePath()
compute path
void add(const Position &pos)
Adds the given position to this one.
bool isInitialised() const
check if Boundary is Initialised
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
bool isAttributeEnabled(SumoXMLAttr key) const
std::vector< std::string > myModes
valid line or modes
void removeLockedObject(const GUIGlObjectType type)
set object unselected
const std::string & getTagStr() const
get tag assigned to this object in string format
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
Copy typed object name - popup entry.
Stores the information about how to visualize structures.
const RGBColor & getColor() const
get color
GNEEdge * getToEdge() const
obtain to edge of this demand element
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.
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.
void updateGeometry()
update pre-computed geometry information
double getAttributeDouble(SumoXMLAttr key) const
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
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
double myArrivalPosition
arrival position
parent of an additional element
void addedLockedObject(const GUIGlObjectType type)
set object selected