17 #ifndef GNEAdditionalHandler_h 18 #define GNEAdditionalHandler_h 299 static GNEAdditional*
buildBusStop(
GNEViewNet* viewNet,
bool allowUndoRedo,
const std::string&
id,
GNELane* lane,
const std::string& startPos,
const std::string& endPos,
const std::string& name,
const std::vector<std::string>& lines,
bool friendlyPosition,
bool blockMovement);
330 const std::vector<std::string>& lines,
bool friendlyPosition,
bool blockMovement);
350 double chargingPower,
double efficiency,
bool chargeInTransit,
double chargeDelay,
bool friendlyPosition,
bool blockMovement);
370 bool friendlyPosition,
int roadSideCapacity,
bool onRoad,
double width,
const std::string& length,
double angle,
bool blockMovement);
402 const std::string& vehicleTypes,
const std::string& name,
bool friendlyPos,
bool blockMovement);
424 const std::string& vehicleTypes,
const std::string& name,
const double timeThreshold,
double speedThreshold,
double jamThreshold,
bool friendlyPos,
bool blockMovement);
446 const std::string& vehicleTypes,
const std::string& name,
const double timeThreshold,
double speedThreshold,
double jamThreshold,
bool friendlyPos,
bool blockMovement);
463 static GNEAdditional*
buildDetectorE3(
GNEViewNet* viewNet,
bool allowUndoRedo,
const std::string&
id,
Position pos,
double freq,
const std::string& filename,
const std::string& vehicleTypes,
const std::string& name,
const double timeThreshold,
double speedThreshold,
bool blockMovement);
505 static GNEAdditional*
buildDetectorE1Instant(
GNEViewNet* viewNet,
bool allowUndoRedo,
const std::string&
id,
GNELane* lane,
double pos,
const std::string& filename,
const std::string& vehicleTypes,
const std::string& name,
bool friendlyPos,
bool blockMovement);
520 static GNEAdditional*
buildCalibrator(
GNEViewNet* viewNet,
bool allowUndoRedo,
const std::string&
id,
GNELane* lane,
double pos,
const std::string& name,
const std::string& outfile,
double freq,
const std::string& routeprobe);
536 static GNEAdditional*
buildCalibrator(
GNEViewNet* viewNet,
bool allowUndoRedo,
const std::string&
id,
GNEEdge* edge,
double pos,
const std::string& name,
const std::string& outfile,
double freq,
const std::string& routeprobe);
547 double accel,
double decel,
double sigma,
double tau,
double length,
double minGap,
double maxSpeed,
548 double speedFactor,
double speedDev,
const RGBColor& color,
SUMOVehicleClass vClass,
const std::string& emissionClass,
549 SUMOVehicleShape shape,
double width,
const std::string& filename,
double impatience,
const std::string& laneChangeModel,
550 const std::string& carFollowModel,
int personCapacity,
int containerCapacity,
double boardingDuration,
551 double loadingDuration,
const std::string& latAlignment,
double minGapLat,
double maxSpeedLat);
557 const std::string& vehsPerHour,
const std::string& speed,
const RGBColor& color,
const std::string& departLane,
const std::string& departPos,
558 const std::string& departSpeed,
const std::string& arrivalLane,
const std::string& arrivalPos,
const std::string& arrivalSpeed,
559 const std::string& line,
int personNumber,
int containerNumber,
bool reroute,
const std::string& departPosLat,
560 const std::string& arrivalPosLat,
double begin,
double end);
574 static GNEAdditional*
buildRerouter(
GNEViewNet* viewNet,
bool allowUndoRedo,
const std::string&
id,
Position pos,
const std::vector<GNEEdge*>& edges,
double prob,
const std::string& name,
const std::string& file,
bool off,
double timeThreshold,
const std::string& vTypes,
bool blockMovement);
709 double getPosition(
double pos,
GNELane& lane,
bool friendlyPos,
const std::string& additionalID);
719 static bool fixStoppinPlacePosition(std::string& startPos, std::string& endPos,
const double laneLength,
const double minLength,
const bool friendlyPos);
736 static bool fixE2DetectorPosition(
double& pos,
double& length,
const double laneLength,
const bool friendlyPos);
static GNEAdditional * buildParkingArea(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, const std::string &startPos, const std::string &endPos, const std::string &name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const std::string &length, double angle, bool blockMovement)
Builds a Parking Area.
GNEAdditional * getLastInsertedAdditional() const
return last additional inserted
SumoXMLTag
Numbers representing SUMO-XML - element names.
static GNEAdditional * buildVehicleType(GNEViewNet *viewNet, bool allowUndoRedo, std::string vehicleTypeID, double accel, double decel, double sigma, double tau, double length, double minGap, double maxSpeed, double speedFactor, double speedDev, const RGBColor &color, SUMOVehicleClass vClass, const std::string &emissionClass, SUMOVehicleShape shape, double width, const std::string &filename, double impatience, const std::string &laneChangeModel, const std::string &carFollowModel, int personCapacity, int containerCapacity, double boardingDuration, double loadingDuration, const std::string &latAlignment, double minGapLat, double maxSpeedLat)
void parseAndBuildRerouterRouteProbReroute(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Route Prob Reroute.
void parseAndBuildRerouterParkingAreaReroute(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a parkingAreaReroute.
static bool fixStoppinPlacePosition(std::string &startPos, std::string &endPos, const double laneLength, const double minLength, const bool friendlyPos)
check if the position of an stoppingPlace over a lane is valid
static bool checkAndFixDetectorPosition(double &pos, const double laneLength, const bool friendlyPos)
check if the position of a detector over a lane is valid
void parseAndBuildDetectorE1(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a induction loop detector (E1)
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
void parseAndBuildTAZ(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Builds a TAZ.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
static GNEAdditional * buildVariableSpeedSign(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, Position pos, const std::vector< GNELane *> &destLanes, const std::string &name, bool blockMovement)
Builds a VariableSpeedSign (lane speed trigger)
std::vector< std::pair< SumoXMLTag, GNEAdditional * > > myInsertedElements
vector used as stack
void popElement()
pop last inserted element (used only in function myEndElement)
void parseAndBuildChargingStation(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a charging station.
void parseAndBuildParkingSpace(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a parking space.
const std::string & getFileName() const
returns the current file name
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
bool myUndoAdditionals
flag to check if created additionals must be undo and redo
void parseAndBuildDetectorExit(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Exit detector.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
static GNEAdditional * buildDetectorE3(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, Position pos, double freq, const std::string &filename, const std::string &vehicleTypes, const std::string &name, const double timeThreshold, double speedThreshold, bool blockMovement)
Builds a multi entry exit detector (E3)
static GNEAdditional * buildCalibratorRoute(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &routeID, const std::vector< GNEEdge *> &edges, const RGBColor &color)
GNEAdditionalHandler(const std::string &file, GNEViewNet *viewNet, bool undoAdditionals=true, GNEAdditional *additionalParent=nullptr)
Constructor.
SAX-handler base for SUMO-files.
double getPosition(double pos, GNELane &lane, bool friendlyPos, const std::string &additionalID)
extracts the position, checks whether it shall be mirrored and checks whether it is within the lane...
static GNEAdditional * buildContainerStop(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, const std::string &startPos, const std::string &endPos, const std::string &name, const std::vector< std::string > &lines, bool friendlyPosition, bool blockMovement)
Builds a container stop.
static GNEAdditional * buildClosingReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNEEdge *closedEdge, SVCPermissions permissions)
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
void parseAndBuildVariableSpeedSign(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Variable Speed Signal (lane speed trigger)
void parseAndBuildDetectorE2(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a lane area detector (E2)
static GNEAdditional * builDestProbReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNEEdge *newEdgeDestination, double probability)
void commitElementInsertion(GNEAdditional *additionalCreated)
commit element insertion (used to save last correct created element)
GNEAdditional * retrieveAdditionalParent(GNEViewNet *viewNet, SumoXMLTag expectedTag) const
retrieve additional parent correspond to current status of myInsertedElements
static GNEAdditional * buildDetectorE1Instant(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, const std::string &filename, const std::string &vehicleTypes, const std::string &name, bool friendlyPos, bool blockMovement)
Builds a Instant Induction Loop Detector (E1Instant)
static GNEAdditional * buildDetectorEntry(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *E3Parent, GNELane *lane, double pos, bool friendlyPos, bool blockMovement)
Builds a entry detector (E3)
static GNEAdditional * buildRouteProbReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, const std::string &newRouteId, double probability)
void insertElement(SumoXMLTag tag)
insert new element (called only in function myStartElement)
void parseAndBuildDetectorE1Instant(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Instant induction loop detector (E1Instant)
~GNEAdditionalHandler()
Destructor.
HierarchyInsertedAdditionals myHierarchyInsertedAdditionals
HierarchyInsertedAdditionals used for insert childs.
void parseAndBuildCalibratorVehicleType(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses vehicle type values of Calibrators.
static GNEAdditional * buildCalibrator(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, const std::string &name, const std::string &outfile, double freq, const std::string &routeprobe)
builds a microscopic calibrator over a lane
static bool checkOverlappingRerouterIntervals(GNEAdditional *rerouter, double newBegin, double newEnd)
check if an overlapping is produced in rerouter if a interval with certain begin and end is inserted ...
void parseAndBuildRerouterInterval(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Rerouter Interval.
static GNEAdditional * buildChargingStation(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, const std::string &startPos, const std::string &endPos, const std::string &name, double chargingPower, double efficiency, bool chargeInTransit, double chargeDelay, bool friendlyPosition, bool blockMovement)
Builds a charging Station.
Encapsulated SAX-Attributes.
Stack used to save the last inserted element.
void parseAndBuildTAZSource(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Builds a TAZ Source.
A point in 2D or 3D with translation and scaling methods.
static GNEAdditional * buildAccess(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *busStop, GNELane *lane, const std::string &pos, const std::string &length, bool friendlyPos, bool blockMovement)
Builds an Access.
static GNEAdditional * buildDetectorE1(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, double freq, const std::string &filename, const std::string &vehicleTypes, const std::string &name, bool friendlyPos, bool blockMovement)
Builds a induction loop detector (E1)
void parseAndBuildRerouter(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a rerouter.
void parseAndBuildCalibratorRoute(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses route values of Calibrators.
static GNEAdditional * buildRerouterInterval(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterParent, double begin, double end)
builds a rerouter interval
GNEViewNet * myViewNet
pointer to View's Net
static GNEAdditional * buildMultiLaneDetectorE2(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, const std::vector< GNELane *> &lanes, double pos, double endPos, double freq, const std::string &filename, const std::string &vehicleTypes, const std::string &name, const double timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement)
Builds a multi-lane Area Detector (E2)
static GNEAdditional * buildTAZSource(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *TAZ, GNEEdge *edge, double departWeight)
Builds a TAZSource (Traffic Assignment Zone)
static bool accessCanBeCreated(GNEAdditional *busStopParent, GNEEdge &edge)
check if a GNEAccess can be created in a certain Edge
void parseAndBuildDetectorE3(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a multi entry exit detector (E3)
static GNEAdditional * buildRerouter(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, Position pos, const std::vector< GNEEdge *> &edges, double prob, const std::string &name, const std::string &file, bool off, double timeThreshold, const std::string &vTypes, bool blockMovement)
builds a rerouter
static GNEAdditional * buildSingleLaneDetectorE2(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, double pos, double length, double freq, const std::string &filename, const std::string &vehicleTypes, const std::string &name, const double timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement)
Builds a single-lane Area Detector (E2)
static GNEAdditional * buildParkingSpace(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *parkingAreaParent, Position pos, double width, double length, double angle, bool blockMovement)
Builds a Parking Space.
void parseAndBuildRouteProbe(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds routeProbe.
void parseAndBuildRerouterDestProbReroute(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Destiny Prob Reroute.
A road/street connecting two junctions (netedit-version)
void parseAndBuildTAZSink(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Builds a TAZ Sink.
void parseAndBuildCalibrator(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a mesoscopic or microscopic calibrator.
void parseAndBuildVariableSpeedSignStep(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Variable Speed Signal Step.
void parseGenericParameter(const SUMOSAXAttributes &attrs)
Parse generic parameter and insert it in the last created additional.
void parseAndBuildBusStop(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a bus stop.
void parseAndBuildContainerStop(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a container stop.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
static GNEAdditional * builParkingAreaReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNEAdditional *newParkignArea, double probability, bool visible)
An Element which don't belongs to GNENet but has influency in the simulation.
static GNEAdditional * buildAdditional(GNEViewNet *viewNet, bool allowUndoRedo, SumoXMLTag tag, std::map< SumoXMLAttr, std::string > values)
Build additionals.
void parseAndBuildCalibratorFlow(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses flow values of Calibrators.
GNEAdditional * myAdditionalParent
pointer to parent additional (used for loading additional childs placed in a different XML) ...
static GNEAdditional * buildVaporizer(GNEViewNet *viewNet, bool allowUndoRedo, GNEEdge *edge, double startTime, double end, const std::string &name)
Builds a vaporizer (lane speed trigger)
void parseAndBuildVaporizer(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Builds a Vaporizer.
static GNEAdditional * buildTAZSink(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *TAZ, GNEEdge *edge, double arrivalWeight)
Builds a TAZSink (Traffic Assignment Zone)
void parseAndBuildRerouterClosingLaneReroute(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Closing Lane reroute.
static GNEAdditional * buildRouteProbe(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNEEdge *edge, const std::string &freq, const std::string &name, const std::string &file, double begin)
builds a Route probe
void parseAndBuildParkingArea(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a parking area.
static GNEAdditional * buildCalibratorFlow(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *calibratorParent, GNEAdditional *route, GNEAdditional *vtype, const std::string &vehsPerHour, const std::string &speed, const RGBColor &color, const std::string &departLane, const std::string &departPos, const std::string &departSpeed, const std::string &arrivalLane, const std::string &arrivalPos, const std::string &arrivalSpeed, const std::string &line, int personNumber, int containerNumber, bool reroute, const std::string &departPosLat, const std::string &arrivalPosLat, double begin, double end)
void parseAndBuildAccess(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses values and adds access to the current bus stop.
static GNEAdditional * buildBusStop(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, GNELane *lane, const std::string &startPos, const std::string &endPos, const std::string &name, const std::vector< std::string > &lines, bool friendlyPosition, bool blockMovement)
Builds a bus stop.
void myEndElement(int element)
Called when a closing tag occurs.
static GNEAdditional * buildVariableSpeedSignStep(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *VSSParent, double time, double speed)
Builds a VariableSpeedSign Step.
static bool fixE2DetectorPosition(double &pos, double &length, const double laneLength, const bool friendlyPos)
check if the position of a detector over a lane is valid
static GNEAdditional * buildClosingLaneReroute(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *rerouterIntervalParent, GNELane *closedLane, SVCPermissions permissions)
static GNEAdditional * buildDetectorExit(GNEViewNet *viewNet, bool allowUndoRedo, GNEAdditional *E3Parent, GNELane *lane, double pos, bool friendlyPos, bool blockMovement)
Builds a exit detector (E3)
void parseAndBuildDetectorEntry(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Entry detector.
static GNEAdditional * buildTAZ(GNEViewNet *viewNet, bool allowUndoRedo, const std::string &id, const PositionVector &shape, const RGBColor &color, const std::vector< GNEEdge *> &edges, bool blockMovement)
Builds a TAZ (Traffic Assignment Zone)
void parseAndBuildRerouterClosingReroute(const SUMOSAXAttributes &attrs, const SumoXMLTag &tag)
Parses his values and builds a Closing Reroute.