Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNETAZFrame.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// The Widget for add TAZ elements
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
25
26
27// ===========================================================================
28// class definitions
29// ===========================================================================
30class GNETAZ;
32
33
34// ===========================================================================
35// class definitions
36// ===========================================================================
41class GNETAZFrame : public GNEFrame {
42
43public:
44 // ===========================================================================
45 // class CurrentTAZ
46 // ===========================================================================
47
49
50 public:
53
54 public:
56 TAZEdgeColor(CurrentTAZ* CurrentTAZParent, GNEEdge* _edge, GNETAZSourceSink* _source, GNETAZSourceSink* _sink);
57
60
62 void updateColors();
63
66
69
72
75
78
81
84
85 private:
88
91 };
92
94 CurrentTAZ(GNETAZFrame* TAZFrameParent);
95
98
100 void setTAZ(GNETAZ* editedTAZ);
101
103 GNETAZ* getTAZ() const;
104
106 bool isTAZEdge(GNEEdge* edge) const;
107
109 const std::vector<GNEEdge*>& getSelectedEdges() const;
110
112 const std::vector<CurrentTAZ::TAZEdgeColor>& getTAZEdges() const;
113
115 void refreshTAZEdges();
116
117 protected:
119 void addTAZChild(GNETAZSourceSink* additional);
120
121 private:
124
127
129 std::vector<GNEEdge*> mySelectedEdges;
130
132 std::vector<TAZEdgeColor> myTAZEdgeColors;
133
136
139
142
145
148 };
149
150 // ===========================================================================
151 // class TAZCommonStatistics
152 // ===========================================================================
153
155
156 public:
158 TAZCommonStatistics(GNETAZFrame* TAZFrameParent);
159
162
165
168
170 void updateStatistics();
171
172 private:
175
178 };
179
180 // ===========================================================================
181 // class TAZSaveChanges
182 // ===========================================================================
183
187
188 public:
190 TAZSaveChanges(GNETAZFrame* TAZFrameParent);
191
194
197
200
203
205 bool isChangesPending() const;
206
210 long onCmdSaveChanges(FXObject*, FXSelector, void*);
211
213 long onCmdCancelChanges(FXObject*, FXSelector, void*);
215
216 protected:
217 FOX_CONSTRUCTOR(TAZSaveChanges)
218
219 private:
222
225
228 };
229
230 // ===========================================================================
231 // class TAZChildDefaultParameters
232 // ===========================================================================
233
237
238 public:
240 TAZChildDefaultParameters(GNETAZFrame* TAZFrameParent);
241
244
247
250
253
255 double getDefaultTAZSourceWeight() const;
256
258 double getDefaultTAZSinkWeight() const;
259
261 bool getToggleMembership() const;
262
266 long onCmdSetDefaultValues(FXObject* obj, FXSelector, void*);
267
269 long onCmdUseSelectedEdges(FXObject* obj, FXSelector, void*);
270
272 long onCmdSetZeroFringeProbabilities(FXObject* obj, FXSelector, void*);
274
275 protected:
277 FOX_CONSTRUCTOR(TAZChildDefaultParameters)
278
279 private:
282
284 FXCheckButton* myToggleMembership;
285
287 FXHorizontalFrame* myToggleMembershipFrame;
288
290 FXHorizontalFrame* myDefaultTAZSourceFrame;
291
294
296 FXHorizontalFrame* myDefaultTAZSinkFrame;
297
300
303
306
309
312
315 };
316
317 // ===========================================================================
318 // class TAZSelectionStatistics
319 // ===========================================================================
320
324
325 public:
327 TAZSelectionStatistics(GNETAZFrame* TAZFrameParent);
328
331
334
337
339 bool selectEdge(const CurrentTAZ::TAZEdgeColor& edge);
340
342 bool unselectEdge(GNEEdge* edge);
343
345 bool isEdgeSelected(GNEEdge* edge);
346
348 void clearSelectedEdges();
349
351 const std::vector<CurrentTAZ::TAZEdgeColor>& getEdgeAndTAZChildrenSelected() const;
352
356 long onCmdSetNewValues(FXObject* obj, FXSelector, void*);
357
359 long onCmdSelectEdges(FXObject* obj, FXSelector, void*);
361
362 protected:
363 FOX_CONSTRUCTOR(TAZSelectionStatistics)
364
365
366 void updateStatistics();
367
368 private:
371
373 FXHorizontalFrame* myTAZSourceFrame;
374
377
379 FXHorizontalFrame* myTAZSinkFrame;
380
383
386
388 std::vector<CurrentTAZ::TAZEdgeColor> myEdgeAndTAZChildrenSelected;
389 };
390
391 // ===========================================================================
392 // class TAZParameters
393 // ===========================================================================
394
398
399 public:
401 TAZParameters(GNETAZFrame* TAZFrameParent);
402
405
408
411
413 bool isCurrentParametersValid() const;
414
416 bool isAddEdgesWithinEnabled() const;
417
419 void getAttributesAndValues() const;
420
424 long onCmdSetColorAttribute(FXObject*, FXSelector, void*);
425
427 long onCmdSetAttribute(FXObject*, FXSelector, void*);
428
430 long onCmdHelp(FXObject*, FXSelector, void*);
432
433 protected:
434 FOX_CONSTRUCTOR(TAZParameters)
435
436 private:
439
442
444 FXButton* myColorEditor;
445
447 FXTextField* myTextFieldCenter;
448
450 FXCheckButton* myCheckButtonFill;
451
453 FXTextField* myTextFieldColor;
454
456 FXTextField* myTextFieldName;
457
460
463 };
464
465 // ===========================================================================
466 // class TAZEdgesGraphic
467 // ===========================================================================
468
472
473 public:
475 TAZEdgesGraphic(GNETAZFrame* TAZFrameParent);
476
479
482
485
487 void updateEdgeColors();
488
492 long onCmdChoosenBy(FXObject* obj, FXSelector, void*);
494
495 protected:
496 FOX_CONSTRUCTOR(TAZEdgesGraphic)
497
498 private:
501
503 FXRadioButton* myColorBySourceWeight;
504
506 FXRadioButton* myColorBySinkWeight;
507
510
513
516
519 };
520
525 GNETAZFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
526
528 ~GNETAZFrame();
529
531 void hide();
532
538 bool processClick(const Position& clickedPosition, const GNEViewNetHelper::ViewObjectsSelector& viewObjects);
539
541 void processEdgeSelection(const std::vector<GNEEdge*>& edges);
542
545
548
551
554
555protected:
558
563 bool shapeDrawed();
564
566 bool addOrRemoveTAZMember(GNEEdge* edge);
567
569 void dropTAZMembers();
570
571private:
574
577
580
583
586
589
592
595};
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
struct for edges and the source/sink colors
Definition GNETAZFrame.h:52
int sourcePlusSinkColor
color by source + sink [0-9]
Definition GNETAZFrame.h:80
GNETAZSourceSink * sink
@brif sink TAZ
Definition GNETAZFrame.h:71
GNETAZSourceSink * source
source TAZ
Definition GNETAZFrame.h:68
~TAZEdgeColor()
destructor (needed because RGBColors has to be deleted)
int sourceMinusSinkColor
color by source - sink [0-9]
Definition GNETAZFrame.h:83
CurrentTAZ * myCurrentTAZParent
pointer to CurrentTAZParent
Definition GNETAZFrame.h:87
int sourceColor
color by source [0-9]
Definition GNETAZFrame.h:74
int sinkColor
color by sink [0-9]
Definition GNETAZFrame.h:77
void refreshTAZEdges()
refresh TAZEdges
double myMinSourceMinusSinkWeight
minimum source minus sink value of current TAZ Edges
std::vector< GNEEdge * > mySelectedEdges
vector with pointers to selected edges
bool isTAZEdge(GNEEdge *edge) const
check if given edge belongs to current TAZ
GNETAZFrame * myTAZFrameParent
pointer to TAZ Frame
GNETAZ * myEditedTAZ
current edited TAZ
const std::vector< CurrentTAZ::TAZEdgeColor > & getTAZEdges() const
get TAZEdges
void setTAZ(GNETAZ *editedTAZ)
set current TAZ
void addTAZChild(GNETAZSourceSink *additional)
add TAZChild
const std::vector< GNEEdge * > & getSelectedEdges() const
get current selected edges
std::vector< TAZEdgeColor > myTAZEdgeColors
vector with TAZ's edges
double myMaxSourceMinusSinkWeight
maximum source minus sink value of current TAZ Edges
FXLabel * myCurrentTAZLabel
Label for current TAZ.
double myMaxSourcePlusSinkWeight
maximum source plus sink value of current TAZ Edges
double myMinSourcePlusSinkWeight
minimum source plus sink value of current TAZ Edges
GNETAZ * getTAZ() const
get current TAZ
bool getToggleMembership() const
check if toggle membership is enabled
FXButton * myUseSelectedEdges
button for use selected edges
FXCheckButton * myToggleMembership
CheckButton to enable or disable Toggle edge Membership.
void collapseTAZChildDefaultParameters()
collapse TAZ child default parameters Module (if we have selected a TAZ)
FXTextField * myTextFieldDefaultValueTAZSources
textField to set a default value for TAZ Sources
long onCmdUseSelectedEdges(FXObject *obj, FXSelector, void *)
Called when the user press "use selected edges" button.
void updateSelectEdgesButton()
update "select edges button"
double getDefaultTAZSourceWeight() const
get default source weight
void extendTAZChildDefaultParameters()
extend TAZ child default parameters Module (if we have selected a TAZ)
FXLabel * myInformationLabel
information label
FXHorizontalFrame * myDefaultTAZSinkFrame
Horizontal Frame for default TAZ Sink Weight.
FXHorizontalFrame * myDefaultTAZSourceFrame
Horizontal Frame for default TAZ Source Weight.
FXHorizontalFrame * myToggleMembershipFrame
Horizontal Frame toggle membership.
GNETAZFrame * myTAZFrameParent
FOX need this.
long onCmdSetZeroFringeProbabilities(FXObject *obj, FXSelector, void *)
Called when the user press "zero fringe probabilities" button.
double myDefaultTAZSourceWeight
default source weight
FXTextField * myTextFieldDefaultValueTAZSinks
textField to set a default value for TAZ Sinks
long onCmdSetDefaultValues(FXObject *obj, FXSelector, void *)
double getDefaultTAZSinkWeight() const
default sink weight
double myDefaultTAZSinkWeight
default sink weight
FXButton * myZeroFringeProbabilities
button for setting zero fringe probabilities
void showTAZCommonStatisticsModule()
show TAZ Common Statistics Module
FXLabel * myStatisticsLabel
Statistics labels.
void hideTAZCommonStatisticsModule()
hide TAZ Common Statistics Module
void updateStatistics()
update Statistics label
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
FXRadioButton * myColorBySourcePlusSinkWeight
add radio button "color source + sink"
RGBColor myEdgeSelectedColor
RGBColor color for selected egdes.
FXRadioButton * myColorBySinkWeight
add radio button "color by sink"
void showTAZEdgesGraphicModule()
show TAZ Edges Graphic Module
void updateEdgeColors()
update edge colors;
FXRadioButton * myColorBySourceWeight
add radio button "color by source"
FXRadioButton * myColorBySourceMinusSinkWeight
add radio button "color source - Sink"
RGBColor myEdgeDefaultColor
default RGBColor for all edges
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
long onCmdChoosenBy(FXObject *obj, FXSelector, void *)
void hideTAZEdgesGraphicModule()
hide TAZ Edges Graphic Module
FXTextField * myTextFieldName
textField to modify the default value of name parameter
void getAttributesAndValues() const
get a map with attributes and their values
bool isAddEdgesWithinEnabled() const
check if edges within has to be used after TAZ Creation
void showTAZParametersModule()
show TAZ parameters and set the default value of parameters
FXButton * myHelpTAZAttribute
button for help
FXCheckButton * myAddEdgesWithinCheckButton
CheckButton to enable or disable use edges within TAZ after creation.
long onCmdSetAttribute(FXObject *, FXSelector, void *)
Called when user set a value.
long onCmdHelp(FXObject *, FXSelector, void *)
Called when help button is pressed.
void hideTAZParametersModule()
hide TAZ parameters
long onCmdSetColorAttribute(FXObject *, FXSelector, void *)
GNETAZFrame * myTAZFrameParent
pointer to GNETAZFrame parent
FXButton * myColorEditor
Button for open color editor.
FXTextField * myTextFieldCenter
text field center
FXTextField * myTextFieldColor
textField to modify the default value of color parameter
FXCheckButton * myCheckButtonFill
CheckButton to enable or disable fill.
bool isCurrentParametersValid() const
check if current parameters are valid
bool isChangesPending() const
return true if there is changes to save
FXButton * mySaveChangesButton
@field FXButton for save changes in TAZEdges
void showTAZSaveChangesModule()
show TAZ Save Changes Module
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
FXButton * myCancelChangesButton
@field FXButton for cancel changes in TAZEdges
long onCmdCancelChanges(FXObject *, FXSelector, void *)
Called when the user press the button cancel changes.
void hideTAZSaveChangesModule()
hide TAZ Save Changes Module
long onCmdSaveChanges(FXObject *, FXSelector, void *)
void enableButtonsAndBeginUndoList()
enable buttons save and cancel changes (And begin Undo List)
long onCmdSelectEdges(FXObject *obj, FXSelector, void *)
Called when the user press select edges.
FXHorizontalFrame * myTAZSourceFrame
Horizontal Frame for default TAZ Source Weight.
std::vector< CurrentTAZ::TAZEdgeColor > myEdgeAndTAZChildrenSelected
vector with the current selected edges and their associated children
void hideTAZSelectionStatisticsModule()
hide TAZ Selection Statistics Module
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
bool isEdgeSelected(GNEEdge *edge)
check if an edge is selected
FXHorizontalFrame * myTAZSinkFrame
Horizontal Frame for default TAZ Sink Weight.
const std::vector< CurrentTAZ::TAZEdgeColor > & getEdgeAndTAZChildrenSelected() const
get map with edge and TAZChildren
void showTAZSelectionStatisticsModule()
show TAZ Selection Statistics Module
long onCmdSetNewValues(FXObject *obj, FXSelector, void *)
void clearSelectedEdges()
clear current TAZ children
FXTextField * myTextFieldTAZSourceWeight
textField for TAZ Source weight
void updateStatistics()
update TAZSelectionStatistics
FXTextField * myTextFieldTAZSinkWeight
textField for TAZ Sink weight
bool selectEdge(const CurrentTAZ::TAZEdgeColor &edge)
add an edge and their TAZ Children in the list of selected items
bool unselectEdge(GNEEdge *edge)
un select an edge (and their TAZ Children)
FXLabel * myStatisticsLabel
Statistics labels.
TAZSelectionStatistics * myTAZSelectionStatistics
TAZ Edges selection parameters.
TAZSelectionStatistics * getTAZSelectionStatisticsModule() const
get TAZ Selection Statistics modul
TAZSaveChanges * getTAZSaveChangesModule() const
get TAZ Save Changes modul
CurrentTAZ * myCurrentTAZ
current TAZ
TAZEdgesGraphic * myTAZEdgesGraphic
TAZ Edges Graphic.
TAZParameters * myTAZParameters
TAZ parameters.
bool addOrRemoveTAZMember(GNEEdge *edge)
add or remove a source and a sink, or remove it if edge is in the list of TAZ Children
void dropTAZMembers()
drop all TAZSources and TAZ Sinks of current TAZ
GNEDrawingShape * getDrawingShapeModule() const
get drawing mode modul
CurrentTAZ * getCurrentTAZModule() const
get Current TAZ modul
TAZCommonStatistics * myTAZCommonStatistics
TAZ Edges common parameters.
GNEDrawingShape * myDrawingShape
Drawing shape.
bool shapeDrawed()
build a shaped element using the drawed shape return true if was successfully created
~GNETAZFrame()
Destructor.
TAZSaveChanges * myTAZSaveChanges
save TAZ Edges
CommonXMLStructure::SumoBaseObject * myBaseTAZ
SumoBaseObject used for creating TAZ.
void hide()
hide TAZ frame
void processEdgeSelection(const std::vector< GNEEdge * > &edges)
process selection of edges in view net
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet
TAZChildDefaultParameters * myTAZChildDefaultParameters
TAZ child defaults parameters.
class used to group all variables related with objects under cursor after a click over view
A single child window which contains a view of the simulation area.
MFXGroupBoxModule (based on FXGroupBox)
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37