 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
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);
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
bool isAdditionalBlocked() const
Check if additional item is currently blocked (i.e. cannot be moved with mouse)
Position position
position of the block icon
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.
virtual Position getPositionInView() const =0
Returns position of additional in view.
An Element which don't belongs to GNENet but has influency in the simulation.
A window containing a gl-object's parameter.
virtual std::string getPopUpID() const =0
get PopPup ID (Used in AC Hierarchy)
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
const std::string & getAdditionalID() const
An upper class for objects with additional parameters.
void calculateMultiShapeRotationsAndLengths()
calculate multi shape rotations and lenghts
PositionVector shape
The shape of the additional element.
virtual Boundary getCenteringBoundary() const =0
Returns the boundary to which the view shall be centered in order to show the object.
Static storage of an output device and its base (abstract) implementation.
void setRotation(GNELane *additionalLane=nullptr)
set Rotation of block Icon (must be called in updateGeometry() function)
Boundary movingGeometryBoundary
boundary used during moving of elements (to avoid insertion in RTREE
std::vector< std::vector< double > > multiShapeRotations
The rotations of the multi-shape parts.
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
PositionVector getShape() const
Returns additional element's shape.
std::vector< double > shapeRotations
The rotations of the single shape parts.
void calculateMultiShapeUnified()
calculate multi shape unified
void setDefaultValues()
change all attributes of additional with their default values (note: this cannot be undo)
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
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 bool isAdditionalValid() const
check if current additional is valid to be writed into XML (by default true, can be reimplemented in ...
An special type of Attribute carrier that owns hierarchical elements.
virtual void drawGL(const GUIVisualizationSettings &s) const =0
Draws the object.
struct for pack all variables and functions related with Block Icon
void changeAdditionalID(const std::string &newID)
change ID of additional
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
std::vector< PositionVector > multiShape
The multi-shape of the additional element (used by certain additionals)
std::string secondOriginalPosition
value for saving second original position over lane before moving
BlockIcon myBlockIcon
variable BlockIcon
GNEAdditional * myAdditional
pointer to additional parent
SumoXMLTag
Numbers representing SUMO-XML - element names.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
virtual std::string getAdditionalProblem() const
return a string with the current additional problem (by default empty, can be reimplemented in childr...
const RGBColor * mySpecialColor
pointer to special color (used for drawing Additional with a certain color, mainly used for selection...
AdditionalMove myMove
variable AdditionalMove
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
virtual bool checkAdditionalChildRestriction() const
check restriction with the number of children
const AdditionalGeometry & getAdditionalGeometry() const
obtain AdditionalGeometry
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
virtual std::string getAttribute(SumoXMLAttr key) const =0
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)
virtual std::string getHierarchyName() const =0
get Hierarchy Name (Used in AC Hierarchy)
BlockIcon(GNEAdditional *additional)
constructor
void selectAttributeCarrier(bool changeFlag=true)
A class that stores a 2D geometrical boundary.
void clearGeometry()
reset geometry
A point in 2D or 3D with translation and scaling methods.
std::string myAdditionalName
name of additional
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
bool myBlockMovement
boolean to check if additional element is blocked (i.e. cannot be moved with mouse)
double rotation
The rotation of the block icon.
struct for pack all variables related with geometry of elemement
~GNEAdditional()
Destructor.
void setSpecialColor(const RGBColor *color)
set special color
void drawIcon(const GUIVisualizationSettings &s, const double exaggeration, const double size=0.5) const
draw lock icon
std::string getGenericParametersStr() const
return generic parameters in string format
AdditionalGeometry()
constructor
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.
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(....
virtual void moveGeometry(const Position &offset)=0
change the position of the element geometry without saving in undoList
const std::string getOptionalName() const
Returns the additional name.
void endGeometryMoving()
begin movement (used when user click over additional to start a movement, to avoid problems with prob...
std::vector< double > shapeLengths
The lengths of the single shape parts.
PositionVector multiShapeUnified
multi shape unified
void startGeometryMoving()
Stores the information about how to visualize structures.
std::vector< std::vector< double > > multiShapeLengths
The lengths of the multi-shape shape parts.
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
virtual void updateGeometry()=0
update pre-computed geometry information
Position originalViewPosition
value for saving first original position over lane before moving
GNEAdditional & operator=(const GNEAdditional &)=delete
Invalidated assignment operator.
std::string firstOriginalLanePosition
value for saving first original position over lane before moving
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
method for checking if the key and their conrrespond attribute are valids
An special type of Attribute carrier that owns hierarchical elements.
virtual void openAdditionalDialog()
open Additional Dialog
virtual void fixAdditionalProblem()
fix additional problem (by default throw an exception, has to be reimplemented in children)
Position offset
The offSet of the block icon.
struct for pack all variables related with additional move
void calculateShapeRotationsAndLengths()
calculate shape rotations and lenghts