86 TAZSource(_TAZSource),
90 sourcePlusSinkColor(0),
91 sourceMinusSinkColor(0),
92 myTAZCurrentParent(TAZCurrentParent)
114 if (percentage >= 1) {
116 }
else if (percentage < 0) {
133 if (percentage >= 1) {
135 }
else if (percentage < 0) {
227 if (i.edge == edge) {
236 const std::vector<GNEEdge*>&
242 const std::vector<GNEEdge*>&
248 const std::vector<GNETAZFrame::TAZCurrent::TAZEdge> &
285 bool createTAZEdge =
true;
287 if (i.edge == edge) {
288 createTAZEdge =
false;
291 i.TAZSource = additional;
293 i.TAZSink = additional;
300 myTAZEdges.push_back(
TAZEdge(
this, edge, additional,
nullptr));
302 myTAZEdges.push_back(
TAZEdge(
this, edge,
nullptr, additional));
310 for (
auto &i : myTAZEdges) {
312 if (i.TAZSource && i.TAZSink) {
314 double sourcePlusSink = GNEAttributeCarrier::parse<double>(i.TAZSource->getAttribute(
SUMO_ATTR_WEIGHT)) +
315 GNEAttributeCarrier::parse<double>(i.TAZSink->getAttribute(
SUMO_ATTR_WEIGHT));
325 double sourceMinusSink = GNEAttributeCarrier::parse<double>(i.TAZSource->getAttribute(
SUMO_ATTR_WEIGHT)) -
326 GNEAttributeCarrier::parse<double>(i.TAZSink->getAttribute(
SUMO_ATTR_WEIGHT));
328 if (sourceMinusSink < 0) {
329 sourceMinusSink *= -1;
379 std::ostringstream information;
487 myDefaultTAZSourceWeight(1),
488 myDefaultTAZSinkWeight(1) {
508 std::ostringstream information;
510 <<
"- Toogle Membership:\n" 511 <<
" Create new Sources/Sinks\n" 512 <<
" with given weights.";
564 bool allSelected =
true;
566 if (!i.edge->isAttributeCarrierSelected()) {
583 bool allSelected =
true;
585 if (!i.edge->isAttributeCarrierSelected()) {
633 std::ostringstream information;
635 <<
"- Toogle Membership:\n" 636 <<
" Create new Sources/Sinks\n" 637 <<
" with given weights.";
656 std::ostringstream information;
658 <<
"- Keep Membership:\n" 659 <<
" Select Sources/Sinks.\n" 660 <<
"- Press ESC to clear\n" 661 <<
" current selection.";
724 bool allSelected =
true;
726 if (!i.edge->isAttributeCarrierSelected()) {
750 bool allSelected =
true;
752 if (!i.edge->isAttributeCarrierSelected()) {
760 if (i.edge->isAttributeCarrierSelected()) {
770 if (!i.edge->isAttributeCarrierSelected()) {
832 if (i.edge == TAZEdge.
edge) {
837 myEdgeAndTAZChildsSelected.push_back(TAZEdge);
853 if (i->edge == edge) {
876 if (i.edge == edge) {
898 const std::vector<GNETAZFrame::TAZCurrent::TAZEdge>&
911 if (newTAZSourceWeight >= 0) {
935 if (newTAZSinkWeight >= 0) {
965 if(!i.edge->isAttributeCarrierSelected()) {
976 if (!i.edge->isAttributeCarrierSelected()) {
997 std::set<std::string> weightSourceSet;
998 std::set<std::string> weightSinkSet;
1001 double maxWeightSource = 0;
1002 double minWeightSource = -1;
1003 double averageWeightSource = 0;
1004 double maxWeightSink = 0;
1005 double minWeightSink = -1;
1006 double averageWeightSink = 0;
1010 weight = GNEAttributeCarrier::parse<double>(i.TAZSource->getAttribute(
SUMO_ATTR_WEIGHT));
1012 weightSourceSet.insert(
toString(weight));
1014 if (maxWeightSource < weight) {
1015 maxWeightSource = weight;
1018 if (minWeightSource == -1 || (maxWeightSource < weight)) {
1019 minWeightSource = weight;
1022 averageWeightSource += weight;
1024 weight = GNEAttributeCarrier::parse<double>(i.TAZSink->getAttribute(
SUMO_ATTR_WEIGHT));
1026 weightSinkSet.insert(
toString(weight));
1028 if (maxWeightSink < weight) {
1029 maxWeightSink = weight;
1032 if (minWeightSink == -1 || (maxWeightSink < weight)) {
1033 minWeightSink = weight;
1036 averageWeightSink += weight;
1039 averageWeightSource /= myEdgeAndTAZChildsSelected.size();
1040 averageWeightSink /= myEdgeAndTAZChildsSelected.size();
1042 std::ostringstream information;
1043 std::string edgeInformation;
1045 if (myEdgeAndTAZChildsSelected.size() == 1) {
1046 edgeInformation =
"- Edge ID: " + myEdgeAndTAZChildsSelected.begin()->edge->getID();
1048 edgeInformation =
"- Number of edges: " +
toString(myEdgeAndTAZChildsSelected.size());
1052 << edgeInformation <<
"\n" 1053 <<
"- Min source: " <<
toString(minWeightSource) <<
"\n" 1054 <<
"- Max source: " <<
toString(maxWeightSource) <<
"\n" 1055 <<
"- Average source: " <<
toString(averageWeightSource) <<
"\n" 1057 <<
"- Min sink: " <<
toString(minWeightSink) <<
"\n" 1058 <<
"- Max sink: " <<
toString(maxWeightSink) <<
"\n" 1059 <<
"- Average sink: " <<
toString(averageWeightSink);
1115 return GNEAttributeCarrier::canParse<RGBColor>(
myTextFieldColor->getText().text());
1125 std::map<SumoXMLAttr, std::string>
1127 std::map<SumoXMLAttr, std::string> parametersAndValues;
1130 return parametersAndValues;
1137 FXColorDialog colordialog(
this, tr(
"Color Dialog"));
1138 colordialog.setTarget(
this);
1140 if (GNEAttributeCarrier::canParse<RGBColor>(
myTextFieldColor->getText().text())) {
1146 if (colordialog.execute()) {
1157 bool currentParametersValid = GNEAttributeCarrier::canParse<RGBColor>(
myTextFieldColor->getText().text());
1159 if (currentParametersValid) {
1164 currentParametersValid =
false;
1189 myEdgeDefaultColor(
RGBColor::GREY),
1190 myEdgeSelectedColor(
RGBColor::MAGENTA) {
1196 FXLabel *selectedTAZEdgeLabel =
new FXLabel(
this,
"Selected TAZ Edge",
nullptr,
GUIDesignLabelCenter);
1214 FXLabel *colorLabel =
new FXLabel(horizontalFrameColors,
"",
nullptr,
GUIDesignLabelLeft);
1245 for (
const auto j : i->getLanes() ) {
1246 j->setSpecialColor(
nullptr);
1258 for (
const auto j : i->getLanes() ) {
1265 for (
const auto j : i.edge->getLanes() ) {
1272 j->setSpecialColor(&
myScaleColors.at(i.sourcePlusSinkColor));
1274 j->setSpecialColor(&
myScaleColors.at(i.sourceMinusSinkColor));
1281 for (
const auto &j : i.edge->getLanes() ) {
1320 GNEFrame(horizontalFrameParent, viewNet,
"TAZs") {
1368 std::map<SumoXMLAttr, std::string> valuesOfElement;
1426 for (
auto i : edges) {
1435 for (
auto i : edges) {
1500 std::vector<std::string> edgeIDs;
1502 for (
auto i : ACsInBoundary) {
1504 edgeIDs.push_back(i.first);
1524 if (i.edge == edge) {
double myMaxSourceMinusSinkWeight
maximum source minus sink value of current TAZ Edges
~TAZSaveChanges()
destructor
TAZSelectionStatistics * getTAZSelectionStatisticsModul() const
get TAZ Selection Statistics modul
average sink (used only by TAZs)
TAZParameters * myTAZParameters
TAZ parameters.
static const TagProperties & getTagProperties(SumoXMLTag tag)
get Tag Properties
void hideNeteditAttributesModul()
hide Netedit attributes modul
std::set< std::pair< std::string, GNEAttributeCarrier * > > getAttributeCarriersInBoundary(const Boundary &boundary, bool forceSelectEdges=false)
get AttributeCarriers in Boundary
GNEAdditional * TAZSource
source TAZ
static RGBColor parseColor(std::string coldef)
Parses a color information.
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
GNETAZ * getTAZ() const
get current TAZ
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
a source within a district (connection road)
TAZChildDefaultParameters * myTAZChildDefaultParameters
TAZ child defaults parameters.
void hide()
hide TAZ frame
FXTextField * myTextFieldTAZSinkWeight
textField for TAZ Sink weight
struct for edges and the source/sink colors
TAZEdgesGraphic()
FOX needs this.
FXHorizontalFrame * myTAZSinkFrame
Horizontal Frame for default TAZ Sink Weight.
void showTAZParametersModul()
show TAZ parameters and set the default value of parameters
bool unselectEdge(GNEEdge *edge)
un select an edge (and their TAZ Childs)
void hideTAZSelectionStatisticsModul()
hide TAZ Selection Statistics Modul
static const RGBColor WHITE
FXButton * myCancelChangesButton
FXButton for cancel changes in TAZEdges
FXLabel * myStatisticsLabel
Statistics labels.
a traffic assignment zone
FXRadioButton * myColorBySourceMinusSinkWeight
add radio button "color source - Sink"
FXHorizontalFrame * myTAZSourceFrame
Horizontal Frame for default TAZ Source Weight.
TAZEdgesGraphic * myTAZEdgesGraphic
TAZ Edges Graphic.
void updateStatistics()
update Statistics label
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
GNETAZ * getTAZFront() const
get front TAZ (or a pointer to nullptr if there isn't)
void hideTAZCommonStatisticsModul()
hide TAZ Common Statistics Modul
bool getToggleMembership() const
check if toggle membership is enabled
void removeLastPoint()
remove last added point
TAZSelectionStatistics()
FOX needs this.
void hideTAZSaveChangesModul()
hide TAZ Save Changes Modul
void hideDrawingShape()
hide Drawing mode
Color of TAZSources/TAZChilds.
long onCmdUseSelectedEdges(FXObject *obj, FXSelector, void *)
Called when the user press use selected edges.
std::vector< RGBColor > myScaleColors
vector wit the scale colors
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...
void clearSelectedEdges()
clear current TAZ childs
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]
min sink (used only by TAZs)
~TAZEdgesGraphic()
destructor
FXButton * myUseSelectedEdges
button for use selected edges
void hideTAZParametersModul()
hide TAZ parameters
FXCheckButton * myToggleMembership
CheckButton to enable or disable Toggle edge Membership.
FXTextField * myTextFieldColor
textField to modify the default value of color parameter
long onCmdSetAttribute(FXObject *, FXSelector, void *)
Called when user set a value.
double myDefaultTAZSinkWeight
default TAZSink weight
bool isChangesPending() const
return true if there is changes to save
virtual std::string getAttribute(SumoXMLAttr key) const =0
#define WRITE_WARNING(msg)
long onCmdSetDefaultValues(FXObject *obj, FXSelector, void *)
void showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties &tagValue)
show Netedit attributes modul
~TAZCommonStatistics()
destructor
void enableButtonsAndBeginUndoList()
enable buttons save and cancel changes (And begin Undo List)
GNEViewNet * myViewNet
View Net for changes.
TAZChildDefaultParameters()
FOX needs this.
GNETAZFrame * myTAZFrameParent
pointer to GNETAZFrame parent
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn't)
void addTAZChild(GNEAdditional *additional)
add TAZChild
long onCmdSetNewValues(FXObject *obj, FXSelector, void *)
const std::vector< GNEEdge * > & getSelectedEdges() const
get current selected edges
FXLabel * myStatisticsLabel
Statistics labels.
~TAZChildDefaultParameters()
destructor
int sourceMinusSinkColor
color by source - sink [0-9]
void showTAZSelectionStatisticsModul()
show TAZ Selection Statistics Modul
GNEUndoList * getUndoList() const
get the undoList object
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
min source (used only by TAZs)
std::vector< TAZEdge > myTAZEdges
vector with TAZ's edges
~TAZSelectionStatistics()
destructor
#define GUIDesignTextField
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
double myMinSourcePlusSinkWeight
minimum source plus sink value of current TAZ Edges
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
max sink (used only by TAZs)
DrawingShape * getDrawingShapeModul() const
get drawing mode modul
double myMaxSourcePlusSinkWeight
maximum source plus sink value of current TAZ Edges
RGBColor myEdgeDefaultColor
default RGBColor for all edges
void dropTAZMembers()
drop all TAZSources and TAZ Sinks of current TAZ
A point in 2D or 3D with translation and scaling methods.
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.
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
FXButton * myColorEditor
Button for open color editor.
void showTAZEdgesGraphicModul()
show TAZ Edges Graphic Modul
GNETAZFrame * myTAZFrameParent
pointer to TAZ Frame
int sourcePlusSinkColor
color by source + sink [0-9]
void showDrawingShape()
show Drawing mode
TAZSelectionStatistics * myTAZSelectionStatistics
TAZ Edges selection parameters.
std::string getAttribute(SumoXMLAttr key) const
TAZCurrent * myTAZCurrentParent
pointer to TAZCurrentParent
TAZSaveChanges()
FOX needs this.
long onCmdSaveChanges(FXObject *, FXSelector, void *)
FXRadioButton * myColorBySourceWeight
add radio button "color by source"
const std::vector< GNEEdge * > & getNetEdges() const
get current net edges
bool isCurrentParametersValid() const
check if current parameters are valid
long onCmdSetColorAttribute(FXObject *, FXSelector, void *)
FXDEFMAP(GNETAZFrame::TAZParameters) TAZParametersMap[]
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
attribute edited trought dialog
long onCmdChoosenBy(FXObject *obj, FXSelector, void *)
void hideTAZChildDefaultParametersModul()
hide TAZ child default parameters Modul
edge: the shape in xml-definition
const PositionVector & getTemporalShape() const
get Temporal shape
FXHorizontalFrame * myDefaultTAZSourceFrame
Horizontal Frame for default TAZ Source Weight.
bool processClick(const Position &clickedPosition, const GNEViewNet::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet
const std::string getID() const
function to support debugging
NeteditAttributes * myNeteditAttributes
Netedit parameter.
void refreshTAZEdges()
refresh TAZEdges
FXCheckButton * myAddEdgesWithinCheckButton
CheckButton to enable or disable use edges within TAZ after creation.
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
FXTextField * myTextFieldDefaultValueTAZSources
textField to set a default value for TAZ Sources
#define GUIDesignLabelCenter
label extended over frame without thick and with text justify to center and height of 23 ...
void hideTAZEdgesGraphicModul()
hide TAZ Edges Graphic Modul
TAZSaveChanges * myTAZSaveChanges
save TAZ Edges
bool getNeteditAttributesAndValues(std::map< SumoXMLAttr, std::string > &valuesMap, GNELane *lane) const
fill valuesMap with netedit attributes
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
void updateEdgeColors()
update edge colors;
GNEAdditional * TAZSink
sink TAZ
void p_abort()
reverts and discards ALL active command groups
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons) ...
bool isTAZEdge(GNEEdge *edge) const
check if given edge belongs to current TAZ
void addNewPoint(const Position &P)
add new point to temporal shape
int sinkColor
color by sink [0-9]
void updateStatistics()
update TAZSelectionStatistics
FXButton * myHelpTAZAttribute
button for help
begin/end of the description of an edge
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
long onCmdHelp(FXObject *, FXSelector, void *)
Called when help button is pressed.
std::vector< TAZCurrent::TAZEdge > myEdgeAndTAZChildsSelected
vector with the current selected edges and their associated childs
bool selectEdge(const TAZCurrent::TAZEdge &edge)
add an edge and their TAZ Childs in the list of selected items
bool isDrawing() const
return true if currently a shape is drawed
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 ...
A road/street connecting two junctions (netedit-version)
FXHorizontalFrame * myDefaultTAZSinkFrame
Horizontal Frame for default TAZ Sink Weight.
std::map< SumoXMLAttr, std::string > getAttributesAndValues() const
get a map with attributes and their values
~TAZEdge()
destructor (needed because RGBColors has to be deleted)
#define GUIDesignTextFieldNCol
Num of column of text field.
void setTAZ(GNETAZ *editedTAZ)
set current TAZ
double myDefaultTAZSourceWeight
default TAZSource weight
GNETAZFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
double getDefaultTAZSourceWeight() const
get default TAZSource weight
RGBColor myEdgeSelectedColor
RGBColor color for selected egdes.
void showTAZCommonStatisticsModul()
show TAZ Common Statistics Modul
std::string generateAdditionalID(SumoXMLTag type) const
generate additional id
virtual void show()
show Frame
a sink within a district (connection road)
FXLabel * myInformationLabel
information label
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
An Element which don't belongs to GNENet but has influency in the simulation.
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
static GNEAdditional * buildAdditional(GNEViewNet *viewNet, bool allowUndoRedo, SumoXMLTag tag, std::map< SumoXMLAttr, std::string > values)
Build additionals.
bool isAddEdgesWithinEnabled() const
check if edges within has to be used after TAZ Creation
TAZCurrent * myTAZCurrent
current TAZ
FXTextField * myTextFieldTAZSourceWeight
textField for TAZ Source weight
const std::vector< TAZCurrent::TAZEdge > & getEdgeAndTAZChildsSelected() const
get map with edge and TAZChilds
TAZCommonStatistics(GNETAZFrame *TAZFrameParent)
constructor
TAZSaveChanges * getTAZSaveChangesModul() const
get TAZ Save Changes modul
FXRadioButton * myColorBySourcePlusSinkWeight
add radio button "color source + sink"
~TAZParameters()
destructor
TAZCurrent(GNETAZFrame *TAZFrameParent)
constructor
virtual void hide()
hide Frame
TAZParameters()
FOX needs this.
GNETAZ * myEditedTAZ
current edited TAZ
GNENet * getNet() const
get the net object
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to Doubles/doubles
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
FXButton * mySaveChangesButton
FXButton for save changes in TAZEdges
void updateColors()
update colors
average source (used only by TAZs)
FXRadioButton * myColorBySinkWeight
add radio button "color by sink"
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
void openHelpAttributesDialog(const GNEAttributeCarrier::TagProperties &tagProperties) const
Open help attributes dialog.
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
DrawingShape * myDrawingShape
Drawing shape.
bool getDeleteLastCreatedPoint()
get flag delete last created point
#define GUIDesignLabelLeft
double getDefaultTAZSinkWeight() const
default TAZSink weight
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame and height of 23
#define GUIDesignRadioButton
FXLabel * myTAZCurrentLabel
Label for current TAZ.
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return vector of additionals that have as Parent this edge (For example, Calibrators) ...
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
TAZCommonStatistics * myTAZCommonStatistics
TAZ Edges common parameters.
bool buildShape()
build a shaped element using the drawed shape return true if was sucesfully created ...
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
FXTextField * myTextFieldDefaultValueTAZSinks
textField to set a default value for TAZ Sinks
std::vector< GNEEdge * > myNetEdges
vector with pointers to edges (it's used to avoid slowdowns during Source/Sinks manipulations) ...
bool isEdgeSelected(GNEEdge *edge)
check if an edge is selected