66 const auto tooltipMenu = attributeTable->getFrameParent()->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
124 const bool computedAttribute = multipleEditedACs ? false : firstEditedAC->isAttributeComputed(attribute);
129 if (!multipleEditedACs && attrProperty->
isVType()) {
130 const auto& ACs =
myAttributeTable->myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
135 if (ACParent ==
nullptr) {
140 if (multipleEditedACs && attrProperty->
isUnique()) {
148 if (attrProperty->
isFlow() && !attributeEnabled) {
152 if (tagPropertyParent->isVehicleStop() && !attributeEnabled) {
172 }
else if ((attribute ==
SUMO_ATTR_TYPE) && tagPropertyParent->hasTypeParent()) {
184 if (attrProperty->
isBool()) {
192 if (!multipleEditedACs && !tagPropertyParent->isNetworkElement() && (attribute ==
SUMO_ATTR_LANE)) {
276 if (!insertDefaultValues && usingDefaultValue) {
318 for (
const auto doubleValue : doubleListValue) {
321 }
else if (
myAttrProperty->isFloat() && ((doubleValue < 0) || (doubleValue > 1))) {
332 if (!usingDefaultValue &&
myAttrProperty->isPositive() && (doubleValue < 0)) {
334 }
else if (!usingDefaultValue &&
myAttrProperty->isProbability() && ((doubleValue < 0) || (doubleValue > 1))) {
404 auto GNEApp =
myAttributeTable->getFrameParent()->getViewNet()->getViewParent()->getGNEAppWindows();
424 auto GNEApp =
myAttributeTable->getFrameParent()->getViewNet()->getViewParent()->getGNEAppWindows();
429 myValueTextField->setText(allowVClassesDialog->getModifiedVClasses().c_str(), TRUE);
498 if (editedAC->isValid(attribute, newValue)) {
506 if (newValue.empty()) {
525 while (shape.find(
", ") != std::string::npos) {
533 if ((doubleValue - (
int)doubleValue) == 0) {
540 if (editedAC->isValid(attribute, newValue)) {
550 if (newValue.empty()) {
576 const auto& ACs =
myAttributeTable->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers();
577 const auto parentTag =
myAttrProperty->getTagPropertyParent()->getTag();
579 return ACs->generateEdgeID();
580 }
else if (
myAttrProperty->getTagPropertyParent()->isAdditionalElement()) {
581 return ACs->generateAdditionalID(parentTag);
582 }
else if (
myAttrProperty->getTagPropertyParent()->isDemandElement()) {
583 return ACs->generateDemandElementID(parentTag);
584 }
else if (
myAttrProperty->getTagPropertyParent()->isMeanData()) {
585 return ACs->generateMeanDataID(parentTag);
587 return ACs->generateEdgeTypeID();
589 return ACs->generateDataSetID();
594 std::set<std::string> values;
597 if (editedAC->hasAttribute(attribute)) {
598 values.insert(editedAC->getAttribute(attribute));
602 std::ostringstream oss;
603 for (
auto it = values.begin(); it != values.end(); it++) {
604 if (it != values.begin()) {
612 return myAttributeTable->myEditedACs.front()->getAlternativeValueForDisabledAttributes(attribute);
754 const bool enabled,
const bool computed) {
756 bool allValuesEqual =
true;
758 std::vector<bool> booleanVector;
764 for (
const auto booleanValue : booleanVector) {
765 if (booleanValue != booleanVector.front()) {
766 allValuesEqual =
false;
770 if (allValuesEqual) {
777 if ((booleanVector.size() > 0) && booleanVector.front()) {
800 const bool enabled,
const bool computed) {
802 bool allValuesEqual =
true;
806 for (
const auto& stringValue : stringVector) {
807 if (stringValue != stringVector.front()) {
808 allValuesEqual =
false;
812 if (allValuesEqual) {
828 }
else if (attrProperty->
isVType()) {
830 const auto& ACs =
myAttributeTable->myFrameParent->getViewNet()->getNet()->getAttributeCarriers();
832 std::map<std::string, GNEDemandElement*> sortedTypes;
833 for (
const auto& type : ACs->getDemandElements().at(
SUMO_TAG_VTYPE)) {
834 sortedTypes[type.second->getID()] = type.second;
836 for (
const auto& sortedType : sortedTypes) {
837 myValueComboBox->appendIconItem(sortedType.first.c_str(), sortedType.second->getACIcon());
841 sortedTypes[typeDistribution.second->getID()] = typeDistribution.second;
843 for (
const auto& sortedType : sortedTypes) {
844 myValueComboBox->appendIconItem(sortedType.first.c_str(), sortedType.second->getACIcon());
920 const auto lane =
myAttributeTable->myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveLane(laneID,
false);
924 if ((lane->getIndex() + 1) >= (
int)lane->getParentEdge()->getChildLanes().size()) {
930 if ((lane->getIndex() - 1) < 0) {
945 const auto& editModes =
myAttributeTable->myFrameParent->getViewNet()->getEditModes();
951 }
else if (editModes.isCurrentSupermodeNetwork()) {
952 if (tagProperty->isNetworkElement() || tagProperty->isAdditionalElement()) {
957 }
else if (editModes.isCurrentSupermodeDemand() && tagProperty->isDemandElement()) {
959 }
else if (editModes.isCurrentSupermodeData() && (tagProperty->isDataElement() || tagProperty->isMeanData())) {
980 if (AC->isAttributeEnabled(attrProperty->
getAttr())) {
FXDEFMAP(GNEAttributesEditorRow) GNEAttributeRowMap[]
@ MID_GNE_ATTRIBUTESEDITORROW_MOVELANEUP
move lane up
@ MID_GNE_ATTRIBUTESEDITORROW_OPENDIALOG_FILE
open file dialog in attributes editor row
@ MID_GNE_ATTRIBUTESEDITORROW_SETATTRIBUTE
set attribute (string, bool, etc.) in attributes editor row
@ MID_GNE_ATTRIBUTESEDITORROW_OPENDIALOG_COLOR
open color dialog in attributes editor row
@ MID_GNE_ATTRIBUTESEDITORROW_REPARENT
reparent
@ MID_GNE_ATTRIBUTESEDITORROW_TOGGLEENABLEATTRIBUTE
toogle enable attribute in attributes editor row
@ MID_GNE_ATTRIBUTESEDITORROW_OPENDIALOG_ALLOW
open allow dialog in attributes editor row
@ MID_GNE_ATTRIBUTESEDITORROW_MOVELANEDOWN
move lane down
@ MID_GNE_ATTRIBUTESEDITORROW_INSPECTPARENT
inspect parent
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
#define GUIDesignTextColorRed
red color (for invalid text)
#define GUIDesignButtonIcon
button only with icon
#define GUIDesignComboBoxAttribute
Combo box static (cannot be edited) extended over the matrix column.
#define GUIDesignTextField
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignBackgroundColorRed
red background color (for invalid text)
#define GUIDesignTextColorBlue
blue color (for default text)
#define GUIDesignComboBoxVisibleItems
#define GUIDesignTextColorBlack
black color (for correct text)
#define GUIDesignBackgroundColorWhite
white background color (for valid text)
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
const std::string invalid_return< std::string >::value
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_VTYPE_DISTRIBUTION
distribution of a vehicle type
@ SUMO_TAG_TYPE
type (edge)
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ GNE_ATTR_STOPOEXCEPTION
stop exceptions (virtual, used by edge and lanes)
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_EXPECTED_CONTAINERS
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_RIGHT_OF_WAY
How to compute right of way.
@ SUMO_ATTR_NOTHING
invalid attribute, must be the last one
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void addDoubleListAttribute(const SumoXMLAttr attr, const std::vector< double > &value)
add double list attribute into current SumoBaseObject node
void addIntAttribute(const SumoXMLAttr attr, const int value)
add int attribute into current SumoBaseObject node
void addPositionVectorAttribute(const SumoXMLAttr attr, const PositionVector &value)
add PositionVector attribute into current SumoBaseObject node
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
void addTimeAttribute(const SumoXMLAttr attr, const SUMOTime value)
add time attribute into current SumoBaseObject node
void addStringListAttribute(const SumoXMLAttr attr, const std::vector< std::string > &value)
add string list attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
void addPositionAttribute(const SumoXMLAttr attr, const Position &value)
add Position attribute into current SumoBaseObject node
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
void addColorAttribute(const SumoXMLAttr attr, const RGBColor &value)
add color attribute into current SumoBaseObject node
void addParameters(const std::string &value)
add parameters into current SumoBaseObject node (format: key=value1|key2=value2|.....
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
bool isVClass() const
return true if attribute is a VehicleClass
bool isBool() const
return true if attribute is boolean
const std::string & getAttrStr() const
get XML Attribute in string format (can be updated using alternative name)
bool isDiscrete() const
return true if attribute is discrete
bool isFileOpen() const
return true if attribute is a filename open
const std::string & getDefinition() const
get default value
bool isVType() const
return true if attribute is a VType or vTypeDistribution
bool isUnique() const
return true if attribute is unique
const GNETagProperties * getTagPropertyParent() const
get reference to tagProperty parent
bool isFileSave() const
return true if attribute is a filename save
bool isFlow() const
return true if attribute is part of a flow definition
bool isActivatable() const
return true if attribute is activatable
const std::vector< std::string > & getDiscreteValues() const
get discrete values
bool isAlwaysEnabled() const
return true if attribute is always enabled
SumoXMLAttr getAttr() const
get XML Attribute
bool isAttributeRowShown() const
check if current attribute row is shown
void enableElements(const GNEAttributeProperties *attrProperty, const bool forceDisable)
check if enable or disable all elements depending of current supermode or forceDisable
MFXButtonTooltip * myValueLaneUpButton
Button for move lane up.
void showValueComboBox(const GNEAttributeProperties *attrProperty, const std::string &value, const bool enabled, const bool computed)
show value for combo Box
FXCheckButton * myAttributeToggleEnableCheckButton
pointer to attribute menu check
MFXButtonTooltip * myAttributeButton
pointer to button that can be used for files, color, parent, vclass or inspect
long onCmdInspectParent(FXObject *, FXSelector, void *)
called when user press "inspect parent"
MFXButtonTooltip * myValueLaneDownButton
Button for move lane down.
const std::string getAttributeValue(const bool enabled) const
get value from edited ACs
long onCmdOpenColorDialog(FXObject *sender, FXSelector, void *arg)
called when user press "edit color" dialog
void showAttributeColor(const GNEAttributeProperties *attrProperty, const bool enabled)
show attribute button color
bool isAttributeEnabled(const GNEAttributeProperties *attrProperty) const
check if the given attribute is enabled
void showAttributeVClass(const GNEAttributeProperties *attrProperty, const bool enabled)
show attribute button vClass
MFXLabelTooltip * myAttributeLabel
pointer to attribute label
MFXComboBoxIcon * myValueComboBox
pointer to combo box for select choices
SumoXMLAttr fillSumoBaseObject(CommonXMLStructure::SumoBaseObject *baseObject, const bool insertDefaultValues) const
fill sumo Base object
bool isValueValid() const
check if current attribute row is valid
bool hideAttributeRow()
hide attribute row (always return false)
void showAttributeLabel(const GNEAttributeProperties *attrProperty)
show attribute label
GNEAttributesEditorType * myAttributeTable
pointer to attribute table parent
long onCmdToggleEnableAttribute(FXObject *, FXSelector, void *)
called when user press the checkBox for toogle enable/disable attribute
std::string getCurrentValue() const
get current value in string format
const GNEAttributeProperties * getAttrProperty() const
get attribute property
GNEAttributesEditorRow()
default constructor (needed for FOX)
GNEAttributesEditorRow(GNEAttributesEditorType *attributeTable)
FOX-declaration.
long onCmdMoveLaneDown(FXObject *, FXSelector, void *)
called when user press "move lane down"
long onCmdMoveLaneUp(FXObject *, FXSelector, void *)
called when user press "move lane up"
void showMoveLaneButtons(const std::string &laneID)
show move lane buttons
void showAttributeToggleEnable(const GNEAttributeProperties *attrProperty, const bool value)
show attribute toogle enable
FXCheckButton * myValueCheckButton
pointer to menu check
void showAttributeInspectParent(const GNEAttributeProperties *attrProperty, const bool enabled)
show attribute button inspect parent
const GNEAttributeProperties * myAttrProperty
edited attribute property
void showValueCheckButton(const std::string &value, const bool enabled, const bool computed)
show value for check button
MFXTextFieldIcon * myValueTextField
pointer to text field for modify values
void hideAllAttributeElements()
hide all attribute elements
long onCmdSetAttribute(FXObject *obj, FXSelector, void *)
set new string/bool attribute
bool showAttributeRow(GNEAttributesEditorType *attributeTable, const GNEAttributeProperties *attrProperty, const bool forceDisable)
return true if attribute row was successfully show
void showAttributeFile(const GNEAttributeProperties *attrProperty, const bool enabled)
show attribute button file
long onCmdOpenFileDialog(FXObject *, FXSelector, void *)
called when user press "open file" dialog
void showAttributeReparent(const bool enabled)
show attribute button reparent
long onCmdOpenVClassDialog(FXObject *, FXSelector, void *)
called when user press "open allow" dialog
void showValueString(const std::string &value, const bool enabled, const bool computed)
show value for strings
long onCmdReparent(FXObject *, FXSelector, void *)
called when user press reparent button
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
std::string getFilename() const
Return file name, if any.
GUIIcon getGUIIcon() const
get GUI icon associated to this tag property
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static FXIcon * getPOIIcon(POIIcon iconType)
returns icon associated to the given POI image
static const RGBColor BLACK
static StringBijection< POIIcon > POIIcons
POI icon values.
static StringBijection< RightOfWay > RightOfWayValues
righ of way algorithms
static std::string replace(std::string str, const std::string &what, const std::string &by)
Replaces all occurrences of the second string by the third string within the first string.
static FXIcon * getVClassIcon(const SUMOVehicleClass vc)
returns icon associated to the given vClass