69 myBlockIconRotation(0),
71 myInspectionable(true),
74 myAdditionalDialog(NULL) {
179 std::vector<SumoXMLAttr> attributes =
getAttrs();
181 if (std::find(attributes.begin(), attributes.end(),
SUMO_ATTR_LANE) != attributes.end()) {
187 new FXMenuCommand(ret, (
"inner position: " +
toString(innerPos)).c_str(), 0, 0, 0);
196 }
else if (std::find(attributes.begin(), attributes.end(),
SUMO_ATTR_EDGE) != attributes.end()) {
202 new FXMenuCommand(ret, (
"inner position: " +
toString(innerPos)).c_str(), 0, 0, 0);
205 const double edgePos = edge->
getLanes().at(0)->getShape().nearest_offset_to_point2D(
myShape[0]);
214 new FXMenuSeparator(ret);
216 dynamic_cast<GNEViewNet&
>(parent).markPopupPosition();
226 std::vector<SumoXMLAttr> attributes =
getAttrs();
230 for (std::vector<SumoXMLAttr>::iterator i = attributes.begin(); i != attributes.end(); i++) {
258 }
else if (
myLane != NULL) {
281 glRotated(180, 0, 0, 1);
321 glTranslated(0, 0,
getType() - 0.01);
324 for (std::vector<Position>::const_iterator j = (*i).begin(); (j + 1) != (*i).end(); j++) {
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
virtual void openAdditionalDialog()
open Additional Dialog
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
virtual const std::string & getParentName() const =0
Returns the name of the parent object (if any)
bool showLockIcon() const
check if lock icon should be visible
void setBlockIconRotation()
SumoXMLTag
Numbers representing SUMO-XML - element names.
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
begin/end of the description of a single lane
std::vector< SumoXMLAttr > getAttrs() const
get vector of attributes
GUIIcon
An enumeration of icons used by the gui applications.
PositionVector getShape() const
Returns additional element's shape.
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
double x() const
Returns the x-position.
GNELane * myLane
The lane this additional belongs.
bool myRotationLefthand
rotation depending of the option "Lefthand"
void removeAdditionalChild(GNEAdditional *additional)
remove additional child to this lane
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
bool isAdditionalSelected() const
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
virtual Position getPositionInView() const =0
Returns position of additional in view.
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.
Copy typed object name - popup entry.
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.
GUIGlID getGlID() const
Returns the numerical id of the object.
#define UNUSED_PARAMETER(x)
A class that stores a 2D geometrical boundary.
static OptionsCont & getOptions()
Retrieves the options.
GNEViewNet * myViewNet
The GNEViewNet this additional element belongs.
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void addAdditionalChild(GNEAdditional *additional)
add additional child to this edge
void updateAdditionalID(const std::string &oldID, GNEAdditional *additional)
update additional ID in container
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void changeEdge(const std::string &edgeID)
change edge of additional
GNEEdge * getEdge() const
get edge of additional, or NULL if additional isn't placed over an edge
GNELane * getLane() const
get lane of additional, or NULL if additional isn't placed over a Lane
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
bool myMovable
boolean to check if additional element is movable (with the mouse). By default true ...
const std::string & getAdditionalID() const
returns the ID of additional
Copy object name - popup entry.
PositionVector myShape
The shape of the additional element.
void addAdditionalChild(GNEAdditional *additional)
add additional child to this lane
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
std::vector< std::vector< Position > > myConnectionPositions
Matrix with the Vertex's positions of connections between Additional Parent an their childs...
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
double y() const
Returns the y-position.
double length() const
Returns the length.
Boundary & grow(double by)
extends the boundary by the given amount
void setAdditionalID(const std::string &id)
set the ID of additional
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
void drawLockIcon(double size=0.5) const
draw lock icon
~GNEAdditional()
Destructor.
virtual std::string getAttribute(SumoXMLAttr key) const =0
This functions has to be implemented in allGNEAttributeCarrier.
void changeLane(const std::string &laneID)
change lane of additional
Position myBlockIconOffset
The offSet of the block icon.
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...
void drawParentAndChildrenConnections() const
draw connections between Parent and childrens
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
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
GNENet * getNet() const
get the net object
bool isAdditionalBlocked() const
Check if additional item is currently blocked (i.e. cannot be moved with mouse)
bool mySelectable
boolean to check if additional element is selectable (With GNESelectorFrame). By default true ...
SumoXMLTag getTag() const
get XML Tag assigned to this object
virtual void updateGeometry()=0
update pre-computed geometry information
void removeAdditionalChild(GNEAdditional *additional)
remove additional child from this edge
bool myInspectionable
boolean to check if additional element is inspectionable (With GNEInspectorFrame). By default true
bool isAdditionalSelectable() const
check if additional element is selectable (With GNESelectorFrame)
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
bool isAdditionalInspectionable() const
check if additional element is inspectionable (With GNEInspectorFrame)
GNEEdge * myEdge
The edge this additional belongs.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
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.
A window containing a gl-object's parameter.
double myBlockIconRotation
The rotation of the block icon.
GNEAdditional(const std::string &id, GNEViewNet *viewNet, SumoXMLTag tag, GUIIcon icon)
Constructor.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
Position myBlockIconPosition
position of the block icon
bool isAdditionalMovable() const
check if additional element is movable