47 myDeleteFrameParent(deleteFrameParent) {
78 GNEFrame(horizontalFrameParent, viewNet,
"Delete") {
127 if (edge && (edge->
getVertexIndex(clickedPosition,
false,
false) != -1)) {
134 if (polygon && (polygon->
getVertexIndex(clickedPosition,
false,
false) != -1)) {
141 if (TAZ && TAZ->
getVertexIndex(clickedPosition,
false,
false) != -1) {
157 int numberOfAdditionals = 0;
159 numberOfAdditionals += (int)i->getAdditionalChilds().size();
160 for (
auto j : i->getLanes()) {
162 numberOfAdditionals += (int)i->getAdditionalChilds().size();
169 if (numberOfAdditionals > 0) {
171 WRITE_DEBUG(
"Opening FXMessageBox 'Force deletion needed'");
172 std::string plural = numberOfAdditionals > 1 ?
"s" :
"";
174 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " + junction->
getTagStr()).c_str(),
"%s",
175 (junction->
getTagStr() +
" '" + junction->
getID() +
"' cannot be deleted because owns " +
176 toString(numberOfAdditionals) +
" additional child" + plural +
".\n Check 'Force deletion of additionals' to force deletion.").c_str());
178 WRITE_DEBUG(
"Closed FXMessageBox 'Force deletion needed' with 'OK'");
196 numberOfAdditionalChilds += (int)i->getAdditionalChilds().size();
203 if (numberOfAdditionalChilds > 0) {
205 WRITE_DEBUG(
"Opening FXMessageBox 'Force deletion needed'");
206 std::string plural = numberOfAdditionalChilds > 1 ?
"s" :
"";
208 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " + edge->
getTagStr()).c_str(),
"%s",
209 (edge->
getTagStr() +
" '" + edge->
getID() +
"' cannot be deleted because owns " +
210 toString(numberOfAdditionalChilds) +
" additional" + plural +
".\n Check 'Force deletion of additionals' to force deletion.").c_str());
212 WRITE_DEBUG(
"Closed FXMessageBox 'Force deletion needed' with 'OK'");
213 }
else if (numberOfAdditionalParents > 0) {
215 WRITE_DEBUG(
"Opening FXMessageBox 'Force deletion needed'");
216 std::string plural = numberOfAdditionalParents > 1 ?
"s" :
"";
218 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " + edge->
getTagStr()).c_str(),
"%s",
219 (edge->
getTagStr() +
" '" + edge->
getID() +
"' cannot be deleted because is part of " +
220 toString(numberOfAdditionalParents) +
" additional" + plural +
".\n Check 'Force deletion of additionals' to force deletion.").c_str());
222 WRITE_DEBUG(
"Closed FXMessageBox 'Force deletion needed' with 'OK'");
244 WRITE_DEBUG(
"Opening FXMessageBox 'Force deletion needed'");
246 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " + lane->
getTagStr()).c_str(),
"%s",
247 (lane->
getTagStr() +
" '" + lane->
getID() +
"' cannot be deleted because it has " +
248 toString(lane->
getAdditionalChilds().size()) +
" additional childs.\n Check 'Force deletion of Additionals' to force deletion.").c_str());
250 WRITE_DEBUG(
"Closed FXMessageBox 'Force deletion needed' with 'OK'");
270 if (tagValue.isAdditional()) {
274 }
else if (tagValue.isShape()) {
DeleteOptions * getDeleteOptions() const
get delete options
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
void hide()
hide delete frame
begin/end of the description of a junction
begin/end of the description of a single lane
a traffic assignment zone
void showACHierarchy(GNEAttributeCarrier *AC)
show ACHierarchy
void show()
show delete frame
connectio between two lanes
void hideACHierarchy()
hide ACHierarchy
GNEViewParent * getViewParent() const
get the net object
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
GNEDeleteFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
automatically delete additional childs
FXCheckButton * myDeleteOnlyGeometryPoints
checkbox for enable/disable delete only geometry points
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
ACHierarchy * myACHierarchy
modul for hierarchy
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge ...
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers()
get all selected attribute carriers
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
#define UNUSED_PARAMETER(x)
GNEViewNet * getViewNet() const
get view net
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
GNEViewNet * myViewNet
View Net for changes.
GNEAdditionalFrame * getAdditionalFrame() const
get frame for GNE_MODE_ADDITIONAL
GNEUndoList * getUndoList() const
get the undoList object
delete only geometry points
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parameter this edge (For example, Rerouters) ...
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
~GNEDeleteFrame()
Destructor.
A point in 2D or 3D with translation and scaling methods.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge ...
void removeAdditional(GNEAdditional *additional)
remove an additional element previously added
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
const std::string getID() const
function to support debugging
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
DeleteOptions * myDeleteOptions
modul for delete options
begin/end of the description of an edge
A road/street connecting two junctions (netedit-version)
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
virtual void show()
show Frame
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
An Element which don't belongs to GNENet but has influency in the simulation.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
const std::string & getTagStr() const
get tag assigned to this object in string format
crossing between edges for pedestrians
virtual void hide()
hide Frame
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
GNENet * getNet() const
get the net object
~DeleteOptions()
destructor
void removeAttributeCarrier(GNEAttributeCarrier *ac, bool ignoreOptions=false)
remove attribute carrier (element)
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
DeleteOptions(GNEDeleteFrame *deleteFrameParent)
constructor
FXCheckButton * myForceDeleteAdditionals
checkbox for enable/disable automatically delete additionals childs
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge ...
begin/end of the description of a polygon
bool forceDeleteAdditionals() const
check if force delete additionals checkbox is enabled
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)