67 myAdditionalParent(NULL),
68 myBlockIconRotation(0),
173 const std::vector<GNEAdditional*>&
205 const std::vector<GNEEdge*>&
237 const std::vector<GNELane*>&
260 new FXMenuSeparator(ret);
267 new FXMenuSeparator(ret);
270 std::vector<SumoXMLAttr> attributes =
getAttrs();
276 new FXMenuCommand(ret, (
"Cursor position inner additional: " +
toString(innerPos)).c_str(), 0, 0, 0);
286 new FXMenuCommand(ret, (
"Cursor position inner additional: " +
toString(innerPos)).c_str(), 0, 0, 0);
289 const double edgePos = edge->
getLanes().at(0)->getShape().nearest_offset_to_point2D(
myShape[0]);
302 std::vector<SumoXMLAttr> attributes =
getAttrs();
306 for (
auto i : attributes) {
328 return Boundary(-0.1, 0.1, 0, 1, 0, 1);
335 if (edges.size() == 0) {
338 }
else if (edges.size() == 1) {
343 auto it = edges.begin();
344 while (it != edges.end() - 1) {
348 if (currentEdge->
getID() == nextEdge->
getID()) {
357 "' ins't consecutive to " +
toString(nextEdge->
getTag()) +
" '" + nextEdge->
getID() +
"'");
396 glRotated(180, 0, 0, 1);
437 for (
auto j : i->getLanes()) {
438 std::pair<Position, double> posRot;
440 if (j->getShape().length() - 6 > 0) {
441 posRot.first = j->getShape().positionAtOffset(j->getShape().length() - 6);
442 posRot.second = j->getShape().rotationDegreeAtOffset(j->getShape().length() - 6);
444 posRot.first = j->getShape().positionAtOffset(j->getShape().length());
445 posRot.second = j->getShape().rotationDegreeAtOffset(j->getShape().length());
453 std::pair<Position, double> posRot;
455 if (i->getShape().length() - 6 > 0) {
456 posRot.first = i->getShape().positionAtOffset(i->getShape().length() - 6);
457 posRot.second = i->getShape().rotationDegreeAtOffset(i->getShape().length() - 6);
459 posRot.first = i->getShape().positionAtOffset(i->getShape().length());
460 posRot.second = i->getShape().rotationDegreeAtOffset(i->getShape().length());
467 std::vector<Position> posConnection;
471 posConnection.push_back(i->getPositionInView());
474 posConnection.push_back(
Position(i->getPositionInView().x() + A, i->getPositionInView().y()));
476 posConnection.push_back(
Position(i->getPositionInView().x(), i->getPositionInView().y() - B));
480 posConnection.push_back(
Position(i->getPositionInView().x(), i->getPositionInView().y() + B));
482 posConnection.push_back(
Position(i->getPositionInView().x() - A, i->getPositionInView().y()));
491 std::vector<Position> posConnection;
495 posConnection.push_back(i.first);
498 posConnection.push_back(
Position(i.first.x() + A, i.first.y()));
500 posConnection.push_back(
Position(i.first.x(), i.first.y() - B));
504 posConnection.push_back(
Position(i.first.x(), i.first.y() + B));
506 posConnection.push_back(
Position(i.first.x() - A, i.first.y()));
522 glTranslated(0, 0,
getType() - 0.01);
525 for (
auto j = i.begin(); (j + 1) != i.end(); j++) {
556 throw InvalidArgument(
"Additional ID " + newID +
" contains invalid characters");
570 if (oldEdge == NULL) {
584 if (oldLane == NULL) {
void removeEdgeChild(GNEEdge *edge)
remove edge child
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
GNEAdditional(const std::string &id, GNEViewNet *viewNet, SumoXMLTag tag, GUIIcon icon, bool movable)
Constructor.
virtual void openAdditionalDialog()
open Additional Dialog
void addEdgeChild(GNEEdge *edge)
add edge child
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
SumoXMLTag
Numbers representing SUMO-XML - element names.
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
bool isAdditionalBlocked() const
Check if additional item is currently blocked (i.e. cannot be moved with mouse)
void removeAdditionalChild(GNEAdditional *additional)
remove additional child from this additional
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
const std::vector< GNEEdge * > & getGNEOutgoingEdges() const
Returns incoming GNEEdges.
begin/end of the description of a single lane
const std::vector< GNEEdge * > & getEdgeChilds() const
get edge chidls
const std::string & getAdditionalID() const
returns Additional ID
const std::vector< GNELane * > & getLaneChilds() const
get lanes of VSS
GUIIcon
An enumeration of icons used by the gui applications.
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
GNEAdditional * getAdditional(SumoXMLTag type, const std::string &id) const
Returns the named additional.
virtual const std::string & getParentName() const =0
Returns the name of the parent object (if any)
double y() const
Returns the y-position.
PositionVector getShape() const
Returns additional element's shape.
double x() const
Returns the x-position.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
FXIcon * getIcon() const
get FXIcon assigned to this object
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
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
This functions has to be implemented in all GNEAttributeCarriers.
#define WRITE_WARNING(msg)
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
std::vector< std::vector< Position > > myChildConnectionPositions
Matrix with the Vertex's positions of connections between parents an their childs.
static bool isValidID(const std::string &value)
true if value is a valid sumo ID
GNEAdditional * myAdditionalParent
pointer to Addititional parent
bool showLockIcon() const
check if lock icon should be visible
void drawChildConnections() const
draw connections between Parent and childrens
void updateAdditionalID(const std::string &oldID, GNEAdditional *additional)
update additional ID in container
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void drawLockIcon(double size=0.5) const
draw lock icon
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static bool hasAttribute(SumoXMLTag tag, SumoXMLAttr attr)
check if an element with certain tag has a certain attribute
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
bool myMovable
flag to check if this additional is movable
void addAdditionalChild(GNEAdditional *additional)
add additional child to this edge
PositionVector myShape
The shape of the additional element.
A point in 2D or 3D with translation and scaling methods.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
Copy object name - popup entry.
void updateChildConnections()
update Connection's geometry
Boundary & grow(double by)
extends the boundary by the given amount
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
std::vector< SumoXMLAttr > getAttrs() const
get vector of attributes
const std::string getID() const
function to support debugging
open additional dialog (used in netedit)
void removeAdditionalChild(GNEAdditional *additional)
remove additional child from this edge
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
~GNEAdditional()
Destructor.
Position myBlockIconOffset
The offSet of the block icon.
std::vector< GNEAdditional * > myAdditionalChilds
vector with the Additional childs
begin/end of the description of an edge
A road/street connecting two junctions (netedit-version)
static bool isUnique(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is unique (may not be edited for a multi-selection and don't have a default valu...
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
const PositionVector & getShape() const
returns the shape of the lane
bool myBlocked
boolean to check if additional element is blocked (i.e. cannot be moved with mouse) ...
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
double length() const
Returns the length.
GNEEdge * changeEdge(GNEEdge *oldEdge, const std::string &newEdgeID)
change edge of additional
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
An Element which don't belongs to GNENet but has influency in the simulation.
GNEAdditional * getAdditionalParent() const
GNEAdditional * retrieveAdditional(const std::string &id, bool hardFail=true) const
Returns the named additional.
void setBlockIconRotation(GNELane *additionalLane=NULL)
std::vector< std::pair< Position, double > > mySymbolsPositionAndRotation
position and rotation of every simbol over lane
static bool canOpenDialog(SumoXMLTag tag)
return true if element tag can open a values editor
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the object.
Copy typed object name - popup entry.
static bool isRouteValid(const std::vector< GNEEdge *> &edges, bool report)
check if a route is valid
void changeAdditionalParent(const std::string &newAdditionalParentID)
change additional parent of additional
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
bool isValidAdditionalID(const std::string &newID) const
check if a new additional ID is valid
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
bool isAdditionalSelected() const
virtual void updateGeometry()=0
update pre-computed geometry information
void addAdditionalChild(GNEAdditional *additional)
add additional child to this additional
void removeLaneChild(GNELane *lane)
remove lane child
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
GUISelectedStorage gSelected
A global holder of selected objects.
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
A window containing a gl-object's parameter.
double myBlockIconRotation
The rotation of the block icon.
GNELane * changeLane(GNELane *oldLane, const std::string &newLaneID)
change lane of additional
void addLaneChild(GNELane *lane)
add lane child
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
Position myBlockIconPosition
position of the block icon
std::vector< GNELane * > myLaneChilds
vector with the lane childs of this additional
SumoXMLTag getTag() const
get XML Tag assigned to this object
std::vector< GNEEdge * > myEdgeChilds
vector with the edge childs of this additional
virtual Position getPositionInView() const =0
Returns position of additional in view.