SUMO - Simulation of Urban MObility
GNETAZFrame.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2018 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 #ifndef GNETAZFrame_h
18 #define GNETAZFrame_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include "GNEFrame.h"
25 
26 
27 // ===========================================================================
28 // class definitions
29 // ===========================================================================
34 class GNETAZFrame : public GNEFrame {
35 
36 public:
37  // ===========================================================================
38  // class TAZCurrent
39  // ===========================================================================
40 
41  class TAZCurrent : protected FXGroupBox {
42 
43  public:
45  struct TAZEdge {
47  TAZEdge(TAZCurrent* TAZCurrentParent, GNEEdge* _edge, GNEAdditional *_TAZSource, GNEAdditional *_TAZSink);
48 
50  ~TAZEdge();
51 
53  void updateColors();
54 
57 
60 
63 
66 
68  int sinkColor;
69 
72 
75 
76  private:
79  };
80 
82  TAZCurrent(GNETAZFrame* TAZFrameParent);
83 
85  ~TAZCurrent();
86 
88  void setTAZ(GNETAZ* editedTAZ);
89 
91  GNETAZ* getTAZ() const;
92 
94  bool isTAZEdge(GNEEdge* edge) const;
95 
97  const std::vector<GNEEdge*> &getNetEdges() const;
98 
100  const std::vector<GNEEdge*> &getSelectedEdges() const;
101 
103  const std::vector<TAZCurrent::TAZEdge> &getTAZEdges() const;
104 
106  void refreshTAZEdges();
107 
108  protected:
110  void addTAZChild(GNEAdditional *additional);
111 
112  private:
115 
118 
120  std::vector<GNEEdge*> myNetEdges;
121 
123  std::vector<GNEEdge*> mySelectedEdges;
124 
126  std::vector<TAZEdge> myTAZEdges;
127 
130 
133 
136 
139 
142  };
143 
144  // ===========================================================================
145  // class TAZCommonStatistics
146  // ===========================================================================
147 
148  class TAZCommonStatistics : protected FXGroupBox {
149 
150  public:
152  TAZCommonStatistics(GNETAZFrame* TAZFrameParent);
153 
156 
158  void showTAZCommonStatisticsModul();
159 
161  void hideTAZCommonStatisticsModul();
162 
163  protected:
165  void updateStatistics();
166 
167  private:
170 
173  };
174 
175  // ===========================================================================
176  // class TAZSaveChanges
177  // ===========================================================================
178 
179  class TAZSaveChanges : protected FXGroupBox {
181  FXDECLARE(GNETAZFrame::TAZSaveChanges)
182 
183  public:
185  TAZSaveChanges(GNETAZFrame* TAZFrameParent);
186 
188  ~TAZSaveChanges();
189 
191  void showTAZSaveChangesModul();
192 
194  void hideTAZSaveChangesModul();
195 
197  void enableButtonsAndBeginUndoList();
198 
200  bool isChangesPending() const;
201 
205  long onCmdSaveChanges(FXObject*, FXSelector, void*);
206 
208  long onCmdCancelChanges(FXObject*, FXSelector, void*);
210 
211  protected:
214 
215  private:
218 
221 
224  };
225 
226  // ===========================================================================
227  // class TAZChildDefaultParameters
228  // ===========================================================================
229 
230  class TAZChildDefaultParameters : protected FXGroupBox {
233 
234  public:
236  TAZChildDefaultParameters(GNETAZFrame* TAZFrameParent);
237 
240 
242  void showTAZChildDefaultParametersModul();
243 
245  void hideTAZChildDefaultParametersModul();
246 
248  void updateSelectEdgesButton();
249 
251  double getDefaultTAZSourceWeight() const;
252 
254  double getDefaultTAZSinkWeight() const;
255 
257  bool getToggleMembership() const;
258 
262  long onCmdSetDefaultValues(FXObject* obj, FXSelector, void*);
263 
265  long onCmdUseSelectedEdges(FXObject* obj, FXSelector, void*);
267 
268  protected:
271 
272  private:
275 
277  FXCheckButton* myToggleMembership;
278 
280  FXHorizontalFrame* myDefaultTAZSourceFrame;
281 
284 
286  FXHorizontalFrame* myDefaultTAZSinkFrame;
287 
290 
293 
296 
299 
302  };
303 
304  // ===========================================================================
305  // class TAZSelectionStatistics
306  // ===========================================================================
307 
308  class TAZSelectionStatistics : protected FXGroupBox {
311 
312  public:
314  TAZSelectionStatistics(GNETAZFrame* TAZFrameParent);
315 
318 
320  void showTAZSelectionStatisticsModul();
321 
323  void hideTAZSelectionStatisticsModul();
324 
326  bool selectEdge(const TAZCurrent::TAZEdge &edge);
327 
329  bool unselectEdge(GNEEdge* edge);
330 
332  bool isEdgeSelected(GNEEdge* edge);
333 
335  void clearSelectedEdges();
336 
338  const std::vector<TAZCurrent::TAZEdge> &getEdgeAndTAZChildsSelected() const;
339 
343  long onCmdSetNewValues(FXObject* obj, FXSelector, void*);
344 
346  long onCmdSelectEdges(FXObject* obj, FXSelector, void*);
348 
349  protected:
352 
354  void updateStatistics();
355 
356  private:
359 
361  FXHorizontalFrame* myTAZSourceFrame;
362 
365 
367  FXHorizontalFrame* myTAZSinkFrame;
368 
371 
374 
376  std::vector<TAZCurrent::TAZEdge> myEdgeAndTAZChildsSelected;
377  };
378 
379  // ===========================================================================
380  // class TAZParameters
381  // ===========================================================================
382 
383  class TAZParameters : protected FXGroupBox {
385  FXDECLARE(GNETAZFrame::TAZParameters)
386 
387  public:
389  TAZParameters(GNETAZFrame* TAZFrameParent);
390 
392  ~TAZParameters();
393 
395  void showTAZParametersModul();
396 
398  void hideTAZParametersModul();
399 
401  bool isCurrentParametersValid() const;
402 
404  bool isAddEdgesWithinEnabled() const;
405 
407  std::map<SumoXMLAttr, std::string> getAttributesAndValues() const;
408 
412  long onCmdSetColorAttribute(FXObject*, FXSelector, void*);
413 
415  long onCmdSetAttribute(FXObject*, FXSelector, void*);
416 
418  long onCmdHelp(FXObject*, FXSelector, void*);
420 
421  protected:
424 
425  private:
428 
430  FXButton* myColorEditor;
431 
433  FXTextField* myTextFieldColor;
434 
437 
440  };
441 
442  // ===========================================================================
443  // class TAZEdgesGraphic
444  // ===========================================================================
445 
446  class TAZEdgesGraphic : protected FXGroupBox {
449 
450  public:
452  TAZEdgesGraphic(GNETAZFrame* TAZFrameParent);
453 
455  ~TAZEdgesGraphic();
456 
458  void showTAZEdgesGraphicModul();
459 
461  void hideTAZEdgesGraphicModul();
462 
464  void updateEdgeColors();
465 
469  long onCmdChoosenBy(FXObject* obj, FXSelector, void*);
471 
472  protected:
475 
476  private:
479 
481  FXRadioButton* myColorBySourceWeight;
482 
484  FXRadioButton* myColorBySinkWeight;
485 
488 
491 
493  std::vector<RGBColor> myScaleColors;
494 
497 
500  };
501 
506  GNETAZFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet);
507 
509  ~GNETAZFrame();
510 
512  void hide();
513 
519  bool processClick(const Position& clickedPosition, const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor);
520 
522  void processEdgeSelection(const std::vector<GNEEdge*>& edges);
523 
526 
529 
532 
535 
536 protected:
541  bool buildShape();
542 
545 
547  void dropTAZMembers();
548 
549 private:
552 
555 
558 
560  NeteditAttributes* myNeteditAttributes;
561 
564 
567 
570 
573 
576 };
577 
578 
579 #endif
580 
581 /****************************************************************************/
double myMaxSourceMinusSinkWeight
maximum source minus sink value of current TAZ Edges
Definition: GNETAZFrame.h:138
TAZSelectionStatistics * getTAZSelectionStatisticsModul() const
get TAZ Selection Statistics modul
TAZParameters * myTAZParameters
TAZ parameters.
Definition: GNETAZFrame.h:557
GNEAdditional * TAZSource
source TAZ
Definition: GNETAZFrame.h:59
GNETAZ * getTAZ() const
get current TAZ
TAZChildDefaultParameters * myTAZChildDefaultParameters
TAZ child defaults parameters.
Definition: GNETAZFrame.h:569
void hide()
hide TAZ frame
FXTextField * myTextFieldTAZSinkWeight
textField for TAZ Sink weight
Definition: GNETAZFrame.h:370
struct for edges and the source/sink colors
Definition: GNETAZFrame.h:45
TAZEdgesGraphic()
FOX needs this.
Definition: GNETAZFrame.h:474
FXHorizontalFrame * myTAZSinkFrame
Horizontal Frame for default TAZ Sink Weight.
Definition: GNETAZFrame.h:367
FXButton * myCancelChangesButton
FXButton for cancel changes in TAZEdges
Definition: GNETAZFrame.h:223
FXLabel * myStatisticsLabel
Statistics labels.
Definition: GNETAZFrame.h:172
FXRadioButton * myColorBySourceMinusSinkWeight
add radio button "color source - Sink"
Definition: GNETAZFrame.h:490
FXHorizontalFrame * myTAZSourceFrame
Horizontal Frame for default TAZ Source Weight.
Definition: GNETAZFrame.h:361
TAZEdgesGraphic * myTAZEdgesGraphic
TAZ Edges Graphic.
Definition: GNETAZFrame.h:575
TAZEdge(TAZCurrent *TAZCurrentParent, GNEEdge *_edge, GNEAdditional *_TAZSource, GNEAdditional *_TAZSink)
constructor
Definition: GNETAZFrame.cpp:84
TAZSelectionStatistics()
FOX needs this.
Definition: GNETAZFrame.h:351
std::vector< RGBColor > myScaleColors
vector wit the scale colors
Definition: GNETAZFrame.h:493
TAZCurrent * getTAZCurrentModul() const
get Current TAZ modul
~GNETAZFrame()
Destructor.
void processEdgeSelection(const std::vector< GNEEdge *> &edges)
process selection of edges in view net
int sourceColor
color by source [0-9]
Definition: GNETAZFrame.h:65
FXButton * myUseSelectedEdges
button for use selected edges
Definition: GNETAZFrame.h:292
FXCheckButton * myToggleMembership
CheckButton to enable or disable Toggle edge Membership.
Definition: GNETAZFrame.h:277
FXTextField * myTextFieldColor
textField to modify the default value of color parameter
Definition: GNETAZFrame.h:433
double myDefaultTAZSinkWeight
default TAZSink weight
Definition: GNETAZFrame.h:301
TAZChildDefaultParameters()
FOX needs this.
Definition: GNETAZFrame.h:270
GNETAZFrame * myTAZFrameParent
pointer to GNETAZFrame parent
Definition: GNETAZFrame.h:427
void addTAZChild(GNEAdditional *additional)
add TAZChild
const std::vector< GNEEdge * > & getSelectedEdges() const
get current selected edges
FXLabel * myStatisticsLabel
Statistics labels.
Definition: GNETAZFrame.h:373
int sourceMinusSinkColor
color by source - sink [0-9]
Definition: GNETAZFrame.h:74
bool addOrRemoveTAZMember(GNEEdge *edge)
add or remove a TAZSource and a TAZSink, or remove it if edge is in the list of TAZ Childs ...
double myMinSourceMinusSinkWeight
minimum source minus sink value of current TAZ Edges
Definition: GNETAZFrame.h:141
std::vector< TAZEdge > myTAZEdges
vector with TAZ&#39;s edges
Definition: GNETAZFrame.h:126
double myMinSourcePlusSinkWeight
minimum source plus sink value of current TAZ Edges
Definition: GNETAZFrame.h:135
DrawingShape * getDrawingShapeModul() const
get drawing mode modul
double myMaxSourcePlusSinkWeight
maximum source plus sink value of current TAZ Edges
Definition: GNETAZFrame.h:132
RGBColor myEdgeDefaultColor
default RGBColor for all edges
Definition: GNETAZFrame.h:496
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
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
Definition: GNETAZFrame.h:274
FXButton * myColorEditor
Button for open color editor.
Definition: GNETAZFrame.h:430
GNETAZFrame * myTAZFrameParent
pointer to TAZ Frame
Definition: GNETAZFrame.h:114
int sourcePlusSinkColor
color by source + sink [0-9]
Definition: GNETAZFrame.h:71
TAZSelectionStatistics * myTAZSelectionStatistics
TAZ Edges selection parameters.
Definition: GNETAZFrame.h:572
TAZCurrent * myTAZCurrentParent
pointer to TAZCurrentParent
Definition: GNETAZFrame.h:78
TAZSaveChanges()
FOX needs this.
Definition: GNETAZFrame.h:213
FXRadioButton * myColorBySourceWeight
add radio button "color by source"
Definition: GNETAZFrame.h:481
const std::vector< GNEEdge * > & getNetEdges() const
get current net edges
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
Definition: GNETAZFrame.h:169
Definition: GNETAZ.h:35
GNEEdge * edge
TAZ edge.
Definition: GNETAZFrame.h:56
FXHorizontalFrame * myDefaultTAZSourceFrame
Horizontal Frame for default TAZ Source Weight.
Definition: GNETAZFrame.h:280
bool processClick(const Position &clickedPosition, const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
NeteditAttributes * myNeteditAttributes
Netedit parameter.
Definition: GNETAZFrame.h:560
void refreshTAZEdges()
refresh TAZEdges
FXCheckButton * myAddEdgesWithinCheckButton
CheckButton to enable or disable use edges within TAZ after creation.
Definition: GNETAZFrame.h:436
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
Definition: GNETAZFrame.h:478
FXTextField * myTextFieldDefaultValueTAZSources
textField to set a default value for TAZ Sources
Definition: GNETAZFrame.h:283
TAZSaveChanges * myTAZSaveChanges
save TAZ Edges
Definition: GNETAZFrame.h:566
GNEAdditional * TAZSink
sink TAZ
Definition: GNETAZFrame.h:62
bool isTAZEdge(GNEEdge *edge) const
check if given edge belongs to current TAZ
int sinkColor
color by sink [0-9]
Definition: GNETAZFrame.h:68
FXButton * myHelpTAZAttribute
button for help
Definition: GNETAZFrame.h:439
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
Definition: GNETAZFrame.h:217
std::vector< TAZCurrent::TAZEdge > myEdgeAndTAZChildsSelected
vector with the current selected edges and their associated childs
Definition: GNETAZFrame.h:376
const std::vector< TAZCurrent::TAZEdge > & getTAZEdges() const
get TAZEdges
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
FXHorizontalFrame * myDefaultTAZSinkFrame
Horizontal Frame for default TAZ Sink Weight.
Definition: GNETAZFrame.h:286
~TAZEdge()
destructor (needed because RGBColors has to be deleted)
Definition: GNETAZFrame.cpp:96
void setTAZ(GNETAZ *editedTAZ)
set current TAZ
double myDefaultTAZSourceWeight
default TAZSource weight
Definition: GNETAZFrame.h:298
GNETAZFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
RGBColor myEdgeSelectedColor
RGBColor color for selected egdes.
Definition: GNETAZFrame.h:499
FXLabel * myInformationLabel
information label
Definition: GNETAZFrame.h:295
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
TAZCurrent * myTAZCurrent
current TAZ
Definition: GNETAZFrame.h:551
FXTextField * myTextFieldTAZSourceWeight
textField for TAZ Source weight
Definition: GNETAZFrame.h:364
TAZSaveChanges * getTAZSaveChangesModul() const
get TAZ Save Changes modul
FXRadioButton * myColorBySourcePlusSinkWeight
add radio button "color source + sink"
Definition: GNETAZFrame.h:487
TAZCurrent(GNETAZFrame *TAZFrameParent)
constructor
TAZParameters()
FOX needs this.
Definition: GNETAZFrame.h:423
GNETAZ * myEditedTAZ
current edited TAZ
Definition: GNETAZFrame.h:117
FXButton * mySaveChangesButton
FXButton for save changes in TAZEdges
Definition: GNETAZFrame.h:220
void updateColors()
update colors
FXRadioButton * myColorBySinkWeight
add radio button "color by sink"
Definition: GNETAZFrame.h:484
std::vector< GNEEdge * > mySelectedEdges
vector with pointers to selected edges
Definition: GNETAZFrame.h:123
DrawingShape * myDrawingShape
Drawing shape.
Definition: GNETAZFrame.h:563
FXLabel * myTAZCurrentLabel
Label for current TAZ.
Definition: GNETAZFrame.h:129
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
Definition: GNETAZFrame.h:358
TAZCommonStatistics * myTAZCommonStatistics
TAZ Edges common parameters.
Definition: GNETAZFrame.h:554
bool buildShape()
build a shaped element using the drawed shape return true if was sucesfully created ...
FXTextField * myTextFieldDefaultValueTAZSinks
textField to set a default value for TAZ Sinks
Definition: GNETAZFrame.h:289
std::vector< GNEEdge * > myNetEdges
vector with pointers to edges (it&#39;s used to avoid slowdowns during Source/Sinks manipulations) ...
Definition: GNETAZFrame.h:120