17 #ifndef GNEAdditional_h 18 #define GNEAdditional_h 300 static bool isRouteValid(
const std::vector<GNEEdge*>& edges,
bool report);
366 void setRotation(
GNELane* additionalLane =
nullptr);
369 void draw(
double size = 0.5)
const;
void removeEdgeChild(GNEEdge *edge)
remove edge child
virtual std::string getPopUpID() const =0
get PopPup ID (Used in AC Hierarchy)
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
method for checking if the key and their conrrespond attribute are valids
virtual void openAdditionalDialog()
open Additional Dialog
void addEdgeChild(GNEEdge *edge)
add edge child
virtual void fixAdditionalProblem()
fix additional problem (by default throw an exception, has to be reimplemented in childs) ...
SumoXMLTag
Numbers representing SUMO-XML - element names.
bool isAdditionalBlocked() const
Check if additional item is currently blocked (i.e. cannot be moved with mouse)
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
void removeAdditionalChild(GNEAdditional *additional)
remove additional child from this additional
PositionVector multiShapeUnified
multi shape unified
void calculateMultiShapeRotationsAndLengths()
calculate multi shape rotations and lenghts
std::vector< double > shapeRotations
The rotations of the single shape parts.
const std::vector< GNEEdge * > & getEdgeChilds() const
get edge chidls
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
const std::string & getAdditionalID() const
returns Additional ID
const std::vector< GNELane * > & getLaneChilds() const
get lanes of VSS
void changeFirstAdditionalParent(const std::string &newAdditionalParentID)
change first additional parent of additional
std::string secondOriginalPosition
value for saving second original position over lane before moving
GNEAdditional(const std::string &id, GNEViewNet *viewNet, GUIGlObjectType type, SumoXMLTag tag, std::string additionalName, bool blockMovement)
Constructor.
struct for pack all variables related with geometry of elemement
GNEAdditional * myAdditional
pointer to additional parent
Stores the information about how to visualize structures.
Position offset
The offSet of the block icon.
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
PositionVector getShape() const
Returns additional element's shape.
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes ...
virtual void drawGL(const GUIVisualizationSettings &s) const =0
Draws the object.
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Position position
position of the block icon
BlockIcon myBlockIcon
variable BlockIcon
void clearGeometry()
reset geometry
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Position originalViewPosition
value for saving first original position over lane before moving
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void setDefaultValues()
change all attributes of additional with their default values (note: this cannot be undo) ...
virtual bool checkAdditionalChildRestriction() const
check restriction with the number of childs
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
virtual bool isAdditionalValid() const
check if current additional is valid to be writed into XML (by default true, can be reimplemented in ...
void changeAdditionalID(const std::string &newID)
change ID of additional
A class that stores a 2D geometrical boundary.
virtual std::string getAttribute(SumoXMLAttr key) const =0
std::vector< std::pair< Position, double > > symbolsPositionAndRotation
position and rotation of every symbol over lane
double rotation
The rotation of the block icon.
bool isValidDetectorID(const std::string &newID) const
check if a new detector ID is valid
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
std::vector< std::vector< double > > multiShapeRotations
The rotations of the multi-shape parts.
virtual std::string getAdditionalProblem() const
return a string with the current additional problem (by default empty, can be reimplemented in childs...
virtual std::string getHierarchyName() const =0
get Hierarchy Name (Used in AC Hierarchy)
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
AdditionalMove myMove
variable AdditionalMove
struct for pack all variables and functions related with Block Icon
GNEAdditional * getSecondAdditionalParent() const
A point in 2D or 3D with translation and scaling methods.
PositionVector shape
The shape of the additional element.
std::string myAdditionalName
name of additional
std::vector< PositionVector > connectionPositions
Matrix with the Vertex's positions of connections between parents an their childs.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
void selectAttributeCarrier(bool changeFlag=true)
std::vector< std::vector< double > > multiShapeLengths
The lengths of the multi-shape shape parts.
ChildConnections myChildConnections
variable ChildConnections
void sortAdditionalChilds()
sort childs (used by Rerouters and VSS)
~GNEAdditional()
Destructor.
std::vector< PositionVector > multiShape
The multi-shape of the additional element (used by certain additionals)
An upper class for objects with additional parameters.
virtual void updateGeometry(bool updateGrid)=0
update pre-computed geometry information
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
std::vector< GNEAdditional * > myAdditionalChilds
vector with the Additional childs
void calculateShapeRotationsAndLengths()
calculate shape rotations and lenghts
std::vector< double > shapeLengths
The lengths of the single shape parts.
GNEAdditional * getFirstAdditionalParent() const
A road/street connecting two junctions (netedit-version)
void changeSecondAdditionalParent(const std::string &newAdditionalParentID)
change second additional parent of additional
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
virtual void updateAdditionalParent()
update parent after add or remove a child (can be reimplemented, for example used for stadistics) ...
GNEEdge * changeEdge(GNEEdge *oldEdge, const std::string &newEdgeID)
change edge of additional
An Element which don't belongs to GNENet but has influency in the simulation.
AdditionalGeometry myGeometry
geometry to be precomputed in updateGeometry(...)
virtual void commitGeometryMoving(GNEUndoList *undoList)=0
commit geometry changes in the attributes of an element after use of moveGeometry(...)
Boundary movingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE
std::string getGenericParametersStr() const
return generic parameters in string format
std::string generateAdditionalChildID(SumoXMLTag childTag)
gererate a new ID for an additional child
struct for pack all variables and functions relative to connections between Additionals and their chi...
Static storage of an output device and its base (abstract) implementation.
static bool isRouteValid(const std::vector< GNEEdge *> &edges, bool report)
check if a route is valid
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
virtual void moveGeometry(const Position &offset)=0
change the position of the element geometry without saving in undoList
void mouseOverObject(const GUIVisualizationSettings &s) const
method for check if mouse is over objects
std::string firstOriginalLanePosition
value for saving first original position over lane before moving
GNEAdditional & operator=(const GNEAdditional &)=delete
Invalidated assignment operator.
void addAdditionalChild(GNEAdditional *additional)
add additional child to this additional
void removeLaneChild(GNELane *lane)
remove lane child
void endGeometryMoving()
begin movement (used when user click over additional to start a movement, to avoid problems with prob...
bool checkAdditionalChildsOverlapping() const
check if childs are overlapped (Used by Rerouters)
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
struct for pack all variables related with additional move
AdditionalGeometry()
constructor
void startGeometryMoving()
A window containing a gl-object's parameter.
GNEAdditional * myAdditional
pointer to additional parent
GNEAdditional * myFirstAdditionalParent
pointer to first Additional parent
GNELane * changeLane(GNELane *oldLane, const std::string &newLaneID)
change lane of additional
void addLaneChild(GNELane *lane)
add lane child
std::vector< GNELane * > myLaneChilds
vector with the lane childs of this additional
void calculateMultiShapeUnified()
calculate multi shape unified
GNEAdditional * mySecondAdditionalParent
pointer to second Additional parent
std::vector< GNEEdge * > myEdgeChilds
vector with the edge childs of this additional
virtual Position getPositionInView() const =0
Returns position of additional in view.