 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
66 return (myForceDeleteAdditionals->getCheck() == TRUE);
72 return (myDeleteOnlyGeometryPoints->getCheck() == TRUE);
78 return (myProtectDemandElements->getCheck() == TRUE);
86 GNEFrame(horizontalFrameParent, viewNet,
"Delete") {
200 if (subordinatedElements.childAdditionals > 0) {
202 WRITE_DEBUG(
"Opening FXMessageBox 'Force deletion needed'");
203 std::string plural = subordinatedElements.childAdditionals > 1 ?
"s" :
"";
207 toString(subordinatedElements.childAdditionals) +
" child additional" + plural +
".\n Check 'Force deletion of additionals' to force deletion.").c_str());
209 WRITE_DEBUG(
"Closed FXMessageBox 'Force deletion needed' with 'OK'");
232 WRITE_DEBUG(
"Opening FXMessageBox 'Force deletion needed'");
233 std::string plural = subordinatedElements.childAdditionals > 1 ?
"s" :
"";
235 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " + tagstr).c_str(),
"%s",
236 (tagstr +
" '" +
id +
"' cannot be deleted because owns " +
toString(subordinatedElements.childAdditionals) +
" additional" + plural +
237 ".\n Check 'Force deletion of additionals' to force deletion.").c_str());
239 WRITE_DEBUG(
"Closed FXMessageBox 'Force deletion needed' with 'OK'");
242 WRITE_DEBUG(
"Opening FXMessageBox 'Force deletion needed'");
243 std::string plural = subordinatedElements.parentAdditionals > 1 ?
"s" :
"";
245 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " + tagstr).c_str(),
"%s",
246 (tagstr +
" '" +
id +
"' cannot be deleted because is part of " +
toString(subordinatedElements.parentAdditionals) +
" additional" + plural +
247 ".\n Check 'Force deletion of additionals' to force deletion.").c_str());
249 WRITE_DEBUG(
"Closed FXMessageBox 'Force deletion needed' with 'OK'");
252 WRITE_DEBUG(
"Opening FXMessageBox 'Unprotect demand elements'");
253 std::string plural = subordinatedElements.childDemandElements > 1 ?
"s" :
"";
255 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " + tagstr).c_str(),
"%s",
256 (tagstr +
" '" +
id +
"' cannot be deleted because owns " +
toString(subordinatedElements.childDemandElements) +
" demand element" + plural +
257 ".\n Uncheck 'Protect demand elements' to force deletion.").c_str());
259 WRITE_DEBUG(
"Closed FXMessageBox 'Unprotect demand elements' with 'OK'");
262 WRITE_DEBUG(
"Opening FXMessageBox 'Unprotect demand elements'");
263 std::string plural = subordinatedElements.parentDemandElements > 1 ?
"s" :
"";
265 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " + tagstr).c_str(),
"%s",
266 (tagstr +
" '" +
id +
"' cannot be deleted because is part of " +
toString(subordinatedElements.parentDemandElements) +
" demand element" + plural +
267 ".\n Uncheck 'Protect demand elements' to force deletion.").c_str());
269 WRITE_DEBUG(
"Closed FXMessageBox 'Unprotect demand elements' with 'OK'");
290 WRITE_DEBUG(
"Opening FXMessageBox 'Force deletion needed'");
291 std::string plural = subordinatedElements.childAdditionals > 1 ?
"s" :
"";
293 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " + tagstr).c_str(),
"%s",
294 (tagstr +
" '" +
id +
"' cannot be deleted because owns " +
toString(subordinatedElements.childAdditionals) +
" additional" + plural +
295 ".\n Check 'Force deletion of additionals' to force deletion.").c_str());
297 WRITE_DEBUG(
"Closed FXMessageBox 'Force deletion needed' with 'OK'");
300 WRITE_DEBUG(
"Opening FXMessageBox 'Force deletion needed'");
301 std::string plural = subordinatedElements.parentAdditionals > 1 ?
"s" :
"";
303 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " + tagstr).c_str(),
"%s",
304 (tagstr +
" '" +
id +
"' cannot be deleted because is part of " +
toString(subordinatedElements.parentAdditionals) +
" additional" + plural +
305 ".\n Check 'Force deletion of additionals' to force deletion.").c_str());
307 WRITE_DEBUG(
"Closed FXMessageBox 'Force deletion needed' with 'OK'");
310 WRITE_DEBUG(
"Opening FXMessageBox 'Unprotect demand elements'");
311 std::string plural = subordinatedElements.childDemandElements > 1 ?
"s" :
"";
313 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " + tagstr).c_str(),
"%s",
314 (tagstr +
" '" +
id +
"' cannot be deleted because owns " +
toString(subordinatedElements.childDemandElements) +
" demand element" + plural +
315 ".\n Uncheck 'Protect demand elements' to force deletion.").c_str());
317 WRITE_DEBUG(
"Closed FXMessageBox 'Unprotect demand elements' with 'OK'");
320 WRITE_DEBUG(
"Opening FXMessageBox 'Unprotect demand elements'");
321 std::string plural = subordinatedElements.parentDemandElements > 1 ?
"s" :
"";
323 FXMessageBox::warning(
getViewNet()->getApp(), MBOX_OK, (
"Problem deleting " + tagstr).c_str(),
"%s",
324 (tagstr +
" '" +
id +
"' cannot be deleted because is part of " +
toString(subordinatedElements.parentDemandElements) +
" demand element" + plural +
325 ".\n Uncheck 'Protect demand elements' to force deletion.").c_str());
327 WRITE_DEBUG(
"Closed FXMessageBox 'Unprotect demand elements' with 'OK'");
365 parentAdditionals(0),
367 parentDemandElements(0),
368 childDemandElements(0) {
382 parentAdditionals(0),
384 parentDemandElements(0),
385 childDemandElements(0) {
392 for (
const auto& i : edge->
getLanes()) {
399 parentAdditionals(0),
401 parentDemandElements(0),
402 childDemandElements(0) {
412 parentAdditionals(0),
414 parentDemandElements(0),
415 childDemandElements(0) {
420 parentAdditionals(0),
422 parentDemandElements(0),
423 childDemandElements(0) {
446 if (i.second->isAttributeCarrierSelected()) {
450 for (
const auto& j : i.second->getGNEIncomingEdges()) {
451 if (j->isAttributeCarrierSelected()) {
455 for (
auto k : j->getLanes()) {
456 if (k->isAttributeCarrierSelected()) {
461 for (
const auto& k : j->getGNEConnections()) {
462 if (k->isAttributeCarrierSelected()) {
468 for (
const auto& j : i.second->getGNECrossings()) {
469 if (j->isAttributeCarrierSelected()) {
478 for (
const auto& j : i.second) {
479 if (j.second->isAttributeCarrierSelected()) {
502 if (i.second->isAttributeCarrierSelected()) {
508 if (i.second->isAttributeCarrierSelected()) {
514 if (i.second->isAttributeCarrierSelected()) {
520 if (i.second->isAttributeCarrierSelected()) {
526 if (i.second->isAttributeCarrierSelected()) {
532 if (i.second->isAttributeCarrierSelected()) {
538 if (i.second->isAttributeCarrierSelected()) {
544 if (i.second->isAttributeCarrierSelected()) {
550 if (i.second->isAttributeCarrierSelected()) {
556 if (i.second->isAttributeCarrierSelected()) {
void hideAttributeCarrierHierarchy()
hide AttributeCarrierHierarchy
const AttributeCarriers & getAttributeCarriers() const
retrieve all attribute carriers of Net
GNEPoly * getPolyFront() const
get front Poly (or a pointer to nullptr if there isn't)
void showAttributeCarrierHierarchy(GNEAttributeCarrier *AC)
show AttributeCarrierHierarchy
void hide()
hide delete frame
An Element which don't belongs to GNENet but has influency in the simulation.
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
An Element which don't belongs to GNENet but has influency in the simulation.
@ SUMO_TAG_STOP_PARKINGAREA
stop placed over a parking area (used in netedit)
int childDemandElements
child demand elements
std::map< std::string, GNEJunction * > junctions
map with the name and pointer to junctions of net
const std::string getID() const
function to support debugging
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
@ SUMO_TAG_POLY
begin/end of the description of a polygon
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 deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
@ SUMO_TAG_STOP_LANE
stop placed over a lane (used in netedit)
FXCheckButton * myProtectDemandElements
checkbox for enable/disable automatic deletion of demand children
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
GNEViewNet * getViewNet() const
get view net
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
@ SUMO_TAG_LANE
begin/end of the description of a single lane
DeleteOptions * myDeleteOptions
modul for delete options
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
GNETAZ * getTAZFront() const
get front TAZ (or a pointer to nullptr if there isn't)
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn't)
@ MID_GNE_SET_ATTRIBUTE
attribute edited
void update() const
Mark the entire GNEViewNet to be repainted later.
std::vector< GNEConnection * > retrieveConnections(bool onlySelected=false) const
return all connections
std::map< SumoXMLTag, std::map< std::string, GNEAdditional * > > additionals
map with the name and pointer to additional elements of net
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
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 deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
A road/street connecting two junctions (netedit-version)
SubordinatedElements(const GNEJunction *junction)
constructor (for junctions)
GNENet * getNet() const
get the net object
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
@ SUMO_TAG_ROUTEFLOW
a flow definition nusing a route instead of a from-to edges route (used in NETEDIT)
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
DeleteOptions * getDeleteOptions() const
get delete options
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
GNEFrameModuls::AttributeCarrierHierarchy * myAttributeCarrierHierarchy
modul for hierarchy
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
@ SUMO_TAG_STOP_CHARGINGSTATION
stop placed over a charging station (used in netedit)
class used to group all variables related with objects under cursor after a click over view
std::vector< GNEDemandElement * > retrieveDemandElements(bool onlySelected=false) const
return all demand elements
int parentAdditionals
parent additionals
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
void enableUpdateGeometry()
@ SUMO_TAG_EDGE
begin/end of the description of an edge
FXCheckButton * myForceDeleteAdditionals
checkbox for enable/disable automatic deletion of additionals children
@ GNE_SUPERMODE_NETWORK
Network mode (Edges, junctions, etc..)
Supermode currentSupermode
the current supermode
void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool ignoreOptions=false)
remove attribute carrier (element)
#define GUIDesignCheckButton
checkButton placed in left position
A point in 2D or 3D with translation and scaling methods.
GNEViewNet * myViewNet
View Net.
GNEUndoList * getUndoList() const
get the undoList object
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
std::vector< GNECrossing * > retrieveCrossings(bool onlySelected=false) const
return all crossings
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
GNEConnection * getConnectionFront() const
get front connection (or a pointer to nullptr if there isn't)
void show()
show delete frame
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > demandElements
map with the name and pointer to demand elements of net
@ SUMO_TAG_VEHICLE
description of a vehicle
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
bool forceDeleteAdditionals() const
check if force delete additionals checkbox is enabled
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
GNEJunction * getJunctionFront() const
get front junction (or a pointer to nullptr if there isn't)
const POIs & getPOIs() const
Returns all pois.
GNEDeleteFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
@ SUMO_TAG_TAZ
a traffic assignment zone
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
bool isSelectable() const
return true if tag correspond to a selectable element
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
@ SUMO_TAG_STOP_CONTAINERSTOP
stop placed over a containerStop (used in netedit)
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
bool ACsToDelete() const
check if there is ACs to delete
GNEDemandElement * getDemandElementFront() const
get front net element element (or a pointer to nullptr if there isn't)
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
@ SUMO_TAG_CONNECTION
connectio between two lanes
struct for saving subordinated elements (Junction->Edge->Lane->(Additional | DemandElement)
GNECrossing * getCrossingFront() const
get front crossing (or a pointer to nullptr if there isn't)
@ SUMO_TAG_ROUTE
begin/end of the description of a route
SubordinatedElements & operator+=(const SubordinatedElements &other)
add operator
GNELane * getLaneFront() const
get front lane (or a pointer to nullptr if there isn't)
static const TagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
bool protectDemandElements() const
check if protect demand elements checkbox is enabled
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier (or a pointer to nullptr if there isn't)
@ SUMO_TAG_STOP_BUSSTOP
stop placed over a busStop (used in netedit)
const std::string & getTagStr() const
get tag assigned to this object in string format
const Polygons & getPolygons() const
Returns all polygons.
int childAdditionals
child additional
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
~GNEDeleteFrame()
Destructor.
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...
DeleteOptions(GNEDeleteFrame *deleteFrameParent)
constructor
virtual void show()
show Frame
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
int parentDemandElements
parent demand elements
GNEShape * getShapeFront() const
get front shape element (or a pointer to nullptr if there isn't)
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
~DeleteOptions()
destructor
virtual void hide()
hide Frame
GNEAdditional * getAdditionalFront() const
get front additional element (or a pointer to nullptr if there isn't)
@ SUMO_TAG_TRIP
a single trip definition (used by router)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
FXCheckButton * myDeleteOnlyGeometryPoints
checkbox for enable/disable delete only geometry points