68 myTransformToVehicle(nullptr),
69 myTransformToVehicleWithEmbeddedRoute(nullptr),
70 myTransformToRouteFlow(nullptr),
71 myTransformToRouteFlowWithEmbeddedRoute(nullptr),
72 myTransformToTrip(nullptr),
73 myTransformToFlow(nullptr) {
82 new FXMenuSeparator(
this);
96 FXMenuPane* transformOperation =
new FXMenuPane(
this);
98 new FXMenuCascade(
this,
"transform to",
nullptr, transformOperation);
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) {
173 new FXMenuSeparator(
this);
187 FXMenuPane* transformOperation =
new FXMenuPane(
this);
189 new FXMenuCascade(
this,
"transform to",
nullptr, transformOperation);
204 new FXMenuSeparator(transformOperation);
222 for (
const auto& vehicle : mySelectedVehicles) {
223 if ((obj == myTransformToVehicle) &&
224 (vehicle->getTagProperty().getTag() == myVehicleTag)) {
226 }
else if ((obj == myTransformToVehicleWithEmbeddedRoute) &&
227 (vehicle->getTagProperty().getTag() == myVehicleTag)) {
229 }
else if ((obj == myTransformToRouteFlow) &&
230 (vehicle->getTagProperty().getTag() == myVehicleTag)) {
232 }
else if ((obj == myTransformToRouteFlowWithEmbeddedRoute) &&
233 (vehicle->getTagProperty().getTag() == myVehicleTag)) {
235 }
else if ((obj == myTransformToTrip) &&
236 (vehicle->getTagProperty().getTag() == myVehicleTag)) {
238 }
else if ((obj == myTransformToFlow) &&
239 (vehicle->getTagProperty().getTag() == myVehicleTag)) {
241 }
else if (obj == myTransformAllVehiclesToVehicle) {
243 }
else if (obj == myTransformAllVehiclesToVehicleWithEmbeddedRoute) {
245 }
else if (obj == myTransformAllVehiclesToRouteFlow) {
247 }
else if (obj == myTransformAllVehiclesToRouteFlowWithEmbeddedRoute) {
249 }
else if (obj == myTransformAllVehiclesToTrip) {
251 }
else if (obj == myTransformAllVehiclesToFlow) {
282 vtypeid = vehicleType->getID();
294 id = vehicleParameters.
id;
296 vtypeid = vehicleType->getID();
308 id = vehicleParameters.
id;
312 vtypeid = vehicleType->getID();
322 GNEPathManager::PathElement::
Options::DEMAND_ELEMENT, {}, {fromEdge, toEdge}, {}, {}, {vehicleType}, {}),
333 GNEPathManager::PathElement::
Options::DEMAND_ELEMENT, {}, {fromEdge, toEdge}, {}, {}, {vehicleType}, {}),
343 GNEPathManager::PathElement::
Options::DEMAND_ELEMENT, {fromJunction, toJunction}, {}, {}, {}, {vehicleType}, {}),
353 GNEPathManager::PathElement::
Options::DEMAND_ELEMENT, {fromJunction, toJunction}, {}, {}, {}, {vehicleType}, {}),
363 GNEPathManager::PathElement::
Options::DEMAND_ELEMENT, {}, {}, {}, {fromTAZ, toTAZ}, {vehicleType}, {}),
369 toTaz = toTAZ->getID();
408 departStr.reserve(20 - departStr.size());
410 for (
int i = (
int)departStr.size(); i < 20; i++) {
411 departStr.insert(departStr.begin(),
'0');
442 if (
via.size() > 0) {
483 if (demandElement->getTagProperty().isStop() || demandElement->getTagProperty().isWaypoint()) {
484 demandElement->writeDemandElement(device);
489 route->writeDemandElement(device);
539 return (
"There is no valid path between edges '" +
getParentEdges().at((
int)i - 1)->getID() +
"' and '" +
getParentEdges().at(i)->getID() +
"'");
550 for (
int i = 1; i < (int)routeEdges.size(); i++) {
552 return (
"There is no valid path between route edges '" + routeEdges.at((
int)i - 1)->getID() +
"' and '" + routeEdges.at(i)->getID() +
"'");
561 for (
int i = 1; i < (int)routeEdges.size(); i++) {
563 return (
"There is no valid path between embedded route edges '" + routeEdges.at((
int)i - 1)->getID() +
"' and '" + routeEdges.at(i)->getID() +
"'");
598 const double rot = ((double)atan2((posB.
x() - posA.
x()), (posA.
y() - posB.
y())) * (double) -180.0 / (
double)
M_PI);
605 const double rot = ((double)atan2((posB.
x() - posA.
x()), (posA.
y() - posB.
y())) * (double) -180.0 / (
double)
M_PI);
614 double posOverLane = 0;
623 demandElement->computePathElement();
625 demandElement->updateGeometry();
643 std::vector<GNEVehicle*> selectedVehicles;
644 selectedVehicles.reserve(selectedDemandElements.size());
645 for (
const auto& selectedDemandElement : selectedDemandElements) {
646 if (selectedDemandElement->getTagProperty().isVehicle()) {
647 selectedVehicles.push_back(
dynamic_cast<GNEVehicle*
>(selectedDemandElement));
681 vehicleBoundary.
grow(20);
682 return vehicleBoundary;
703 const double vehicleSizeSquared = (width * width) * (length * length) * (exaggeration * exaggeration);
704 const auto vehicleColor =
setColor(s);
722 glTranslated(vehiclePosition.
x(), vehiclePosition.
y(), 0);
723 glRotated(vehicleRotation, 0, 0, -1);
725 glTranslated(0, (-1) * length * exaggeration, 0);
736 glTranslated(vehiclePosition.
x(), vehiclePosition.
y(), 0);
737 glRotated(vehicleRotation, 0, 0, -1);
739 glTranslated(0, (-1) * length * exaggeration, 0);
742 double upscaleLength = exaggeration;
743 if ((exaggeration > 1) && (length > 5)) {
745 upscaleLength =
MAX2(1.0, upscaleLength * (5 + sqrt(length - 5)) / length);
747 glScaled(exaggeration, upscaleLength, 1);
764 glColor3d(0., 1., 0.);
767 glVertex2d(0., minGap);
768 glVertex2d(-.5, minGap);
769 glVertex2d(.5, minGap);
773 glTranslated(0,
MIN2(length / 2,
double(5)), -
getType());
774 glScaled(1 / exaggeration, 1 / upscaleLength, 1);
775 glRotated(vehicleRotation, 0, 0, -1);
795 drawFlowLabel(vehiclePosition, vehicleRotation, width, length, exaggeration);
800 mouseWithinGeometry(vehiclePosition, length * 0.5, width * 0.5, length * -0.5, 0, vehicleRotation);
843 std::vector<GNELane*> laneStopWaypoints;
847 if (demandElement->getTagProperty().isStop() || demandElement->getTagProperty().isWaypoint()) {
848 if (demandElement->getParentAdditionals().size() > 0) {
849 laneStopWaypoints.push_back(demandElement->getParentAdditionals().front()->getParentLanes().front());
851 laneStopWaypoints.push_back(demandElement->getParentLanes().front());
856 std::vector<GNELane*> lanes;
861 if (firstLane && lastLane) {
865 if (laneStopWaypoints.size() > 0) {
867 for (
const auto& laneStop : laneStopWaypoints) {
868 lanes.push_back(laneStop);
872 for (
const auto& edgeID :
via) {
875 lanes.push_back(edge->getLaneByAllowedVClass(
getVClass()));
917 geometryDepartPos, geometryEndPos,
921 geometryDepartPos, -1,
937 glTranslated(0, 0,
getType() + offsetFront);
978 glTranslated(geometryEndPosition.
x(), geometryEndPosition.
y(), 0);
1042 glTranslated(0, 0,
getType() + offsetFront);
1054 if (dottedElement) {
1061 width, 1,
false,
false);
1067 width, 1,
false,
false);
1073 width, 1,
false,
false);
1079 width, 1,
false,
false);
1126 if ((departLaneIndex >= 0) && (departLaneIndex < (int)firstEdge->
getLanes().size())) {
1127 return firstEdge->
getLanes().at(departLaneIndex);
1174 if ((arrivalLaneIndex >= 0) && (arrivalLaneIndex < (int)lastEdge->
getLanes().size())) {
1175 return lastEdge->
getLanes().at(arrivalLaneIndex);
1276 return "containerTriggered";
1398 return laneShape.front();
1400 return laneShape.back();
1405 return laneShape.front();
1414 return laneShape.front();
1416 return laneShape.back();
1421 return laneShape.back();
1494 if (value ==
getID()) {
1509 return canParse<RGBColor>(value);
1511 int dummyDepartLane;
1515 if (error.empty()) {
1521 return (dummyDepartLane == 0);
1523 return (dummyDepartLane == 0);
1532 double dummyDepartPos;
1536 return error.empty();
1539 double dummyDepartSpeed;
1543 if (error.empty()) {
1556 int dummyArrivalLane;
1560 if (error.empty()) {
1566 return (dummyArrivalLane == 0);
1568 return (dummyArrivalLane == 0);
1577 double dummyArrivalPos;
1581 return error.empty();
1584 double dummyArrivalSpeed;
1588 return error.empty();
1593 return canParse<int>(value) && parse<int>(value) >= 0;
1595 return canParse<int>(value) && parse<int>(value) >= 0;
1599 double dummyDepartPosLat;
1603 return error.empty();
1606 double dummyArrivalPosLat;
1610 return error.empty();
1621 return error.empty();
1635 if (value.empty()) {
1637 }
else if (canParse<int>(value)) {
1639 const int index = parse<int>(value);
1655 if (value.empty()) {
1658 return canParse<std::vector<GNEEdge*> >(
myNet, value,
false);
1667 return (ACs->retrieveAdditional(
SUMO_TAG_TAZ, value,
false) !=
nullptr);
1670 if (canParse<double>(value)) {
1671 return (parse<double>(value) >= 0);
1676 if (canParse<double>(value)) {
1677 return (parse<double>(value) > 0);
1683 if (canParse<double>(value)) {
1684 return (parse<double>(value) > 0);
1689 if (canParse<double>(value)) {
1690 const double prob = parse<double>(value);
1691 return ((prob >= 0) && (prob <= 1));
1696 if (canParse<int>(value)) {
1697 return (parse<int>(value) >= 0);
1703 return canParse<bool>(value);
1787 for (
const auto& i :
via) {
1868 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
1876 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
1884 double hue = 180. + atan2(pb.
x() - pe.
x(), pb.
y() - pe.
y()) * 180. /
M_PI;
1891 std::hash<const GNEVehicle*> ptr_hash;
1892 const double hue = (double)(ptr_hash(
this) % 360);
1893 const double sat = (double)((ptr_hash(
this) / 360) % 67) / 100. + 0.33;
1912 bool updateSpreadStackGeometry =
false;
1921 childDemandElement->setMicrosimID(
getID());
1925 if (
getID().size() > 0) {
1937 color = parse<RGBColor>(value);
1970 if (
getID().size() > 0) {
1972 updateSpreadStackGeometry =
true;
2010 if (
getID().size() > 0) {
2012 updateSpreadStackGeometry =
true;
2111 updateSpreadStackGeometry =
true;
2119 updateSpreadStackGeometry =
true;
2127 updateSpreadStackGeometry =
true;
2131 if (!value.empty()) {
2133 via = parse< std::vector<std::string> >(value);
2144 updateSpreadStackGeometry =
true;
2149 if (value.empty()) {
2161 if (
getID().size() > 0) {
2163 updateSpreadStackGeometry =
true;
2169 if (value.empty()) {
2180 if (
getID().size() > 0) {
2183 updateSpreadStackGeometry =
true;
2193 updateSpreadStackGeometry =
true;
2201 updateSpreadStackGeometry =
true;
2212 updateSpreadStackGeometry =
true;
2222 updateSpreadStackGeometry =
true;
2246 if (parse<bool>(value)) {
2259 if (updateSpreadStackGeometry) {
FXDEFMAP(GNEVehicle::GNESingleVehiclePopupMenu) GNESingleVehiclePopupMenuMap[]
@ DEMAND_TYPE
Mode for editing types.
@ MID_COPY_TYPED_NAME
Copy typed object name - popup entry.
@ MID_GNE_VEHICLE_TRANSFORM
transform vehicle to another vehicle type (ej: flow to trip)
@ MID_COPY_NAME
Copy object name - popup entry.
@ GLO_ROUTEFLOW
a routeFlow
GUIIcon
An enumeration of icons used by the gui applications.
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
SUMOVehicleShape getVehicleShapeID(const std::string &name)
Returns the class id of the shape class given by its name.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearances.
const std::string DEFAULT_VTYPE_ID
const int VEHPARS_DEPARTEDGE_SET
const int VEHPARS_ARRIVALEDGE_SET
const int VEHPARS_PROB_SET
@ GIVEN
The edge index is given.
@ DEFAULT
No information given; use default.
const int VEHPARS_VPH_SET
const int VEHPARS_END_SET
const int VEHPARS_ROUTE_SET
const int VEHPARS_COLOR_SET
const int VEHPARS_POISSON_SET
DepartLaneDefinition
Possible ways to choose a lane on depart.
@ GIVEN
The lane is given.
const int VEHPARS_TO_TAZ_SET
ArrivalSpeedDefinition
Possible ways to choose the arrival speed.
DepartPosLatDefinition
Possible ways to choose the lateral departure position.
DepartPosDefinition
Possible ways to choose the departure position.
@ GIVEN
The position is given.
ArrivalLaneDefinition
Possible ways to choose the arrival lane.
@ GIVEN
The arrival lane is given.
const int VEHPARS_DEPARTPOS_SET
const int VEHPARS_CONTAINER_NUMBER_SET
const int VEHPARS_ARRIVALLANE_SET
DepartSpeedDefinition
Possible ways to choose the departure speed.
@ GIVEN
The speed is given.
const int VEHPARS_DEPARTLANE_SET
const int VEHPARS_ARRIVALPOSLAT_SET
const int VEHPARS_FROM_TAZ_SET
const int VEHPARS_NUMBER_SET
const int VEHPARS_ARRIVALSPEED_SET
ArrivalPosDefinition
Possible ways to choose the arrival position.
@ GIVEN
The arrival position is given.
const int VEHPARS_LINE_SET
const int VEHPARS_PERSON_NUMBER_SET
const int VEHPARS_DEPARTSPEED_SET
const int VEHPARS_PERIOD_SET
ArrivalPosLatDefinition
Possible ways to choose the lateral arrival position.
const int VEHPARS_VTYPE_SET
const int VEHPARS_ARRIVALPOS_SET
DepartDefinition
Possible ways to depart.
@ BEGIN
The departure is at simulation start.
@ NOW
The vehicle is discarded if emission fails (not fully implemented yet)
@ SPLIT
The departure is triggered by a train split.
@ CONTAINER_TRIGGERED
The departure is container triggered.
@ TRIGGERED
The departure is person triggered.
const int VEHPARS_VIA_SET
const int VEHPARS_DEPARTPOSLAT_SET
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_TRIP_JUNCTIONS
a trip between junctions
@ GNE_TAG_TRIP_TAZS
a single trip definition that uses TAZs
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_VEHICLE
description of a vehicle
@ GNE_TAG_FLOW_ROUTE
a flow definition using a route instead of a from-to edges route
@ GNE_TAG_FLOW_JUNCTIONS
a flow between junctions
@ GNE_TAG_FLOW_WITHROUTE
description of a vehicle with an embedded route
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ GNE_TAG_FLOW_TAZS
a flow between TAZs
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ SUMO_TAG_VTYPE_DISTRIBUTION
distribution of a vehicle type
@ GNE_TAG_VEHICLE_WITHROUTE
description of a vehicle with an embedded route
@ GNE_TAG_ROUTE_EMBEDDED
embedded route
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_DEPARTPOS_LAT
@ GNE_ATTR_FLOWPARAMETERS
flow parameters (integer for mask end, number, etc...)
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_BEGIN
weights: time range begin
@ GNE_ATTR_POISSON
poisson definition (used in flow)
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_CONTAINER_NUMBER
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_PERSON_NUMBER
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_ARRIVALPOS_LAT
@ SUMO_ATTR_INSERTIONCHECKS
const double INVALID_DOUBLE
invalid double
const double SUMO_const_halfLaneWidth
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
Position getCenter() const
Returns the center of the boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
double ymin() const
Returns minimum y-coordinate.
double xmin() const
Returns minimum x-coordinate.
Boundary & grow(double by)
extends the boundary by the given amount
double ymax() const
Returns maximum y-coordinate.
double xmax() const
Returns maximum x-coordinate.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
static void pushName(unsigned int name)
push Name
static void popMatrix()
pop matrix
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
static void popName()
pop Name
static void pushMatrix()
push matrix
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
An Element which don't belong to GNENet but has influence in the simulation.
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
friend class GNEChange_EnableAttribute
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
bool isTemplate() const
check if this AC is template
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
void resetDefaultValues()
reset attribute carrier to their default values
GNENet * myNet
pointer to net
GNENet * getNet() const
get pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
const GNETagProperties & myTagProperty
reference to tagProperty associated with this attribute carrier
An Element which don't belong to GNENet but has influence in the simulation.
void buildMenuCommandRouteLength(GUIGLObjectPopupMenu *ret) const
build menu command route length
void replaceDemandElementParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace demand element parent
void drawStackLabel(const int number, const std::string &element, const Position &position, const double rotation, const double width, const double length, const double exaggeration) const
draw stack label
Position getPathElementArrivalPos() const
get path element arrival position
GUIGeometry myDemandElementGeometry
demand element geometry (also called "stacked geometry")
virtual double getAttributeDouble(SumoXMLAttr key) const =0
void drawFlowLabel(const Position &position, const double rotation, const double width, const double length, const double exaggeration) const
draw flow label
void replaceLastParentEdge(const std::string &value)
replace the last parent edge
void drawJunctionLine(const GNEDemandElement *element) const
draw line between junctions
virtual const RGBColor & getColor() const =0
get color
void replaceFirstParentAdditional(SumoXMLTag tag, const std::string &value)
replace the first parent additional
GNEDemandElement * getRouteParent() const
get route parent (always the second parent demand element)
GUIGeometry mySpreadGeometry
demand element spread geometry (Only used by vehicles and pedestrians)
void replaceFirstParentJunction(const std::string &value)
replace the first parent junction
GNEDemandElement * getTypeParent() const
get type parent (needed because first parent can be either type or typeDistribution)
bool demandElementExist(const std::string &id, const std::vector< SumoXMLTag > tags) const
check if the given demand element exist
void replaceFirstParentEdge(const std::string &value)
replace the first parent edge
int myStackedLabelNumber
stacked label number
Problem
enum class for demandElement problems
void adjustDefaultFlowAttributes(SUMOVehicleParameter *vehicleParameters)
adjust flow default attributes (called in vehicle/person/flow constructors)
void setFlowParameters(SUMOVehicleParameter *vehicleParameters, const SumoXMLAttr attribute, const bool value)
set flow parameters (used in toggleAttribute(...) function of vehicles, persons and containers
void replaceLastParentAdditional(SumoXMLTag tag, const std::string &value)
replace the last parent additional
void replaceLastParentJunction(const std::string &value)
replace the last parent junction
A road/street connecting two junctions (netedit-version)
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
GNELane * getLaneByAllowedVClass(const SUMOVehicleClass vClass) const
return the first lane that allow a vehicle of type vClass (or the first lane, if none was found)
const std::vector< GNEJunction * > & getParentJunctions() const
get parent junctions
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
bool exist(const GNELane *toLane) const
check if exist a lane2lane geometry for the given toLane
const GUIGeometry & getLane2laneGeometry(const GNELane *toLane) const
get lane2lane geometry
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const PositionVector & getLaneShape() const
get elements shape
const GNELane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
int getIndex() const
returns the index of the lane
const GUIGeometry & getLaneGeometry() const
GNEEdge * getParentEdge() const
get parent edge
double myMoveElementLateralOffset
move element lateral offset (used by elements placed over lanes
bool getAllowChangeLane() const
allow change lane
CommonModeOptions * getCommonModeOptions() const
get common mode options
const GNELane * newFirstLane
new first Lane
double newFirstPos
new first position
const GNELane * newSecondLane
new second Lane
const GNEMoveOperation::OperationType operationType
move operation
double firstLaneOffset
lane offset
double newSecondPos
new second position
std::vector< GNEDemandElement * > getSelectedDemandElements() const
get selected demand elements
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
A NBNetBuilder extended by visualisation and editing capabilities.
const Boundary & getBoundary() const
returns the bounder of the network
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEPathManager * getPathManager()
get path manager
GNEViewNet * getViewNet() const
get view net
bool consecutiveEdgesConnected(const SUMOVehicleClass vClass, const GNEEdge *from, const GNEEdge *to) const
check if exist a path between the two given consecutive edges for the given VClass
std::vector< GNEEdge * > calculateDijkstraPath(const SUMOVehicleClass vClass, const std::vector< GNEEdge * > &partialEdges) const
calculate Dijkstra path between a list of partial edges
bool drawPathGeometry(const bool dottedElement, const GNELane *lane, SumoXMLTag tag)
check if path element geometry must be drawn in the given lane
virtual Position getPathElementArrivalPos() const =0
get path element arrival position
bool isRoute() const
check if pathElement is a route
PathElement()=delete
invalidate default constructor
PathElement * getPathElement() const
get path element
Segment * getNextSegment() const
get next segment
bool isLastSegment() const
check if segment is the last path's segment
bool isFirstSegment() const
check if segment is the first path's segment
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
PathDraw * getPathDraw()
obtain instance of PathDraw
void calculatePathJunctions(PathElement *pathElement, SUMOVehicleClass vClass, const std::vector< GNEJunction * > junctions)
calculate path junctions (using dijkstra, require path calculator updated)
void calculatePathLanes(PathElement *pathElement, SUMOVehicleClass vClass, const std::vector< GNELane * > lanes)
calculate path lanes (using dijkstra, require path calculator updated)
bool isPathValid(const PathElement *pathElement) const
check if path element is valid
static void transformToRouteFlow(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform routeFlow over an existent route
static void transformToFlow(GNEVehicle *originalVehicle)
transform to flow
static void transformToTrip(GNEVehicle *originalVehicle)
transform to trip
static void transformToVehicle(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform vehicle functions
bool isFlow() const
return true if tag correspond to a flow element
bool hasEmbeddedRoute() const
return true if tag correspond to an element that owns an embedded route
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
bool isCalibrator() const
return true if tag correspond to a calibrator (Only used to group all detectors in the XML)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
const std::string & getDefaultValue(SumoXMLAttr attr) const
return the default value of the attribute of an element
SumoXMLTag getXMLTag() const
get XML tag
GNEDemandElement * getCurrentType() const
get current Vehicle Type
TypeSelector * getTypeSelector() const
get vehicle type selector
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
const Parameterised::Map & getACParametersMap() const
get parameters map
GNELane * getLastPathLane() const
get last path lane
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children)
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GNEMoveOperation * getMoveOperation()
get move operation
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
std::string getParentName() const
Returns the name of the parent object.
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object.
void computePathElement()
compute pathElement
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
double getAttributeDouble(SumoXMLAttr key) const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool isAttributeEnabled(SumoXMLAttr key) const
const RGBColor & getColor() const
get color
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
GNELane * getFirstPathLane() const
get first path lane
Problem isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
static const double myArrivalPositionDiameter
vehicle arrival position radius
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void updateGeometry()
update pre-computed geometry information
Position getAttributePosition(SumoXMLAttr key) const
std::string getBegin() const
get begin time of demand element
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Position getPositionInView() const
Returns position of demand element in view.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform demand element changes
void toggleAttribute(SumoXMLAttr key, const bool value)
method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute)
RGBColor setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
void writeDemandElement(OutputDevice &device) const
write demand element element into a xml file
GNEVehicle(SumoXMLTag tag, GNENet *net)
default constructor
SUMOVehicleClass getVClass() const
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
bool drawSelectContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw select contour
bool drawDeleteContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw delete contour
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
GNEViewParent * getViewParent() const
get the net object
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
GNEMoveFrame * getMoveFrame() const
get frame for move elements
GNETypeFrame * getTypeFrame() const
get frame for DEMAND_TYPE
static void drawAction_drawVehicleAsTrianglePlus(const double width, const double length, bool amReversed=false)
draw vehicle as a triangle
static void drawAction_drawVehicleAsPoly(const GUIVisualizationSettings &s, const SUMOVehicleShape shape, const double width, const double length, int carriageIndex=-1, bool isStopped=false, bool amReversed=false)
draw vehicle as a polygon
static void drawAction_drawVehicleAsBoxPlus(const double width, const double length, bool amReversed=false)
draw vehicle as a Box
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
static void drawDottedSquaredShape(const GUIVisualizationSettings &s, const DottedContourType type, const Position &pos, const double width, const double height, const double offsetX, const double offsetY, const double rot, const double exaggeration)
draw dotted squared contour (used by additionals and demand elements)
static void drawDottedContourShape(const GUIVisualizationSettings &s, const DottedContourType type, const PositionVector &shape, const double width, const double exaggeration, const bool drawFirstExtrem, const bool drawLastExtrem)
draw dotted contour for the given shape (used by additionals)
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
static void drawGeometry(const GUIVisualizationSettings &s, const Position &mousePos, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
void updateSinglePosGeometry(const Position &position, const double rotation)
update position and rotation
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
bool mouseWithinGeometry(const Position center, const double radius) const
check if mouse is within elements geometry (for circles)
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app) const
Builds an entry which allows to copy the cursor position if geo projection is used,...
GUIGlID getGlID() const
Returns the numerical id of the object.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
T getColor(const double value) const
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings addName
GUIVisualizationTextSettings vehicleName
GUIVisualizationSizeSettings vehicleSize
GUIColorer vehicleColorer
The vehicle colorer.
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
GUIVisualizationDetailSettings detailSettings
detail settings
GUIVisualizationWidthSettings widthSettings
width settings
GUIVisualizationColorSettings colorSettings
color settings
double scale
information about a lane's width (temporary, used for a single view)
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
bool drawMinGap
Information whether the minimum gap shall be drawn.
GUIVisualizationTextSettings personName
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
double angle
The current view rotation angle.
static OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static bool areParametersValid(const std::string &value, bool report=false, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
std::map< std::string, std::string > Map
parameters map
void setParametersStr(const std::string ¶msString, const std::string kvsep="=", const std::string sep="|")
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
std::string getParametersStr(const std::string kvsep="=", const std::string sep="|") const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
A point in 2D or 3D with translation and scaling methods.
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
static const Position INVALID
used to indicate that a position is valid
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
double distanceSquaredTo(const Position &p2) const
returns the square of the distance to another position
double x() const
Returns the x-position.
double angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position
double y() const
Returns the y-position.
double length2D() const
Returns the length.
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
static const RGBColor WHITE
static const RGBColor BLUE
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
static const RGBColor DEFAULT_COLOR
The default color (for vehicle types and vehicles)
static const RGBColor RED
named colors
Structure representing possible vehicle parameter.
double departPosLat
(optional) The lateral position the vehicle shall depart from
double arrivalPosLat
(optional) The lateral position the vehicle shall arrive on
std::string getArrivalSpeed() const
obtain arrival speed parameter in string format
double repetitionProbability
The probability for emitting a vehicle per second.
int parametersSet
Information for the router which parameter were set, TraCI may modify this (when changing color)
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
ArrivalSpeedDefinition arrivalSpeedProcedure
Information how the vehicle's end speed shall be chosen.
double departSpeed
(optional) The initial speed of the vehicle
SumoXMLTag tag
The vehicle tag.
std::string vtypeid
The vehicle's type id.
std::string getDepartLane() const
obtain depart lane parameter in string format
SUMOTime repetitionOffset
The time offset between vehicle reinsertions.
void parseInsertionChecks(const std::string &value)
parses insertion checks
std::vector< std::string > via
List of the via-edges the vehicle must visit.
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.
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.
ArrivalLaneDefinition arrivalLaneProcedure
Information how the vehicle shall choose the lane to arrive on.
void write(OutputDevice &dev, const OptionsCont &oc, const SumoXMLTag altTag=SUMO_TAG_VEHICLE, const std::string &typeID="") const
Writes the parameters as a beginning element.
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
std::string getArrivalLane() const
obtain arrival lane parameter in string format
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.
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.
int personNumber
The static number of persons in the vehicle when it departs (not including boarding persons)
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.
RouteIndexDefinition arrivalEdgeProcedure
Information how the vehicle's final edge shall be chosen.
DepartPosLatDefinition departPosLatProcedure
Information how the vehicle shall choose the lateral departure position.
SUMOTime repetitionEnd
The time at which the flow ends (only needed when using repetitionProbability)
std::string getDepartSpeed() const
obtain depart speed parameter in string format
std::string getArrivalPos() const
obtain arrival pos parameter in string format
double departPos
(optional) The position the vehicle shall depart from
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
RGBColor color
The vehicle's color, TraCI may change this.
bool areInsertionChecksValid(const std::string &value) const
check if given insertion checks are valid
double arrivalPos
(optional) The position the vehicle shall arrive on
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.
std::string getInsertionChecks() const
get insertion checks in string format
std::string routeid
The vehicle's route id.
std::string id
The vehicle's id.
int departEdge
(optional) The initial edge within the route of the vehicle
static bool parseDepart(const std::string &val, const std::string &element, const std::string &id, SUMOTime &depart, DepartDefinition &dd, std::string &error, const std::string &attr="departure")
Validates a given depart value.
bool wasSet(int what) const
Returns whether the given parameter was set.
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
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.
std::string getDepartPosLat() const
obtain depart pos lat parameter in string format
std::string getArrivalPosLat() const
obtain arrival pos lat parameter in string format
std::string getDepartPos() const
obtain depart pos parameter in string format
std::string toTaz
The vehicle's destination zone (district)
double arrivalSpeed
(optional) The final speed of the vehicle (not used yet)
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
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.
int arrivalEdge
(optional) The final edge within the route of the vehicle
std::string fromTaz
The vehicle's origin zone (district)
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
std::string line
The vehicle's line (mainly for public transport)
int containerNumber
The static number of containers in the vehicle when it departs.
RouteIndexDefinition departEdgeProcedure
Information how the vehicle's initial edge shall be chosen.
ArrivalPosLatDefinition arrivalPosLatProcedure
Information how the vehicle shall choose the lateral arrival position.
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
bool showDemandElements() const
check if show demand elements checkbox is enabled
bool drawSpreadVehicles() const
check if vehicles must be drawn spread
bool showNonInspectedDemandElements(const GNEDemandElement *demandElement) const
check if non inspected element has to be hidden
bool showAllTrips() const
check if trips has to be drawn
DemandEditMode demandEditMode
the current Demand edit mode
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
static void drawLockIcon(const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position viewPosition, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
bool drawSpreadVehicles() const
check if vehicles must be drawn spread
bool showDemandElements() const
check if show demand elements checkbox is enabled
RGBColor vehicleTripColor
color for vehicle trips
RGBColor selectedVehicleColor
vehicle selection color
static const double vehicleTriangles
details for draw person as triangles
static const double vehicleShapes
details for draw person as shapes
static const double vehicleBoxes
details for draw person as boxes
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
bool show(const GUIGlObject *o) const
whether to show the text
double scaledSize(double scale, double constFactor=0.1) const
get scale size
double tripWidth
width for trips