58 #ifdef CHECK_MEMORY_LEAKS 72 myAdditionalSetParent(additionalSetParent),
74 myInspectionable(true),
77 myBlockIconRotation(0),
80 myAdditionalDialog(NULL) {
193 throw InvalidArgument(
"Calling virtual function removeEdgeReference() of class GNEAdditional. Implement removeEdgeReference() in additional child to avoid this exception");
199 throw InvalidArgument(
"Calling virtual function removeLaneReference() of class GNEAdditional. Implement removeLaneReference() in additional child to avoid this exception");
225 std::vector<SumoXMLAttr> attributes =
getAttrs();
227 if (std::find(attributes.begin(), attributes.end(),
SUMO_ATTR_LANE) != attributes.end()) {
233 new FXMenuCommand(ret, (
"inner position: " +
toString(innerPos)).c_str(), 0, 0, 0);
237 new FXMenuCommand(ret, (
"lane position: " +
toString(innerPos + lanePos)).c_str(), 0, 0, 0);
242 }
else if (std::find(attributes.begin(), attributes.end(),
SUMO_ATTR_EDGE) != attributes.end()) {
248 new FXMenuCommand(ret, (
"inner position: " +
toString(innerPos)).c_str(), 0, 0, 0);
252 new FXMenuCommand(ret, (
"edge position: " +
toString(innerPos + edgePos)).c_str(), 0, 0, 0);
263 new FXMenuSeparator(ret);
264 if (additionalSet->getNumberOfAdditionalChilds() > 0) {
265 new FXMenuCommand(ret, (
"number of additional childs: " +
toString(additionalSet->getNumberOfAdditionalChilds())).c_str(), 0, 0, 0);
266 }
else if (additionalSet->getNumberOfEdgeChilds() > 0) {
267 new FXMenuCommand(ret, (
"number of edge childs: " +
toString(additionalSet->getNumberOfEdgeChilds())).c_str(), 0, 0, 0);
268 }
else if (additionalSet->getNumberOfLaneChilds() > 0) {
269 new FXMenuCommand(ret, (
"number of lane childs: " +
toString(additionalSet->getNumberOfLaneChilds())).c_str(), 0, 0, 0);
272 new FXMenuSeparator(ret);
274 dynamic_cast<GNEViewNet&
>(parent).markPopupPosition();
284 std::vector<SumoXMLAttr> attributes =
getAttrs();
288 for (std::vector<SumoXMLAttr>::iterator i = attributes.begin(); i != attributes.end(); i++) {
316 }
else if (lane != NULL) {
337 glRotated(180, 0, 0, 1);
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.
SumoXMLTag
Numbers representing SUMO-XML - element names.
GNEAdditionalSet * getAdditionalSetParent() const
get additionalSet parent, or NULL if don't belongs to an additionalSet
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
SUMOReal nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
std::vector< SumoXMLAttr > getAttrs() const
get vector of attributes
PositionVector getShape() const
Returns additional element's shape.
bool myRotationLefthand
rotation depending of the option "Lefthand"
virtual const std::string & getParentName() const =0
Returns the name of the parent object (if any)
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.
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 setBlocked(bool value)
Block or unblock additional element(i.e. cannot be moved with mouse)
An Element wich group additionalSet elements.
SUMOReal x() const
Returns the x-position.
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.
virtual std::string getAttribute(SumoXMLAttr key) const =0
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 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.
virtual GNEEdge * getEdge() const
get edge of additional, or NULL if additional isn't placed over an edge
SUMOReal myBlockIconRotation
The rotation of the block icon.
virtual GNELane * getLane() const
get lane of additional, or NULL if additional isn't placed over a Lane
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
GNEAdditional(const std::string &id, GNEViewNet *viewNet, Position pos, SumoXMLTag tag, GNEAdditionalSet *additionalSetParent=NULL, bool blocked=false)
Constructor.
Copy object name - popup entry.
SUMOReal getPositionRelativeToParametricLenght(SUMOReal position) const
PositionVector myShape
The shape of the additional element.
A point in 2D or 3D with translation and scaling methods.
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
void setBlockIconRotation(GNELane *lane=NULL)
bool addAdditionalChild(GNEAdditional *additional)
add additional element to this set
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
void drawLockIcon(SUMOReal size=0.5) const
draw lock icon
void setAdditionalID(const std::string &id)
set the ID of additional
bool removeAdditionalChild(GNEAdditional *additional)
remove additional element to this set
~GNEAdditional()
Destructor.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Position myBlockIconOffset
The offSet of the block icon.
A road/street connecting two junctions (netedit-version)
SUMOReal length() const
Returns the length.
SUMOReal rotationDegreeAtOffset(SUMOReal pos) const
Returns the rotation at the given length.
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
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
GNEAdditionalSet * myAdditionalSetParent
pointer to additional set parent, if belong to set
virtual void removeLaneReference()
if additional is placed over a lane, remove it reference
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
SUMOReal y() const
Returns the y-position.
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)
virtual void removeEdgeReference()
if additional is placed over an edge, remove it reference
bool mySelectable
boolean to check if additional element is selectable (With GNESelectorFrame). By default true ...
SumoXMLTag getTag() const
get Tag assigned to this object
Position myPosition
The position in which this additional element is located.
void setPositionInView(const Position &pos)
set new position in the view
static bool isUnique(SumoXMLAttr attr)
whether an attribute is unique (may not be edited for a multi-selection)
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)
static GUIGlID getGif(GUITexture which)
returns a texture Gif previously defined in the enum GUITexture
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.
void closeBuilding()
Closes the building of the table.
A window containing a gl-object's parameter.
static void drawTexturedBox(int which, SUMOReal size)
Draws a named texture as a box with the given size.
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