76 FXIMPLEMENT(
GNEDeleteFrame, FXVerticalFrame, GNEDeleteFrameMap, ARRAYNUMBER(GNEDeleteFrameMap))
82 GNEFrame(horizontalFrameParent, viewNet, "Delete"),
87 myCurrentElementLabel =
new FXLabel(myGroupBoxCurrentElement,
"No item under cursor", 0,
GUIDesignLabelLeft);
94 myAutomaticallyDeleteAdditionalsCheckButton->setCheck(
true);
98 myMarkedElementLabel =
new FXLabel(myGroupBoxTreeList,
"No item marked", 0,
GUIDesignLabelLeft);
103 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,
GUIDesignLabelLeft);
119 switch (dynamic_cast<GUIGlObject*>(ac)->getType()) {
125 junctionItem->setExpanded(
true);
127 for (
int i = 0; i < (int)junction->
getGNEEdges().size(); i++) {
131 edgeItem->setExpanded(
true);
133 for (
int j = 0; j < (int)edge->
getLanes().size(); j++) {
137 laneItem->setExpanded(
true);
143 additionalItem->setExpanded(
true);
149 incomingConnections->setExpanded(
false);
154 connectionItem->setExpanded(
true);
161 outgoingConnections->setExpanded(
false);
166 connectionItem->setExpanded(
true);
175 additionalItem->setExpanded(
true);
184 crossingItem->setExpanded(
true);
193 edgeItem->setExpanded(
true);
195 for (
int i = 0; i < (int)edge->
getLanes().size(); i++) {
199 laneItem->setExpanded(
true);
205 additionalItem->setExpanded(
true);
211 incomingConnections->setExpanded(
false);
216 connectionItem->setExpanded(
true);
223 outgoingConnections->setExpanded(
false);
228 connectionItem->setExpanded(
true);
237 additionalItem->setExpanded(
true);
243 rerouters->setExpanded(
true);
249 rerouterItem->setExpanded(
true);
259 laneItem->setExpanded(
true);
265 additionalItem->setExpanded(
true);
271 incomingConnections->setExpanded(
false);
276 connectionItem->setExpanded(
true);
283 outgoingConnections->setExpanded(
false);
288 connectionItem->setExpanded(
true);
298 POIItem->setExpanded(
true);
306 polygonItem->setExpanded(
true);
314 crossingItem->setExpanded(
true);
322 additionalItem->setExpanded(
true);
330 connectionItem->setExpanded(
true);
344 if (shown() ==
false) {
350 switch (dynamic_cast<GUIGlObject*>(ac)->getType()) {
360 for (std::vector<GNELane*>::const_iterator i = edge->
getLanes().begin(); i != edge->
getLanes().end(); i++) {
361 numberOfAdditionals += (int)(*i)->getAdditionalChilds().size();
367 if (numberOfAdditionals > 0) {
372 std::string plural = numberOfAdditionals > 1 ?
"s" :
"";
374 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " +
toString(edge->
getTag())).c_str(),
"%s",
376 toString(numberOfAdditionals) +
" additional child" + plural +
".\n Check 'Force deletion of additionals' to force deletion.").c_str());
379 WRITE_WARNING(
"Closed FXMessageBox of type 'warning' with 'OK'");
381 }
else if (numberOfRerouters > 0) {
386 std::string plural = numberOfRerouters > 1 ?
"s" :
"";
388 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " +
toString(edge->
getTag())).c_str(),
"%s",
389 (
toString(edge->
getTag()) +
" '" + edge->
getID() +
"' cannot be deleted because is part of " +
393 WRITE_WARNING(
"Closed FXMessageBox of type 'warning' with 'OK'");
415 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " +
toString(lane->
getTag())).c_str(),
"%s",
417 toString(lane->
getAdditionalChilds().size()) +
" additional childs.\n Check 'Force deletion of Additionals' to force deletion.").c_str());
420 WRITE_WARNING(
"Closed FXMessageBox of type 'warning' with 'OK'");
494 FXEvent* e = (FXEvent*) data;
495 FXTreeItem* item =
myTreelist->getItemAt(e->win_x, e->win_y);
508 }
else if (dynamic_cast<GNEAdditional*>(
myClickedAC)) {
548 FXMenuPane* pane =
new FXMenuPane(
myTreelist);
553 new FXMenuSeparator(pane);
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return list of additionals associated with this edge
ShapeContainer & getShapeContainer()
get shape container
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_MODE_INSPECT
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
std::set< FXTreeItem * > myTreeItemsWithoutAC
set used to save tree items without AC assigned (for example, Incoming/Outcoming connections) ...
tree list with the childs
FXDEFMAP(GNEDeleteFrame) GNEDeleteFrameMap[]
In GNEDeleteFrame, center element.
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 getNumberOfGNERerouters() const
get number of rerouters that has this edge as parameters
FXIcon * getIcon() const
get FXIcon assigned to this object
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
FXLabel * myCurrentElementLabel
label for current element
#define GUIDesignTreeListFrame
Tree list used in frames to represent childs of elements.
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
GNEViewNet * getViewNet() const
get view net
In GNEDeleteFrame, delete element.
#define WRITE_WARNING(msg)
bool isTestingModeEnabled() const
check if netedit is running in testing mode
GNEViewNet * myViewNet
the window to inform when the tls is modfied
GNEAdditionalFrame * getAdditionalFrame() const
get frame for GNE_MODE_ADDITIONAL
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
GNEUndoList * getUndoList() const
get the undoList object
long onCmdCenterItem(FXObject *, FXSelector, void *)
called when user select option "center item" of child Menu
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.
virtual bool removePOI(const std::string &id)
Removes a PoI from the container.
In GNEDeleteFrame, inspect element.
void deleteLane(GNELane *lane, GNEUndoList *undoList)
removes lane
void deleteGeometryOrEdge(GNEEdge *edge, const Position &pos, GNEUndoList *undoList)
removes geometry when pos is close to a geometry node, deletes the whole edge otherwise ...
FXCheckButton * myAutomaticallyDeleteAdditionalsCheckButton
checkbox for enable/disble 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
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user select option "inspect item" of child menu
const std::vector< GNERerouter * > & getGNERerouters() const
get rerouters vinculated with this edge
void markAttributeCarrier(GNEAttributeCarrier *ac)
mark attribute carrier (element)
automatically delete additional childs
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
GNEAttributeCarrier * myCurrentAC
pointer to current AC
long onCmdDeleteItem(FXObject *, FXSelector, void *)
called when user select option "delte item" of child menu
GNEAttributeCarrier * myMarkedAC
pointer to marked attributeCarrier (element)
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
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
long onCmdShowChildMenu(FXObject *, FXSelector, void *data)
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)
void showAttributeCarrierChilds(GNEAttributeCarrier *ac)
show child of attributeCarrier in frame if previously there isn't a marked element ...
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
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
GNEAttributeCarrier * getMarkedAttributeCarrier() const
returns marked atrribute carrier
#define GUIDesignLabelLeft
std::map< FXTreeItem *, GNEAttributeCarrier * > myTreeItemToACMap
map used to save the Tree items with their AC
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 std::vector< GNEAdditional * > & getAdditionalChilds() const
get additional childs of lane
SumoXMLTag getTag() const
get XML Tag assigned to this object