Skip to content

Commit

Permalink
Added default constructor to all demand elements (used by TagSelector…
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Nov 25, 2021
1 parent 9d9e35b commit c8d2bf3
Show file tree
Hide file tree
Showing 26 changed files with 288 additions and 117 deletions.
12 changes: 10 additions & 2 deletions src/netedit/elements/demand/GNEContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,18 @@ GNEContainer::GNESelectedContainersPopupMenu::onCmdTransform(FXObject* obj, FXSe
// member method definitions
// ===========================================================================

GNEContainer::GNEContainer(SumoXMLTag tag, GNENet* net) :
GNEDemandElement("", net, GLO_CONTAINER, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {}, {}, {}, {}, {}, {}, {}) {
// reset default values
resetDefaultValues();
}


GNEContainer::GNEContainer(SumoXMLTag tag, GNENet* net, GNEDemandElement* pType, const SUMOVehicleParameter& containerparameters) :
GNEDemandElement(containerparameters.id, net, (tag == SUMO_TAG_CONTAINERFLOW) ? GLO_CONTAINERFLOW : GLO_CONTAINER, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {}, {}, {}, {}, {}, {pType}, {}),
SUMOVehicleParameter(containerparameters) {
{}, {}, {}, {}, {}, {}, {pType}, {}),
SUMOVehicleParameter(containerparameters) {
// set manually vtypeID (needed for saving)
vtypeid = pType->getID();
}
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/demand/GNEContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ class GNEContainer : public GNEDemandElement, public SUMOVehicleParameter {
FXMenuCommand* myTransformToContainerFlow;
};

/// @brief default constructor
GNEContainer(SumoXMLTag tag, GNENet* net);

/// @brief constructor for containers
GNEContainer(SumoXMLTag tag, GNENet* net, GNEDemandElement* pType, const SUMOVehicleParameter& containerparameters);

Expand Down
12 changes: 10 additions & 2 deletions src/netedit/elements/demand/GNEPerson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,18 @@ GNEPerson::GNESelectedPersonsPopupMenu::onCmdTransform(FXObject* obj, FXSelector
// member method definitions
// ===========================================================================

GNEPerson::GNEPerson(SumoXMLTag tag, GNENet* net) :
GNEDemandElement("", net, GLO_PERSON, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {}, {}, {}, {}, {}, {}, {}) {
// reset default values
resetDefaultValues();
}


GNEPerson::GNEPerson(SumoXMLTag tag, GNENet* net, GNEDemandElement* pType, const SUMOVehicleParameter& personparameters) :
GNEDemandElement(personparameters.id, net, (tag == SUMO_TAG_PERSONFLOW) ? GLO_PERSONFLOW : GLO_PERSON, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {}, {}, {}, {}, {}, {pType}, {}),
SUMOVehicleParameter(personparameters) {
{}, {}, {}, {}, {}, {}, {pType}, {}),
SUMOVehicleParameter(personparameters) {
// set manually vtypeID (needed for saving)
vtypeid = pType->getID();
}
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/demand/GNEPerson.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ class GNEPerson : public GNEDemandElement, public SUMOVehicleParameter {
FXMenuCommand* myTransformToPersonFlow;
};

/// @brief default constructor
GNEPerson(SumoXMLTag tag, GNENet* net);

/// @brief constructor for persons
GNEPerson(SumoXMLTag tag, GNENet* net, GNEDemandElement* pType, const SUMOVehicleParameter& personparameters);

Expand Down
25 changes: 17 additions & 8 deletions src/netedit/elements/demand/GNEPersonTrip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,32 @@
// method definitions
// ===========================================================================

GNEPersonTrip::GNEPersonTrip(SumoXMLTag tag, GNENet* net) :
GNEDemandElement("", net, GLO_PERSONTRIP, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {}, {}, {}, {}, {}, {}, {}),
myArrivalPosition(0) {
// reset default values
resetDefaultValues();
}


GNEPersonTrip::GNEPersonTrip(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge,
double arrivalPosition, const std::vector<std::string>& types, const std::vector<std::string>& modes) :
GNEDemandElement(personParent, net, GLO_PERSONTRIP, GNE_TAG_PERSONTRIP_EDGE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {fromEdge, toEdge}, {}, {}, {}, {}, {personParent}, {}),
myArrivalPosition(arrivalPosition),
myVTypes(types),
myModes(modes) {
{}, {fromEdge, toEdge}, {}, {}, {}, {}, {personParent}, {}),
myArrivalPosition(arrivalPosition),
myVTypes(types),
myModes(modes) {
}


GNEPersonTrip::GNEPersonTrip(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* toBusStop,
double arrivalPosition, const std::vector<std::string>& types, const std::vector<std::string>& modes) :
GNEDemandElement(personParent, net, GLO_PERSONTRIP, GNE_TAG_PERSONTRIP_BUSSTOP, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {fromEdge}, {}, {toBusStop}, {}, {}, {personParent}, {}),
myArrivalPosition(arrivalPosition),
myVTypes(types),
myModes(modes) {
{}, {fromEdge}, {}, {toBusStop}, {}, {}, {personParent}, {}),
myArrivalPosition(arrivalPosition),
myVTypes(types),
myModes(modes) {
}


Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/demand/GNEPersonTrip.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class GNEVehicle;
class GNEPersonTrip : public GNEDemandElement, public Parameterised {

public:
/// @brief default constructor
GNEPersonTrip(SumoXMLTag tag, GNENet* net);

/**@brief parameter constructor for person edge->edge
* @param[in] viewNet view in which this PersonTrip is placed
* @param[in] personParent person parent
Expand Down
21 changes: 15 additions & 6 deletions src/netedit/elements/demand/GNERide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,30 @@
// method definitions
// ===========================================================================

GNERide::GNERide(SumoXMLTag tag, GNENet* net) :
GNEDemandElement("", net, GLO_RIDE, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {}, {}, {}, {}, {}, {}, {}),
myArrivalPosition(0) {
// reset default values
resetDefaultValues();
}


GNERide::GNERide(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge,
double arrivalPosition, const std::vector<std::string>& lines) :
GNEDemandElement(personParent, net, GLO_RIDE, GNE_TAG_RIDE_EDGE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {fromEdge, toEdge}, {}, {}, {}, {}, {personParent}, {}),
myArrivalPosition(arrivalPosition),
myLines(lines) {
{}, {fromEdge, toEdge}, {}, {}, {}, {}, {personParent}, {}),
myArrivalPosition(arrivalPosition),
myLines(lines) {
}


GNERide::GNERide(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* toBusStop,
double arrivalPosition, const std::vector<std::string>& lines) :
GNEDemandElement(personParent, net, GLO_RIDE, GNE_TAG_RIDE_BUSSTOP, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {fromEdge}, {}, {toBusStop}, {}, {}, {personParent}, {}),
myArrivalPosition(arrivalPosition),
myLines(lines) {
{}, {fromEdge}, {}, {toBusStop}, {}, {}, {personParent}, {}),
myArrivalPosition(arrivalPosition),
myLines(lines) {
}


Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/demand/GNERide.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class GNEVehicle;
class GNERide : public GNEDemandElement, public Parameterised {

public:
/// @brief default constructor
GNERide(SumoXMLTag tag, GNENet* net);

/**@brief parameter constructor for person edge->edge
* @param[in] viewNet view in which this Ride is placed
* @param[in] personParent person parent
Expand Down
70 changes: 43 additions & 27 deletions src/netedit/elements/demand/GNERoute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,53 +70,69 @@ GNERoute::GNERoutePopupMenu::onCmdApplyDistance(FXObject*, FXSelector, void*) {
// GNERoute - methods
// ===========================================================================

GNERoute::GNERoute(SumoXMLTag tag, GNENet* net) :
GNEDemandElement("", net, GLO_ROUTE, tag,
GNEPathManager::PathElement::Options::DEMAND_ELEMENT | GNEPathManager::PathElement::Options::ROUTE,
{}, {}, {}, {}, {}, {}, {}, {}),
Parameterised(),
myColor(RGBColor::YELLOW),
myRepeat(0),
myCycleTime(0),
myVClass(SVC_PASSENGER) {
// reset default values
resetDefaultValues();
}


GNERoute::GNERoute(GNENet* net) :
GNEDemandElement(net->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_ROUTE), net, GLO_ROUTE, SUMO_TAG_ROUTE,
GNEPathManager::PathElement::Options::DEMAND_ELEMENT | GNEPathManager::PathElement::Options::ROUTE,
{}, {}, {}, {}, {}, {}, {}, {}),
Parameterised(),
myColor(RGBColor::YELLOW),
myRepeat(0),
myCycleTime(0),
myVClass(SVC_PASSENGER) {
GNEPathManager::PathElement::Options::DEMAND_ELEMENT | GNEPathManager::PathElement::Options::ROUTE,
{}, {}, {}, {}, {}, {}, {}, {}),
Parameterised(),
myColor(RGBColor::YELLOW),
myRepeat(0),
myCycleTime(0),
myVClass(SVC_PASSENGER) {
// reset default values
resetDefaultValues();
}


GNERoute::GNERoute(GNENet* net, const std::string& id, SUMOVehicleClass vClass, const std::vector<GNEEdge*>& edges,
const RGBColor& color, const int repeat, const SUMOTime cycleTime, const std::map<std::string, std::string>& parameters) :
GNEDemandElement(id, net, GLO_ROUTE, SUMO_TAG_ROUTE,
GNEPathManager::PathElement::Options::DEMAND_ELEMENT | GNEPathManager::PathElement::Options::ROUTE,
{}, edges, {}, {}, {}, {}, {}, {}),
Parameterised(parameters),
myColor(color),
myRepeat(repeat),
myCycleTime(cycleTime),
myVClass(vClass) {
GNEPathManager::PathElement::Options::DEMAND_ELEMENT | GNEPathManager::PathElement::Options::ROUTE,
{}, edges, {}, {}, {}, {}, {}, {}),
Parameterised(parameters),
myColor(color),
myRepeat(repeat),
myCycleTime(cycleTime),
myVClass(vClass) {
}


GNERoute::GNERoute(GNENet* net, GNEDemandElement* vehicleParent, const std::vector<GNEEdge*>& edges,
const RGBColor& color, const int repeat, const SUMOTime cycleTime, const std::map<std::string, std::string>& parameters) :
GNEDemandElement(vehicleParent, net, GLO_ROUTE, GNE_TAG_ROUTE_EMBEDDED,
GNEPathManager::PathElement::Options::DEMAND_ELEMENT | GNEPathManager::PathElement::Options::ROUTE,
{}, edges, {}, {}, {}, {}, {vehicleParent}, {}),
Parameterised(parameters),
myColor(color),
myRepeat(repeat),
myCycleTime(cycleTime),
myVClass(vehicleParent->getVClass()) {
GNEPathManager::PathElement::Options::DEMAND_ELEMENT | GNEPathManager::PathElement::Options::ROUTE,
{}, edges, {}, {}, {}, {}, {vehicleParent}, {}),
Parameterised(parameters),
myColor(color),
myRepeat(repeat),
myCycleTime(cycleTime),
myVClass(vehicleParent->getVClass()) {
}


GNERoute::GNERoute(GNEDemandElement* route) :
GNEDemandElement(route, route->getNet(), GLO_ROUTE, SUMO_TAG_ROUTE,
GNEPathManager::PathElement::Options::DEMAND_ELEMENT | GNEPathManager::PathElement::Options::ROUTE,
{}, route->getParentEdges(), {}, {}, {}, {}, {}, {}),
Parameterised(),
myColor(route->getColor()),
myRepeat(parse<int>(route->getAttribute(SUMO_ATTR_REPEAT))),
myCycleTime(parse<SUMOTime>(route->getAttribute(SUMO_ATTR_CYCLETIME))),
myVClass(route->getVClass()) {
{}, route->getParentEdges(), {}, {}, {}, {}, {}, {}),
Parameterised(),
myColor(route->getColor()),
myRepeat(parse<int>(route->getAttribute(SUMO_ATTR_REPEAT))),
myCycleTime(parse<SUMOTime>(route->getAttribute(SUMO_ATTR_CYCLETIME))),
myVClass(route->getVClass()) {
}


Expand Down
7 changes: 4 additions & 3 deletions src/netedit/elements/demand/GNERoute.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ class GNERoute : public GNEDemandElement, public Parameterised {
GNERoutePopupMenu() {}
};

/**@brief default constructor
* @param[in] viewNet view in which this Route is placed
*/
/// @brief default constructor
GNERoute(SumoXMLTag tag, GNENet* net);

/// @brief default constructor (used in calibrators)
GNERoute(GNENet* net);

/**@brief parameter constructor
Expand Down
16 changes: 12 additions & 4 deletions src/netedit/elements/demand/GNEStop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,25 @@
// member method definitions
// ===========================================================================

GNEStop::GNEStop(SumoXMLTag tag, GNENet* net) :
GNEDemandElement("", net, GLO_STOP, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {}, {}, {}, {}, {}, {}, {}) {
// reset default values
resetDefaultValues();
}


GNEStop::GNEStop(SumoXMLTag tag, GNENet* net, const SUMOVehicleParameter::Stop& stopParameter, GNEAdditional* stoppingPlace, GNEDemandElement* stopParent) :
GNEDemandElement(stopParent, net, GLO_STOP, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {}, {}, {stoppingPlace}, {}, {}, {stopParent}, {}),
SUMOVehicleParameter::Stop(stopParameter) {
{}, {}, {}, {stoppingPlace}, {}, {}, {stopParent}, {}),
SUMOVehicleParameter::Stop(stopParameter) {
}


GNEStop::GNEStop(GNENet* net, const SUMOVehicleParameter::Stop& stopParameter, GNELane* lane, GNEDemandElement* stopParent) :
GNEDemandElement(stopParent, net, GLO_STOP, SUMO_TAG_STOP_LANE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {}, {lane}, {}, {}, {}, {stopParent}, {}),
SUMOVehicleParameter::Stop(stopParameter) {
{}, {}, {lane}, {}, {}, {}, {stopParent}, {}),
SUMOVehicleParameter::Stop(stopParameter) {
}


Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/demand/GNEStop.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
class GNEStop : public GNEDemandElement, public SUMOVehicleParameter::Stop {

public:
/// @brief default constructor
GNEStop(SumoXMLTag tag, GNENet* net);

/// @brief constructor used for stops over stoppingPlaces
GNEStop(SumoXMLTag tag, GNENet* net, const SUMOVehicleParameter::Stop& stopParameter, GNEAdditional* stoppingPlace, GNEDemandElement* stopParent);

Expand Down
16 changes: 12 additions & 4 deletions src/netedit/elements/demand/GNEStopContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,25 @@
// member method definitions
// ===========================================================================

GNEStopContainer::GNEStopContainer(SumoXMLTag tag, GNENet* net) :
GNEDemandElement("", net, GLO_STOP_CONTAINER, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {}, {}, {}, {}, {}, {}, {}) {
// reset default values
resetDefaultValues();
}


GNEStopContainer::GNEStopContainer(GNENet* net, GNEDemandElement* containerParent, GNEAdditional* stoppingPlace, const SUMOVehicleParameter::Stop& stopParameter) :
GNEDemandElement(containerParent, net, GLO_STOP_CONTAINER, GNE_TAG_STOPCONTAINER_CONTAINERSTOP, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {}, {}, {stoppingPlace}, {}, {}, {containerParent}, {}),
SUMOVehicleParameter::Stop(stopParameter) {
{}, {}, {}, {stoppingPlace}, {}, {}, {containerParent}, {}),
SUMOVehicleParameter::Stop(stopParameter) {
}


GNEStopContainer::GNEStopContainer(GNENet* net, GNEDemandElement* containerParent, GNEEdge* edge, const SUMOVehicleParameter::Stop& stopParameter) :
GNEDemandElement(containerParent, net, GLO_STOP_CONTAINER, GNE_TAG_STOPCONTAINER_EDGE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {edge}, {}, {}, {}, {}, {containerParent}, {}),
SUMOVehicleParameter::Stop(stopParameter) {
{}, {edge}, {}, {}, {}, {}, {containerParent}, {}),
SUMOVehicleParameter::Stop(stopParameter) {
}


Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/demand/GNEStopContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
class GNEStopContainer : public GNEDemandElement, public SUMOVehicleParameter::Stop {

public:
/// @brief default constructor
GNEStopContainer(SumoXMLTag tag, GNENet* net);

/// @brief constructor used for stops over stopContainers
GNEStopContainer(GNENet* net, GNEDemandElement* containerParent, GNEAdditional* stoppingPlace, const SUMOVehicleParameter::Stop& stopParameter);

Expand Down
16 changes: 12 additions & 4 deletions src/netedit/elements/demand/GNEStopPerson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,25 @@
// member method definitions
// ===========================================================================

GNEStopPerson::GNEStopPerson(SumoXMLTag tag, GNENet* net) :
GNEDemandElement("", net, GLO_STOP_PERSON, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {}, {}, {}, {}, {}, {}, {}) {
// reset default values
resetDefaultValues();
}


GNEStopPerson::GNEStopPerson(GNENet* net, GNEDemandElement* personParent, GNEAdditional* stoppingPlace, const SUMOVehicleParameter::Stop& stopParameter) :
GNEDemandElement(personParent, net, GLO_STOP_PERSON, GNE_TAG_STOPPERSON_BUSSTOP, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {}, {}, {stoppingPlace}, {}, {}, {personParent}, {}),
SUMOVehicleParameter::Stop(stopParameter) {
{}, {}, {}, {stoppingPlace}, {}, {}, {personParent}, {}),
SUMOVehicleParameter::Stop(stopParameter) {
}


GNEStopPerson::GNEStopPerson(GNENet* net, GNEDemandElement* personParent, GNEEdge* edge, const SUMOVehicleParameter::Stop& stopParameter) :
GNEDemandElement(personParent, net, GLO_STOP_PERSON, GNE_TAG_STOPPERSON_EDGE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT,
{}, {edge}, {}, {}, {}, {}, {personParent}, {}),
SUMOVehicleParameter::Stop(stopParameter) {
{}, {edge}, {}, {}, {}, {}, {personParent}, {}),
SUMOVehicleParameter::Stop(stopParameter) {
}


Expand Down
3 changes: 3 additions & 0 deletions src/netedit/elements/demand/GNEStopPerson.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
class GNEStopPerson : public GNEDemandElement, public SUMOVehicleParameter::Stop {

public:
/// @brief default constructor
GNEStopPerson(SumoXMLTag tag, GNENet* net);

/// @brief constructor used for stops over busStops
GNEStopPerson(GNENet* net, GNEDemandElement* personParent, GNEAdditional* stoppingPlace, const SUMOVehicleParameter::Stop& stopParameter);

Expand Down
Loading

0 comments on commit c8d2bf3

Please sign in to comment.