66 #ifdef CHECK_MEMORY_LEAKS 68 #endif // CHECK_MEMORY_LEAKS 83 FXIMPLEMENT(
GNEDeleteFrame, FXVerticalFrame, GNEDeleteFrameMap, ARRAYNUMBER(GNEDeleteFrameMap))
89 GNEFrame(horizontalFrameParent, viewNet, "Delete"),
94 myCurrentElementLabel =
new FXLabel(myGroupBoxCurrentElement,
"No item under cursor", 0,
GUIDesignLabelLeft);
101 myCheckBoxAutomaticallyDeleteAdditionals->setCheck(
true);
105 myMarkedElementLabel =
new FXLabel(myGroupBoxTreeList,
"No item marked", 0,
GUIDesignLabelLeft);
110 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);
126 switch (dynamic_cast<GUIGlObject*>(ac)->getType()) {
132 junctionItem->setExpanded(
true);
134 for (
int i = 0; i < (int)junction->
getGNEEdges().size(); i++) {
138 edgeItem->setExpanded(
true);
140 for (
int j = 0; j < (int)edge->
getLanes().size(); j++) {
144 laneItem->setExpanded(
true);
150 additionalItem->setExpanded(
true);
156 incomingConnections->setExpanded(
false);
161 connectionItem->setExpanded(
true);
168 outgoingConnections->setExpanded(
false);
173 connectionItem->setExpanded(
true);
182 additionalItem->setExpanded(
true);
191 crossingItem->setExpanded(
true);
200 edgeItem->setExpanded(
true);
202 for (
int i = 0; i < (int)edge->
getLanes().size(); i++) {
206 laneItem->setExpanded(
true);
212 additionalItem->setExpanded(
true);
218 incomingConnections->setExpanded(
false);
223 connectionItem->setExpanded(
true);
230 outgoingConnections->setExpanded(
false);
235 connectionItem->setExpanded(
true);
244 additionalItem->setExpanded(
true);
253 laneItem->setExpanded(
true);
259 additionalItem->setExpanded(
true);
265 incomingConnections->setExpanded(
false);
270 connectionItem->setExpanded(
true);
277 outgoingConnections->setExpanded(
false);
282 connectionItem->setExpanded(
true);
292 POIItem->setExpanded(
true);
300 polygonItem->setExpanded(
true);
308 crossingItem->setExpanded(
true);
316 additionalItem->setExpanded(
true);
324 connectionItem->setExpanded(
true);
338 if (shown() ==
false) {
344 switch (dynamic_cast<GUIGlObject*>(ac)->getType()) {
353 for (std::vector<GNELane*>::const_iterator i = edge->
getLanes().begin(); i != edge->
getLanes().end(); i++) {
354 numberOfAdditionals += (int)(*i)->getAdditionalChilds().size();
360 if (numberOfAdditionals == 0) {
363 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " +
toString(edge->
getTag())).c_str(),
"%s",
365 toString(numberOfAdditionals) +
" additional childs.\n Check 'Force deletion of additionals' to force deletion.").c_str());
379 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " +
toString(lane->
getTag())).c_str(),
"%s",
381 toString(lane->
getAdditionalChilds().size()) +
" additional childs.\n Check 'Force deletion of Additionals' to force deletion.").c_str());
454 FXEvent* e = (FXEvent*) data;
455 FXTreeItem* item =
myTreelist->getItemAt(e->win_x, e->win_y);
468 }
else if (dynamic_cast<GNEAdditional*>(
myClickedAC)) {
508 FXMenuPane* pane =
new FXMenuPane(
myTreelist);
513 new FXMenuSeparator(pane);
ShapeContainer & getShapeContainer()
get shape container
tree list with the childs
FXMenuCheck * myCheckBoxAutomaticallyDeleteAdditionals
checkbox for enable/disble automatically delete additionals childs
In GNEDeleteFrame, inspect element.
virtual void centerTo(GUIGlID id, bool applyZoom, SUMOReal zoomDist=20)
centers to the chosen artifact
FXDEFMAP(GNEDeleteFrame) GNEDeleteFrameMap[]
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
const std::vector< GNEAdditional * > & getAdditionalChilds() const
get additional childs of lane
GNEAdditionalFrame * getAdditionalFrame() const
get frame for GNE_MODE_ADDITIONAL
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< GNEAdditional * > & getAdditionalChilds() const
return list of additionals associated with this edge
automatically delete additional childs
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
std::set< FXTreeItem * > myTreeItesmWithoutAC
set used to save tree items without AC assigned (for example, Incoming/Outcoming connections) ...
GNEViewNet * myViewNet
the window to inform when the tls is modfied
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...
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
~GNEDeleteFrame()
Destructor.
virtual bool removePOI(const std::string &id)
Removes a PoI from the container.
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 ...
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
void removeAdditional(GNEAdditional *additional)
remove an additional element previously added
#define GUIDesignMenuCheck
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user select option "inspect item" of child menu
void markAttributeCarrier(GNEAttributeCarrier *ac)
mark attribute carrier (element)
GNEAttributeCarrier * myClickedAC
current attribute carrier selected in three
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_MODE_INSPECT
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
GNEAttributeCarrier * myCurrentAC
pointer to current AC
long onCmdDeleteItem(FXObject *, FXSelector, void *)
called when user select option "delte item" of child menu
const std::string getID() const
function to support debugging
GNEAttributeCarrier * myMarkedAC
pointer to marked attributeCarrier (element)
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
GNEViewNet * getViewNet() const
get view net
A road/street connecting two junctions (netedit-version)
FXIcon * getIcon() const
get FXIcon assigned to this object
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)
GNEAttributeCarrier * getMarkedAttributeCarrier() const
returns marked atrribute carrier
void showAttributeCarrierChilds(GNEAttributeCarrier *ac)
show child of attributeCarrier in frame if previously there isn't a marked element ...
GNENet * getNet() const
get the net object
virtual void hide()
hide Frame
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
void show()
show inspector frame
In GNEDeleteFrame, center element.
SumoXMLTag getTag() const
get XML Tag assigned to this object
#define GUIDesignLabelLeft
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
In GNEDeleteFrame, delete element.
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)