62 myDeleteFrameParent(deleteFrameParent) {
65 myDeleteOnlyGeometryPoints->setCheck(FALSE);
74 return (myDeleteOnlyGeometryPoints->getCheck() == TRUE);
80 myDeleteFrameParent->getViewNet()->update();
100 for (
const auto& lane : edge->
getLanes()) {
133 openWarningDialog(
"additional", myAdditionalParents,
false);
135 openWarningDialog(
"additional", myAdditionalChilds,
true);
137 openWarningDialog(
"demand", myDemandElementParents,
false);
139 openWarningDialog(
"demand", myDemandElementChilds,
true);
141 openWarningDialog(
"data", myGenericDataParents,
false);
143 openWarningDialog(
"data", myGenericDataChilds,
true);
153 myAttributeCarrier(attributeCarrier),
155 myAdditionalParents(0),
156 myAdditionalChilds(0),
157 myDemandElementParents(0),
158 myDemandElementChilds(0),
159 myGenericDataParents(0),
160 myGenericDataChilds(0) {
166 myAttributeCarrier(attributeCarrier),
168 myAdditionalParents(hierarchicalElement->getParentAdditionals().size()),
169 myAdditionalChilds(hierarchicalElement->getChildAdditionals().size()),
170 myDemandElementParents(hierarchicalElement->getParentDemandElements().size()),
171 myDemandElementChilds(hierarchicalElement->getChildDemandElements().size()),
172 myGenericDataParents(hierarchicalElement->getParentGenericDatas().size()),
173 myGenericDataChilds(hierarchicalElement->getChildGenericDatas().size()) {
210 const std::string plural = (number > 1) ?
"s" :
"";
212 const std::string header =
"Problem deleting " + myAttributeCarrier->getTagProperty().getTagStr() +
" '" + myAttributeCarrier->getID() +
"'";
217 msg = myAttributeCarrier->getTagProperty().getTagStr() +
" '" + myAttributeCarrier->getID() +
218 "' cannot be deleted because it has " +
toString(number) +
" " + type +
" element" + plural +
".\n" +
219 "To delete it, uncheck 'protect " + type +
" elements'.";
221 msg = myAttributeCarrier->getTagProperty().getTagStr() +
" '" + myAttributeCarrier->getID() +
222 "' cannot be deleted because it is part of " +
toString(number) +
" " + type +
" element" + plural +
".\n" +
223 "To delete it, uncheck 'protect " + type +
" elements'.";
228 FXMessageBox::warning(
myViewNet->getApp(), MBOX_OK, header.c_str(),
"%s", msg.c_str());
263 return (myProtectAdditionals->getCheck() == TRUE);
269 return (myProtectTAZs->getCheck() == TRUE);
275 return (myProtectDemandElements->getCheck() == TRUE);
281 return (myProtectGenericDatas->getCheck() == TRUE);
287 myProtectAdditionals->setCheck(TRUE);
288 myProtectTAZs->setCheck(TRUE);
289 myProtectDemandElements->setCheck(TRUE);
290 myProtectGenericDatas->setCheck(TRUE);
297 myProtectAdditionals->setCheck(FALSE);
298 myProtectTAZs->setCheck(FALSE);
299 myProtectDemandElements->setCheck(FALSE);
300 myProtectGenericDatas->setCheck(FALSE);
307 if (myProtectAdditionals->getCheck() && myProtectTAZs->getCheck() &&
308 myProtectDemandElements->getCheck() && myProtectGenericDatas->getCheck()) {
309 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
311 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
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);
368 const auto selectedJunctions = attributeCarriers->getSelectedJunctions();
369 for (
const auto& selectedJunction : selectedJunctions) {
373 const auto selectedEdges = attributeCarriers->getSelectedEdges();
374 for (
const auto& selectedEdge : selectedEdges) {
378 const auto selectedLanes = attributeCarriers->getSelectedLanes();
379 for (
const auto& selectedLane : selectedLanes) {
383 const auto selectedConnections = attributeCarriers->getSelectedConnections();
384 for (
const auto& selectedConnection : selectedConnections) {
388 const auto selectedCrossings = attributeCarriers->getSelectedCrossings();
389 for (
const auto& selectedCrossing : selectedCrossings) {
393 while (attributeCarriers->getNumberOfSelectedAdditionals() > 0) {
398 while (attributeCarriers->getNumberOfSelectedDemandElements() > 0) {
403 auto selectedGenericDatas = attributeCarriers->getSelectedGenericDatas();
404 for (
const auto& selectedGenericData : selectedGenericDatas) {
422 std::vector<GUIGlObject*> filteredGLObjects;
424 for (
const auto& glObject : viewObjects.
getGLObjects()) {
425 if (glObject->isGLObjectLocked()) {
428 filteredGLObjects.push_back(glObject);
433 if (filteredGLObjects.size() > 1) {
436 }
else if (filteredGLObjects.size() > 0) {
437 filteredGLObjects.front()->deleteGLObject();
440 !viewObjects.
getGLObjects().front()->isGLObjectLocked()) {
460 }
else if (AC->getTagProperty().getTag() ==
SUMO_TAG_TAZ) {
490 if (junction.second->isAttributeCarrierSelected()) {
494 for (
const auto& edge : junction.second->getGNEIncomingEdges()) {
495 if (edge->isAttributeCarrierSelected()) {
499 for (
const auto& lane : edge->getLanes()) {
500 if (lane->isAttributeCarrierSelected()) {
505 for (
const auto& connection : edge->getGNEConnections()) {
506 if (connection->isAttributeCarrierSelected()) {
512 for (
const auto& crossing : junction.second->getGNECrossings()) {
513 if (crossing->isAttributeCarrierSelected()) {
520 for (
const auto& additional : additionalTag.second) {
521 if (additional.second->isAttributeCarrierSelected()) {
529 for (
const auto& demandElement : demandElementTag.second) {
530 if (demandElement.second->isAttributeCarrierSelected()) {
538 for (
const auto& genericData : genericDataTag.second) {
539 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)
An Element which don't belong to GNENet but has influence in the simulation.
~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
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.
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEAdditional * > > & getAdditionals() const
get additionals
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEGenericData * > > & getGenericDatas() const
get all generic datas
const std::map< std::string, GNEJunction * > & getJunctions() const
get junctions
const std::map< SumoXMLTag, std::map< const GUIGlObject *, GNEDemandElement * > > & getDemandElements() const
get demand elements
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