17 #ifndef GNEDemandElement_h 18 #define GNEDemandElement_h 129 void insertEdgeLengthRotSegment(
const GNEDemandElement* element,
const GNEEdge* edge,
const Position pos,
double length,
double rotation,
const bool visible,
const bool valid);
135 void clearDemandElementSegmentGeometry();
138 void calculatePartialShapeRotationsAndLengths();
141 std::vector<Segment>::const_iterator begin()
const;
144 std::vector<Segment>::const_iterator end()
const;
180 void updateDijkstraRouter();
183 std::vector<GNEEdge*> calculateDijkstraRoute(
SUMOVehicleClass vClass,
const std::vector<GNEEdge*>& partialEdges)
const;
186 std::vector<GNEEdge*> calculateDijkstraRoute(
GNENet* net,
SUMOVehicleClass vClass,
const std::vector<std::string>& partialEdgesStr)
const;
216 const std::vector<GNEEdge*>& edgeParents,
217 const std::vector<GNELane*>& laneParents,
218 const std::vector<GNEShape*>& shapeParents,
219 const std::vector<GNEAdditional*>& additionalParents,
220 const std::vector<GNEDemandElement*>& demandElementParents,
221 const std::vector<GNEEdge*>& edgeChildren,
222 const std::vector<GNELane*>& laneChildren,
223 const std::vector<GNEShape*>& shapeChildren,
224 const std::vector<GNEAdditional*>& additionalChildren,
225 const std::vector<GNEDemandElement*>& demandElementChildren);
244 const std::vector<GNEEdge*>& edgeParents,
245 const std::vector<GNELane*>& laneParents,
246 const std::vector<GNEShape*>& shapeParents,
247 const std::vector<GNEAdditional*>& additionalParents,
248 const std::vector<GNEDemandElement*>& demandElementParents,
249 const std::vector<GNEEdge*>& edgeChildren,
250 const std::vector<GNELane*>& laneChildren,
251 const std::vector<GNEShape*>& shapeChildren,
252 const std::vector<GNEAdditional*>& additionalChildren,
253 const std::vector<GNEDemandElement*>& demandElementChildren);
316 virtual std::string
getBegin()
const;
465 static bool isRouteValid(
const std::vector<GNEEdge*>& edges,
bool report);
struct for pack all variables related with geometry of elemements divided in segments ...
void calculateShapeRotationsAndLengths()
calculate shape rotations and lengths
static bool isRouteValid(const std::vector< GNEEdge *> &edges, bool report)
check if a route is valid
DemandElementGeometry myDemandElementGeometry
demand element geometry
An special type of Attribute carrier that owns hierarchical elements.
void clearGeometry()
reset geometry
SumoXMLTag
Numbers representing SUMO-XML - element names.
virtual void selectAttributeCarrier(bool changeFlag=true)=0
GNEDemandElement(const std::string &id, GNEViewNet *viewNet, GUIGlObjectType type, SumoXMLTag tag, const std::vector< GNEEdge *> &edgeParents, const std::vector< GNELane *> &laneParents, const std::vector< GNEShape *> &shapeParents, const std::vector< GNEAdditional *> &additionalParents, const std::vector< GNEDemandElement *> &demandElementParents, const std::vector< GNEEdge *> &edgeChildren, const std::vector< GNELane *> &laneChildren, const std::vector< GNEShape *> &shapeChildren, const std::vector< GNEAdditional *> &additionalChildren, const std::vector< GNEDemandElement *> &demandElementChildren)
Constructor.
Boundary movingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE)
virtual void fixDemandElementProblem()
fix demand element problem (by default throw an exception, has to be reimplemented in children) ...
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
method for checking if the key and their conrrespond attribute are valids
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
virtual std::string getHierarchyName() const =0
get Hierarchy Name (Used in AC Hierarchy)
virtual std::string getDemandElementProblem() const
return a string with the current demand element problem (by default empty, can be reimplemented in ch...
DemandElementGeometry()
constructor
const GNEDemandElement * element
element
std::string firstOriginalLanePosition
value for saving first original position over lane before moving
virtual Position getPositionInView() const =0
Returns position of demand element in view.
Stores the information about how to visualize structures.
struct for pack all variables related with Demand Element moving
bool geometryDeprecated
mark geometry as deprecated (used to avoid multiple updates)
GNEDemandElement & operator=(const GNEDemandElement &)=delete
Invalidated assignment operator.
virtual void updateGeometry()=0
update pre-computed geometry information
std::string secondOriginalPosition
value for saving second original position over lane before moving
Position originalViewPosition
value for saving first original position over lane before moving
virtual void drawGL(const GUIVisualizationSettings &s) const =0
Draws the object.
class used to calculate routes in nets
A NBNetBuilder extended by visualisation and editing capabilities.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
virtual void writeDemandElement(OutputDevice &device) const =0
writte demand element element into a xml file
virtual double getAttributeDouble(SumoXMLAttr key) const =0
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
void changeDemandElementID(const std::string &newID)
change ID of demand element
const GNEJunction * junction
junction
PositionVector shape
The shape of the additional element.
virtual void moveGeometry(const Position &offset)=0
change the position of the element geometry without saving in undoList
A class that stores a 2D geometrical boundary.
static RouteCalculator * getRouteCalculatorInstance()
obtain instance of RouteCalculator
virtual std::string getPopUpID() const =0
get PopPup ID (Used in AC Hierarchy)
virtual void compute()=0
compute demand element (used by flows, trips, personPlans<from-to>,...)
const DemandElementGeometry & getDemandElementGeometry() const
get demand element geometry
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
An special type of Attribute carrier that owns hierarchical elements.
virtual void setGenericParametersStr(const std::string &value)=0
set generic parameters in string format
virtual SUMOVehicleClass getVClass() const =0
obtain VClass related with this demand element
static void createRouteCalculatorInstance(GNENet *net)
create instance of RouteCalculator
virtual std::string getGenericParametersStr() const =0
return generic parameters in string format
virtual void endGeometryMoving()=0
end geometry movement
~GNEDemandElement()
Destructor.
A point in 2D or 3D with translation and scaling methods.
DemandElementSegmentGeometry myDemandElementSegmentGeometry
demand element segment geometry
std::vector< double > shapeLengths
The lengths of the single shape parts.
GNENet * myNet
pointer to net
virtual void startGeometryMoving()=0
void markSegmentGeometryDeprecated()
mark demand element segment geometry as deprecated
bool isValidDemandElementID(const std::string &newID) const
check if a new demand element ID is valid
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
virtual const RGBColor & getColor() const =0
get color
virtual void unselectAttributeCarrier(bool changeFlag=true)=0
unselect attribute carrier using GUIGlobalSelection
const std::string & getDemandElementID() const
returns DemandElement ID
virtual std::vector< std::pair< std::string, std::string > > getGenericParameters() const =0
return generic parameters as vector of pairs format
static RouteCalculator * myRouteCalculatorInstance
RouteCalculator instance.
virtual bool checkDemandElementChildRestriction() const
check restriction with the number of children
virtual void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)=0
struct used for represent segments of demand element geometry
virtual void openDemandElementDialog()
open DemandElement Dialog
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const DemandElementSegmentGeometry & getDemandElementSegmentGeometry() const
get demand element segment geometry
A road/street connecting two junctions (netedit-version)
virtual GNEEdge * getToEdge() const =0
obtain to edge of this demand element
An Element which don't belongs to GNENet but has influency in the simulation.
virtual GNEEdge * getFromEdge() const =0
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform demand element changes ...
virtual void commitGeometryMoving(GNEUndoList *undoList)=0
commit geometry changes in the attributes of an element after use of moveGeometry(...)
GNEViewNet * myViewNet
The GNEViewNet this demand element element belongs.
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which demand element element is located.
Static storage of an output device and its base (abstract) implementation.
virtual std::string getBegin() const
get begin time of demand element
struct for pack all variables related with geometry of stop
static void deleteRouteCalculatorInstance()
delete instance of RouteCalculator
std::vector< double > shapeRotations
The rotations of the single shape parts.
const Position pos
position
const bool visible
visible
SUMOAbstractRouter< NBRouterEdge, NBVehicle > * myDijkstraRouter
SUMO Abstract DijkstraRouter.
A window containing a gl-object's parameter.
virtual std::string getAttribute(SumoXMLAttr key) const =0
virtual GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
An Element which don't belongs to GNENet but has influency in the simulation.
virtual Boundary getCenteringBoundary() const =0
Returns the boundary to which the view shall be centered in order to show the object.
virtual bool isDemandElementValid() const
check if current demand element is valid to be writed into XML (by default true, can be reimplemented...
std::vector< Segment > myShapeSegments
vector of segments that constitutes the shape