54 myDeleteFrameParent(deleteFrameParent) {
57 myDeleteOnlyGeometryPoints->setCheck(FALSE);
66 return (myDeleteOnlyGeometryPoints->getCheck() == TRUE);
72 myDeleteFrameParent->getViewNet()->update();
92 for (
const auto& lane : edge->
getLanes()) {
125 openWarningDialog(
"additional", myAdditionalParents,
false);
127 openWarningDialog(
"additional", myAdditionalChilds,
true);
129 openWarningDialog(
"demand", myDemandElementParents,
false);
131 openWarningDialog(
"demand", myDemandElementChilds,
true);
133 openWarningDialog(
"data", myGenericDataParents,
false);
135 openWarningDialog(
"data", myGenericDataChilds,
true);
145 myAttributeCarrier(attributeCarrier),
147 myAdditionalParents(0),
148 myAdditionalChilds(0),
149 myDemandElementParents(0),
150 myDemandElementChilds(0),
151 myGenericDataParents(0),
152 myGenericDataChilds(0) {
158 myAttributeCarrier(attributeCarrier),
160 myAdditionalParents(hierarchicalElement->getParentAdditionals().size()),
161 myAdditionalChilds(hierarchicalElement->getChildAdditionals().size()),
162 myDemandElementParents(hierarchicalElement->getParentDemandElements().size()),
163 myDemandElementChilds(hierarchicalElement->getChildDemandElements().size()),
164 myGenericDataParents(hierarchicalElement->getParentGenericDatas().size()),
165 myGenericDataChilds(hierarchicalElement->getChildGenericDatas().size()) {
202 const std::string plural = (number > 1) ?
"s" :
"";
204 const std::string header =
"Problem deleting " + myAttributeCarrier->getTagProperty().getTagStr() +
" '" + myAttributeCarrier->getID() +
"'";
209 msg = myAttributeCarrier->getTagProperty().getTagStr() +
" '" + myAttributeCarrier->getID() +
210 "' cannot be deleted because it has " +
toString(number) +
" " + type +
" element" + plural +
".\n" +
211 "To delete it, uncheck 'protect " + type +
" elements'.";
213 msg = myAttributeCarrier->getTagProperty().getTagStr() +
" '" + myAttributeCarrier->getID() +
214 "' cannot be deleted because it is part of " +
toString(number) +
" " + type +
" element" + plural +
".\n" +
215 "To delete it, uncheck 'protect " + type +
" elements'.";
220 FXMessageBox::warning(
myViewNet->getApp(), MBOX_OK, header.c_str(),
"%s", msg.c_str());
251 return (myProtectAdditionals->getCheck() == TRUE);
257 return (myProtectTAZs->getCheck() == TRUE);
263 return (myProtectDemandElements->getCheck() == TRUE);
269 return (myProtectGenericDatas->getCheck() == TRUE);
277 GNEFrame(viewParent, viewNet,
"Delete") {
314 const auto selectedJunctions = attributeCarriers->getSelectedJunctions();
315 for (
const auto& selectedJunction : selectedJunctions) {
319 const auto selectedEdges = attributeCarriers->getSelectedEdges();
320 for (
const auto& selectedEdge : selectedEdges) {
324 const auto selectedLanes = attributeCarriers->getSelectedLanes();
325 for (
const auto& selectedLane : selectedLanes) {
329 const auto selectedConnections = attributeCarriers->getSelectedConnections();
330 for (
const auto& selectedConnection : selectedConnections) {
334 const auto selectedCrossings = attributeCarriers->getSelectedCrossings();
335 for (
const auto& selectedCrossing : selectedCrossings) {
339 while (attributeCarriers->getNumberOfSelectedAdditionals() > 0) {
344 while (attributeCarriers->getNumberOfSelectedDemandElements() > 0) {
349 auto selectedGenericDatas = attributeCarriers->getSelectedGenericDatas();
350 for (
const auto& selectedGenericData : selectedGenericDatas) {
368 std::vector<GUIGlObject*> filteredGLObjects;
371 if (glObject->isGLObjectLocked()) {
374 filteredGLObjects.push_back(glObject);
379 if (filteredGLObjects.size() > 1) {
382 }
else if (filteredGLObjects.size() > 0) {
383 filteredGLObjects.front()->deleteGLObject();
432 if (junction.second->isAttributeCarrierSelected()) {
436 for (
const auto& edge : junction.second->getGNEIncomingEdges()) {
437 if (edge->isAttributeCarrierSelected()) {
441 for (
const auto& lane : edge->getLanes()) {
442 if (lane->isAttributeCarrierSelected()) {
447 for (
const auto& connection : edge->getGNEConnections()) {
448 if (connection->isAttributeCarrierSelected()) {
454 for (
const auto& crossing : junction.second->getGNECrossings()) {
455 if (crossing->isAttributeCarrierSelected()) {
462 for (
const auto& additional : additionalTag.second) {
463 if (additional->isAttributeCarrierSelected()) {
471 for (
const auto& demandElement : demandElementTag.second) {
472 if (demandElement->isAttributeCarrierSelected()) {
480 for (
const auto& genericData : genericDataTag.second) {
481 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_POLY
begin/end of the description of a polygon
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
An Element which don't belong to GNENet but has influence 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
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 myGenericDataParents
parent demand elements
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
ProtectElements * getProtectElements() const
get protect elements modul
DeleteOptions * getDeleteOptions() const
get delete options modul
~GNEDeleteFrame()
Destructor.
DeleteOptions * myDeleteOptions
modul for delete options
void removeSelectedAttributeCarriers()
remove selected attribute carriers (element)
GNEDeleteFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
void hide()
hide delete frame
ProtectElements * myProtectElements
modul for protect elements
void removeGeometryPoint(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
remove geometry point
void show()
show delete frame
void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
remove attribute carrier (element)
An Element which don't belong to GNENet but has influence 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
FOX need this.
virtual void show()
show Frame
virtual void hide()
hide Frame
An Element which don't belong to GNENet but has influence 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< GNEEdge * > & getChildEdges() const
get child edges
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< 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 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 deleteJunction(GNEJunction *junction, GNEUndoList *undoList)
removes junction and all incident edges
void enableUpdateGeometry()
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList) override
remove geometry point in the clicked position
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
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
const std::vector< GUIGlObject * > & getClickedGLObjects() const
get vector with clicked GL objects
GNENetworkElement * getNetworkElementFront() const
get front network element or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
GNETAZ * getTAZFront() const
get front TAZ 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.
void openDeleteDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open delete dialog at cursor
A single child window which contains a view of the simulation area.
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
Options
GroupBoxModule options.
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
static std::vector< GUIGlObject * > filterElementsByLayer(const std::vector< GUIGlObject * > &GLObjects)
filter elements based on the layer