Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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-2025 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// class definitions
28// ===========================================================================
29
31class GNEDrawingShape;
33
34// ===========================================================================
35// class definitions
36// ===========================================================================
37
38class GNETAZFrame : public GNEFrame {
39
40public:
41 // ===========================================================================
42 // class CurrentTAZ
43 // ===========================================================================
44
46
47 public:
50
51 public:
53 TAZEdgeColor(CurrentTAZ* CurrentTAZParent, GNEEdge* _edge, GNETAZSourceSink* _source, GNETAZSourceSink* _sink);
54
57
59 void updateColors();
60
63
66
69
72
75
78
81
82 private:
85
88 };
89
91 CurrentTAZ(GNETAZFrame* TAZFrameParent);
92
95
97 void setTAZ(GNETAZ* editedTAZ);
98
100 GNETAZ* getTAZ() const;
101
103 bool isTAZEdge(GNEEdge* edge) const;
104
106 const std::vector<GNEEdge*>& getSelectedEdges() const;
107
109 const std::vector<CurrentTAZ::TAZEdgeColor>& getTAZEdges() const;
110
112 void refreshTAZEdges();
113
114 protected:
116 void addSourceSink(GNETAZSourceSink* additional);
117
118 private:
121
124
126 std::vector<GNEEdge*> mySelectedEdges;
127
129 std::vector<TAZEdgeColor> myTAZEdgeColors;
130
133
136
139
142
145 };
146
147 // ===========================================================================
148 // class TAZCommonStatistics
149 // ===========================================================================
150
152
153 public:
155 TAZCommonStatistics(GNETAZFrame* TAZFrameParent);
156
159
162
165
167 void updateStatistics();
168
169 private:
172
175 };
176
177 // ===========================================================================
178 // class TAZSaveChanges
179 // ===========================================================================
180
184
185 public:
187 TAZSaveChanges(GNETAZFrame* TAZFrameParent);
188
191
194
197
200
202 bool isChangesPending() const;
203
207 long onCmdSaveChanges(FXObject*, FXSelector, void*);
208
210 long onCmdCancelChanges(FXObject*, FXSelector, void*);
212
213 protected:
214 FOX_CONSTRUCTOR(TAZSaveChanges)
215
216 private:
219
222
225 };
226
227 // ===========================================================================
228 // class TAZChildDefaultParameters
229 // ===========================================================================
230
234
235 public:
237 TAZChildDefaultParameters(GNETAZFrame* TAZFrameParent);
238
241
244
247
250
252 double getDefaultTAZSourceWeight() const;
253
255 double getDefaultTAZSinkWeight() const;
256
258 bool getToggleMembership() const;
259
263 long onCmdSetDefaultValues(FXObject* obj, FXSelector, void*);
264
266 long onCmdUseSelectedEdges(FXObject* obj, FXSelector, void*);
267
269 long onCmdSetZeroFringeProbabilities(FXObject* obj, FXSelector, void*);
271
272 protected:
274 FOX_CONSTRUCTOR(TAZChildDefaultParameters)
275
276 private:
279
281 FXCheckButton* myToggleMembership;
282
284 FXHorizontalFrame* myToggleMembershipFrame;
285
287 FXHorizontalFrame* myDefaultTAZSourceFrame;
288
291
293 FXHorizontalFrame* myDefaultTAZSinkFrame;
294
297
300
303
306
309
312 };
313
314 // ===========================================================================
315 // class TAZSelectionStatistics
316 // ===========================================================================
317
321
322 public:
324 TAZSelectionStatistics(GNETAZFrame* TAZFrameParent);
325
328
331
334
336 bool selectEdge(const CurrentTAZ::TAZEdgeColor& edge);
337
339 bool unselectEdge(GNEEdge* edge);
340
342 bool isEdgeSelected(GNEEdge* edge);
343
345 void clearSelectedEdges();
346
348 const std::vector<CurrentTAZ::TAZEdgeColor>& getEdgeAndTAZChildrenSelected() const;
349
353 long onCmdSetNewValues(FXObject* obj, FXSelector, void*);
354
356 long onCmdSelectEdges(FXObject* obj, FXSelector, void*);
358
359 protected:
360 FOX_CONSTRUCTOR(TAZSelectionStatistics)
361
362
363 void updateStatistics();
364
365 private:
368
370 FXHorizontalFrame* myTAZSourceFrame;
371
374
376 FXHorizontalFrame* myTAZSinkFrame;
377
380
383
385 std::vector<CurrentTAZ::TAZEdgeColor> myEdgeAndTAZChildrenSelected;
386 };
387
388 // ===========================================================================
389 // class TAZEdgesGraphic
390 // ===========================================================================
391
395
396 public:
398 TAZEdgesGraphic(GNETAZFrame* TAZFrameParent);
399
402
405
408
410 void updateEdgeColors();
411
415 long onCmdChoosenBy(FXObject* obj, FXSelector, void*);
417
418 protected:
419 FOX_CONSTRUCTOR(TAZEdgesGraphic)
420
421 private:
424
426 FXRadioButton* myColorBySourceWeight;
427
429 FXRadioButton* myColorBySinkWeight;
430
433
436
439
442 };
443
448 GNETAZFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);
449
451 ~GNETAZFrame();
452
454 void show();
455
457 void hide();
458
464 bool processClick(const Position& clickedPosition, const GNEViewNetHelper::ViewObjectsSelector& viewObjects);
465
467 void processEdgeSelection(const std::vector<GNEEdge*>& edges);
468
471
474
477
480
481protected:
484
489 bool shapeDrawed();
490
492 bool addOrRemoveTAZMember(GNEEdge* edge);
493
495 void dropTAZMembers();
496
497private:
500
503
506
509
512
515
518
521};
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
struct for edges and the source/sink colors
Definition GNETAZFrame.h:49
int sourcePlusSinkColor
color by source + sink [0-9]
Definition GNETAZFrame.h:77
GNETAZSourceSink * sink
@brif sink TAZ
Definition GNETAZFrame.h:68
GNETAZSourceSink * source
source TAZ
Definition GNETAZFrame.h:65
~TAZEdgeColor()
destructor (needed because RGBColors has to be deleted)
int sourceMinusSinkColor
color by source - sink [0-9]
Definition GNETAZFrame.h:80
CurrentTAZ * myCurrentTAZParent
pointer to CurrentTAZParent
Definition GNETAZFrame.h:84
int sourceColor
color by source [0-9]
Definition GNETAZFrame.h:71
int sinkColor
color by sink [0-9]
Definition GNETAZFrame.h:74
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
void addSourceSink(GNETAZSourceSink *additional)
add source sink
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
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
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
GNEAttributesEditor * myTAZAttributesEditor
TAZ parameters.
CurrentTAZ * myCurrentTAZ
current TAZ
TAZEdgesGraphic * myTAZEdgesGraphic
TAZ Edges Graphic.
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
void show()
show TAZ Frame
~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