Eclipse SUMO - Simulation of Urban MObility
GNETAZFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The Widget for add TAZ elements
16 /****************************************************************************/
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 #include <config.h>
22 
26 #include <netedit/GNENet.h>
27 #include <netedit/GNEViewNet.h>
34 #include <netedit/GNEUndoList.h>
35 
36 #include "GNETAZFrame.h"
37 
38 
39 // ===========================================================================
40 // FOX callback mapping
41 // ===========================================================================
42 
43 FXDEFMAP(GNETAZFrame::TAZParameters) TAZParametersMap[] = {
46  FXMAPFUNC(SEL_COMMAND, MID_HELP, GNETAZFrame::TAZParameters::onCmdHelp),
47 };
48 
49 FXDEFMAP(GNETAZFrame::TAZSaveChanges) TAZSaveChangesMap[] = {
52 };
53 
54 FXDEFMAP(GNETAZFrame::TAZChildDefaultParameters) TAZChildDefaultParametersMap[] = {
57 };
58 
59 FXDEFMAP(GNETAZFrame::TAZSelectionStatistics) TAZSelectionStatisticsMap[] = {
61 };
62 
63 FXDEFMAP(GNETAZFrame::TAZEdgesGraphic) TAZEdgesGraphicMap[] = {
65 };
66 
67 // Object implementation
68 FXIMPLEMENT(GNETAZFrame::TAZParameters, FXGroupBox, TAZParametersMap, ARRAYNUMBER(TAZParametersMap))
69 FXIMPLEMENT(GNETAZFrame::TAZSaveChanges, FXGroupBox, TAZSaveChangesMap, ARRAYNUMBER(TAZSaveChangesMap))
70 FXIMPLEMENT(GNETAZFrame::TAZChildDefaultParameters, FXGroupBox, TAZChildDefaultParametersMap, ARRAYNUMBER(TAZChildDefaultParametersMap))
71 FXIMPLEMENT(GNETAZFrame::TAZSelectionStatistics, FXGroupBox, TAZSelectionStatisticsMap, ARRAYNUMBER(TAZSelectionStatisticsMap))
72 FXIMPLEMENT(GNETAZFrame::TAZEdgesGraphic, FXGroupBox, TAZEdgesGraphicMap, ARRAYNUMBER(TAZEdgesGraphicMap))
73 
74 
75 // ===========================================================================
76 // method definitions
77 // ===========================================================================
78 
79 // ---------------------------------------------------------------------------
80 // GNETAZFrame::TAZCurrent - methods
81 // ---------------------------------------------------------------------------
82 
83 GNETAZFrame::TAZCurrent::TAZEdge::TAZEdge(TAZCurrent* TAZCurrentParent, GNEEdge* _edge, GNETAZSourceSink* _TAZSource, GNETAZSourceSink* _TAZSink) :
84  edge(_edge),
85  TAZSource(_TAZSource),
86  TAZSink(_TAZSink),
87  sourceColor(0),
88  sinkColor(0),
89  sourcePlusSinkColor(0),
90  sourceMinusSinkColor(0),
91  myTAZCurrentParent(TAZCurrentParent)
92 { }
93 
94 
96 
97 
98 void
100  sourceColor = GNEAttributeCarrier::parse<int>(TAZSource->getAttribute(GNE_ATTR_TAZCOLOR));
101  sinkColor = GNEAttributeCarrier::parse<int>(TAZSink->getAttribute(GNE_ATTR_TAZCOLOR));
102  // Obtain Source+Sink needs more steps. First obtain Source+Sink Weight
103  double sourcePlusSinkWeight = TAZSource->getDepartWeight() + TAZSink->getDepartWeight();
104  // avoid division between zero
107  } else {
108  // calculate percentage relative to the max and min Source+Sink weight
109  double percentage = (sourcePlusSinkWeight - myTAZCurrentParent->myMinSourcePlusSinkWeight) /
111  // convert percentage to a value between [0-9] (because we have only 10 colors)
112  if (percentage >= 1) {
114  } else if (percentage < 0) {
116  } else {
117  sourcePlusSinkColor = (int)(percentage * 10);
118  }
119  }
120  // Obtain Source+Sink needs more steps. First obtain Source-Sink Weight
121  double sourceMinusSinkWeight = TAZSource->getDepartWeight() - TAZSink->getDepartWeight();
122  // avoid division between zero
125  } else {
126  // calculate percentage relative to the max and min Source-Sink weight
127  double percentage = (sourceMinusSinkWeight - myTAZCurrentParent->myMinSourceMinusSinkWeight) /
129  // convert percentage to a value between [0-9] (because we have only 10 colors)
130  if (percentage >= 1) {
132  } else if (percentage < 0) {
134  } else {
135  sourceMinusSinkColor = (int)(percentage * 10);
136  }
137  }
138 }
139 
140 
142  FXGroupBox(TAZFrameParent->myContentFrame, "TAZ", GUIDesignGroupBoxFrame),
143  myTAZFrameParent(TAZFrameParent),
144  myEditedTAZ(nullptr),
149  // create TAZ label
150  myTAZCurrentLabel = new FXLabel(this, "No TAZ selected", 0, GUIDesignLabelLeft);
151 }
152 
153 
155 
156 
157 void
159  // set new current TAZ
160  myEditedTAZ = editedTAZ;
161  // update label and moduls
162  if (myEditedTAZ != nullptr) {
163  myTAZCurrentLabel->setText(("Current TAZ: " + myEditedTAZ->getID()).c_str());
164  // obtain a copy of all edges of the net (to avoid slowdown during manipulations)
166  // obtain a copy of all SELECTED edges of the net (to avoid slowdown during manipulations)
168  // resfresh TAZ Edges
169  refreshTAZEdges();
170  // hide TAZ parameters
172  // hide Netedit parameters
174  // hide drawing shape
176  // show edge common parameters
178  // show save TAZ Edges
180  // show edge common parameters
182  // show Edges graphics
184  } else {
185  // show TAZ parameters
187  // show Netedit parameters
189  // show drawing shape
191  // hide edge common parameters
193  // hide edge common parameters
195  // hide Edges graphics
197  // hide save TAZ Edges
199  // restore label
200  myTAZCurrentLabel->setText("No TAZ selected");
201  // clear net edges (always the last step due hideTAZEdgesGraphicModul() function)
202  myNetEdges.clear();
203  // clear selected edges
204  mySelectedEdges.clear();
205  // reset all weight values
210  }
211 }
212 
213 
214 GNETAZ*
216  return myEditedTAZ;
217 }
218 
219 
220 bool
222  // simply iterate over edges and check edge parameter
223  for (const auto& i : myTAZEdges) {
224  if (i.edge == edge) {
225  return true;
226  }
227  }
228  // not found, then return false
229  return false;
230 }
231 
232 
233 const std::vector<GNEEdge*>&
235  return myNetEdges;
236 }
237 
238 
239 const std::vector<GNEEdge*>&
241  return mySelectedEdges;
242 }
243 
244 
245 const std::vector<GNETAZFrame::TAZCurrent::TAZEdge>&
247  return myTAZEdges;
248 }
249 
250 
251 void
253  // clear all curren TAZEdges
254  myTAZEdges.clear();
255  // clear weight values
260  // only refresh if we're editing an TAZ
261  if (myEditedTAZ) {
262  // iterate over additional children and create TAZEdges
263  for (const auto& i : myEditedTAZ->getAdditionalChildren()) {
264  addTAZChild(dynamic_cast<GNETAZSourceSink*>(i));
265  }
266  // update colors after add all edges
267  for (auto& i : myTAZEdges) {
268  i.updateColors();
269  }
270  // update edge colors
272  }
273 }
274 
275 
276 void
278  // first make sure that additional is an TAZ Source or Sink
279  if (sourceSink && ((sourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) || (sourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSINK))) {
281  // first check if TAZEdge has to be created
282  bool createTAZEdge = true;
283  for (auto& i : myTAZEdges) {
284  if (i.edge == edge) {
285  createTAZEdge = false;
286  // update TAZ Source or Sink
287  if (sourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) {
288  i.TAZSource = sourceSink;
289  } else {
290  i.TAZSink = sourceSink;
291  }
292  }
293  }
294  // check if additional has to be created
295  if (createTAZEdge) {
296  if (sourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) {
297  myTAZEdges.push_back(TAZEdge(this, edge, sourceSink, nullptr));
298  } else {
299  myTAZEdges.push_back(TAZEdge(this, edge, nullptr, sourceSink));
300  }
301  }
302  // recalculate weights
307  for (const auto& i : myTAZEdges) {
308  // make sure that both TAZ Source and Sink exist
309  if (i.TAZSource && i.TAZSink) {
310  // obtain source plus sink
311  double sourcePlusSink = i.TAZSource->getDepartWeight() + i.TAZSink->getDepartWeight();
312  // check myMaxSourcePlusSinkWeight
313  if (sourcePlusSink > myMaxSourcePlusSinkWeight) {
314  myMaxSourcePlusSinkWeight = sourcePlusSink;
315  }
316  // check myMinSourcePlusSinkWeight
317  if ((myMinSourcePlusSinkWeight == -1) || (sourcePlusSink < myMinSourcePlusSinkWeight)) {
318  myMinSourcePlusSinkWeight = sourcePlusSink;
319  }
320  // obtain source minus sink
321  double sourceMinusSink = i.TAZSource->getDepartWeight() - i.TAZSink->getDepartWeight();
322  // use valor absolute
323  if (sourceMinusSink < 0) {
324  sourceMinusSink *= -1;
325  }
326  // check myMaxSourcePlusSinkWeight
327  if (sourceMinusSink > myMaxSourceMinusSinkWeight) {
328  myMaxSourceMinusSinkWeight = sourceMinusSink;
329  }
330  // check myMinSourcePlusSinkWeight
331  if ((myMinSourceMinusSinkWeight == -1) || (sourceMinusSink < myMinSourceMinusSinkWeight)) {
332  myMinSourceMinusSinkWeight = sourceMinusSink;
333  }
334  }
335  }
336  } else {
337  throw ProcessError("Invalid TAZ Child");
338  }
339 }
340 
341 // ---------------------------------------------------------------------------
342 // GNETAZFrame::TAZCommonStatistics - methods
343 // ---------------------------------------------------------------------------
344 
346  FXGroupBox(TAZFrameParent->myContentFrame, "TAZ Statistics", GUIDesignGroupBoxFrame),
347  myTAZFrameParent(TAZFrameParent) {
348  // create label for statistics
349  myStatisticsLabel = new FXLabel(this, "Statistics", 0, GUIDesignLabelFrameInformation);
350 }
351 
352 
354 
355 
356 void
358  // always update statistics after show
360  show();
361 }
362 
363 
364 void
366  hide();
367 }
368 
369 
370 void
373  // declare ostringstream for statistics
374  std::ostringstream information;
375  information
376  << "- Number of Edges: " << toString(myTAZFrameParent->myTAZCurrent->getTAZ()->getAdditionalChildren().size() / 2) << "\n"
377  << "- Min source: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_MIN_SOURCE) << "\n"
378  << "- Max source: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_MAX_SOURCE) << "\n"
379  << "- Average source: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_AVERAGE_SOURCE) << "\n"
380  << "\n"
381  << "- Min sink: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_MIN_SINK) << "\n"
382  << "- Max sink: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_MAX_SINK) << "\n"
384  // set new label
385  myStatisticsLabel->setText(information.str().c_str());
386  } else {
387  myStatisticsLabel->setText("No TAZ Selected");
388  }
389 }
390 
391 // ---------------------------------------------------------------------------
392 // GNETAZFrame::TAZSaveChanges - methods
393 // ---------------------------------------------------------------------------
394 
396  FXGroupBox(TAZFrameParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame),
397  myTAZFrameParent(TAZFrameParent) {
398  // Create groupbox for save changes
399  mySaveChangesButton = new FXButton(this, "Save changes", GUIIconSubSys::getIcon(ICON_SAVE), this, MID_OK, GUIDesignButton);
400  mySaveChangesButton->disable();
401  // Create groupbox cancel changes
402  myCancelChangesButton = new FXButton(this, "Cancel changes", GUIIconSubSys::getIcon(ICON_CANCEL), this, MID_CANCEL, GUIDesignButton);
403  myCancelChangesButton->disable();
404 }
405 
406 
408 
409 
410 void
412  show();
413 }
414 
415 
416 void
418  // cancel changes before hidding modul
419  onCmdCancelChanges(0, 0, 0);
420  hide();
421 }
422 
423 
424 void
426  // check that save changes is disabled
427  if (!mySaveChangesButton->isEnabled()) {
428  // enable mySaveChangesButton and myCancelChangesButton
429  mySaveChangesButton->enable();
430  myCancelChangesButton->enable();
431  // start undo list set
432  myTAZFrameParent->myViewNet->getUndoList()->p_begin("TAZ attributes");
433  }
434 }
435 
436 
437 bool
439  // simply check if save Changes Button is enabled
440  return mySaveChangesButton->isEnabled();
441 }
442 
443 
444 long
445 GNETAZFrame::TAZSaveChanges::onCmdSaveChanges(FXObject*, FXSelector, void*) {
446  // check that save changes is enabled
447  if (mySaveChangesButton->isEnabled()) {
448  // disable mySaveChangesButton and myCancelChangesButtonand
449  mySaveChangesButton->disable();
450  myCancelChangesButton->disable();
451  // finish undo list set
453  }
454  return 1;
455 }
456 
457 
458 long
459 GNETAZFrame::TAZSaveChanges::onCmdCancelChanges(FXObject*, FXSelector, void*) {
460  // check that save changes is enabled
461  if (mySaveChangesButton->isEnabled()) {
462  // disable buttons
463  mySaveChangesButton->disable();
464  myCancelChangesButton->disable();
465  // abort undo list
467  // always refresh TAZ Edges after removing TAZSources/Sinks
469  // update use edges button
471  }
472  return 1;
473 }
474 
475 // ---------------------------------------------------------------------------
476 // GNETAZFrame::TAZChildDefaultParameters - methods
477 // ---------------------------------------------------------------------------
478 
480  FXGroupBox(TAZFrameParent->myContentFrame, "TAZ Sources/Sinks", GUIDesignGroupBoxFrame),
481  myTAZFrameParent(TAZFrameParent),
482  myDefaultTAZSourceWeight(1),
483  myDefaultTAZSinkWeight(1) {
484  // create checkbox for toogle membership
485  FXHorizontalFrame* toogleMembershipFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
486  new FXLabel(toogleMembershipFrame, "Membership", 0, GUIDesignLabelAttribute);
487  myToggleMembership = new FXCheckButton(toogleMembershipFrame, "Toggle", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
488  // by default enabled
489  myToggleMembership->setCheck(TRUE);
490  // create default TAZ Source weight
491  myDefaultTAZSourceFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
492  new FXLabel(myDefaultTAZSourceFrame, "New source", 0, GUIDesignLabelAttribute);
494  myTextFieldDefaultValueTAZSources->setText("1");
495  // create default TAZ Sink weight
496  myDefaultTAZSinkFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
497  new FXLabel(myDefaultTAZSinkFrame, "New sink", 0, GUIDesignLabelAttribute);
499  myTextFieldDefaultValueTAZSinks->setText("1");
500  // Create button for use selected edges
501  myUseSelectedEdges = new FXButton(this, "Use selected edges", nullptr, this, MID_GNE_SELECT, GUIDesignButton);
502  // Create information label
503  std::ostringstream information;
504  information
505  << "- Toogle Membership:\n"
506  << " Create new Sources/Sinks\n"
507  << " with given weights.";
508  myInformationLabel = new FXLabel(this, information.str().c_str(), 0, GUIDesignLabelFrameInformation);
509 }
510 
511 
513 
514 
515 void
517  // check if TAZ selection Statistics Modul has to be shown
518  if (myToggleMembership->getCheck() == FALSE) {
520  } else {
522  }
523  // update selected button
525  // show modul
526  show();
527 }
528 
529 
530 void
532  // hide TAZ Selection Statistics Modul
534  // hide modul
535  hide();
536 }
537 
538 
539 void
541  if (myToggleMembership->getCheck() == TRUE) {
542  // check if use selected edges has to be enabled
543  if (myTAZFrameParent->myTAZCurrent->getSelectedEdges().size() > 0) {
544  myUseSelectedEdges->setText("Use selected edges");
545  myUseSelectedEdges->enable();
546  } else if (myTAZFrameParent->myTAZCurrent->getTAZEdges().size() > 0) {
547  myUseSelectedEdges->setText("Remove all edges");
548  myUseSelectedEdges->enable();
549  } else {
550  myUseSelectedEdges->setText("Use selected edges");
551  myUseSelectedEdges->disable();
552  }
553  } else if (myTAZFrameParent->getTAZCurrentModul()->getTAZEdges().size() > 0) {
554  // enable myUseSelectedEdges button
555  myUseSelectedEdges->enable();
556  // update mySelectEdgesOfSelection label
558  // check if all edges of TAZChildren are selected
559  bool allSelected = true;
560  for (const auto& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) {
561  if (!i.edge->isAttributeCarrierSelected()) {
562  allSelected = false;
563  }
564  }
565  if (allSelected) {
566  myUseSelectedEdges->setText("Remove all edges from selection");
567  } else {
568  myUseSelectedEdges->setText("Add all edges to selection");
569  }
571  if (myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().front().edge->isAttributeCarrierSelected()) {
572  myUseSelectedEdges->setText("Remove edge from selection");
573  } else {
574  myUseSelectedEdges->setText("Add edge to selection");
575  }
576  } else {
577  // check if all edges of TAZChildren selected are selected
578  bool allSelected = true;
580  if (!i.edge->isAttributeCarrierSelected()) {
581  allSelected = false;
582  }
583  }
584  if (allSelected) {
585  myUseSelectedEdges->setText(("Remove " + toString(myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().size()) + " from to selection").c_str());
586  } else {
587  myUseSelectedEdges->setText(("Add " + toString(myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().size()) + " edges to selection").c_str());
588  }
589  }
590  } else {
591  // TAZ doesn't have children, then disable button
592  myUseSelectedEdges->disable();
593  }
594 }
595 
596 
597 double
600 }
601 
602 
603 double
605  return myDefaultTAZSinkWeight;
606 }
607 
608 
609 bool
611  return (myToggleMembership->getCheck() == TRUE);
612 }
613 
614 
615 long
617  // find edited object
618  if (obj == myToggleMembership) {
619  // first clear selected edges
621  // set text of myToggleMembership
622  if (myToggleMembership->getCheck() == TRUE) {
623  myToggleMembership->setText("toogle");
624  // show TAZSource/Sink Frames
625  myDefaultTAZSourceFrame->show();
626  myDefaultTAZSinkFrame->show();
627  // update information label
628  std::ostringstream information;
629  information
630  << "- Toogle Membership:\n"
631  << " Create new Sources/Sinks\n"
632  << " with given weights.";
633  myInformationLabel->setText(information.str().c_str());
634  // hide TAZSelectionStatistics
636  // check if use selected edges has to be enabled
637  if (myTAZFrameParent->myTAZCurrent->getSelectedEdges().size() > 0) {
638  myUseSelectedEdges->setText("Use selected edges");
639  } else if (myTAZFrameParent->myTAZCurrent->getTAZEdges().size() > 0) {
640  myUseSelectedEdges->setText("Remove all edges");
641  } else {
642  myUseSelectedEdges->setText("Use selected edges");
643  myUseSelectedEdges->disable();
644  }
645  } else {
646  myToggleMembership->setText("keep");
647  // hide TAZSource/Sink Frames
648  myDefaultTAZSourceFrame->hide();
649  myDefaultTAZSinkFrame->hide();
650  // update information label
651  std::ostringstream information;
652  information
653  << "- Keep Membership:\n"
654  << " Select Sources/Sinks.\n"
655  << "- Press ESC to clear\n"
656  << " current selection.";
657  myInformationLabel->setText(information.str().c_str());
658  // show TAZSelectionStatistics
660  }
661  // update button
663  } else if (obj == myTextFieldDefaultValueTAZSources) {
664  // check if given value is valid
665  if (GNEAttributeCarrier::canParse<double>(myTextFieldDefaultValueTAZSources->getText().text())) {
666  myDefaultTAZSourceWeight = GNEAttributeCarrier::parse<double>(myTextFieldDefaultValueTAZSources->getText().text());
667  // check if myDefaultTAZSourceWeight is greather than 0
668  if (myDefaultTAZSourceWeight >= 0) {
669  // set valid color
670  myTextFieldDefaultValueTAZSources->setTextColor(FXRGB(0, 0, 0));
671  } else {
672  // set invalid color
673  myTextFieldDefaultValueTAZSources->setTextColor(FXRGB(255, 0, 0));
675  }
676  } else {
677  // set invalid color
678  myTextFieldDefaultValueTAZSources->setTextColor(FXRGB(255, 0, 0));
680  }
681  } else if (obj == myTextFieldDefaultValueTAZSinks) {
682  // check if given value is valid
683  if (GNEAttributeCarrier::canParse<double>(myTextFieldDefaultValueTAZSinks->getText().text())) {
684  myDefaultTAZSinkWeight = GNEAttributeCarrier::parse<double>(myTextFieldDefaultValueTAZSinks->getText().text());
685  // check if myDefaultTAZSinkWeight is greather than 0
686  if (myDefaultTAZSinkWeight >= 0) {
687  // set valid color
688  myTextFieldDefaultValueTAZSinks->setTextColor(FXRGB(0, 0, 0));
689  } else {
690  // set invalid color
691  myTextFieldDefaultValueTAZSinks->setTextColor(FXRGB(255, 0, 0));
693  }
694  } else {
695  // set invalid color
696  myTextFieldDefaultValueTAZSinks->setTextColor(FXRGB(255, 0, 0));
698  }
699  }
700  return 1;
701 }
702 
703 
704 long
706  // select edge or create new TAZ Source/Child, depending of myToggleMembership
707  if (myToggleMembership->getCheck() == TRUE) {
708  // first drop all edges
710  // iterate over selected edges and add it as TAZMember
711  for (const auto& i : myTAZFrameParent->myTAZCurrent->getSelectedEdges()) {
713  }
714  // update selected button
716  } else {
718  // first check if all TAZEdges are selected
719  bool allSelected = true;
720  for (const auto& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) {
721  if (!i.edge->isAttributeCarrierSelected()) {
722  allSelected = false;
723  }
724  }
725  // select or unselect all depending of allSelected
726  if (allSelected) {
727  // remove form selection all TAZEdges
728  for (const auto& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) {
729  // enable save button
731  // change attribute selected
732  i.edge->setAttribute(GNE_ATTR_SELECTED, "false", myTAZFrameParent->myViewNet->getUndoList());
733  }
734  } else {
735  // add to selection all TAZEdges
736  for (const auto& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) {
737  // enable save button
739  // change attribute selected
740  i.edge->setAttribute(GNE_ATTR_SELECTED, "true", myTAZFrameParent->myViewNet->getUndoList());
741  }
742  }
743  } else {
744  // first check if all TAZEdges are selected
745  bool allSelected = true;
747  if (!i.edge->isAttributeCarrierSelected()) {
748  allSelected = false;
749  }
750  }
751  // select or unselect all depending of allSelected
752  if (allSelected) {
753  // only remove from selection selected TAZEdges
755  if (i.edge->isAttributeCarrierSelected()) {
756  // enable save button
758  // change attribute selected
759  i.edge->setAttribute(GNE_ATTR_SELECTED, "false", myTAZFrameParent->myViewNet->getUndoList());
760  }
761  }
762  } else {
763  // only add to selection selected TAZEdges
765  if (!i.edge->isAttributeCarrierSelected()) {
766  // enable save button
768  // change attribute selected
769  i.edge->setAttribute(GNE_ATTR_SELECTED, "true", myTAZFrameParent->myViewNet->getUndoList());
770  }
771  }
772  }
773  }
774  }
775  // update selection button
777  // update view net
779  return 1;
780 }
781 
782 // ---------------------------------------------------------------------------
783 // GNETAZFrame::TAZSelectionStatistics - methods
784 // ---------------------------------------------------------------------------
785 
787  FXGroupBox(TAZFrameParent->myContentFrame, "Selection Statistics", GUIDesignGroupBoxFrame),
788  myTAZFrameParent(TAZFrameParent) {
789  // create default TAZ Source weight
790  myTAZSourceFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
791  new FXLabel(myTAZSourceFrame, "Source", 0, GUIDesignLabelAttribute);
793  myTAZSourceFrame->hide();
794  // create default TAZ Sink weight
795  myTAZSinkFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
796  new FXLabel(myTAZSinkFrame, "Sink", 0, GUIDesignLabelAttribute);
798  myTAZSinkFrame->hide();
799  // create label for statistics
800  myStatisticsLabel = new FXLabel(this, "Statistics", 0, GUIDesignLabelFrameInformation);
801 }
802 
803 
805 
806 
807 void
809  // update Statistics before show
811  show();
812 }
813 
814 
815 void
817  // clear children before hide
819  hide();
820 }
821 
822 
823 bool
825  // find TAZEdge using edge as criterium wasn't previously selected
826  for (const auto& i : myEdgeAndTAZChildrenSelected) {
827  if (i.edge == TAZEdge.edge) {
828  throw ProcessError("TAZEdge already selected");
829  }
830  }
831  // add edge and their TAZ Children into myTAZChildSelected
832  myEdgeAndTAZChildrenSelected.push_back(TAZEdge);
833  // always update statistics after insertion
835  // update edge colors
837  // update selection button
839  return true;
840 }
841 
842 
843 bool
845  if (edge) {
846  // find TAZEdge using edge as criterium
847  for (auto i = myEdgeAndTAZChildrenSelected.begin(); i != myEdgeAndTAZChildrenSelected.end(); i++) {
848  if (i->edge == edge) {
850  // always update statistics after insertion
852  // update edge colors
854  // update selection button
856  return true;
857  }
858  }
859  // throw exception if edge wasn't found
860  throw ProcessError("edge wasn't found");
861  } else {
862  throw ProcessError("Invalid edge");
863  }
864 }
865 
866 
867 bool
869  // find TAZEdge using edge as criterium
870  for (const auto& i : myEdgeAndTAZChildrenSelected) {
871  if (i.edge == edge) {
872  return true;
873  }
874  }
875  // edge wasn't found, then return false
876  return false;
877 }
878 
879 
880 void
882  // clear all selected edges (and the TAZ Children)
884  // always update statistics after clear edges
886  // update edge colors
888  // update selection button
890 }
891 
892 
893 const std::vector<GNETAZFrame::TAZCurrent::TAZEdge>&
896 }
897 
898 
899 long
901  if (obj == myTextFieldTAZSourceWeight) {
902  // check if given value is valid
903  if (GNEAttributeCarrier::canParse<double>(myTextFieldTAZSourceWeight->getText().text())) {
904  double newTAZSourceWeight = GNEAttributeCarrier::parse<double>(myTextFieldTAZSourceWeight->getText().text());
905  // check if myDefaultTAZSourceWeight is greather than 0
906  if (newTAZSourceWeight >= 0) {
907  // set valid color in TextField
908  myTextFieldTAZSourceWeight->setTextColor(FXRGB(0, 0, 0));
909  // enable save button
911  // update weight of all TAZSources
912  for (const auto& i : myEdgeAndTAZChildrenSelected) {
913  i.TAZSource->setAttribute(SUMO_ATTR_WEIGHT, myTextFieldTAZSourceWeight->getText().text(), myTAZFrameParent->myViewNet->getUndoList());
914  }
915  // refresh TAZ Edges
917  } else {
918  // set invalid color
919  myTextFieldTAZSourceWeight->setTextColor(FXRGB(255, 0, 0));
920  }
921  } else {
922  // set invalid color
923  myTextFieldTAZSourceWeight->setTextColor(FXRGB(255, 0, 0));
924  }
925  } else if (obj == myTextFieldTAZSinkWeight) {
926  // check if given value is valid
927  if (GNEAttributeCarrier::canParse<double>(myTextFieldTAZSinkWeight->getText().text())) {
928  double newTAZSinkWeight = GNEAttributeCarrier::parse<double>(myTextFieldTAZSinkWeight->getText().text());
929  // check if myDefaultTAZSinkWeight is greather than 0
930  if (newTAZSinkWeight >= 0) {
931  // set valid color in TextField
932  myTextFieldTAZSinkWeight->setTextColor(FXRGB(0, 0, 0));
933  // enable save button
935  // update weight of all TAZSources
936  for (const auto& i : myEdgeAndTAZChildrenSelected) {
937  i.TAZSink->setAttribute(SUMO_ATTR_WEIGHT, myTextFieldTAZSinkWeight->getText().text(), myTAZFrameParent->myViewNet->getUndoList());
938  }
939  // refresh TAZ Edges
941  } else {
942  // set invalid color
943  myTextFieldTAZSinkWeight->setTextColor(FXRGB(255, 0, 0));
944  }
945  } else {
946  // set invalid color
947  myTextFieldTAZSinkWeight->setTextColor(FXRGB(255, 0, 0));
948  }
949  }
950  return 1;
951 }
952 
953 
954 long
956  if (myEdgeAndTAZChildrenSelected.size() == 0) {
957  // add to selection all TAZEdges
958  for (const auto& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) {
959  // avoid empty undolists
960  if (!i.edge->isAttributeCarrierSelected()) {
961  // enable save button
963  // change attribute selected
964  i.edge->setAttribute(GNE_ATTR_SELECTED, "true", myTAZFrameParent->myViewNet->getUndoList());
965  }
966  }
967  } else {
968  // only add to selection selected TAZEdges
969  for (const auto& i : myEdgeAndTAZChildrenSelected) {
970  // avoid empty undolists
971  if (!i.edge->isAttributeCarrierSelected()) {
972  // enable save button
974  // change attribute selected
975  i.edge->setAttribute(GNE_ATTR_SELECTED, "true", myTAZFrameParent->myViewNet->getUndoList());
976  }
977  }
978  }
979  // update view net
981  return 1;
982 }
983 
984 
985 void
987  if (myEdgeAndTAZChildrenSelected.size() > 0) {
988  // show TAZSources/Sinks frames
989  myTAZSourceFrame->show();
990  myTAZSinkFrame->show();
991  // declare string sets for TextFields (to avoid duplicated values)
992  std::set<std::string> weightSourceSet;
993  std::set<std::string> weightSinkSet;
994  // declare stadistic variables
995  double weight = 0;
996  double maxWeightSource = 0;
997  double minWeightSource = -1;
998  double averageWeightSource = 0;
999  double maxWeightSink = 0;
1000  double minWeightSink = -1;
1001  double averageWeightSink = 0;
1002  // iterate over additional children
1003  for (const auto& i : myEdgeAndTAZChildrenSelected) {
1004  //start with sources
1005  weight = i.TAZSource->getDepartWeight();
1006  // insert source weight in weightSinkTextField
1007  weightSourceSet.insert(toString(weight));
1008  // check max Weight
1009  if (maxWeightSource < weight) {
1010  maxWeightSource = weight;
1011  }
1012  // check min Weight
1013  if (minWeightSource == -1 || (maxWeightSource < weight)) {
1014  minWeightSource = weight;
1015  }
1016  // update Average
1017  averageWeightSource += weight;
1018  // continue with sinks
1019  weight = i.TAZSink->getDepartWeight();
1020  // save sink weight in weightSinkTextField
1021  weightSinkSet.insert(toString(weight));
1022  // check max Weight
1023  if (maxWeightSink < weight) {
1024  maxWeightSink = weight;
1025  }
1026  // check min Weight
1027  if (minWeightSink == -1 || (maxWeightSink < weight)) {
1028  minWeightSink = weight;
1029  }
1030  // update Average
1031  averageWeightSink += weight;
1032  }
1033  // calculate average
1034  averageWeightSource /= myEdgeAndTAZChildrenSelected.size();
1035  averageWeightSink /= myEdgeAndTAZChildrenSelected.size();
1036  // declare ostringstream for statistics
1037  std::ostringstream information;
1038  std::string edgeInformation;
1039  // first fill edgeInformation
1040  if (myEdgeAndTAZChildrenSelected.size() == 1) {
1041  edgeInformation = "- Edge ID: " + myEdgeAndTAZChildrenSelected.begin()->edge->getID();
1042  } else {
1043  edgeInformation = "- Number of edges: " + toString(myEdgeAndTAZChildrenSelected.size());
1044  }
1045  // fill rest of information
1046  information
1047  << edgeInformation << "\n"
1048  << "- Min source: " << toString(minWeightSource) << "\n"
1049  << "- Max source: " << toString(maxWeightSource) << "\n"
1050  << "- Average source: " << toString(averageWeightSource) << "\n"
1051  << "\n"
1052  << "- Min sink: " << toString(minWeightSink) << "\n"
1053  << "- Max sink: " << toString(maxWeightSink) << "\n"
1054  << "- Average sink: " << toString(averageWeightSink);
1055  // set new label
1056  myStatisticsLabel->setText(information.str().c_str());
1057  // set TextFields (Text and color)
1058  myTextFieldTAZSourceWeight->setText(joinToString(weightSourceSet, " ").c_str());
1059  myTextFieldTAZSourceWeight->setTextColor(FXRGB(0, 0, 0));
1060  myTextFieldTAZSinkWeight->setText(joinToString(weightSinkSet, " ").c_str());
1061  myTextFieldTAZSinkWeight->setTextColor(FXRGB(0, 0, 0));
1062  } else {
1063  // hide TAZSources/Sinks frames
1064  myTAZSourceFrame->hide();
1065  myTAZSinkFrame->hide();
1066  // hide myStatisticsLabel
1067  myStatisticsLabel->setText("No edges selected");
1068  }
1069 }
1070 
1071 // ---------------------------------------------------------------------------
1072 // GNETAZFrame::TAZParameters- methods
1073 // ---------------------------------------------------------------------------
1074 
1076  FXGroupBox(TAZFrameParent->myContentFrame, "TAZ parameters", GUIDesignGroupBoxFrame),
1077  myTAZFrameParent(TAZFrameParent) {
1078  // create Button and string textField for color and set blue as default color
1079  FXHorizontalFrame* colorParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
1080  myColorEditor = new FXButton(colorParameter, toString(SUMO_ATTR_COLOR).c_str(), 0, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute);
1081  myTextFieldColor = new FXTextField(colorParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
1082  myTextFieldColor->setText("blue");
1083  // create Label and CheckButton for use innen edges with true as default value
1084  FXHorizontalFrame* useInnenEdges = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
1085  new FXLabel(useInnenEdges, "Edges within", 0, GUIDesignLabelAttribute);
1086  myAddEdgesWithinCheckButton = new FXCheckButton(useInnenEdges, "use", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
1087  myAddEdgesWithinCheckButton->setCheck(true);
1088  // Create help button
1089  myHelpTAZAttribute = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonRectangular);
1090 }
1091 
1092 
1094 
1095 
1096 void
1098  FXGroupBox::show();
1099 }
1100 
1101 
1102 void
1104  FXGroupBox::hide();
1105 }
1106 
1107 
1108 bool
1110  return GNEAttributeCarrier::canParse<RGBColor>(myTextFieldColor->getText().text());
1111 }
1112 
1113 
1114 bool
1116  return (myAddEdgesWithinCheckButton->getCheck() == TRUE);
1117 }
1118 
1119 
1120 std::map<SumoXMLAttr, std::string>
1122  std::map<SumoXMLAttr, std::string> parametersAndValues;
1123  // get color (currently the only editable attribute)
1124  parametersAndValues[SUMO_ATTR_COLOR] = myTextFieldColor->getText().text();
1125  return parametersAndValues;
1126 }
1127 
1128 
1129 long
1131  // create FXColorDialog
1132  FXColorDialog colordialog(this, tr("Color Dialog"));
1133  colordialog.setTarget(this);
1134  // If previous attribute wasn't correct, set black as default color
1135  if (GNEAttributeCarrier::canParse<RGBColor>(myTextFieldColor->getText().text())) {
1136  colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::parseColor(myTextFieldColor->getText().text())));
1137  } else {
1138  colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::parseColor("blue")));
1139  }
1140  // execute dialog to get a new color
1141  if (colordialog.execute()) {
1142  myTextFieldColor->setText(toString(MFXUtils::getRGBColor(colordialog.getRGBA())).c_str());
1143  onCmdSetAttribute(0, 0, 0);
1144  }
1145  return 0;
1146 }
1147 
1148 
1149 long
1150 GNETAZFrame::TAZParameters::onCmdSetAttribute(FXObject*, FXSelector, void*) {
1151  // only COLOR text field has to be checked
1152  bool currentParametersValid = GNEAttributeCarrier::canParse<RGBColor>(myTextFieldColor->getText().text());
1153  // change color of textfield dependig of myCurrentParametersValid
1154  if (currentParametersValid) {
1155  myTextFieldColor->setTextColor(FXRGB(0, 0, 0));
1156  myTextFieldColor->killFocus();
1157  } else {
1158  myTextFieldColor->setTextColor(FXRGB(255, 0, 0));
1159  currentParametersValid = false;
1160  }
1161  // change useInnenEdgesCheckButton text
1162  if (myAddEdgesWithinCheckButton->getCheck() == TRUE) {
1163  myAddEdgesWithinCheckButton->setText("use");
1164  } else {
1165  myAddEdgesWithinCheckButton->setText("not use");
1166  }
1167  return 0;
1168 }
1169 
1170 
1171 long
1172 GNETAZFrame::TAZParameters::onCmdHelp(FXObject*, FXSelector, void*) {
1174  return 1;
1175 }
1176 
1177 // ---------------------------------------------------------------------------
1178 // GNETAZFrame::TAZEdgesGraphic - methods
1179 // ---------------------------------------------------------------------------
1180 
1182  FXGroupBox(TAZFrameParent->myContentFrame, "Edges", GUIDesignGroupBoxFrame),
1183  myTAZFrameParent(TAZFrameParent),
1184  myEdgeDefaultColor(RGBColor::GREY),
1185  myEdgeSelectedColor(RGBColor::MAGENTA) {
1186  // create label for non taz edge color information
1187  FXLabel* NonTAZEdgeLabel = new FXLabel(this, "Non TAZ Edge", nullptr, GUIDesignLabelCenter);
1188  NonTAZEdgeLabel->setBackColor(MFXUtils::getFXColor(myEdgeDefaultColor));
1189  NonTAZEdgeLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE));
1190  // create label for selected TAZEdge color information
1191  FXLabel* selectedTAZEdgeLabel = new FXLabel(this, "Selected TAZ Edge", nullptr, GUIDesignLabelCenter);
1192  selectedTAZEdgeLabel->setBackColor(MFXUtils::getFXColor(myEdgeSelectedColor));
1193  // create label for color information
1194  new FXLabel(this, "Scala: Min -> Max", nullptr, GUIDesignLabelCenterThick);
1195  // fill scale colors
1196  myScaleColors.push_back(RGBColor(232, 35, 0));
1197  myScaleColors.push_back(RGBColor(255, 165, 0));
1198  myScaleColors.push_back(RGBColor(255, 255, 0));
1199  myScaleColors.push_back(RGBColor(28, 215, 0));
1200  myScaleColors.push_back(RGBColor(0, 181, 100));
1201  myScaleColors.push_back(RGBColor(0, 255, 191));
1202  myScaleColors.push_back(RGBColor(178, 255, 255));
1203  myScaleColors.push_back(RGBColor(0, 112, 184));
1204  myScaleColors.push_back(RGBColor(56, 41, 131));
1205  myScaleColors.push_back(RGBColor(127, 0, 255));
1206  // create frame for color scale
1207  FXHorizontalFrame* horizontalFrameColors = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
1208  for (const auto& i : myScaleColors) {
1209  FXLabel* colorLabel = new FXLabel(horizontalFrameColors, "", nullptr, GUIDesignLabelLeft);
1210  colorLabel->setBackColor(MFXUtils::getFXColor(i));
1211  }
1212  // create Radio button for show edges by source weight
1213  myColorBySourceWeight = new FXRadioButton(this, "Color by Source", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
1214  // create Radio button for show edges by sink weight
1215  myColorBySinkWeight = new FXRadioButton(this, "Color by Sink", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
1216  // create Radio button for show edges by source + sink weight
1217  myColorBySourcePlusSinkWeight = new FXRadioButton(this, "Color by Source + Sink", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
1218  // create Radio button for show edges by source - sink weight
1219  myColorBySourceMinusSinkWeight = new FXRadioButton(this, "Color by Source - Sink", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton);
1220  // show by source as default
1221  myColorBySourceWeight->setCheck(true);
1222 }
1223 
1224 
1226 
1227 
1228 void
1230  // update edge colors
1231  updateEdgeColors();
1232  show();
1233 }
1234 
1235 
1236 void
1238  // iterate over all edges and restore color
1239  for (const auto& i : myTAZFrameParent->myTAZCurrent->getNetEdges()) {
1240  for (const auto j : i->getLanes()) {
1241  j->setSpecialColor(nullptr);
1242  }
1243  }
1244  hide();
1245 }
1246 
1247 
1248 void
1250  // start painting all edges in gray
1251  for (const auto& i : myTAZFrameParent->myTAZCurrent->getNetEdges()) {
1252  // set candidate color (in this case, gray)
1253  for (const auto j : i->getLanes()) {
1254  j->setSpecialColor(&myEdgeDefaultColor);
1255  }
1256  }
1257  // now paint Source/sinks colors
1258  for (const auto& i : myTAZFrameParent->myTAZCurrent->getTAZEdges()) {
1259  // set candidate color (in this case,
1260  for (const auto j : i.edge->getLanes()) {
1261  // check what will be painted (source, sink or both)
1262  if (myColorBySourceWeight->getCheck() == TRUE) {
1263  j->setSpecialColor(&myScaleColors.at(i.sourceColor), i.TAZSource->getDepartWeight());
1264  } else if (myColorBySinkWeight->getCheck() == TRUE) {
1265  j->setSpecialColor(&myScaleColors.at(i.sinkColor), i.TAZSink->getDepartWeight());
1266  } else if (myColorBySourcePlusSinkWeight->getCheck() == TRUE) {
1267  j->setSpecialColor(&myScaleColors.at(i.sourcePlusSinkColor), i.TAZSource->getDepartWeight() + i.TAZSink->getDepartWeight());
1268  } else {
1269  j->setSpecialColor(&myScaleColors.at(i.sourceMinusSinkColor), i.TAZSource->getDepartWeight() - i.TAZSink->getDepartWeight());
1270  }
1271  }
1272  }
1273  // as last step paint candidate colors
1275  // set candidate selected color
1276  for (const auto& j : i.edge->getLanes()) {
1277  j->setSpecialColor(&myEdgeSelectedColor);
1278  }
1279  }
1280  // always update view after setting new colors
1282 }
1283 
1284 
1285 long
1286 GNETAZFrame::TAZEdgesGraphic::onCmdChoosenBy(FXObject* obj, FXSelector, void*) {
1287  // check what radio was pressed and disable the others
1288  if (obj == myColorBySourceWeight) {
1289  myColorBySinkWeight->setCheck(FALSE);
1290  myColorBySourcePlusSinkWeight->setCheck(FALSE);
1291  myColorBySourceMinusSinkWeight->setCheck(FALSE);
1292  } else if (obj == myColorBySinkWeight) {
1293  myColorBySourceWeight->setCheck(FALSE);
1294  myColorBySourcePlusSinkWeight->setCheck(FALSE);
1295  myColorBySourceMinusSinkWeight->setCheck(FALSE);
1296  } else if (obj == myColorBySourcePlusSinkWeight) {
1297  myColorBySourceWeight->setCheck(FALSE);
1298  myColorBySinkWeight->setCheck(FALSE);
1299  myColorBySourceMinusSinkWeight->setCheck(FALSE);
1300  } else if (obj == myColorBySourceMinusSinkWeight) {
1301  myColorBySourceWeight->setCheck(FALSE);
1302  myColorBySinkWeight->setCheck(FALSE);
1303  myColorBySourcePlusSinkWeight->setCheck(FALSE);
1304  }
1305  // update edge colors
1306  updateEdgeColors();
1307  return 1;
1308 }
1309 
1310 // ---------------------------------------------------------------------------
1311 // GNETAZFrame - methods
1312 // ---------------------------------------------------------------------------
1313 
1314 GNETAZFrame::GNETAZFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
1315  GNEFrame(horizontalFrameParent, viewNet, "TAZs") {
1316 
1317  // create current TAZ modul
1318  myTAZCurrent = new TAZCurrent(this);
1319 
1320  // Create TAZ Parameters modul
1321  myTAZParameters = new TAZParameters(this);
1322 
1325 
1326  // Create drawing controls modul
1328 
1329  // Create TAZ Edges Common Statistics modul
1331 
1332  // Create save TAZ Edges modul
1333  myTAZSaveChanges = new TAZSaveChanges(this);
1334 
1335  // Create TAZ Edges Common Parameters modul
1337 
1338  // Create TAZ Edges Selection Statistics modul
1340 
1341  // Create TAZ Edges Common Parameters modul
1342  myTAZEdgesGraphic = new TAZEdgesGraphic(this);
1343 
1344  // by default there isn't a TAZ
1345  myTAZCurrent->setTAZ(nullptr);
1346 }
1347 
1348 
1350 }
1351 
1352 
1353 void
1355  // hide frame
1356  GNEFrame::hide();
1357 }
1358 
1359 
1360 bool
1361 GNETAZFrame::processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) {
1362  // Declare map to keep values
1363  std::map<SumoXMLAttr, std::string> valuesOfElement;
1364  if (myDrawingShape->isDrawing()) {
1365  // add or delete a new point depending of flag "delete last created point"
1368  } else {
1369  myDrawingShape->addNewPoint(clickedPosition);
1370  }
1371  return true;
1372  } else if ((myTAZCurrent->getTAZ() == nullptr) || (objectsUnderCursor.getTAZFront() && myTAZCurrent->getTAZ() && !myTAZSaveChanges->isChangesPending())) {
1373  // if user click over an TAZ and there isn't changes pending, then select a new TAZ
1374  if (objectsUnderCursor.getTAZFront()) {
1375  // avoid reset of Frame if user doesn't click over an TAZ
1376  myTAZCurrent->setTAZ(objectsUnderCursor.getTAZFront());
1377  return true;
1378  } else {
1379  return false;
1380  }
1381  } else if (objectsUnderCursor.getEdgeFront()) {
1382  // if toogle Edge is enabled, select edge. In other case create two new TAZSource/Sinks
1384  // create new TAZSource/Sinks or delete it
1385  return addOrRemoveTAZMember(objectsUnderCursor.getEdgeFront());
1386  } else {
1387  // first check if clicked edge was previously selected
1388  if (myTAZSelectionStatistics->isEdgeSelected(objectsUnderCursor.getEdgeFront())) {
1389  // clear selected edges
1391  } else {
1392  // iterate over TAZEdges saved in TAZCurrent (it contains the Edge and Source/sinks)
1393  for (const auto& i : myTAZCurrent->getTAZEdges()) {
1394  if (i.edge == objectsUnderCursor.getEdgeFront()) {
1395  // clear current selection (to avoid having two or more edges selected at the same time using mouse clicks)
1397  // now select edge
1399  // edge selected, then return true
1400  return true;
1401  }
1402  }
1403  }
1404  // edge wasn't selected, then return false
1405  return false;
1406  }
1407  } else {
1408  // nothing to do
1409  return false;
1410  }
1411 }
1412 
1413 
1414 void
1415 GNETAZFrame::processEdgeSelection(const std::vector<GNEEdge*>& edges) {
1416  // first check that a TAZ is selected
1417  if (myTAZCurrent->getTAZ()) {
1418  // if "toogle Membership" is enabled, create new TAZSources/sinks. In other case simply select edges
1420  // iterate over edges
1421  for (auto i : edges) {
1422  // first check if edge owns a TAZEge
1423  if (myTAZCurrent->isTAZEdge(i) == false) {
1424  // create new TAZ Sources/Sinks
1426  }
1427  }
1428  } else {
1429  // iterate over edges
1430  for (auto i : edges) {
1431  // first check that selected edge isn't already selected
1433  // iterate over TAZEdges saved in TAZCurrent (it contains the Edge and Source/sinks)
1434  for (const auto& j : myTAZCurrent->getTAZEdges()) {
1435  if (j.edge == i) {
1437  }
1438  }
1439  }
1440  }
1441  }
1442  }
1443 }
1444 
1445 
1448  return myDrawingShape;
1449 }
1450 
1451 
1454  return myTAZCurrent;
1455 }
1456 
1457 
1460  return myTAZSelectionStatistics;
1461 }
1462 
1463 
1466  return myTAZSaveChanges;
1467 }
1468 
1469 
1470 bool
1472  // show warning dialogbox and stop check if input parameters are valid
1474  return false;
1475  } else if (myDrawingShape->getTemporalShape().size() == 0) {
1476  WRITE_WARNING("TAZ shape cannot be empty");
1477  return false;
1478  } else {
1479  // Declare map to keep TAZ Parameters values
1480  std::map<SumoXMLAttr, std::string> valuesOfElement = myTAZParameters->getAttributesAndValues();
1481 
1482  // obtain Netedit attributes
1483  myNeteditAttributes->getNeteditAttributesAndValues(valuesOfElement, nullptr);
1484 
1485  // generate new ID
1487 
1488  // obtain shape and close it
1490  shape.closePolygon();
1491  valuesOfElement[SUMO_ATTR_SHAPE] = toString(shape);
1492 
1493  // check if TAZ has to be created with edges
1495  std::vector<std::string> edgeIDs;
1496  auto ACsInBoundary = myViewNet->getAttributeCarriersInBoundary(shape.getBoxBoundary(), true);
1497  for (auto i : ACsInBoundary) {
1498  if (i.second->getTagProperty().getTag() == SUMO_TAG_EDGE) {
1499  edgeIDs.push_back(i.first);
1500  }
1501  }
1502  valuesOfElement[SUMO_ATTR_EDGES] = toString(edgeIDs);
1503  } else {
1504  // TAZ is created without edges
1505  valuesOfElement[SUMO_ATTR_EDGES] = "";
1506  }
1507  // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes
1508  SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesOfElement, getPredefinedTagsMML(), toString(SUMO_TAG_TAZ));
1509  // return true if TAZ was successfully created
1510  return GNEAdditionalHandler::buildAdditional(myViewNet, true, SUMO_TAG_TAZ, SUMOSAXAttrs, nullptr);
1511  }
1512 }
1513 
1514 
1515 bool
1517  // first check if edge exist;
1518  if (edge) {
1519  // first check if already exist (in this case, remove it)
1520  for (const auto& i : myTAZCurrent->getTAZEdges()) {
1521  if (i.edge == edge) {
1522  // enable save changes button
1524  // remove Source and Sinks using GNEChange_Additional
1525  myViewNet->getUndoList()->add(new GNEChange_Additional(i.TAZSource, false), true);
1526  myViewNet->getUndoList()->add(new GNEChange_Additional(i.TAZSink, false), true);
1527  // always refresh TAZ Edges after removing TAZSources/Sinks
1529  // update select edges button
1531  return true;
1532  }
1533  }
1534  // if wasn't found, then add it
1536  // create TAZ Sink using GNEChange_Additional and value of TAZChild default parameters
1538  myViewNet->getUndoList()->add(new GNEChange_Additional(TAZSource, true), true);
1539  // create TAZ Sink using GNEChange_Additional and value of TAZChild default parameters
1541  myViewNet->getUndoList()->add(new GNEChange_Additional(TAZSink, true), true);
1542  // always refresh TAZ Edges after adding TAZSources/Sinks
1544  // update selected button
1546  return true;
1547  } else {
1548  throw ProcessError("Edge cannot be null");
1549  }
1550 }
1551 
1552 
1553 void
1555  // iterate over all TAZEdges
1556  for (const auto& i : myTAZCurrent->getTAZEdges()) {
1557  // enable save changes button
1559  // remove Source and Sinks using GNEChange_Additional
1560  myViewNet->getUndoList()->add(new GNEChange_Additional(i.TAZSource, false), true);
1561  myViewNet->getUndoList()->add(new GNEChange_Additional(i.TAZSink, false), true);
1562  }
1563  // always refresh TAZ Edges after removing TAZSources/Sinks
1565 }
1566 
1567 /****************************************************************************/
double myMaxSourceMinusSinkWeight
maximum source minus sink value of current TAZ Edges
Definition: GNETAZFrame.h:143
TAZSelectionStatistics * getTAZSelectionStatisticsModul() const
get TAZ Selection Statistics modul
average sink (used only by TAZs)
TAZParameters * myTAZParameters
TAZ parameters.
Definition: GNETAZFrame.h:562
static const TagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
std::set< std::pair< std::string, GNEAttributeCarrier * > > getAttributeCarriersInBoundary(const Boundary &boundary, bool forceSelectEdges=false)
get AttributeCarriers in Boundary
Definition: GNEViewNet.cpp:299
static RGBColor parseColor(std::string coldef)
Parses a color information.
Definition: RGBColor.cpp:177
GNETAZ * getTAZ() const
get current TAZ
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:1020
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
Definition: GUIDesigns.h:69
GNETAZ * getTAZFront() const
get front TAZ (or a pointer to nullptr if there isn&#39;t)
a source within a district (connection road)
TAZChildDefaultParameters * myTAZChildDefaultParameters
TAZ child defaults parameters.
Definition: GNETAZFrame.h:574
void hide()
hide TAZ frame
FXTextField * myTextFieldTAZSinkWeight
textField for TAZ Sink weight
Definition: GNETAZFrame.h:375
struct for edges and the source/sink colors
Definition: GNETAZFrame.h:50
TAZEdgesGraphic()
FOX needs this.
Definition: GNETAZFrame.h:479
void update() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:292
double getDepartWeight() const
get depart weight
FXHorizontalFrame * myTAZSinkFrame
Horizontal Frame for default TAZ Sink Weight.
Definition: GNETAZFrame.h:372
void showTAZParametersModul()
show TAZ parameters and set the default value of parameters
bool unselectEdge(GNEEdge *edge)
un select an edge (and their TAZ Children)
void hideTAZSelectionStatisticsModul()
hide TAZ Selection Statistics Modul
static const RGBColor WHITE
Definition: RGBColor.h:197
bool isDrawing() const
return true if currently a shape is drawed
FXButton * myCancelChangesButton
FXButton for cancel changes in TAZEdges
Definition: GNETAZFrame.h:228
FXLabel * myStatisticsLabel
Statistics labels.
Definition: GNETAZFrame.h:177
a traffic assignment zone
FXRadioButton * myColorBySourceMinusSinkWeight
add radio button "color source - Sink"
Definition: GNETAZFrame.h:495
FXHorizontalFrame * myTAZSourceFrame
Horizontal Frame for default TAZ Source Weight.
Definition: GNETAZFrame.h:366
bool getDeleteLastCreatedPoint()
get flag delete last created point
TAZEdgesGraphic * myTAZEdgesGraphic
TAZ Edges Graphic.
Definition: GNETAZFrame.h:580
void updateStatistics()
update Statistics label
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:108
GNEFrameModuls::DrawingShape * getDrawingShapeModul() const
get drawing mode modul
void hideTAZCommonStatisticsModul()
hide TAZ Common Statistics Modul
GNETAZSourceSink * TAZSink
sink TAZ
Definition: GNETAZFrame.h:67
bool getToggleMembership() const
check if toggle membership is enabled
void showDrawingShape()
show Drawing mode
void addNewPoint(const Position &P)
add new point to temporal shape
TAZSelectionStatistics()
FOX needs this.
Definition: GNETAZFrame.h:356
void hideTAZSaveChangesModul()
hide TAZ Save Changes Modul
Color of TAZSources/TAZSinks.
long onCmdUseSelectedEdges(FXObject *obj, FXSelector, void *)
Called when the user press use selected edges.
void removeLastPoint()
remove last added point
std::vector< RGBColor > myScaleColors
vector wit the scale colors
Definition: GNETAZFrame.h:498
TAZCurrent * getTAZCurrentModul() const
get Current TAZ modul
~GNETAZFrame()
Destructor.
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...
Definition: GNEUndoList.cpp:73
void hideNeteditAttributesModul()
hide Netedit attributes modul
void clearSelectedEdges()
clear current TAZ children
void showTAZChildDefaultParametersModul()
show TAZ child default parameters Modul
void processEdgeSelection(const std::vector< GNEEdge *> &edges)
process selection of edges in view net
max source (used only by TAZs)
int sourceColor
color by source [0-9]
Definition: GNETAZFrame.h:70
Encapsulated Xerces-SAX-attributes.
const std::vector< TAZCurrent::TAZEdge > & getEdgeAndTAZChildrenSelected() const
get map with edge and TAZChildren
void addTAZChild(GNETAZSourceSink *additional)
add TAZChild
min sink (used only by TAZs)
FXButton * myUseSelectedEdges
button for use selected edges
Definition: GNETAZFrame.h:297
void hideTAZParametersModul()
hide TAZ parameters
static bool buildAdditional(GNEViewNet *viewNet, bool allowUndoRedo, SumoXMLTag tag, const SUMOSAXAttributes &attrs, HierarchyInsertedAdditionals *insertedAdditionals)
Build additionals.
FXCheckButton * myToggleMembership
CheckButton to enable or disable Toggle edge Membership.
Definition: GNETAZFrame.h:282
bool shapeDrawed()
build a shaped element using the drawed shape return true if was sucesfully created ...
const std::vector< GNEAdditional * > & getAdditionalChildren() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
FXTextField * myTextFieldColor
textField to modify the default value of color parameter
Definition: GNETAZFrame.h:438
const std::map< int, std::string > & getPredefinedTagsMML() const
get predefinedTagsMML
Definition: GNEFrame.cpp:276
long onCmdSetAttribute(FXObject *, FXSelector, void *)
Called when user set a value.
double myDefaultTAZSinkWeight
default TAZSink weight
Definition: GNETAZFrame.h:306
bool isChangesPending() const
return true if there is changes to save
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:239
long onCmdSetDefaultValues(FXObject *obj, FXSelector, void *)
void enableButtonsAndBeginUndoList()
enable buttons save and cancel changes (And begin Undo List)
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:120
TAZChildDefaultParameters()
FOX needs this.
Definition: GNETAZFrame.h:275
void hideDrawingShape()
hide Drawing mode
GNETAZFrame * myTAZFrameParent
pointer to GNETAZFrame parent
Definition: GNETAZFrame.h:432
void showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties &tagValue)
show Netedit attributes modul
long onCmdSetNewValues(FXObject *obj, FXSelector, void *)
const std::vector< GNEEdge * > & getSelectedEdges() const
get current selected edges
FXLabel * myStatisticsLabel
Statistics labels.
Definition: GNETAZFrame.h:378
int sourceMinusSinkColor
color by source - sink [0-9]
Definition: GNETAZFrame.h:79
void showTAZSelectionStatisticsModul()
show TAZ Selection Statistics Modul
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:933
bool addOrRemoveTAZMember(GNEEdge *edge)
add or remove a TAZSource and a TAZSink, or remove it if edge is in the list of TAZ Children ...
double myMinSourceMinusSinkWeight
minimum source minus sink value of current TAZ Edges
Definition: GNETAZFrame.h:146
set type of selection
Definition: GUIAppEnum.h:493
min source (used only by TAZs)
std::vector< TAZEdge > myTAZEdges
vector with TAZ&#39;s edges
Definition: GNETAZFrame.h:131
#define GUIDesignTextField
Definition: GUIDesigns.h:34
the edges of a route
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
double myMinSourcePlusSinkWeight
minimum source plus sink value of current TAZ Edges
Definition: GNETAZFrame.h:140
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:123
max sink (used only by TAZs)
double myMaxSourcePlusSinkWeight
maximum source plus sink value of current TAZ Edges
Definition: GNETAZFrame.h:137
RGBColor myEdgeDefaultColor
default RGBColor for all edges
Definition: GNETAZFrame.h:501
help button
Definition: GUIAppEnum.h:536
void dropTAZMembers()
drop all TAZSources and TAZ Sinks of current TAZ
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
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.
Definition: GNEUndoList.cpp:80
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:131
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
Definition: GNETAZFrame.h:279
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
Definition: GUIDesigns.h:289
A list of positions.
FXButton * myColorEditor
Button for open color editor.
Definition: GNETAZFrame.h:435
void showTAZEdgesGraphicModul()
show TAZ Edges Graphic Modul
GNETAZFrame * myTAZFrameParent
pointer to TAZ Frame
Definition: GNETAZFrame.h:119
int sourcePlusSinkColor
color by source + sink [0-9]
Definition: GNETAZFrame.h:76
TAZSelectionStatistics * myTAZSelectionStatistics
TAZ Edges selection parameters.
Definition: GNETAZFrame.h:577
std::string getAttribute(SumoXMLAttr key) const
Definition: GNETAZ.cpp:346
TAZCurrent * myTAZCurrentParent
pointer to TAZCurrentParent
Definition: GNETAZFrame.h:83
TAZSaveChanges()
FOX needs this.
Definition: GNETAZFrame.h:218
long onCmdSaveChanges(FXObject *, FXSelector, void *)
FXRadioButton * myColorBySourceWeight
add radio button "color by source"
Definition: GNETAZFrame.h:486
const std::vector< GNEEdge * > & getNetEdges() const
get current net edges
bool isCurrentParametersValid() const
check if current parameters are valid
class used to group all variables related with objects under cursor after a click over view ...
long onCmdSetColorAttribute(FXObject *, FXSelector, void *)
FXDEFMAP(GNETAZFrame::TAZParameters) TAZParametersMap[]
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
Definition: GNETAZFrame.h:174
attribute edited trought dialog
Definition: GUIAppEnum.h:645
Definition: GNETAZ.h:35
long onCmdChoosenBy(FXObject *obj, FXSelector, void *)
void hideTAZChildDefaultParametersModul()
hide TAZ child default parameters Modul
GNEEdge * edge
TAZ edge.
Definition: GNETAZFrame.h:61
edge: the shape in xml-definition
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn&#39;t)
FXHorizontalFrame * myDefaultTAZSourceFrame
Horizontal Frame for default TAZ Source Weight.
Definition: GNETAZFrame.h:285
const std::string getID() const
function to support debugging
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
void refreshTAZEdges()
refresh TAZEdges
FXCheckButton * myAddEdgesWithinCheckButton
CheckButton to enable or disable use edges within TAZ after creation.
Definition: GNETAZFrame.h:441
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
Definition: GNETAZFrame.h:483
FXTextField * myTextFieldDefaultValueTAZSources
textField to set a default value for TAZ Sources
Definition: GNETAZFrame.h:288
#define GUIDesignLabelCenter
label extended over frame without thick and with text justify to center and height of 23 ...
Definition: GUIDesigns.h:171
void hideTAZEdgesGraphicModul()
hide TAZ Edges Graphic Modul
TAZSaveChanges * myTAZSaveChanges
save TAZ Edges
Definition: GNETAZFrame.h:571
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:210
void updateEdgeColors()
update edge colors;
void p_abort()
reverts and discards ALL active command groups
Definition: GNEUndoList.cpp:94
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons) ...
Definition: GUIDesigns.h:72
bool isTAZEdge(GNEEdge *edge) const
check if given edge belongs to current TAZ
int sinkColor
color by sink [0-9]
Definition: GNETAZFrame.h:73
void updateStatistics()
update TAZSelectionStatistics
FXButton * myHelpTAZAttribute
button for help
Definition: GNETAZFrame.h:444
const PositionVector & getTemporalShape() const
get Temporal shape
begin/end of the description of an edge
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
Definition: GNETAZFrame.h:222
select element
Definition: GUIAppEnum.h:633
GNEFrameModuls::DrawingShape * myDrawingShape
Drawing shape.
Definition: GNETAZFrame.h:568
long onCmdHelp(FXObject *, FXSelector, void *)
Called when help button is pressed.
bool selectEdge(const TAZCurrent::TAZEdge &edge)
add an edge and their TAZ Children in the list of selected items
bool getNeteditAttributesAndValues(std::map< SumoXMLAttr, std::string > &valuesMap, const GNELane *lane) const
fill valuesMap with netedit attributes
const std::vector< TAZCurrent::TAZEdge > & getTAZEdges() const
get TAZEdges
#define GUIDesignLabelCenterThick
label extended over frame with thick and with text justify to center and height of 23 ...
Definition: GUIDesigns.h:183
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
FXHorizontalFrame * myDefaultTAZSinkFrame
Horizontal Frame for default TAZ Sink Weight.
Definition: GNETAZFrame.h:291
std::map< SumoXMLAttr, std::string > getAttributesAndValues() const
get a map with attributes and their values
~TAZEdge()
destructor (needed because RGBColors has to be deleted)
Definition: GNETAZFrame.cpp:95
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:58
void setTAZ(GNETAZ *editedTAZ)
set current TAZ
double myDefaultTAZSourceWeight
default TAZSource weight
Definition: GNETAZFrame.h:303
GNETAZFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
double getDefaultTAZSourceWeight() const
get default TAZSource weight
RGBColor myEdgeSelectedColor
RGBColor color for selected egdes.
Definition: GNETAZFrame.h:504
#define GUIDesignButton
Definition: GUIDesigns.h:66
void showTAZCommonStatisticsModul()
show TAZ Common Statistics Modul
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
Definition: GNENet.cpp:2256
virtual void show()
show Frame
Definition: GNEFrame.cpp:108
a sink within a district (connection road)
FXLabel * myInformationLabel
information label
Definition: GNETAZFrame.h:300
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1151
std::vector< TAZCurrent::TAZEdge > myEdgeAndTAZChildrenSelected
vector with the current selected edges and their associated children
Definition: GNETAZFrame.h:381
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:255
bool isAddEdgesWithinEnabled() const
check if edges within has to be used after TAZ Creation
GNETAZSourceSink * TAZSource
source TAZ
Definition: GNETAZFrame.h:64
TAZCurrent * myTAZCurrent
current TAZ
Definition: GNETAZFrame.h:556
FXTextField * myTextFieldTAZSourceWeight
textField for TAZ Source weight
Definition: GNETAZFrame.h:369
element is selected
TAZCommonStatistics(GNETAZFrame *TAZFrameParent)
constructor
TAZSaveChanges * getTAZSaveChangesModul() const
get TAZ Save Changes modul
FXRadioButton * myColorBySourcePlusSinkWeight
add radio button "color source + sink"
Definition: GNETAZFrame.h:492
TAZCurrent(GNETAZFrame *TAZFrameParent)
constructor
Ok-button pressed.
Definition: GUIAppEnum.h:213
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:117
TAZParameters()
FOX needs this.
Definition: GNETAZFrame.h:428
Cancel-button pressed.
Definition: GUIAppEnum.h:215
GNETAZ * myEditedTAZ
current edited TAZ
Definition: GNETAZFrame.h:122
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:927
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to doubles/floats
Definition: GUIDesigns.h:40
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:114
FXButton * mySaveChangesButton
FXButton for save changes in TAZEdges
Definition: GNETAZFrame.h:225
void updateColors()
update colors
Definition: GNETAZFrame.cpp:99
attribute edited
Definition: GUIAppEnum.h:619
average source (used only by TAZs)
FXRadioButton * myColorBySinkWeight
add radio button "color by sink"
Definition: GNETAZFrame.h:489
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
void openHelpAttributesDialog(const GNEAttributeCarrier::TagProperties &tagProperties) const
Open help attributes dialog.
Definition: GNEFrame.cpp:197
void updateSelectEdgesButton()
update "select edges button"
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
long onCmdSelectEdges(FXObject *obj, FXSelector, void *)
Called when the user press select edges.
void showTAZSaveChangesModul()
show TAZ Save Changes Modul
std::vector< GNEEdge * > mySelectedEdges
vector with pointers to selected edges
Definition: GNETAZFrame.h:128
#define GUIDesignLabelLeft
Definition: GUIDesigns.h:165
double getDefaultTAZSinkWeight() const
default TAZSink weight
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame and height of 23
Definition: GUIDesigns.h:186
#define GUIDesignRadioButton
Definition: GUIDesigns.h:155
FXLabel * myTAZCurrentLabel
Label for current TAZ.
Definition: GNETAZFrame.h:134
long onCmdCancelChanges(FXObject *, FXSelector, void *)
Called when the user press the button cancel changes.
void closePolygon()
ensures that the last position equals the first
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
Definition: GNETAZFrame.h:363
TAZCommonStatistics * myTAZCommonStatistics
TAZ Edges common parameters.
Definition: GNETAZFrame.h:559
A color information.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
GNEFrameAttributesModuls::NeteditAttributes * myNeteditAttributes
Netedit parameter.
Definition: GNETAZFrame.h:565
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:247
FXTextField * myTextFieldDefaultValueTAZSinks
textField to set a default value for TAZ Sinks
Definition: GNETAZFrame.h:294
std::vector< GNEEdge * > myNetEdges
vector with pointers to edges (it&#39;s used to avoid slowdowns during Source/Sinks manipulations) ...
Definition: GNETAZFrame.h:125
bool isEdgeSelected(GNEEdge *edge)
check if an edge is selected
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet