74 return (myDeleteOnlyGeometryPoints->getCheck() == TRUE);
80 return (myProtectAdditionals->getCheck() == TRUE);
86 return (myProtectTAZs->getCheck() == TRUE);
92 return (myProtectShapes->getCheck() == TRUE);
98 return (myProtectDemandElements->getCheck() == TRUE);
104 return (myProtectGenericDatas->getCheck() == TRUE);
112 GNEFrame(horizontalFrameParent, viewNet,
"Delete") {
145 for (
const auto& selectedJunction : selectedJunctions) {
150 for (
const auto& selectedEdge : selectedEdges) {
155 for (
const auto& selectedLane : selectedLanes) {
160 for (
const auto& selectedConnection : selectedConnections) {
165 for (
const auto& selectedCrossing : selectedCrossings) {
170 for (
const auto& selectedShape : selectedShapes) {
185 for (
const auto& selectedGenericData : selectedGenericDatas) {
294 for (
const auto& lane : edge->
getLanes()) {
332 openWarningDialog(
"additional", myAdditionalParents,
false);
334 openWarningDialog(
"additional", myAdditionalChilds,
true);
335 }
else if ((myTAZParents > 0) && deleteOptions->
protectTAZs()) {
336 openWarningDialog(
"TAZ", myTAZParents,
false);
337 }
else if ((myTAZChilds > 0) && deleteOptions->
protectTAZs()) {
338 openWarningDialog(
"TAZ", myTAZChilds,
true);
339 }
else if ((myShapeParents > 0) && deleteOptions->
protectShapes()) {
340 openWarningDialog(
"shape", myShapeParents,
false);
341 }
else if ((myShapeChilds > 0) && deleteOptions->
protectShapes()) {
342 openWarningDialog(
"shape", myShapeChilds,
true);
344 openWarningDialog(
"demand", myDemandElementParents,
false);
346 openWarningDialog(
"demand", myDemandElementChilds,
true);
348 openWarningDialog(
"data", myGenericDataParents,
false);
350 openWarningDialog(
"data", myGenericDataChilds,
true);
360 myAttributeCarrier(attributeCarrier),
362 myAdditionalParents(0),
363 myAdditionalChilds(0),
368 myDemandElementParents(0),
369 myDemandElementChilds(0),
370 myGenericDataParents(0),
371 myGenericDataChilds(0) {
377 myAttributeCarrier(attributeCarrier),
379 myAdditionalParents(hierarchicalElement->getParentAdditionals().size()),
380 myAdditionalChilds(hierarchicalElement->getChildAdditionals().size()),
381 myTAZParents(hierarchicalElement->getParentTAZElements().size()),
382 myTAZChilds(hierarchicalElement->getChildTAZElements().size()),
383 myShapeParents(hierarchicalElement->getParentShapes().size()),
384 myShapeChilds(hierarchicalElement->getChildShapes().size()),
385 myDemandElementParents(hierarchicalElement->getParentDemandElements().size()),
386 myDemandElementChilds(hierarchicalElement->getChildDemandElements().size()),
387 myGenericDataParents(hierarchicalElement->getParentGenericDatas().size()),
388 myGenericDataChilds(hierarchicalElement->getChildGenericDatas().size()) {
435 const std::string plural = (number > 1) ?
"s" :
"";
437 const std::string header =
"Problem deleting " + myAttributeCarrier->getTagProperty().getTagStr() +
" '" + myAttributeCarrier->getID() +
"'";
442 message = myAttributeCarrier->getTagProperty().getTagStr() +
" '" + myAttributeCarrier->getID() +
443 "' cannot be deleted because it has " +
toString(number) +
" " + type +
" element" + plural +
".\n" +
444 "To delete it, uncheck 'protect " + type +
" elements'.";
446 message = myAttributeCarrier->getTagProperty().getTagStr() +
" '" + myAttributeCarrier->getID() +
447 "' cannot be deleted because it is part of " +
toString(number) +
" " + type +
" element" + plural +
".\n" +
448 "To delete it, uncheck 'protect " + type +
" elements'.";
453 FXMessageBox::warning(
myViewNet->getApp(), MBOX_OK, header.c_str(),
"%s", message.c_str());
468 if (junction.second->isAttributeCarrierSelected()) {
472 for (
const auto& edge : junction.second->getGNEIncomingEdges()) {
473 if (edge->isAttributeCarrierSelected()) {
477 for (
const auto& lane : edge->getLanes()) {
478 if (lane->isAttributeCarrierSelected()) {
483 for (
const auto& connection : edge->getGNEConnections()) {
484 if (connection->isAttributeCarrierSelected()) {
490 for (
const auto& crossing : junction.second->getGNECrossings()) {
491 if (crossing->isAttributeCarrierSelected()) {
498 for (
const auto& shape : shapeTag.second) {
499 if (shape.second->isAttributeCarrierSelected()) {
506 for (
const auto& additional : additionalTag.second) {
507 if (additional.second->isAttributeCarrierSelected()) {
515 for (
const auto& demandElement : demandElementTag.second) {
516 if (demandElement.second->isAttributeCarrierSelected()) {
524 for (
const auto& dataInterval : dataSet.second->getDataIntervalChildren()) {
525 for (
const auto& genericData : dataInterval.second->getGenericDataChildren()) {
526 if (genericData->isAttributeCarrierSelected()) {
@ MID_GNE_SET_ATTRIBUTE
attribute edited
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
#define GUIDesignCheckButton
checkButton placed in left position
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_CONNECTION
connectio between two lanes
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_EDGE
begin/end of the description of an edge
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
An Element which don't belongs to GNENet but has influency in the simulation.
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
FXCheckButton * myDeleteOnlyGeometryPoints
checkbox for enable/disable delete only geometry points
bool protectShapes() const
check if protect shapes elements checkbox is enabled
FXCheckButton * myProtectGenericDatas
checkbox for enable/disable protect generic datas
FXCheckButton * myProtectTAZs
checkbox for enable/disable protect TAZs
~DeleteOptions()
destructor
bool protectDemandElements() const
check if protect demand elements checkbox is enabled
FXCheckButton * myProtectDemandElements
checkbox for enable/disable protect demand elements
bool protectGenericDatas() const
check if protect generic datas checkbox is enabled
FXCheckButton * myProtectShapes
checkbox for enable/disable protect shapes
bool protectTAZs() const
check if protect TAZ elements checkbox is enabled
DeleteOptions(GNEDeleteFrame *deleteFrameParent)
constructor
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
bool protectAdditionals() const
check if protect additional elements checkbox is enabled
FXCheckButton * myProtectAdditionals
checkbox for enable/disable protect additionals
struct for saving subordinated elements (Junction->Edge->Lane->(Additional | DemandElement)
size_t myDemandElementParents
parent demand elements
~SubordinatedElements()
destructor
size_t myGenericDataChilds
child demand elements
size_t myShapeParents
parent shapes
size_t myGenericDataParents
parent demand elements
size_t myTAZParents
parent TAZs
size_t myShapeChilds
child shape
size_t myTAZChilds
child TAZ
size_t myDemandElementChilds
child demand elements
size_t myAdditionalParents
parent additionals (except TAZs)
void openWarningDialog(const std::string &elementType, const size_t number, const bool isChild)
size_t myAdditionalChilds
child additional (except TAZs)
bool checkElements(const DeleteOptions *deleteOptions)
if element can be removed
void addValuesFromSubordinatedElements(SubordinatedElements *originalSE, const SubordinatedElements &newSE)
add in originalSE the values of newSE
SubordinatedElements(const GNEJunction *junction)
constructor (for junctions)
bool selectedACsToDelete() const
check if there is selected ACs to delete
DeleteOptions * getDeleteOptions() const
get delete options
~GNEDeleteFrame()
Destructor.
DeleteOptions * myDeleteOptions
modul for delete options
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
void hide()
hide delete frame
GNEDeleteFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, bool ignoreOptions=false)
remove attribute carrier (element)
void removeGeometryPoint(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
remove geometry point
void show()
show delete frame
An Element which don't belongs to GNENet but has influency in the simulation.
A road/street connecting two junctions (netedit-version)
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
GNEViewNet * getViewNet() const
get view net
GNEViewNet * myViewNet
View Net.
virtual void show()
show Frame
virtual void hide()
hide Frame
An Element which don't belongs to GNENet but has influency in the simulation.
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
const std::vector< GNEGenericData * > & getParentGenericDatas() const
get parent demand elements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNEShape * > & getParentShapes() const
get parent shapes
const std::vector< GNEEdge * > & getChildEdges() const
get child edges
const std::vector< GNEShape * > & getChildShapes() const
get child shapes
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
const std::vector< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
const std::map< std::string, GNEDataSet * > & getDataSets() const
const std::map< SumoXMLTag, std::map< std::string, GNEAdditional * > > & getAdditionals() const
const std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > & getDemandElements() const
const std::map< std::string, GNEJunction * > & getJunctions() const
map with the ID and pointer to junctions of net
const std::map< SumoXMLTag, std::map< std::string, GNEShape * > > & getShapes() const
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
void disableUpdateGeometry()
disable update geometry of elements after inserting or removing an element in net
void deleteTAZElement(GNETAZElement *TAZElement, GNEUndoList *undoList)
remove TAZElement
std::vector< GNEGenericData * > retrieveGenericDatas(bool onlySelected=false) const
return all generic datas
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
std::vector< GNEAdditional * > retrieveAdditionals(bool onlySelected=false) const
return all additionals
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
std::vector< GNEDemandElement * > retrieveDemandElements(bool onlySelected=false) const
return all demand elements
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
retrieve all attribute carriers of Net
std::vector< GNEConnection * > retrieveConnections(bool onlySelected=false) const
return all connections
std::vector< GNEJunction * > retrieveJunctions(bool onlySelected=false)
return all junctions
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
std::vector< GNEShape * > retrieveShapes(SumoXMLTag shapeTag, bool onlySelected=false)
return shape by type shapes
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
std::vector< GNECrossing * > retrieveCrossings(bool onlySelected=false) const
return all crossings
void enableUpdateGeometry()
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
bool isPersonPlan() const
return true if tag correspond to a person plan
bool isNetworkElement() const
return true if tag correspond to a network element
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
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...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
class used to group all variables related with objects under cursor after a click over view
GNEPoly * getPolyFront() const
get front Poly or a pointer to nullptr
GNEGenericData * getGenericDataElementFront() const
get generic data element or a pointer to nullptr
GNENetworkElement * getNetworkElementFront() const
get front network element or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
GNECrossing * getCrossingFront() const
get front crossing or a pointer to nullptr
GNELane * getLaneFront() const
get front lane or a pointer to nullptr
GNETAZElement * getTAZElementFront() const
get front TAZElement or a pointer to nullptr
GNEAdditional * getAdditionalFront() const
get front additional element or a pointer to nullptr
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
GNEDemandElement * getDemandElementFront() const
get front demand element or a pointer to nullptr
GNEShape * getShapeFront() const
get front shape element or a pointer to nullptr
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNETAZ * getTAZFront() const
get front TAZ or a pointer to nullptr
GNEConnection * getConnectionFront() const
get front connection or a pointer to nullptr
GNENet * getNet() const
get the net object
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
GNEUndoList * getUndoList() const
get the undoList object
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
A point in 2D or 3D with translation and scaling methods.
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network