67 FXDialogBox(viewNet->getApp(), ("Fix stoppingPlaces positions"),
GUIDesignDialogBoxExplicit, 0, 0, 458, 300, 0, 0, 0, 0),
69 myInvalidStoppingPlaces(invalidStoppingPlaces),
70 myInvalidDetectors(invalidDetectors) {
79 myTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
80 myTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
81 myTable->setEditable(
false);
83 myTable->clearItems();
85 myTable->setTableSize(
int(myInvalidStoppingPlaces.size() + myInvalidDetectors.size()), 3);
87 myTable->setVisibleColumns(4);
89 myTable->setColumnWidth(1, 160);
90 myTable->setColumnWidth(2, 260);
91 myTable->setColumnText(0,
"");
93 myTable->setColumnText(2,
"Conflict");
94 myTable->getRowHeader()->setWidth(0);
97 FXTableItem* item = 0;
99 for (
auto i : myInvalidStoppingPlaces) {
101 item =
new FXTableItem(
"", i->getIcon());
102 item->setIconPosition(FXTableItem::CENTER_X);
103 myTable->setItem(indexRow, 0, item);
105 item =
new FXTableItem(i->getID().c_str());
106 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
107 myTable->setItem(indexRow, 1, item);
109 std::string errorStartPosition, errorEndPosition, separator;
111 if (i->getAbsoluteStartPosition() < 0) {
115 if (i->getAbsoluteEndPosition() > i->getLane()->getLaneParametricLength()) {
119 if ((errorStartPosition.size() > 0) && (errorEndPosition.size() > 0)) {
122 item =
new FXTableItem((errorStartPosition + separator + errorEndPosition).c_str());
123 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
124 myTable->setItem(indexRow, 2, item);
129 for (
auto i : myInvalidDetectors) {
131 item =
new FXTableItem(
"", i->getIcon());
132 item->setIconPosition(FXTableItem::CENTER_X);
133 myTable->setItem(indexRow, 0, item);
135 item =
new FXTableItem(i->getID().c_str());
136 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
137 myTable->setItem(indexRow, 1, item);
139 std::string errorPosition, errorLenght, separator;
141 if (i->getAbsolutePositionOverLane() < 0) {
143 }
else if (i->getAbsolutePositionOverLane() > i->getLane()->getLaneParametricLength()) {
152 if ((errorPosition.size() > 0) && (errorLenght.size() > 0)) {
155 item =
new FXTableItem((errorPosition + separator + errorLenght).c_str());
156 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
157 myTable->setItem(indexRow, 2, item);
167 myOptionA =
new FXRadioButton(RadioButtonsLeft,
"Activate friendlyPos and save\t\tFriendly pos parameter will be activated in all stopping places and E2 detectors",
169 myOptionC =
new FXRadioButton(RadioButtonsLeft,
"Save invalid positions\t\tSave stopping places and E2 detectors with invalid positions",
173 myOptionB =
new FXRadioButton(RadioButtonsRight,
"Fix positions and save\t\tPosition of stopping places and E2 detectors will be fixed",
175 myOptionD =
new FXRadioButton(RadioButtonsRight,
"Select invalid additionals\t\tCancel saving of additionals and select invalid stopping places and E2 detectors",
178 myOptionA->setCheck(
true);
186 myAcceptButton->setFocus();
240 getApp()->stopModal(
this, TRUE);
242 }
else if (
myOptionB->getCheck() == TRUE) {
247 if (stoppingPlace != NULL) {
262 if (E2Detector != NULL) {
282 getApp()->stopModal(
this, TRUE);
284 }
else if (
myOptionC->getCheck() == TRUE) {
286 getApp()->stopModal(
this, TRUE);
288 }
else if (
myOptionD->getCheck() == TRUE) {
289 std::set<GUIGlID> GLIDsToSelect;
295 GLIDsToSelect.insert((*i)->getGlID());
299 GLIDsToSelect.insert((*i)->getGlID());
305 getApp()->stopModal(
this, FALSE);
309 getApp()->stopModal(
this, FALSE);
318 getApp()->stopModal(
this, FALSE);
#define GUIDesignTableIconCellWidth
width of cells that only contains an Icon
#define GUIDesignHorizontalFrame
FXRadioButton * myOptionD
Option "Select invalid stops and cancel".
FXRadioButton * myOptionA
Option "Activate friendlyPos and save".
long onCmdAccept(FXObject *, FXSelector, void *)
event after press accept button
~GNEDialog_FixAdditionalPositions()
destructor
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
static bool checkAndFixDetectorPositionPosition(double &pos, const double laneLength, const bool friendlyPos)
check if the position of a detector over a lane is valid
#define GUIDesignButtonCancel
Cancel Button.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes ...
FXRadioButton * myOptionC
Option "Save invalid".
std::vector< GNEStoppingPlace * > myInvalidStoppingPlaces
vector with the invalid stoppingplaces
GNEUndoList * getUndoList() const
get the undoList object
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
const std::set< GUIGlID > & getSelected() const
Returns the set of ids of all selected objects.
#define GUIDesignDialogBoxExplicit
design for dialog box with specift width and height (for example, additional dialogs) ...
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
GNELane * getLane() const
get lane of additional, or NULL if additional isn't placed over a Lane
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
Dialog for edit rerouters.
double getAbsolutePositionOverLane() const
get absolute position over Lane
#define GUIDesignTableAdditionals
design for tables used in additional dialogs
#define GUIDesignAuxiliarVerticalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
#define GUIDesignButtonAccept
Accept Button.
#define GUIDesignLabelCenterThick
label extended over frame with thick and with text justify to center
GNEViewNet * myViewNet
view net
static bool fixE2DetectorPositionPosition(double &pos, double &length, const double laneLength, const bool friendlyPos)
check if the position of a detector over a lane is valid
FXRadioButton * myOptionB
Option "Fix Positions and save".
GNENet * getNet() const
get the net object
FXDEFMAP(GNEDialog_FixAdditionalPositions) GNEDialog_FixAdditionalPositionsMap[]
FixStoppingPlaces dialog.
virtual std::string getAttribute(SumoXMLAttr key) const =0
This functions has to be implemented in allGNEAttributeCarrier.
std::vector< GNEDetector * > myInvalidDetectors
vector with the invalid stoppingplaces
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
static bool fixStoppinPlacePosition(double &startPos, double &endPos, const double laneLength, const double minLength, const bool friendlyPos)
check if the position of an stoppingPlace over a lane is valid
#define GUIDesignRadioButton
double getLaneParametricLength() const
returns the parameteric length of the lane
double getAbsoluteLenght() const
get absolute lenght
GUISelectedStorage gSelected
A global holder of selected objects.
long onCmdSelectOption(FXObject *obj, FXSelector, void *)
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon