17 #ifndef GNEAdditional_h 18 #define GNEAdditional_h 108 const std::vector<GNEEdge*>& edgeParents,
109 const std::vector<GNELane*>& laneParents,
110 const std::vector<GNEShape*>& shapeParents,
111 const std::vector<GNEAdditional*>& additionalParents,
112 const std::vector<GNEDemandElement*>& demandElementParents,
113 const std::vector<GNEEdge*>& edgeChildren,
114 const std::vector<GNELane*>& laneChildren,
115 const std::vector<GNEShape*>& shapeChildren,
116 const std::vector<GNEAdditional*>& additionalChildren,
117 const std::vector<GNEDemandElement*>& demandElementChildren);
138 const std::vector<GNEEdge*>& edgeParents,
139 const std::vector<GNELane*>& laneParents,
140 const std::vector<GNEShape*>& shapeParents,
141 const std::vector<GNEAdditional*>& additionalParents,
142 const std::vector<GNEDemandElement*>& demandElementParents,
143 const std::vector<GNEEdge*>& edgeChildren,
144 const std::vector<GNELane*>& laneChildren,
145 const std::vector<GNEShape*>& shapeChildren,
146 const std::vector<GNEAdditional*>& additionalChildren,
147 const std::vector<GNEDemandElement*>& demandElementChildren);
344 void setRotation(
GNELane* additionalLane =
nullptr);
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
virtual void fixAdditionalProblem()
fix additional problem (by default throw an exception, has to be reimplemented in children) ...
An special type of Attribute carrier that owns hierarchical elements.
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
PositionVector multiShapeUnified
multi shape unified
void calculateMultiShapeRotationsAndLengths()
calculate multi shape rotations and lenghts
std::vector< double > shapeRotations
The rotations of the single shape parts.
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
const std::string & getAdditionalID() const
std::string secondOriginalPosition
value for saving second original position over lane before moving
struct for pack all variables related with geometry of elemement
GNEAdditional * myAdditional
pointer to additional parent
Stores the information about how to visualize structures.
virtual Boundary getCenteringBoundary() const =0
Returns the boundary to which the view shall be centered in order to show the object.
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.
bool isAttributeEnabled(SumoXMLAttr key) const
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) ...
const RGBColor * mySpecialColor
pointer to special color (used for drawing Additional with a certain color, mainly used for selection...
virtual bool checkAdditionalChildRestriction() const
check restriction with the number of children
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const AdditionalGeometry & getAdditionalGeometry() const
obtain AdditionalGeometry
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
GNEAdditional(const std::string &id, GNEViewNet *viewNet, GUIGlObjectType type, SumoXMLTag tag, std::string additionalName, bool blockMovement, 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.
double rotation
The rotation of the block icon.
bool isValidDetectorID(const std::string &newID) const
check if a new detector ID is valid
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) ...
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 childr...
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
An special type of Attribute carrier that owns hierarchical elements.
struct for pack all variables and functions related with Block Icon
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
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.
~GNEAdditional()
Destructor.
std::vector< PositionVector > multiShape
The multi-shape of the additional element (used by certain additionals)
void setSpecialColor(const RGBColor *color)
set special color
An upper class for objects with additional parameters.
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
void calculateShapeRotationsAndLengths()
calculate shape rotations and lenghts
std::vector< double > shapeLengths
The lengths of the single shape parts.
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
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
Static storage of an output device and its base (abstract) implementation.
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
const std::string getOptionalName() const
Returns the additional name.
virtual void moveGeometry(const Position &offset)=0
change the position of the element geometry without saving in undoList
virtual void updateGeometry()=0
update pre-computed geometry information
std::string firstOriginalLanePosition
value for saving first original position over lane before moving
GNEAdditional & operator=(const GNEAdditional &)=delete
Invalidated assignment operator.
void endGeometryMoving()
begin movement (used when user click over additional to start a movement, to avoid problems with prob...
struct for pack all variables related with additional move
AdditionalGeometry()
constructor
void startGeometryMoving()
A window containing a gl-object's parameter.
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
void calculateMultiShapeUnified()
calculate multi shape unified
virtual Position getPositionInView() const =0
Returns position of additional in view.