 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
66 myTransformToVehicle(
nullptr),
67 myTransformToVehicleWithEmbeddedRoute(
nullptr),
68 myTransformToRouteFlow(
nullptr),
69 myTransformToRouteFlowWithEmbeddedRoute(
nullptr),
70 myTransformToTrip(
nullptr),
71 myTransformToFlow(
nullptr) {
73 myVehicle->buildPopupHeader(
this, app);
75 myVehicle->buildCenterPopupEntry(
this);
76 myVehicle->buildPositionCopyEntry(
this,
false);
78 new FXMenuCommand(
this, (
"Copy " + myVehicle->getTagStr() +
" name to clipboard").c_str(),
nullptr,
this,
MID_COPY_NAME);
79 new FXMenuCommand(
this, (
"Copy " + myVehicle->getTagStr() +
" typed name to clipboard").c_str(),
nullptr,
this,
MID_COPY_TYPED_NAME);
80 new FXMenuSeparator(
this);
82 myVehicle->getViewNet()->buildSelectionACPopupEntry(
this, myVehicle);
83 myVehicle->buildShowParamsPopupEntry(
this);
92 FXMenuPane* transformOperation =
new FXMenuPane(
this);
93 this->insertMenuPaneChild(transformOperation);
94 new FXMenuCascade(
this,
"transform to",
nullptr, transformOperation);
97 myTransformToVehicleWithEmbeddedRoute =
new FXMenuCommand(transformOperation,
"Vehicle (embedded route)", vehicleIcon,
this,
MID_GNE_VEHICLE_TRANSFORM);
98 myTransformToRouteFlow =
new FXMenuCommand(transformOperation,
"RouteFlow", routeFlowIcon,
this,
MID_GNE_VEHICLE_TRANSFORM);
99 myTransformToRouteFlowWithEmbeddedRoute =
new FXMenuCommand(transformOperation,
"RouteFlow (embedded route)", routeFlowIcon,
this,
MID_GNE_VEHICLE_TRANSFORM);
104 if (myVehicle->getParentDemandElements().size() > 1) {
105 myTransformToVehicle->disable();
107 myTransformToVehicleWithEmbeddedRoute->disable();
110 if (myVehicle->getParentDemandElements().size() > 1) {
111 myTransformToRouteFlow->disable();
113 myTransformToRouteFlowWithEmbeddedRoute->disable();
115 }
else if (myVehicle->getTagProperty().getTag() ==
SUMO_TAG_TRIP) {
116 myTransformToTrip->disable();
117 }
else if (myVehicle->getTagProperty().getTag() ==
SUMO_TAG_FLOW) {
118 myTransformToFlow->disable();
129 if (obj == myTransformToVehicle) {
131 }
else if (obj == myTransformToVehicleWithEmbeddedRoute) {
133 }
else if (obj == myTransformToRouteFlow) {
135 }
else if (obj == myTransformToRouteFlowWithEmbeddedRoute) {
137 }
else if (obj == myTransformToTrip) {
139 }
else if (obj == myTransformToFlow) {
151 mySelectedVehicles(selectedVehicle),
153 myTransformToVehicle(nullptr),
154 myTransformToVehicleWithEmbeddedRoute(nullptr),
155 myTransformToRouteFlow(nullptr),
156 myTransformToRouteFlowWithEmbeddedRoute(nullptr),
157 myTransformToTrip(nullptr),
158 myTransformToFlow(nullptr),
159 myTransformAllVehiclesToVehicle(nullptr),
160 myTransformAllVehiclesToVehicleWithEmbeddedRoute(nullptr),
161 myTransformAllVehiclesToRouteFlow(nullptr),
162 myTransformAllVehiclesToRouteFlowWithEmbeddedRoute(nullptr),
163 myTransformAllVehiclesToTrip(nullptr),
164 myTransformAllVehiclesToFlow(nullptr) {
171 new FXMenuCommand(
this, (
"Copy " + vehicle->
getTagStr() +
" name to clipboard").c_str(),
nullptr,
this,
MID_COPY_NAME);
173 new FXMenuSeparator(
this);
185 FXMenuPane* transformOperation =
new FXMenuPane(
this);
187 new FXMenuCascade(
this,
"transform to",
nullptr, transformOperation);
202 new FXMenuSeparator(transformOperation);
220 for (
const auto& i : mySelectedVehicles) {
221 if ((obj == myTransformToVehicle) &&
222 (i->getTagProperty().getTag() == myVehicleTag)) {
224 }
else if ((obj == myTransformToVehicleWithEmbeddedRoute) &&
225 (i->getTagProperty().getTag() == myVehicleTag)) {
227 }
else if ((obj == myTransformToRouteFlow) &&
228 (i->getTagProperty().getTag() == myVehicleTag)) {
230 }
else if ((obj == myTransformToRouteFlowWithEmbeddedRoute) &&
231 (i->getTagProperty().getTag() == myVehicleTag)) {
233 }
else if ((obj == myTransformToTrip) &&
234 (i->getTagProperty().getTag() == myVehicleTag)) {
236 }
else if ((obj == myTransformToFlow) &&
237 (i->getTagProperty().getTag() == myVehicleTag)) {
239 }
else if (obj == myTransformAllVehiclesToVehicle) {
241 }
else if (obj == myTransformAllVehiclesToVehicleWithEmbeddedRoute) {
243 }
else if (obj == myTransformAllVehiclesToRouteFlow) {
245 }
else if (obj == myTransformAllVehiclesToRouteFlowWithEmbeddedRoute) {
247 }
else if (obj == myTransformAllVehiclesToTrip) {
249 }
else if (obj == myTransformAllVehiclesToFlow) {
262 {}, {}, {}, {}, {vehicleType, route}, {}, {}, {}, {}, {}),
267 vtypeid = vehicleType->getID();
273 {}, {}, {}, {}, {vehicleType, route}, {}, {}, {}, {}, {}),
276 id = vehicleParameters.
id;
278 vtypeid = vehicleType->getID();
284 {}, {}, {}, {}, {vehicleType}, {}, {}, {}, {}, {}),
287 id = vehicleParameters.
id;
291 vtypeid = vehicleType->getID();
296 const std::vector<GNEEdge*>& via) :
299 }, {}, {}, {}, {vehicleType}, {}, {}, {}, {}, {}),
312 }, {}, {}, {}, {vehicleType}, {}, {}, {}, {}, {}),
327 std::string departStr;
334 departStr.reserve(20 - departStr.size());
336 for (
int i = (
int)departStr.size(); i < 20; i++) {
337 departStr.insert(departStr.begin(),
'0');
370 if (
via.size() > 0) {
397 i->writeDemandElement(device);
433 return (
"Edge '" +
getParentEdges().at((
int)i - 1)->getID() +
"' and edge '" +
getParentEdges().at(i)->getID() +
"' aren't consecutives");
521 double departPosLane = -1;
522 double arrivalPosLane = -1;
548 double departPosLane = -1;
549 double arrivalPosLane = -1;
561 i->updatePartialGeometry(edge);
599 return Position((A.
x() + B.
x()) / 2, (A.
y() + B.
y()) / 2);
609 std::vector<GNEVehicle*> selectedVehicles;
610 selectedVehicles.reserve(selectedDemandElements.size());
611 for (
const auto& i : selectedDemandElements) {
612 if (i->getTagProperty().isVehicle()) {
613 selectedVehicles.push_back(
dynamic_cast<GNEVehicle*
>(i));
640 vehicleBoundary.
add(
getFromEdge()->getLanes().front()->getLaneShape().front());
641 vehicleBoundary.
grow(20);
642 return vehicleBoundary;
660 double vehicleSizeSquared = width * length * exaggeration * width * length * exaggeration;
665 double vehicleRotation = 0;
691 glRotated(vehicleRotation, 0, 0, 1);
693 glTranslated(0, (-1) * length, 0);
711 glRotated(vehicleRotation, 0, 0, 1);
713 glTranslated(0, (-1) * length, 0);
716 double upscaleLength = exaggeration;
717 if ((exaggeration > 1) && (length > 5)) {
719 upscaleLength =
MAX2(1.0, upscaleLength * (5 + sqrt(length - 5)) / length);
721 glScaled(exaggeration, upscaleLength, 1);
752 glColor3d(0., 1., 0.);
755 glVertex2d(0., minGap);
756 glVertex2d(-.5, minGap);
757 glVertex2d(.5, minGap);
761 glTranslated(0,
MIN2(length / 2,
double(5)), -
getType());
762 glScaled(1 / exaggeration, 1 / upscaleLength, 1);
763 glRotated(-1 * vehicleRotation, 0, 0, 1);
1017 return canParse<RGBColor>(value);
1019 int dummyDepartLane;
1023 if (error.empty()) {
1034 double dummyDepartPos;
1038 return error.empty();
1041 double dummyDepartSpeed;
1045 if (error.empty()) {
1056 int dummyArrivalLane;
1060 return error.empty();
1063 double dummyArrivalPos;
1067 return error.empty();
1070 double dummyArrivalSpeed;
1074 return error.empty();
1079 return canParse<int>(value) && parse<int>(value) >= 0;
1081 return canParse<int>(value) && parse<int>(value) >= 0;
1085 double dummyDepartPosLat;
1089 return error.empty();
1092 double dummyArrivalPosLat;
1096 return error.empty();
1104 return error.empty();
1117 if (value.empty()) {
1120 return canParse<std::vector<GNEEdge*> >(
myViewNet->
getNet(), value,
false);
1124 if (canParse<double>(value)) {
1125 return (parse<double>(value) >= 0);
1130 if (value.empty()) {
1132 }
else if (canParse<double>(value)) {
1133 return (parse<double>(value) >= 0);
1138 if (value.empty()) {
1140 }
else if (canParse<double>(value)) {
1141 return (parse<double>(value) > 0);
1146 if (value.empty()) {
1148 }
else if (canParse<double>(value)) {
1149 return (parse<double>(value) > 0);
1154 if (value.empty()) {
1156 }
else if (canParse<double>(value)) {
1157 return (parse<double>(value) >= 0);
1162 if (canParse<int>(value)) {
1163 return (parse<int>(value) >= 0);
1169 return canParse<bool>(value);
1234 for (
const auto& i :
via) {
1314 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
1323 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
1332 double hue = 180. + atan2(pb.
x() - pe.
x(), pb.
y() - pe.
y()) * 180. /
M_PI;
1340 std::hash<const GNEVehicle*> ptr_hash;
1341 const double hue = (double)(ptr_hash(
this) % 360);
1342 const double sat = ((ptr_hash(
this) / 360) % 67) / 100.0 + 0.33;
1374 color = parse<RGBColor>(value);
1530 std::string oldDepart =
getBegin();
1557 if (!value.empty()) {
1559 via = parse< std::vector<std::string> >(value);
1598 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
double getAttributeDouble(SumoXMLAttr key) const
GNEViewNet * myViewNet
The GNEViewNet this demand element element belongs.
static const double vehicleBoxes
details for draw person as boxes
int personNumber
The static number of persons in the vehicle when it departs (not including boarding persons)
static const RGBColor DEFAULT_COLOR
The default color (for vehicle types and vehicles)
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
GNELane * getLastAllowedVehicleLane() const
get first allowed vehicle lane
void replaceMiddleParentEdges(GNEDemandElement *elementChild, const std::vector< GNEEdge * > &newMiddleEdges, const bool updateChildReferences)
replace middle (via) parent edges
int containerNumber
The static number of containers in the vehicle when it departs.
static void transformToVehicle(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform vehicle functions
@ ARRIVAL_POS_GIVEN
The arrival position is given.
bool wasSet(int what) const
Returns whether the given parameter was set.
An Element which don't belongs to GNENet but has influency in the simulation.
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048)
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
ArrivalPosDefinition
Possible ways to choose the arrival position.
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
int parametersSet
Information for the router which parameter were set, TraCI may modify this (whe changing color)
void startGeometryMoving()
const std::vector< GNEEdge * > & getPathEdges() const
get path edges
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
void selectAttributeCarrier(bool changeFlag=true)
inherited from GNEAttributeCarrier
const std::string getID() const
function to support debugging
void replaceLastParentEdge(GNEDemandElement *elementChild, GNEEdge *newLastEdge)
replace the last parent edge (used by demand elements)
void updateGeometry()
update pre-computed geometry information
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
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
RGBColor color
The vehicle's color, TraCI may change this.
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
double ymin() const
Returns minimum y-coordinate.
std::string getArrivalPos() const
obtain arrival pos parameter in string format
Static storage of an output device and its base (abstract) implementation.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
std::string getDepartSpeed() const
obtain depart speed parameter in string format
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
double angle
The current view rotation angle.
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
static const Position INVALID
used to indicate that a position is valid
static void drawAction_drawVehicleAsPoly(const GUIVisualizationSettings &s, const SUMOVehicleShape shape, const double width, const double length, int carriageIndex=-1)
draw vehicle as a polygon
double departSpeed
(optional) The initial speed of the vehicle
const GNEGeometry::SegmentGeometry & getDemandElementSegmentGeometry() const
get demand element segment geometry
friend class GNEChange_EnableAttribute
void computePath()
compute path
std::string vtypeid
The vehicle's type id.
const int VEHPARS_NUMBER_SET
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
double getFirstRotation() const
get first rotation (or Invalid position if segments are empty)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
static void transformToTrip(GNEVehicle *originalVehicle)
transform to trip
SUMOTime repetitionOffset
The time offset between vehicle reinsertions.
static bool parseDepartSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, DepartSpeedDefinition &dsd, std::string &error)
Validates a given departSpeed value.
@ SUMO_ATTR_ARRIVALPOS_LAT
static bool parseDepartLane(const std::string &val, const std::string &element, const std::string &id, int &lane, DepartLaneDefinition &dld, std::string &error)
Validates a given departLane value.
GNEEdge * getFromEdge() const
ArrivalPosLatDefinition
Possible ways to choose the departure position.
FXDEFMAP(GNEVehicle::GNESingleVehiclePopupMenu) GNESingleVehiclePopupMenuMap[]
GNELane * getFirstAllowedVehicleLane() const
get first allowed vehicle lane
bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
DepartDefinition
Possible ways to depart.
const int VEHPARS_ARRIVALSPEED_SET
double xmax() const
Returns maximum x-coordinate.
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
@ SUMO_ATTR_COLOR
A color information.
ArrivalLaneDefinition
Possible ways to choose the arrival lane.
static OptionsCont & getOptions()
Retrieves the options.
std::string getBegin() const
get begin time of demand element
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
bool showDemandElements() const
check if show demand elements checkbox is enabled
Position getPositionInView() const
Returns position of demand element in view.
static bool parseArrivalPosLat(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosLatDefinition &apd, std::string &error)
Validates a given arrivalPosLat value.
double length() const
Returns the length.
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which demand element element is located.
Structure representing possible vehicle parameter.
static void transformToFlow(GNEVehicle *originalVehicle)
transform to flow
@ MID_COPY_NAME
Copy object name - popup entry.
GUIVisualizationSizeSettings vehicleSize
GUIColorer vehicleColorer
The vehicle colorer.
@ SUMO_TAG_VTYPE
description of a vehicle type
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
SUMOVehicleClass getVClass() const
obtain VClass related with this demand element
static bool parseArrivalPos(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosDefinition &apd, std::string &error)
Validates a given arrivalPos value.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
bool drawMinGap
Information whether the minimum gap shall be drawn.
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
SumoXMLTag
Numbers representing SUMO-XML - element names.
static const double vehicleShapes
details for draw person as shapes
const int VEHPARS_PROB_SET
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
const int VEHPARS_DEPARTSPEED_SET
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
double scaledSize(double scale, double constFactor=0.1) const
get scale size
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
SumoXMLTag tag
The vehicle tag.
std::string getDepartPosLat() const
obtain depart pos lat parameter in string format
@ SUMO_ATTR_BEGIN
weights: time range begin
GNEGeometry::SegmentGeometry myDemandElementSegmentGeometry
demand element segment geometry
A road/street connecting two junctions (netedit-version)
const int VEHPARS_ARRIVALLANE_SET
friend class GNEChange_Attribute
declare friend class
const int VEHPARS_ROUTE_SET
@ SUMO_ATTR_PERSON_NUMBER
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void changeDemandElementID(const std::string &newID)
change ID of demand element
std::string line
The vehicle's line (mainly for public transport)
GNENet * getNet() const
get the net object
SumoXMLTag getTagSynonym() const
get tag synonym
static void setFlowParameters(const SumoXMLAttr attribute, int ¶meters)
configure flow parameters
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
@ SUMO_TAG_ROUTEFLOW
a flow definition nusing a route instead of a from-to edges route (used in NETEDIT)
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
const int VEHPARS_ARRIVALPOS_SET
GUIVisualizationDetailSettings detailSettings
detail settings
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
static bool parseDepartPosLat(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosLatDefinition &dpd, std::string &error)
Validates a given departPosLat value.
double xmin() const
Returns minimum x-coordinate.
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
std::string getArrivalPosLat() const
obtain arrival pos lat parameter in string format
const PositionVector & getLaneShape() const
std::string getDepart() const
obtain depart parameter in string format
const RGBColor & getColor() const
get color
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
bool isAttributeEnabled(SumoXMLAttr key) const
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
const int VEHPARS_COLOR_SET
@ DEPART_SPEED_GIVEN
The speed is given.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
static bool parseArrivalLane(const std::string &val, const std::string &element, const std::string &id, int &lane, ArrivalLaneDefinition &ald, std::string &error)
Validates a given arrivalLane value.
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
const std::string DEFAULT_VTYPE_ID
@ SUMO_ATTR_DEPARTPOS_LAT
@ DEPART_LANE_GIVEN
The lane is given.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
std::vector< GNEDemandElement * > retrieveDemandElements(bool onlySelected=false) const
return all demand elements
std::string id
The vehicle's id.
GUIGlID getGlID() const
Returns the numerical id of the object.
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
A class that stores a 2D geometrical boundary.
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
std::string getAttribute(SumoXMLAttr key) const
double repetitionProbability
The probability for emitting a vehicle per second.
const int VEHPARS_VIA_SET
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
double arrivalPos
(optional) The position the vehicle shall arrive on
const int VEHPARS_LINE_SET
static void drawShapeDottedContourRectangle(const GUIVisualizationSettings &s, const int type, const Position ¢er, const double width, const double height, const double rotation=0, const double offsetX=0, const double offsetY=0)
draw a dotted contour around the given Position with certain width and height
static const RGBColor BLUE
double scale
information about a lane's width (temporary, used for a single view)
Supermode currentSupermode
the current supermode
GUIVisualizationTextSettings vehicleName
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
@ SUMO_ATTR_CONTAINER_NUMBER
A point in 2D or 3D with translation and scaling methods.
double x() const
Returns the x-position.
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
std::string time2string(SUMOTime t)
void invalidatePath()
invalidate path
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
double arrivalPosLat
(optional) The lateral position the vehicle shall arrive on
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
static bool parseArrivalSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, ArrivalSpeedDefinition &asd, std::string &error)
Validates a given arrivalSpeed value.
static bool parseDepart(const std::string &val, const std::string &element, const std::string &id, SUMOTime &depart, DepartDefinition &dd, std::string &error)
Validates a given depart value.
static const RGBColor RED
named colors
const int VEHPARS_ARRIVALPOSLAT_SET
void updateDemandElementBegin(const std::string &oldBegin, GNEDemandElement *demandElement)
update demand element begin in container
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
std::string routeid
The vehicle's route id.
static void drawAction_drawVehicleAsBoxPlus(const double width, const double length)
draw vehicle as a Box
GNEEdge * getToEdge() const
obtain to edge of this demand element
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
const Position & getFirstPosition() const
get first position (or Invalid position if segments are empty)
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
static void transformToRouteFlow(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform routeFlow over an existent route
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
std::string getDepartPos() const
obtain depart pos parameter in string format
@ SUMO_TAG_VEHICLE
description of a vehicle
std::string getDepartLane() const
obtain depart lane parameter in string format
SUMOTime string2time(const std::string &r)
const int VEHPARS_VPH_SET
double departPosLat
(optional) The lateral position the vehicle shall depart from
const int VEHPARS_DEPARTLANE_SET
GNEViewNet * getViewNet() const
get view net
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
void write(OutputDevice &dev, const OptionsCont &oc, const SumoXMLTag tag=SUMO_TAG_VEHICLE, const std::string &typeID="") const
Writes the parameters as a beginning element.
GUIVisualizationColorSettings colorSettings
color settings
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
DepartLaneDefinition
Possible ways to choose a lane on depart.
static const double vehicleTriangles
details for draw person as triangles
SUMOTime repetitionEnd
The time at which the flow ends (only needed when using repetitionProbability)
void setParametersStr(const std::string ¶msString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
bool showNonInspectedDemandElements(const GNEDemandElement *demandElement) const
check if non inspected element has to be hidden
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
void updatePartialGeometry(const GNEEdge *edge)
partial update pre-computed geometry information
const Boundary & getBoundary() const
returns the bounder of the network
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const int VEHPARS_VTYPE_SET
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
bool areEdgesConsecutives(SUMOVehicleClass vClass, GNEEdge *from, GNEEdge *to) const
check if exist a route between the two given consecutives edges
const std::string & getDefaultValue(SumoXMLAttr attr) const
return the default value of the attribute of an element
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
const int VEHPARS_DEPARTPOSLAT_SET
double y() const
Returns the y-position.
std::vector< std::string > via
List of the via-edges the vehicle must visit.
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
static bool isValidTypeID(const std::string &value)
whether the given string is a valid id for an edge or vehicle type
Position getCenter() const
Returns the center of the boundary.
bool hasTagSynonym() const
return true if tag correspond to an element that will be written in XML with another tag
GNEVehicle(SumoXMLTag tag, GNEViewNet *viewNet, const std::string &vehicleID, GNEDemandElement *vehicleType, GNEDemandElement *route)
default constructor for vehicles and routeFlows without embedded routes
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|....
const int VEHPARS_CONTAINER_NUMBER_SET
@ GNE_SUPERMODE_DEMAND
Demanding mode (Routes, Vehicles etc..)
const int VEHPARS_DEPARTPOS_SET
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
const int VEHPARS_PERSON_NUMBER_SET
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute)
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
DepartPosDefinition
Possible ways to choose the departure position.
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,...
ArrivalPosLatDefinition arrivalPosLatProcedure
Information how the vehicle shall choose the lateral arrival position.
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
std::string getParentName() const
Returns the name of the parent object.
@ SUMO_TAG_ROUTE
begin/end of the description of a route
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
void replaceParentDemandElement(GNEShape *shapeTobeChanged, const std::string &newParentDemandElementID, int demandElementParentIndex)
replace the parent demand element of a shape
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
GUIVisualizationTextSettings personName
int size() const
number of segments
@ GNE_ATTR_SELECTED
element is selected
@ MID_GNE_VEHICLE_TRANSFORM
transform vehicle to another vehicle type (ej: flow to trip)
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
@ SUMO_ATTR_END
weights: time range end
Boundary & grow(double by)
extends the boundary by the given amount
DepartSpeedDefinition
Possible ways to choose the departure speed.
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
const int VEHPARS_PERIOD_SET
@ DEPART_POS_GIVEN
The position is given.
void removeLockedObject(const GUIGlObjectType type)
set object unselected
const std::string & getTagStr() const
get tag assigned to this object in string format
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
@ MID_COPY_TYPED_NAME
Copy typed object name - popup entry.
static bool parseDepartPos(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosDefinition &dpd, std::string &error)
Validates a given departPos value.
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Stores the information about how to visualize structures.
DepartPosLatDefinition departPosLatProcedure
Information how the vehicle shall choose the lateral departure position.
const int VEHPARS_END_SET
std::string getArrivalLane() const
obtain arrival lane parameter in string format
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
RGBColor selectedVehicleColor
vehicle selection color
@ GLO_ROUTEFLOW
a routeFlow
std::string getArrivalSpeed() const
obtain arrival speed parameter in string format
const T getColor(const double value) const
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void endGeometryMoving()
end geometry movement
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
static void drawAction_drawVehicleAsTrianglePlus(const double width, const double length)
draw vehicle as a triangle
double departPos
(optional) The position the vehicle shall depart from
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
@ SUMO_TAG_TRIP
a single trip definition (used by router)
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
static const RGBColor WHITE
double ymax() const
Returns maximum y-coordinate.
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
double arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
ArrivalSpeedDefinition
Possible ways to choose the arrival speed.
void addedLockedObject(const GUIGlObjectType type)
set object selected