61 myDeleteFrameParent(deleteFrameParent) {
64 myDeleteOnlyGeometryPoints->setCheck(FALSE);
73 return (myDeleteOnlyGeometryPoints->getCheck() == TRUE);
79 myDeleteFrameParent->getViewNet()->update();
132 const bool runningInternalTests = internalTest ? internalTest->
isRunning() :
false;
135 openWarningDialog(
"additional", myAdditionalParents,
false, runningInternalTests);
137 openWarningDialog(
"additional", myAdditionalChilds,
true, runningInternalTests);
139 openWarningDialog(
"demand", myDemandElementParents,
false, runningInternalTests);
141 openWarningDialog(
"demand", myDemandElementChilds,
true, runningInternalTests);
143 openWarningDialog(
"data", myGenericDataParents,
false, runningInternalTests);
145 openWarningDialog(
"data", myGenericDataChilds,
true, runningInternalTests);
155 myAttributeCarrier(attributeCarrier),
157 myAdditionalParents(0),
158 myAdditionalChilds(0),
159 myDemandElementParents(0),
160 myDemandElementChilds(0),
161 myGenericDataParents(0),
162 myGenericDataChilds(0) {
168 myAttributeCarrier(attributeCarrier),
170 myAdditionalParents(hierarchicalElement->getParentAdditionals().size()),
171 myAdditionalChilds(hierarchicalElement->getChildAdditionals().size()),
172 myDemandElementParents(hierarchicalElement->getParentDemandElements().size()),
173 myDemandElementChilds(hierarchicalElement->getChildDemandElements().size()),
174 myGenericDataParents(hierarchicalElement->getParentGenericDatas().size()),
175 myGenericDataChilds(hierarchicalElement->getChildGenericDatas().size()) {
212 const std::string plural = (number > 1) ?
"s" :
"";
214 const std::string header =
"Problem deleting " + myAttributeCarrier->getTagProperty()->getTagStr() +
" '" + myAttributeCarrier->getID() +
"'";
219 msg = myAttributeCarrier->getTagProperty()->getTagStr() +
" '" + myAttributeCarrier->getID() +
220 "' cannot be deleted because it has " +
toString(number) +
" " + type +
" element" + plural +
".\n" +
221 "To delete it, uncheck 'protect " + type +
" elements'.";
223 msg = myAttributeCarrier->getTagProperty()->getTagStr() +
" '" + myAttributeCarrier->getID() +
224 "' cannot be deleted because it is part of " +
toString(number) +
" " + type +
" element" + plural +
".\n" +
225 "To delete it, uncheck 'protect " + type +
" elements'.";
228 if (!runningInternalTests) {
239 myDeleteFrameParent(deleteFrameParent) {
266 return myDeleteFrameParent;
272 return (myProtectAdditionals->getCheck() == TRUE);
278 return (myProtectTAZs->getCheck() == TRUE);
284 return (myProtectDemandElements->getCheck() == TRUE);
290 return (myProtectGenericDatas->getCheck() == TRUE);
296 myProtectAdditionals->setCheck(TRUE);
297 myProtectTAZs->setCheck(TRUE);
298 myProtectDemandElements->setCheck(TRUE);
299 myProtectGenericDatas->setCheck(TRUE);
300 myUnprotectAllButton->enable();
307 myProtectAdditionals->setCheck(FALSE);
308 myProtectTAZs->setCheck(FALSE);
309 myProtectDemandElements->setCheck(FALSE);
310 myProtectGenericDatas->setCheck(FALSE);
311 myProtectAllButton->enable();
318 if (myProtectAdditionals->getCheck() && myProtectTAZs->getCheck() &&
319 myProtectDemandElements->getCheck() && myProtectGenericDatas->getCheck()) {
320 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
322 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
329 if (!myProtectAdditionals->getCheck() && !myProtectTAZs->getCheck() &&
330 !myProtectDemandElements->getCheck() && !myProtectGenericDatas->getCheck()) {
331 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
333 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
379 const auto selectedJunctions = attributeCarriers->getSelectedJunctions();
380 for (
const auto& selectedJunction : selectedJunctions) {
384 const auto selectedEdges = attributeCarriers->getSelectedEdges();
385 for (
const auto& selectedEdge : selectedEdges) {
389 const auto selectedLanes = attributeCarriers->getSelectedLanes();
390 for (
const auto& selectedLane : selectedLanes) {
394 const auto selectedConnections = attributeCarriers->getSelectedConnections();
395 for (
const auto& selectedConnection : selectedConnections) {
399 const auto selectedCrossings = attributeCarriers->getSelectedCrossings();
400 for (
const auto& selectedCrossing : selectedCrossings) {
404 while (attributeCarriers->getNumberOfSelectedAdditionals() > 0) {
409 while (attributeCarriers->getNumberOfSelectedDemandElements() > 0) {
414 auto selectedGenericDatas = attributeCarriers->getSelectedGenericDatas();
415 for (
const auto& selectedGenericData : selectedGenericDatas) {
433 std::vector<GUIGlObject*> filteredGLObjects;
435 for (
const auto& glObject : viewObjects.
getGLObjects()) {
436 if (glObject->isGLObjectLocked()) {
439 filteredGLObjects.push_back(glObject);
444 if (filteredGLObjects.size() > 1) {
447 }
else if (filteredGLObjects.size() > 0) {
448 filteredGLObjects.front()->deleteGLObject();
451 !viewObjects.
getGLObjects().front()->isGLObjectLocked()) {
468 }
else if (AC->getTagProperty()->getTag() ==
SUMO_TAG_POLY) {
471 }
else if (AC->getTagProperty()->getTag() ==
SUMO_TAG_TAZ) {
501 if (junction.second->isAttributeCarrierSelected()) {
505 for (
const auto& edge : junction.second->getGNEIncomingEdges()) {
506 if (edge->isAttributeCarrierSelected()) {
510 for (
const auto& lane : edge->getChildLanes()) {
511 if (lane->isAttributeCarrierSelected()) {
516 for (
const auto& connection : edge->getGNEConnections()) {
517 if (connection->isAttributeCarrierSelected()) {
523 for (
const auto& crossing : junction.second->getGNECrossings()) {
524 if (crossing->isAttributeCarrierSelected()) {
531 for (
const auto& additional : additionalTag.second) {
532 if (additional.second->isAttributeCarrierSelected()) {
540 for (
const auto& demandElement : demandElementTag.second) {
541 if (demandElement.second->isAttributeCarrierSelected()) {
549 for (
const auto& genericData : genericDataTag.second) {
550 if (genericData.second->isAttributeCarrierSelected()) {
FXDEFMAP(GNEDeleteFrame::DeleteOptions) DeleteOptionsMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_UNPROTECT_ALL
unprotect all elements
@ MID_GNE_PROTECT_ALL
protect all elements
#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
@ SUMO_TAG_EDGE
begin/end of the description of an edge
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
GNEInternalTest * getInternalTest() const
get netedit test system
~DeleteOptions()
destructor
long onCmdSetOption(FXObject *, FXSelector, void *)
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
long onUpdUnprotectAll(FXObject *, FXSelector, void *)
update unprotect all elements
FXCheckButton * myProtectGenericDatas
checkbox for enable/disable protect generic datas
bool protectGenericDatas() const
check if protect generic datas checkbox is enabled
GNEDeleteFrame * getDeleteFrameParent() const
get delete frame parent
bool protectAdditionals() const
check if protect additional elements checkbox is enabled
long onCmdUnprotectAll(FXObject *, FXSelector, void *)
unprotect all elements
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
FXButton * myUnprotectAllButton
unprotect all button
bool protectDemandElements() const
check if protect demand elements checkbox is enabled
long onUpdProtectAll(FXObject *, FXSelector, void *)
update protect all elements
long onCmdProtectAll(FXObject *, FXSelector, void *)
FXButton * myProtectAllButton
protect all button
bool protectTAZs() const
check if protect TAZ elements checkbox is enabled
ProtectElements(GNEDeleteFrame *deleteFrameParent)
FOX-declaration.
struct for saving subordinated elements (Junction->Edge->Lane->(Additional | DemandElement)
size_t myDemandElementParents
parent demand elements
~SubordinatedElements()
destructor
size_t myGenericDataChilds
child demand elements
void openWarningDialog(const std::string &elementType, const size_t number, const bool isChild, const bool runningInternalTests)
size_t myGenericDataParents
parent demand elements
size_t myDemandElementChilds
child demand elements
size_t myAdditionalParents
parent additionals (except TAZs)
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
bool removeGeometryPoint(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove geometry point
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 removeAttributeCarrier(const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
remove attribute carrier (element)
void show()
show delete frame
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this edge
GNEViewNet * getViewNet() const
get view net
GNEViewNet * myViewNet
FOX need this.
virtual void show()
show Frame
virtual void hide()
hide Frame
const GNEHierarchicalContainerChildren< GNEEdge * > & getChildEdges() const
get child edges
const GNEHierarchicalContainerParents< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const GNEHierarchicalContainerParents< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
const GNEHierarchicalContainerChildren< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
const GNEHierarchicalContainerChildren< GNELane * > & getChildLanes() const
get child lanes
const GNEHierarchicalContainerParents< GNEGenericData * > & getParentGenericDatas() const
get parent demand elements
const GNEHierarchicalContainerChildren< GNEAdditional * > & getChildAdditionals() const
return child additionals
const GNEHierarchicalContainerChildren< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
virtual void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)=0
remove geometry point in the clicked position
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * >, std::hash< int > > & getDemandElements() const
get demand elements
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEGenericData * >, std::hash< int > > & getGenericDatas() const
get all generic datas
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEAdditional * >, std::hash< int > > & getAdditionals() const
get additionals
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()
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this poly
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this TAZ
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
const std::vector< GNEAttributeCarrier * > & getAttributeCarriers() const
get vector with ACs
GNEPoly * getPolyFront() const
get front Poly 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
const std::vector< GUIGlObject * > & getGLObjects() const
get vector with GL objects
GNENet * getNet() const
get the net object
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
void openDeleteDialogAtCursor(const std::vector< GUIGlObject * > &GLObjects)
open delete dialog at cursor
A single child window which contains a view of the simulation area.
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
bool isRunning() const
check if test is running
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