85 TAZSource(_TAZSource),
89 sourcePlusSinkColor(0),
90 sourceMinusSinkColor(0),
91 myTAZCurrentParent(TAZCurrentParent)
112 if (percentage >= 1) {
114 }
else if (percentage < 0) {
130 if (percentage >= 1) {
132 }
else if (percentage < 0) {
224 if (i.edge == edge) {
233 const std::vector<GNEEdge*>&
239 const std::vector<GNEEdge*>&
245 const std::vector<GNETAZFrame::TAZCurrent::TAZEdge>&
282 bool createTAZEdge =
true;
284 if (i.edge == edge) {
285 createTAZEdge =
false;
288 i.TAZSource = sourceSink;
290 i.TAZSink = sourceSink;
297 myTAZEdges.push_back(
TAZEdge(
this, edge, sourceSink,
nullptr));
299 myTAZEdges.push_back(
TAZEdge(
this, edge,
nullptr, sourceSink));
307 for (
const auto& i : myTAZEdges) {
309 if (i.TAZSource && i.TAZSink) {
311 double sourcePlusSink = i.TAZSource->getDepartWeight() + i.TAZSink->getDepartWeight();
321 double sourceMinusSink = i.TAZSource->getDepartWeight() - i.TAZSink->getDepartWeight();
323 if (sourceMinusSink < 0) {
324 sourceMinusSink *= -1;
374 std::ostringstream information;
482 myDefaultTAZSourceWeight(1),
483 myDefaultTAZSinkWeight(1) {
503 std::ostringstream information;
505 <<
"- Toogle Membership:\n" 506 <<
" Create new Sources/Sinks\n" 507 <<
" with given weights.";
559 bool allSelected =
true;
561 if (!i.edge->isAttributeCarrierSelected()) {
578 bool allSelected =
true;
580 if (!i.edge->isAttributeCarrierSelected()) {
628 std::ostringstream information;
630 <<
"- Toogle Membership:\n" 631 <<
" Create new Sources/Sinks\n" 632 <<
" with given weights.";
651 std::ostringstream information;
653 <<
"- Keep Membership:\n" 654 <<
" Select Sources/Sinks.\n" 655 <<
"- Press ESC to clear\n" 656 <<
" current selection.";
719 bool allSelected =
true;
721 if (!i.edge->isAttributeCarrierSelected()) {
745 bool allSelected =
true;
747 if (!i.edge->isAttributeCarrierSelected()) {
755 if (i.edge->isAttributeCarrierSelected()) {
765 if (!i.edge->isAttributeCarrierSelected()) {
827 if (i.edge == TAZEdge.
edge) {
832 myEdgeAndTAZChildrenSelected.push_back(TAZEdge);
848 if (i->edge == edge) {
871 if (i.edge == edge) {
893 const std::vector<GNETAZFrame::TAZCurrent::TAZEdge>&
906 if (newTAZSourceWeight >= 0) {
930 if (newTAZSinkWeight >= 0) {
960 if (!i.edge->isAttributeCarrierSelected()) {
971 if (!i.edge->isAttributeCarrierSelected()) {
992 std::set<std::string> weightSourceSet;
993 std::set<std::string> weightSinkSet;
996 double maxWeightSource = 0;
997 double minWeightSource = -1;
998 double averageWeightSource = 0;
999 double maxWeightSink = 0;
1000 double minWeightSink = -1;
1001 double averageWeightSink = 0;
1005 weight = i.TAZSource->getDepartWeight();
1007 weightSourceSet.insert(
toString(weight));
1009 if (maxWeightSource < weight) {
1010 maxWeightSource = weight;
1013 if (minWeightSource == -1 || (maxWeightSource < weight)) {
1014 minWeightSource = weight;
1017 averageWeightSource += weight;
1019 weight = i.TAZSink->getDepartWeight();
1021 weightSinkSet.insert(
toString(weight));
1023 if (maxWeightSink < weight) {
1024 maxWeightSink = weight;
1027 if (minWeightSink == -1 || (maxWeightSink < weight)) {
1028 minWeightSink = weight;
1031 averageWeightSink += weight;
1034 averageWeightSource /= myEdgeAndTAZChildrenSelected.size();
1035 averageWeightSink /= myEdgeAndTAZChildrenSelected.size();
1037 std::ostringstream information;
1038 std::string edgeInformation;
1040 if (myEdgeAndTAZChildrenSelected.size() == 1) {
1041 edgeInformation =
"- Edge ID: " + myEdgeAndTAZChildrenSelected.begin()->edge->getID();
1043 edgeInformation =
"- Number of edges: " +
toString(myEdgeAndTAZChildrenSelected.size());
1047 << edgeInformation <<
"\n" 1048 <<
"- Min source: " <<
toString(minWeightSource) <<
"\n" 1049 <<
"- Max source: " <<
toString(maxWeightSource) <<
"\n" 1050 <<
"- Average source: " <<
toString(averageWeightSource) <<
"\n" 1052 <<
"- Min sink: " <<
toString(minWeightSink) <<
"\n" 1053 <<
"- Max sink: " <<
toString(maxWeightSink) <<
"\n" 1054 <<
"- Average sink: " <<
toString(averageWeightSink);
1110 return GNEAttributeCarrier::canParse<RGBColor>(
myTextFieldColor->getText().text());
1120 std::map<SumoXMLAttr, std::string>
1122 std::map<SumoXMLAttr, std::string> parametersAndValues;
1125 return parametersAndValues;
1132 FXColorDialog colordialog(
this, tr(
"Color Dialog"));
1133 colordialog.setTarget(
this);
1135 if (GNEAttributeCarrier::canParse<RGBColor>(
myTextFieldColor->getText().text())) {
1141 if (colordialog.execute()) {
1152 bool currentParametersValid = GNEAttributeCarrier::canParse<RGBColor>(
myTextFieldColor->getText().text());
1154 if (currentParametersValid) {
1159 currentParametersValid =
false;
1184 myEdgeDefaultColor(
RGBColor::GREY),
1185 myEdgeSelectedColor(
RGBColor::MAGENTA) {
1191 FXLabel* selectedTAZEdgeLabel =
new FXLabel(
this,
"Selected TAZ Edge",
nullptr,
GUIDesignLabelCenter);
1209 FXLabel* colorLabel =
new FXLabel(horizontalFrameColors,
"",
nullptr,
GUIDesignLabelLeft);
1240 for (
const auto j : i->getLanes()) {
1241 j->setSpecialColor(
nullptr);
1253 for (
const auto j : i->getLanes()) {
1260 for (
const auto j : i.edge->getLanes()) {
1263 j->setSpecialColor(&
myScaleColors.at(i.sourceColor), i.TAZSource->getDepartWeight());
1265 j->setSpecialColor(&
myScaleColors.at(i.sinkColor), i.TAZSink->getDepartWeight());
1267 j->setSpecialColor(&
myScaleColors.at(i.sourcePlusSinkColor), i.TAZSource->getDepartWeight() + i.TAZSink->getDepartWeight());
1269 j->setSpecialColor(&
myScaleColors.at(i.sourceMinusSinkColor), i.TAZSource->getDepartWeight() - i.TAZSink->getDepartWeight());
1276 for (
const auto& j : i.edge->getLanes()) {
1315 GNEFrame(horizontalFrameParent, viewNet,
"TAZs") {
1363 std::map<SumoXMLAttr, std::string> valuesOfElement;
1421 for (
auto i : edges) {
1430 for (
auto i : edges) {
1495 std::vector<std::string> edgeIDs;
1497 for (
auto i : ACsInBoundary) {
1499 edgeIDs.push_back(i.first);
1521 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
std::set< std::pair< std::string, GNEAttributeCarrier * > > getAttributeCarriersInBoundary(const Boundary &boundary, bool forceSelectEdges=false)
get AttributeCarriers in Boundary
static RGBColor parseColor(std::string coldef)
Parses a color information.
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
GNETAZ * getTAZFront() const
get front TAZ (or a pointer to nullptr if there isn't)
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.
void update() const
Mark the entire GNEViewNet to be repainted later.
double getDepartWeight() const
get depart weight
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 Children)
void hideTAZSelectionStatisticsModul()
hide TAZ Selection Statistics Modul
static const RGBColor WHITE
bool isDrawing() const
return true if currently a shape is drawed
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.
bool getDeleteLastCreatedPoint()
get flag delete last created point
TAZEdgesGraphic * myTAZEdgesGraphic
TAZ Edges Graphic.
void updateStatistics()
update Statistics label
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
GNEFrameModuls::DrawingShape * getDrawingShapeModul() const
get drawing mode modul
void hideTAZCommonStatisticsModul()
hide TAZ Common Statistics Modul
GNETAZSourceSink * TAZSink
sink TAZ
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.
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
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 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]
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)
~TAZEdgesGraphic()
destructor
FXButton * myUseSelectedEdges
button for use selected edges
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.
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
const std::map< int, std::string > & getPredefinedTagsMML() const
get predefinedTagsMML
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
#define WRITE_WARNING(msg)
long onCmdSetDefaultValues(FXObject *obj, FXSelector, void *)
~TAZCommonStatistics()
destructor
void enableButtonsAndBeginUndoList()
enable buttons save and cancel changes (And begin Undo List)
GNEViewNet * myViewNet
View Net.
TAZChildDefaultParameters()
FOX needs this.
void hideDrawingShape()
hide Drawing mode
GNETAZFrame * myTAZFrameParent
pointer to GNETAZFrame parent
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.
~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 Children ...
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)
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.
#define GUIDesignCheckButton
checkButton placed in left position
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]
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
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
attribute edited trought dialog
long onCmdChoosenBy(FXObject *obj, FXSelector, void *)
void hideTAZChildDefaultParametersModul()
hide TAZ child default parameters Modul
edge: the shape in xml-definition
GNEEdge * getEdgeFront() const
get front edge (or a pointer to nullptr if there isn't)
FXHorizontalFrame * myDefaultTAZSourceFrame
Horizontal Frame for default TAZ Source Weight.
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.
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
#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;
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
int sinkColor
color by sink [0-9]
void updateStatistics()
update TAZSelectionStatistics
FXButton * myHelpTAZAttribute
button for help
const PositionVector & getTemporalShape() const
get Temporal shape
begin/end of the description of an edge
GNETAZFrame * myTAZFrameParent
pointer to TAZFrame parent
GNEFrameModuls::DrawingShape * myDrawingShape
Drawing shape.
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 ...
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
std::vector< TAZCurrent::TAZEdge > myEdgeAndTAZChildrenSelected
vector with the current selected edges and their associated children
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
bool isAddEdgesWithinEnabled() const
check if edges within has to be used after TAZ Creation
GNETAZSourceSink * TAZSource
source TAZ
TAZCurrent * myTAZCurrent
current TAZ
FXTextField * myTextFieldTAZSourceWeight
textField for TAZ Source weight
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/floats
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
#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.
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.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
GNEFrameAttributesModuls::NeteditAttributes * myNeteditAttributes
Netedit parameter.
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
bool processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet