59 myTransformToVehicle(
nullptr),
60 myTransformToVehicleWithEmbeddedRoute(
nullptr),
61 myTransformToRouteFlow(
nullptr),
62 myTransformToRouteFlowWithEmbeddedRoute(
nullptr),
63 myTransformToTrip(
nullptr),
64 myTransformToFlow(
nullptr) {
66 myVehicle->buildPopupHeader(
this, app);
68 myVehicle->buildCenterPopupEntry(
this);
69 myVehicle->buildPositionCopyEntry(
this,
false);
73 new FXMenuSeparator(
this);
75 myVehicle->getNet()->getViewNet()->buildSelectionACPopupEntry(
this, myVehicle);
76 myVehicle->buildShowParamsPopupEntry(
this);
78 if (myVehicle->getNet()->getViewNet()->getEditModes().isCurrentSupermodeDemand()) {
85 FXMenuPane* transformOperation =
new FXMenuPane(
this);
86 this->insertMenuPaneChild(transformOperation);
87 new FXMenuCascade(
this,
"transform to",
nullptr, transformOperation);
97 myTransformToVehicle->disable();
99 myTransformToVehicleWithEmbeddedRoute->disable();
101 myTransformToRouteFlow->disable();
103 myTransformToRouteFlowWithEmbeddedRoute->disable();
104 }
else if (myVehicle->getTagProperty().getTag() ==
SUMO_TAG_TRIP) {
105 myTransformToTrip->disable();
106 }
else if (myVehicle->getTagProperty().getTag() ==
SUMO_TAG_FLOW) {
107 myTransformToFlow->disable();
118 if (obj == myTransformToVehicle) {
120 }
else if (obj == myTransformToVehicleWithEmbeddedRoute) {
122 }
else if (obj == myTransformToRouteFlow) {
124 }
else if (obj == myTransformToRouteFlowWithEmbeddedRoute) {
126 }
else if (obj == myTransformToTrip) {
128 }
else if (obj == myTransformToFlow) {
140 mySelectedVehicles(selectedVehicle),
142 myTransformToVehicle(nullptr),
143 myTransformToVehicleWithEmbeddedRoute(nullptr),
144 myTransformToRouteFlow(nullptr),
145 myTransformToRouteFlowWithEmbeddedRoute(nullptr),
146 myTransformToTrip(nullptr),
147 myTransformToFlow(nullptr),
148 myTransformAllVehiclesToVehicle(nullptr),
149 myTransformAllVehiclesToVehicleWithEmbeddedRoute(nullptr),
150 myTransformAllVehiclesToRouteFlow(nullptr),
151 myTransformAllVehiclesToRouteFlowWithEmbeddedRoute(nullptr),
152 myTransformAllVehiclesToTrip(nullptr),
153 myTransformAllVehiclesToFlow(nullptr) {
162 new FXMenuSeparator(
this);
174 FXMenuPane* transformOperation =
new FXMenuPane(
this);
176 new FXMenuCascade(
this,
"transform to",
nullptr, transformOperation);
191 new FXMenuSeparator(transformOperation);
209 for (
const auto& i : mySelectedVehicles) {
210 if ((obj == myTransformToVehicle) &&
211 (i->getTagProperty().getTag() == myVehicleTag)) {
213 }
else if ((obj == myTransformToVehicleWithEmbeddedRoute) &&
214 (i->getTagProperty().getTag() == myVehicleTag)) {
216 }
else if ((obj == myTransformToRouteFlow) &&
217 (i->getTagProperty().getTag() == myVehicleTag)) {
219 }
else if ((obj == myTransformToRouteFlowWithEmbeddedRoute) &&
220 (i->getTagProperty().getTag() == myVehicleTag)) {
222 }
else if ((obj == myTransformToTrip) &&
223 (i->getTagProperty().getTag() == myVehicleTag)) {
225 }
else if ((obj == myTransformToFlow) &&
226 (i->getTagProperty().getTag() == myVehicleTag)) {
228 }
else if (obj == myTransformAllVehiclesToVehicle) {
230 }
else if (obj == myTransformAllVehiclesToVehicleWithEmbeddedRoute) {
232 }
else if (obj == myTransformAllVehiclesToRouteFlow) {
234 }
else if (obj == myTransformAllVehiclesToRouteFlowWithEmbeddedRoute) {
236 }
else if (obj == myTransformAllVehiclesToTrip) {
238 }
else if (obj == myTransformAllVehiclesToFlow) {
251 {}, {}, {}, {}, {}, {}, {vehicleType, route}, {}),
256 vtypeid = vehicleType->getID();
262 {}, {}, {}, {}, {}, {}, {vehicleType, route}, {}),
265 id = vehicleParameters.
id;
267 vtypeid = vehicleType->getID();
273 {}, {}, {}, {}, {}, {}, {vehicleType}, {}),
276 id = vehicleParameters.
id;
280 vtypeid = vehicleType->getID();
285 const std::vector<GNEEdge*>& via) :
287 {}, {fromEdge, toEdge}, {}, {}, {}, {}, {vehicleType}, {}),
299 {}, {fromEdge, toEdge}, {}, {}, {}, {}, {vehicleType}, {}),
316 departStr.reserve(20 - departStr.size());
318 for (
int i = (
int)departStr.size(); i < 20; i++) {
319 departStr.insert(departStr.begin(),
'0');
352 if (
via.size() > 0) {
379 i->writeDemandElement(device);
393 }
else if (
getPath().size() > 0) {
426 return (
"There is no valid path between edges '" +
getParentEdges().at((
int)i - 1)->getID() +
"' and '" +
getParentEdges().at(i)->getID() +
"'");
435 for (
int i = 1; i < (int)routeEdges.size(); i++) {
437 return (
"There is no valid path between route edges '" + routeEdges.at((
int)i - 1)->getID() +
"' and '" + routeEdges.at(i)->getID() +
"'");
446 for (
int i = 1; i < (int)routeEdges.size(); i++) {
448 return (
"There is no valid path between embebbed route edges '" + routeEdges.at((
int)i - 1)->getID() +
"' and '" + routeEdges.at(i)->getID() +
"'");
526 }
else if ((
getPath().size() > 0) &&
getPath().front().getLane()) {
528 firstLane =
getPath().front().getLane();
603 std::vector<GNEVehicle*> selectedVehicles;
604 selectedVehicles.reserve(selectedDemandElements.size());
605 for (
const auto& i : selectedDemandElements) {
606 if (i->getTagProperty().isVehicle()) {
607 selectedVehicles.push_back(
dynamic_cast<GNEVehicle*
>(i));
635 vehicleBoundary.
grow(20);
636 return vehicleBoundary;
657 const double vehicleSizeSquared = (width * width) * (length * length) * (exaggeration * exaggeration);
675 glTranslated(vehiclePosition.
x(), vehiclePosition.
y(), 0);
676 glRotated(vehicleRotation, 0, 0, -1);
678 glTranslated(0, (-1) * length * exaggeration, 0);
689 glTranslated(vehiclePosition.
x(), vehiclePosition.
y(), 0);
690 glRotated(vehicleRotation, 0, 0, -1);
692 glTranslated(0, (-1) * length * exaggeration, 0);
695 double upscaleLength = exaggeration;
696 if ((exaggeration > 1) && (length > 5)) {
698 upscaleLength =
MAX2(1.0, upscaleLength * (5 + sqrt(length - 5)) / length);
700 glScaled(exaggeration, upscaleLength, 1);
731 glColor3d(0., 1., 0.);
734 glVertex2d(0., minGap);
735 glVertex2d(-.5, minGap);
736 glVertex2d(.5, minGap);
740 glTranslated(0,
MIN2(length / 2,
double(5)), -
getType());
741 glScaled(1 / exaggeration, 1 / upscaleLength, 1);
742 glRotated(vehicleRotation, 0, 0, -1);
754 drawStackLabel(vehiclePosition, vehicleRotation, width, length, exaggeration);
758 drawFlowLabel(vehiclePosition, vehicleRotation, width, length, exaggeration);
789 glTranslated(0, 0,
getType() + offsetFront);
797 if (drawSpreadVehicles) {
800 if (segment.isLaneSegment() && (segment.getLane() == lane)) {
807 if (segment.isLaneSegment() && (segment.getLane() == lane)) {
825 if (segment.isLaneSegment() && (segment.getLane() == lane)) {
827 if (firstLane == lane) {
830 }
else if (lastLane == lane) {
859 glTranslated(0, 0,
getType() + offsetFront);
1104 return canParse<RGBColor>(value);
1106 int dummyDepartLane;
1110 if (error.empty()) {
1112 if (lane ==
nullptr) {
1124 double dummyDepartPos;
1128 return error.empty();
1131 double dummyDepartSpeed;
1135 if (error.empty()) {
1146 int dummyArrivalLane;
1150 return error.empty();
1153 double dummyArrivalPos;
1157 return error.empty();
1160 double dummyArrivalSpeed;
1164 return error.empty();
1169 return canParse<int>(value) && parse<int>(value) >= 0;
1171 return canParse<int>(value) && parse<int>(value) >= 0;
1175 double dummyDepartPosLat;
1179 return error.empty();
1182 double dummyArrivalPosLat;
1186 return error.empty();
1194 return error.empty();
1207 if (value.empty()) {
1210 return canParse<std::vector<GNEEdge*> >(
myNet, value,
false);
1214 if (canParse<double>(value)) {
1215 return (parse<double>(value) >= 0);
1220 if (value.empty()) {
1222 }
else if (canParse<double>(value)) {
1223 return (parse<double>(value) >= 0);
1228 if (value.empty()) {
1230 }
else if (canParse<double>(value)) {
1231 return (parse<double>(value) > 0);
1236 if (value.empty()) {
1238 }
else if (canParse<double>(value)) {
1239 return (parse<double>(value) > 0);
1244 if (value.empty()) {
1246 }
else if (canParse<double>(value)) {
1247 return (parse<double>(value) >= 0);
1252 if (canParse<int>(value)) {
1253 return (parse<int>(value) >= 0);
1259 return canParse<bool>(value);
1324 for (
const auto& i :
via) {
1336 const std::map<std::string, std::string>&
1410 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
1419 double hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
M_PI;
1428 double hue = 180. + atan2(pb.
x() - pe.
x(), pb.
y() - pe.
y()) * 180. /
M_PI;
1436 std::hash<const GNEVehicle*> ptr_hash;
1437 const double hue = (double)(ptr_hash(
this) % 360);
1438 const double sat = ((ptr_hash(
this) / 360) % 67) / 100.0 + 0.33;
1458 bool updateSpreadStackGeometry =
false;
1466 childDemandElement->setMicrosimID(
getID());
1476 color = parse<RGBColor>(value);
1510 updateSpreadStackGeometry =
true;
1548 updateSpreadStackGeometry =
true;
1642 updateSpreadStackGeometry =
true;
1650 updateSpreadStackGeometry =
true;
1658 updateSpreadStackGeometry =
true;
1662 if (!value.empty()) {
1664 via = parse< std::vector<std::string> >(value);
1677 updateSpreadStackGeometry =
true;
1702 if (parse<bool>(value)) {
1715 if (updateSpreadStackGeometry) {
1739 const double contourWidth = (0.05 * exaggeration);
1744 glRotated(vehicleRotation, 0, 0, -1);
1745 glTranslated((width * exaggeration * 0.5) + (0.35 * exaggeration), 0, 0);
1750 glTranslated(0, 0, 0.1);
1763 const double contourWidth = (0.05 * exaggeration);
1768 glRotated(vehicleRotation, 0, 0, -1);
1769 glTranslated(-1 * ((width * 0.5 * exaggeration) + (0.35 * exaggeration)), 0, 0);
1774 glTranslated(0, 0, 0.1);
FXDEFMAP(GNEVehicle::GNESingleVehiclePopupMenu) GNESingleVehiclePopupMenuMap[]
@ 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
@ GLO_PERSONFLOW
a person flow
std::string time2string(SUMOTime t)
convert SUMOTime to string
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
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 appearences.
const std::string DEFAULT_VTYPE_ID
const int VEHPARS_PROB_SET
const int VEHPARS_VPH_SET
const int VEHPARS_END_SET
const int VEHPARS_ROUTE_SET
const int VEHPARS_COLOR_SET
DepartLaneDefinition
Possible ways to choose a lane on depart.
@ GIVEN
The lane is given.
ArrivalSpeedDefinition
Possible ways to choose the arrival speed.
DepartPosDefinition
Possible ways to choose the departure position.
@ GIVEN
The position is given.
ArrivalLaneDefinition
Possible ways to choose the arrival lane.
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_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 departure position.
const int VEHPARS_VTYPE_SET
const int VEHPARS_ARRIVALPOS_SET
DepartDefinition
Possible ways to depart.
const int VEHPARS_VIA_SET
const int VEHPARS_DEPARTPOSLAT_SET
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_VTYPE
description of a vehicle 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 (used in NETEDIT)
@ GNE_TAG_FLOW_WITHROUTE
description of a vehicle with an embedded route (used in NETEDIT)
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
@ SUMO_TAG_ROUTE
begin/end of the description of a route
@ GNE_TAG_VEHICLE_WITHROUTE
@ GNE_TAG_ROUTE_EMBEDDED
embedded route (used in NETEDIT)
@ 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_SELECTED
element is selected
@ SUMO_ATTR_BEGIN
weights: time range begin
@ 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
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 drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, const int align=0, double width=-1)
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)
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 Tag Property assigned to this object
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
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
the xml tag to which this attribute carrier corresponds
An Element which don't belongs to GNENet but has influency in the simulation.
GNEGeometry::SegmentGeometry myDemandElementSegmentGeometry
demand element segment geometry (also called "stacked geometry")
void replaceDemandElementParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace demand element parent
GNELane * getLastAllowedVehicleLane() const
get first allowed vehicle lane
void replaceLastParentEdge(const std::string &value)
replace the last parent edge
GNEGeometry::Geometry mySpreadGeometry
demand element spread geometry (Only used by vehicles and pedestrians)
void replaceFirstParentEdge(const std::string &value)
replace the first parent edge
int myStackedLabelNumber
stacked label number
GNEGeometry::Geometry myDemandElementGeometry
demand element geometry (also called "stacked geometry")
GNELane * getFirstAllowedVehicleLane() const
get first allowed vehicle lane
void replaceMiddleParentEdges(const std::string &value, const bool updateChildReferences)
replace middle (via) parent edges
std::vector< GNEEdge * > getViaEdges() const
get middle (via) parent edges
const std::string & getID() const
get ID
A road/street connecting two junctions (netedit-version)
void updateVehicleStackLabels()
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
class for pack all variables related with DottedGeometry
class for NETEDIT geometries over lanes
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
update geometry shape
bool exist(const GNELane *toLane) const
check if exist a lane2lane geometry for the given tolane
const GNEGeometry::Geometry & getLane2laneGeometry(const GNELane *toLane) const
get lane2lane geometry
const GNEGeometry::DottedGeometry & getLane2laneDottedGeometry(const GNELane *toLane) const
get lane2lane dotted geometry
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const PositionVector & getLaneShape() const
const GNEGeometry::DottedGeometry & getDottedLaneGeometry() const
get dotted lane geometry
const GNEGeometry::Lane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
GNEEdge * getParentEdge() const
get arent edge
void updateID(GNEAttributeCarrier *AC, const std::string newID)
update ID
std::vector< GNEEdge * > calculatePath(const SUMOVehicleClass vClass, const std::vector< GNEEdge * > &partialEdges) const
calculate Dijkstra path between a list of partial edges
bool consecutiveEdgesConnected(const SUMOVehicleClass vClass, const GNEEdge *from, const GNEEdge *to) const
check if exist a path between the two given consecutives edges for the given VClass
A NBNetBuilder extended by visualisation and editing capabilities.
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true) const
get edge by id
const Boundary & getBoundary() const
returns the bounder of the network
std::vector< GNEDemandElement * > retrieveDemandElements(bool onlySelected=false) const
return all demand elements
GNENetHelper::PathCalculator * getPathCalculator()
obtain instance of PathCalculator
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
GNEViewNet * getViewNet() const
get view net
void calculatePathLanes(SUMOVehicleClass vClass, const bool allowedVClass, GNELane *fromLane, GNELane *toLane, const std::vector< GNEEdge * > &viaEdges)
calculate path lanes (Dijkstra)
const std::vector< GNEPathElements::PathElement > & getPath() const
get path edges
void resetPathLanes(SUMOVehicleClass vClass, const bool allowedVClass, GNELane *fromLane, GNELane *toLane, const std::vector< GNEEdge * > &viaEdges)
reset path lanes
static void transformToRouteFlow(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform routeFlow over an existent route
static void transformToFlow(GNEVehicle *originalVehicle)
transform to flow
static void setFlowParameters(const SumoXMLAttr attribute, int ¶meters)
configure flow parameters
static void transformToTrip(GNEVehicle *originalVehicle)
transform to trip
static void transformToVehicle(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform vehicle functions
bool hasTagSynonym() const
return true if tag correspond to an element that will be written in XML with another tag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
SumoXMLTag getTagSynonym() const
get tag synonym
const std::string & getDefaultValue(SumoXMLAttr attr) const
return the default value of the attribute of an element
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void drawFlowLabel(const Position &vehiclePosition, const double vehicleRotation, const double width, const double length, const double exaggeration) const
draw flow label
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
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.
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
std::string getParentName() const
Returns the name of the parent object.
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
const std::map< std::string, std::string > & getACParametersMap() const
get parameters map
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute)
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
void computePath()
compute path
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
void startGeometryMoving()
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
std::string getBegin() const
get begin time of demand element
bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
void drawStackLabel(const Position &vehiclePosition, const double vehicleRotation, const double width, const double length, const double exaggeration) const
draw stack label
Position getPositionInView() const
Returns position of demand element in view.
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
void invalidatePath()
invalidate path
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 drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const double offsetFront) const
Draws partial object.
void writeDemandElement(OutputDevice &device) const
writte demand element element into a xml file
SUMOVehicleClass getVClass() const
GNEVehicle(SumoXMLTag tag, GNENet *net, const std::string &vehicleID, GNEDemandElement *vehicleType, GNEDemandElement *route)
default constructor for vehicles and routeFlows without embedded routes
void endGeometryMoving()
end geometry movement
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
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
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, GUIGlObjectType objectType, const double extraOffset=0)
draw front attributeCarrier
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
static void drawAction_drawVehicleAsPoly(const GUIVisualizationSettings &s, const SUMOVehicleShape shape, const double width, const double length, int carriageIndex=-1)
draw vehicle as a polygon
static void drawAction_drawVehicleAsTrianglePlus(const double width, const double length)
draw vehicle as a triangle
static void drawAction_drawVehicleAsBoxPlus(const double width, const double length)
draw vehicle as a Box
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
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.
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) const
draw name of item
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
const T getColor(const double value) const
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
bool drawDottedContour() const
check if dotted contour can be drawn
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
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, ParameterisedAttrType attrType=ParameterisedAttrType::STRING, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
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"
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".
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
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 distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
double x() const
Returns the x-position.
double y() const
Returns the y-position.
double length() const
Returns the length.
static const RGBColor WHITE
static const RGBColor BLUE
static const RGBColor GREY
static const RGBColor CYAN
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 BLACK
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.
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.
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.
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.
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.
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.
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 routeid
The vehicle's route id.
std::string id
The vehicle's id.
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.
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
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.
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.
ArrivalPosLatDefinition arrivalPosLatProcedure
Information how the vehicle shall choose the lateral arrival position.
static bool isValidTypeID(const std::string &value)
whether the given string is a valid id for an edge or vehicle type
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
struct for variables used in Geometry extremes
double laneEndPosition
arrival position over lane
double laneStartPosition
depart position over lane
static void drawDottedContourLane(const DottedContourType type, const GUIVisualizationSettings &s, const DottedGeometry &dottedGeometry, const double width, const bool drawFirstExtrem, const bool drawLastExtrem)
draw dotted contour for the given dottedGeometry (used by lanes, routes, etc.)
static void calculateLaneGeometricPath(GNEGeometry::SegmentGeometry &segmentGeometry, const std::vector< GNEPathElements::PathElement > &path, GNEGeometry::ExtremeGeometry &extremeGeometry)
calculate route between lanes
static void drawSegmentGeometry(const GNEViewNet *viewNet, const SegmentGeometry::Segment &segment, const double width)
draw geometry segment
static void drawGeometry(const GNEViewNet *viewNet, const Geometry &geometry, const double width)
draw geometry
static void drawDottedSquaredShape(const DottedContourType type, const GUIVisualizationSettings &s, 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)
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 isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool drawSpreadVehicles() const
check if vehicles must be drawn spread
bool showDemandElements() const
check if show demand elements checkbox is enabled
static const RGBColor vehicleTrips
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
double scaledSize(double scale, double constFactor=0.1) const
get scale size
static const double trip
width for trips