52 myDeleteFrameParent(deleteFrameParent) {
55 myDeleteOnlyGeometryPoints->setCheck(FALSE);
64 return (myDeleteOnlyGeometryPoints->getCheck() == TRUE);
70 myDeleteFrameParent->getViewNet()->update();
103 return (myProtectAdditionals->getCheck() == TRUE);
109 return (myProtectTAZs->getCheck() == TRUE);
115 return (myProtectShapes->getCheck() == TRUE);
121 return (myProtectDemandElements->getCheck() == TRUE);
127 return (myProtectGenericDatas->getCheck() == TRUE);
135 GNEFrame(horizontalFrameParent, viewNet,
"Delete") {
171 const auto selectedJunctions = attributeCarriers->getSelectedJunctions();
172 for (
const auto& selectedJunction : selectedJunctions) {
176 const auto selectedEdges = attributeCarriers->getSelectedEdges();
177 for (
const auto& selectedEdge : selectedEdges) {
181 const auto selectedLanes = attributeCarriers->getSelectedLanes();
182 for (
const auto& selectedLane : selectedLanes) {
186 const auto selectedConnections = attributeCarriers->getSelectedConnections();
187 for (
const auto& selectedConnection : selectedConnections) {
191 const auto selectedCrossings = attributeCarriers->getSelectedCrossings();
192 for (
const auto& selectedCrossing : selectedCrossings) {
196 const auto selectedShapes = attributeCarriers->getSelectedShapes();
197 for (
const auto& selectedShape : selectedShapes) {
201 while (attributeCarriers->getNumberOfSelectedAdditionals() > 0) {
206 while (attributeCarriers->getNumberOfSelectedDemandElements() > 0) {
211 auto selectedGenericDatas = attributeCarriers->getSelectedGenericDatas();
212 for (
const auto& selectedGenericData : selectedGenericDatas) {
319 for (
const auto& lane : edge->
getLanes()) {
357 openWarningDialog(
"additional", myAdditionalParents,
false);
359 openWarningDialog(
"additional", myAdditionalChilds,
true);
360 }
else if ((myTAZParents > 0) && protectElements->
protectTAZs()) {
361 openWarningDialog(
"TAZ", myTAZParents,
false);
362 }
else if ((myTAZChilds > 0) && protectElements->
protectTAZs()) {
363 openWarningDialog(
"TAZ", myTAZChilds,
true);
364 }
else if ((myShapeParents > 0) && protectElements->
protectShapes()) {
365 openWarningDialog(
"shape", myShapeParents,
false);
366 }
else if ((myShapeChilds > 0) && protectElements->
protectShapes()) {
367 openWarningDialog(
"shape", myShapeChilds,
true);
369 openWarningDialog(
"demand", myDemandElementParents,
false);
371 openWarningDialog(
"demand", myDemandElementChilds,
true);
373 openWarningDialog(
"data", myGenericDataParents,
false);
375 openWarningDialog(
"data", myGenericDataChilds,
true);
385 myAttributeCarrier(attributeCarrier),
387 myAdditionalParents(0),
388 myAdditionalChilds(0),
393 myDemandElementParents(0),
394 myDemandElementChilds(0),
395 myGenericDataParents(0),
396 myGenericDataChilds(0) {
402 myAttributeCarrier(attributeCarrier),
404 myAdditionalParents(hierarchicalElement->getParentAdditionals().size()),
405 myAdditionalChilds(hierarchicalElement->getChildAdditionals().size()),
406 myTAZParents(hierarchicalElement->getParentTAZElements().size()),
407 myTAZChilds(hierarchicalElement->getChildTAZElements().size()),
408 myShapeParents(hierarchicalElement->getParentShapes().size()),
409 myShapeChilds(hierarchicalElement->getChildShapes().size()),
410 myDemandElementParents(hierarchicalElement->getParentDemandElements().size()),
411 myDemandElementChilds(hierarchicalElement->getChildDemandElements().size()),
412 myGenericDataParents(hierarchicalElement->getParentGenericDatas().size()),
413 myGenericDataChilds(hierarchicalElement->getChildGenericDatas().size()) {
460 const std::string plural = (number > 1) ?
"s" :
"";
462 const std::string header =
"Problem deleting " + myAttributeCarrier->getTagProperty().getTagStr() +
" '" + myAttributeCarrier->getID() +
"'";
467 msg = myAttributeCarrier->getTagProperty().getTagStr() +
" '" + myAttributeCarrier->getID() +
468 "' cannot be deleted because it has " +
toString(number) +
" " + type +
" element" + plural +
".\n" +
469 "To delete it, uncheck 'protect " + type +
" elements'.";
471 msg = myAttributeCarrier->getTagProperty().getTagStr() +
" '" + myAttributeCarrier->getID() +
472 "' cannot be deleted because it is part of " +
toString(number) +
" " + type +
" element" + plural +
".\n" +
473 "To delete it, uncheck 'protect " + type +
" elements'.";
478 FXMessageBox::warning(
myViewNet->getApp(), MBOX_OK, header.c_str(),
"%s", msg.c_str());
493 if (junction.second->isAttributeCarrierSelected()) {
497 for (
const auto& edge : junction.second->getGNEIncomingEdges()) {
498 if (edge->isAttributeCarrierSelected()) {
502 for (
const auto& lane : edge->getLanes()) {
503 if (lane->isAttributeCarrierSelected()) {
508 for (
const auto& connection : edge->getGNEConnections()) {
509 if (connection->isAttributeCarrierSelected()) {
515 for (
const auto& crossing : junction.second->getGNECrossings()) {
516 if (crossing->isAttributeCarrierSelected()) {
523 for (
const auto& shape : shapeTag.second) {
524 if (shape->isAttributeCarrierSelected()) {
531 for (
const auto& additional : additionalTag.second) {
532 if (additional->isAttributeCarrierSelected()) {
540 for (
const auto& demandElement : demandElementTag.second) {
541 if (demandElement->isAttributeCarrierSelected()) {
549 for (
const auto& genericData : genericDataTag.second) {
550 if (genericData->isAttributeCarrierSelected()) {
FXDEFMAP(GNEDeleteFrame::DeleteOptions) DeleteOptionsMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
#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)
FXGroupBoxModule (based on FXGroupBox)
Options
GroupBoxModule options.
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toogled)
An Element which don't belongs to GNENet but has influency in the simulation.
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
~DeleteOptions()
destructor
long onCmdSetOption(FXObject *, FXSelector, void *)
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
FXCheckButton * myProtectGenericDatas
checkbox for enable/disable protect generic datas
bool protectGenericDatas() const
check if protect generic datas checkbox is enabled
bool protectAdditionals() const
check if protect additional elements checkbox is enabled
FXCheckButton * myProtectAdditionals
checkbox for enable/disable protect additionals
~ProtectElements()
destructor
FXCheckButton * myProtectDemandElements
checkbox for enable/disable protect demand elements
FXCheckButton * myProtectTAZs
checkbox for enable/disable protect TAZs
bool protectDemandElements() const
check if protect demand elements checkbox is enabled
bool protectTAZs() const
check if protect TAZ elements checkbox is enabled
FXCheckButton * myProtectShapes
checkbox for enable/disable protect shapes
bool protectShapes() const
check if protect shapes elements checkbox is enabled
ProtectElements(GNEDeleteFrame *deleteFrameParent)
constructor
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 ProtectElements *protectElements)
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.
ProtectElements * myProtectElements
modul for protect elements
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.
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
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< SumoXMLTag, std::set< GNEGenericData * > > & getGenericDatas() const
get all generic datas
const std::map< SumoXMLTag, std::set< GNEDemandElement * > > & getDemandElements() const
get demand elements
const std::map< SumoXMLTag, std::set< GNEShape * > > & getShapes() const
get shapes
const std::map< SumoXMLTag, std::set< GNEAdditional * > > & getAdditionals() const
get additionals
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
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
void deleteDemandElement(GNEDemandElement *demandElement, GNEUndoList *undoList)
remove demand element
void deleteConnection(GNEConnection *connection, GNEUndoList *undoList)
remove connection
void deleteGenericData(GNEGenericData *genericData, GNEUndoList *undoList)
remove generic data
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
void deleteShape(GNEShape *shape, GNEUndoList *undoList)
remove shape
void deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
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 end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
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