74 FXIMPLEMENT(
GNEDeleteFrame, FXVerticalFrame, GNEDeleteFrameMap, ARRAYNUMBER(GNEDeleteFrameMap))
81 GNEFrame(horizontalFrameParent, viewNet, "Delete"),
92 myAutomaticallyDeleteAdditionalsCheckButton->setCheck(
true);
96 myDeleteOnlyGeometryPoints->setCheck(
false);
105 myInformationLabel =
new FXLabel(myGroupBoxInformation,
" - Left click to delete element.\n - Hold <CTRL> and left click\n to mark element.\n - Left click in another element\n dismark marked element.", 0,
GUIDesignLabelFrameInformation);
126 junctionItem->setExpanded(
true);
128 for (
int i = 0; i < (int)junction->
getGNEEdges().size(); i++) {
132 edgeItem->setExpanded(
true);
134 for (
int j = 0; j < (int)edge->
getLanes().size(); j++) {
138 laneItem->setExpanded(
true);
144 additionalItem->setExpanded(
true);
150 incomingConnections->setExpanded(
false);
155 connectionItem->setExpanded(
true);
162 outgoingConnections->setExpanded(
false);
167 connectionItem->setExpanded(
true);
176 additionalItem->setExpanded(
true);
185 crossingItem->setExpanded(
true);
194 edgeItem->setExpanded(
true);
196 for (
int i = 0; i < (int)edge->
getLanes().size(); i++) {
200 laneItem->setExpanded(
true);
206 additionalItem->setExpanded(
true);
212 incomingConnections->setExpanded(
false);
217 connectionItem->setExpanded(
true);
224 outgoingConnections->setExpanded(
false);
229 connectionItem->setExpanded(
true);
238 additionalItem->setExpanded(
true);
242 FXTreeItem* additionalParents =
myTreelist->insertItem(0, edgeItem,
"part of", 0, 0);
244 additionalParents->setExpanded(
true);
250 additionalItem->setExpanded(
true);
260 laneItem->setExpanded(
true);
266 additionalItem->setExpanded(
true);
272 incomingConnections->setExpanded(
false);
277 connectionItem->setExpanded(
true);
284 outgoingConnections->setExpanded(
false);
289 connectionItem->setExpanded(
true);
299 POIItem->setExpanded(
true);
307 polygonItem->setExpanded(
true);
315 crossingItem->setExpanded(
true);
323 additionalItem->setExpanded(
true);
331 connectionItem->setExpanded(
true);
347 if (shown() ==
false) {
378 int numberOfAdditionals = 0;
381 for (
auto j : i->getLanes()) {
383 numberOfAdditionals += (int)i->getAdditionalChilds().size();
390 if (numberOfAdditionals > 0) {
393 WRITE_WARNING(
"Opening FXMessageBox 'Force deletion needed'");
395 std::string plural = numberOfAdditionals > 1 ?
"s" :
"";
397 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " +
toString(junction->
getTag())).c_str(),
"%s",
398 (
toString(junction->
getTag()) +
" '" + junction->
getID() +
"' cannot be deleted because owns " +
399 toString(numberOfAdditionals) +
" additional child" + plural +
".\n Check 'Force deletion of additionals' to force deletion.").c_str());
402 WRITE_WARNING(
"Closed FXMessageBox 'Force deletion needed' with 'OK'");
420 numberOfAdditionalChilds += (int)i->getAdditionalChilds().size();
426 if (numberOfAdditionalChilds > 0) {
429 WRITE_WARNING(
"Opening FXMessageBox 'Force deletion needed'");
431 std::string plural = numberOfAdditionalChilds > 1 ?
"s" :
"";
433 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " +
toString(edge->
getTag())).c_str(),
"%s",
435 toString(numberOfAdditionalChilds) +
" additional" + plural +
".\n Check 'Force deletion of additionals' to force deletion.").c_str());
438 WRITE_WARNING(
"Closed FXMessageBox 'Force deletion needed' with 'OK'");
440 }
else if (numberOfAdditionalParents > 0) {
443 WRITE_WARNING(
"Opening FXMessageBox 'Force deletion needed'");
445 std::string plural = numberOfAdditionalParents > 1 ?
"s" :
"";
447 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " +
toString(edge->
getTag())).c_str(),
"%s",
448 (
toString(edge->
getTag()) +
" '" + edge->
getID() +
"' cannot be deleted because is part of " +
449 toString(numberOfAdditionalParents) +
" additional" + plural +
".\n Check 'Force deletion of additionals' to force deletion.").c_str());
452 WRITE_WARNING(
"Closed FXMessageBox 'Force deletion needed' with 'OK'");
472 WRITE_WARNING(
"Opening FXMessageBox 'Force deletion needed'");
475 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " +
toString(lane->
getTag())).c_str(),
"%s",
477 toString(lane->
getAdditionalChilds().size()) +
" additional childs.\n Check 'Force deletion of Additionals' to force deletion.").c_str());
480 WRITE_WARNING(
"Closed FXMessageBox 'Force deletion needed' with 'OK'");
550 FXEvent* e = (FXEvent*) eventData;
551 FXTreeItem* item =
myTreelist->getItemAt(e->win_x, e->win_y);
590 FXMenuPane* pane =
new FXMenuPane(
myTreelist);
595 new FXMenuSeparator(pane);
In GNEDeleteFrame, center element.
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_MODE_INSPECT
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
long onCmdCenterChildItem(FXObject *, FXSelector, void *)
called when user select option "center item" of child Menu
std::set< FXTreeItem * > myTreeItemsWithoutAC
set used to save tree items without AC assigned (for example, Incoming/Outcoming connections) ...
FXDEFMAP(GNEDeleteFrame) GNEDeleteFrameMap[]
FXCheckButton * myDeleteOnlyGeometryPoints
checkbox for enable/disable delete only geometry points
void removeAttributeCarrier(GNEAttributeCarrier *ac)
remove attribute carrier (element)
FXTreeList * myTreelist
tree list to show the childs of the element to erase
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
void updateCurrentLabel(GNEAttributeCarrier *ac)
update current label
GNEViewParent * getViewParent() const
get the net object
int getVertexIndex(const Position &pos, bool createIfNoExist=true)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge ...
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
FXIcon * getIcon() const
get FXIcon assigned to this object
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
In GNEDeleteFrame, inspect element.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void showChildsOfMarkedAttributeCarrier()
show childs of marked attribute carrier
FXLabel * myCurrentElementLabel
label for current element
#define GUIDesignTreeListFrame
Tree list used in frames to represent childs of elements.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
automatically delete additional childs
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList)
removes edge
long onCmdShowChildMenu(FXObject *, FXSelector, void *eventData)
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
#define WRITE_WARNING(msg)
static OptionsCont & getOptions()
Retrieves the options.
GNEViewNet * myViewNet
View Net for changes.
GNEAdditionalFrame * getAdditionalFrame() const
get frame for GNE_MODE_ADDITIONAL
int getVertexIndex(const Position &pos, bool createIfNoExist=true)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge ...
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
GNEUndoList * getUndoList() const
get the undoList object
const std::vector< GNEAdditional * > & getAdditionalParents() const
return vector of additionals that have as Parameter this edge (For example, Rerouters) ...
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
~GNEDeleteFrame()
Destructor.
A point in 2D or 3D with translation and scaling methods.
void deleteLane(GNELane *lane, GNEUndoList *undoList)
removes lane
FXCheckButton * myAutomaticallyDeleteAdditionalsCheckButton
checkbox for enable/disable automatically delete additionals childs
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
void removeAdditional(GNEAdditional *additional)
remove an additional element previously added
void markAttributeCarrier(GNEAttributeCarrier *ac)
mark attribute carrier (element)
GNEAttributeCarrier * myClickedAC
current attribute carrier selected in three
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
GNEAttributeCarrier * myMarkedAC
pointer to marked attributeCarrier (element)
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
A road/street connecting two junctions (netedit-version)
long onCmdDeleteChildItem(FXObject *, FXSelector, void *)
called when user select option "delte item" of child menu
long onCmdInspectChildItem(FXObject *, FXSelector, void *)
called when user select option "inspect item" of child menu
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
virtual void show()
show Frame
An Element which don't belongs to GNENet but has influency in the simulation.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
GUIMainWindow * getApp() const
get App (GUIMainWindow)
virtual void hide()
hide Frame
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
void show()
show inspector frame
GNENet * getNet() const
get the net object
GUIGlID getGlID() const
Returns the numerical id of the 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.
GNEAttributeCarrier * getMarkedAttributeCarrier() const
returns marked atrribute carrier
delete only geometry points
std::map< FXTreeItem *, GNEAttributeCarrier * > myTreeItemToACMap
map used to save the Tree items with their AC
C++ TraCI client API implementation.
In GNEDeleteFrame, delete element.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXLabel * myMarkedElementLabel
label for marked element
void createPopUpMenu(int X, int Y, GNEAttributeCarrier *ac)
const GUIGlObject * getGUIGLObject() const
get const pointer to GUIGlObject vinculated with this Attribute Carrier
SumoXMLTag getTag() const
get XML Tag assigned to this object