58 myDeleteFrameParent(deleteFrameParent) {
61 myDeleteOnlyGeometryPoints->setCheck(FALSE);
70 return (myDeleteOnlyGeometryPoints->getCheck() == TRUE);
76 myDeleteFrameParent->getViewNet()->update();
129 openWarningDialog(
"additional", myAdditionalParents,
false);
131 openWarningDialog(
"additional", myAdditionalChilds,
true);
133 openWarningDialog(
"demand", myDemandElementParents,
false);
135 openWarningDialog(
"demand", myDemandElementChilds,
true);
137 openWarningDialog(
"data", myGenericDataParents,
false);
139 openWarningDialog(
"data", myGenericDataChilds,
true);
149 myAttributeCarrier(attributeCarrier),
151 myAdditionalParents(0),
152 myAdditionalChilds(0),
153 myDemandElementParents(0),
154 myDemandElementChilds(0),
155 myGenericDataParents(0),
156 myGenericDataChilds(0) {
162 myAttributeCarrier(attributeCarrier),
164 myAdditionalParents(hierarchicalElement->getParentAdditionals().size()),
165 myAdditionalChilds(hierarchicalElement->getChildAdditionals().size()),
166 myDemandElementParents(hierarchicalElement->getParentDemandElements().size()),
167 myDemandElementChilds(hierarchicalElement->getChildDemandElements().size()),
168 myGenericDataParents(hierarchicalElement->getParentGenericDatas().size()),
169 myGenericDataChilds(hierarchicalElement->getChildGenericDatas().size()) {
206 const std::string plural = (number > 1) ?
"s" :
"";
208 const std::string header =
"Problem deleting " + myAttributeCarrier->getTagProperty()->getTagStr() +
" '" + myAttributeCarrier->getID() +
"'";
213 msg = myAttributeCarrier->getTagProperty()->getTagStr() +
" '" + myAttributeCarrier->getID() +
214 "' cannot be deleted because it has " +
toString(number) +
" " + type +
" element" + plural +
".\n" +
215 "To delete it, uncheck 'protect " + type +
" elements'.";
217 msg = myAttributeCarrier->getTagProperty()->getTagStr() +
" '" + myAttributeCarrier->getID() +
218 "' cannot be deleted because it is part of " +
toString(number) +
" " + type +
" element" + plural +
".\n" +
219 "To delete it, uncheck 'protect " + type +
" elements'.";
222 FXMessageBox::warning(
myViewNet->getApp(), MBOX_OK, header.c_str(),
"%s", msg.c_str());
255 return (myProtectAdditionals->getCheck() == TRUE);
261 return (myProtectTAZs->getCheck() == TRUE);
267 return (myProtectDemandElements->getCheck() == TRUE);
273 return (myProtectGenericDatas->getCheck() == TRUE);
279 myProtectAdditionals->setCheck(TRUE);
280 myProtectTAZs->setCheck(TRUE);
281 myProtectDemandElements->setCheck(TRUE);
282 myProtectGenericDatas->setCheck(TRUE);
289 myProtectAdditionals->setCheck(FALSE);
290 myProtectTAZs->setCheck(FALSE);
291 myProtectDemandElements->setCheck(FALSE);
292 myProtectGenericDatas->setCheck(FALSE);
299 if (myProtectAdditionals->getCheck() && myProtectTAZs->getCheck() &&
300 myProtectDemandElements->getCheck() && myProtectGenericDatas->getCheck()) {
301 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
303 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
310 if (!myProtectAdditionals->getCheck() && !myProtectTAZs->getCheck() &&
311 !myProtectDemandElements->getCheck() && !myProtectGenericDatas->getCheck()) {
312 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
314 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
360 const auto selectedJunctions = attributeCarriers->getSelectedJunctions();
361 for (
const auto& selectedJunction : selectedJunctions) {
365 const auto selectedEdges = attributeCarriers->getSelectedEdges();
366 for (
const auto& selectedEdge : selectedEdges) {
370 const auto selectedLanes = attributeCarriers->getSelectedLanes();
371 for (
const auto& selectedLane : selectedLanes) {
375 const auto selectedConnections = attributeCarriers->getSelectedConnections();
376 for (
const auto& selectedConnection : selectedConnections) {
380 const auto selectedCrossings = attributeCarriers->getSelectedCrossings();
381 for (
const auto& selectedCrossing : selectedCrossings) {
385 while (attributeCarriers->getNumberOfSelectedAdditionals() > 0) {
390 while (attributeCarriers->getNumberOfSelectedDemandElements() > 0) {
395 auto selectedGenericDatas = attributeCarriers->getSelectedGenericDatas();
396 for (
const auto& selectedGenericData : selectedGenericDatas) {
414 std::vector<GUIGlObject*> filteredGLObjects;
416 for (
const auto& glObject : viewObjects.
getGLObjects()) {
417 if (glObject->isGLObjectLocked()) {
420 filteredGLObjects.push_back(glObject);
425 if (filteredGLObjects.size() > 1) {
428 }
else if (filteredGLObjects.size() > 0) {
429 filteredGLObjects.front()->deleteGLObject();
432 !viewObjects.
getGLObjects().front()->isGLObjectLocked()) {
449 }
else if (AC->getTagProperty()->getTag() ==
SUMO_TAG_POLY) {
452 }
else if (AC->getTagProperty()->getTag() ==
SUMO_TAG_TAZ) {
482 if (junction.second->isAttributeCarrierSelected()) {
486 for (
const auto& edge : junction.second->getGNEIncomingEdges()) {
487 if (edge->isAttributeCarrierSelected()) {
491 for (
const auto& lane : edge->getChildLanes()) {
492 if (lane->isAttributeCarrierSelected()) {
497 for (
const auto& connection : edge->getGNEConnections()) {
498 if (connection->isAttributeCarrierSelected()) {
504 for (
const auto& crossing : junction.second->getGNECrossings()) {
505 if (crossing->isAttributeCarrierSelected()) {
512 for (
const auto& additional : additionalTag.second) {
513 if (additional.second->isAttributeCarrierSelected()) {
521 for (
const auto& demandElement : demandElementTag.second) {
522 if (demandElement.second->isAttributeCarrierSelected()) {
530 for (
const auto& genericData : genericDataTag.second) {
531 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)
~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
bool protectAdditionals() const
check if protect additional elements checkbox is enabled
long onCmdUnprotectAll(FXObject *, FXSelector, void *)
unprotect all elements
FXCheckButton * myProtectAdditionals
FOX need this.
~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
long onUpdProtectAll(FXObject *, FXSelector, void *)
update protect all elements
long onCmdProtectAll(FXObject *, FXSelector, void *)
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
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
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
A road/street connecting two junctions (netedit-version)
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
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
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
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()
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
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
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.
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.
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