55#define TEXTCOLOR_BLACK FXRGB(0, 0, 0)
56#define TEXTCOLOR_BLUE FXRGB(0, 0, 255)
57#define TEXTCOLOR_RED FXRGB(255, 0, 0)
58#define TEXTCOLOR_BACKGROUND_RED FXRGBA(255, 213, 213, 255)
59#define TEXTCOLOR_BACKGROUND_WHITE FXRGB(255, 255, 255)
67 myAttributeTable(attributeTable) {
141 const bool computedAttribute = multipleEditedACs ? false : firstEditedAC->isAttributeComputed(
myAttribute);
146 if (!multipleEditedACs && attrProperty.
isVType()) {
152 if (ACParent ==
nullptr) {
157 if (multipleEditedACs && attrProperty.
isUnique()) {
165 if (attrProperty.
isFlow() && !attributeEnabled) {
169 if (tagProperty.isVehicleStop() && !attributeEnabled) {
180 (GNEAttributeCarrier::parse<double>(firstEditedAC->getAttribute(
GNE_ATTR_STOPOFFSET)) == 0)) {
198 if (attrProperty.
isBool()) {
239 FXColorDialog colordialog(
this,
TL(
"Color Dialog"));
240 colordialog.setTarget(
this);
243 if (GNEAttributeCarrier::canParse<RGBColor>(
myValueTextField->getText().text())) {
245 }
else if (!attrProperty.getDefaultValue().empty()) {
246 colordialog.setRGBA(
MFXUtils::getFXColor(GNEAttributeCarrier::parse<RGBColor>(attrProperty.getDefaultValue())));
251 if (colordialog.execute()) {
263 bool acceptChanges =
false;
308 const auto& attrProperties = editedAC->getTagProperty().getAttributeProperties(
myAttribute);
329 if (newValue.empty()) {
333 WRITE_DEBUG(
TLF(
"ComboBox value '%' for attribute % of % isn't valid", newValue, attrProperties.getAttrStr(), attrProperties.getTagPropertyParent().getTagStr()));
342 if (
myValueTextField->getText().empty() && attrProperties.hasDefaultValue() && !attrProperties.isVClass()) {
349 const double angle = fmod(GNEAttributeCarrier::parse<double>(
myValueTextField->getText().text()), 360);
355 while (shape.find(
", ") != std::string::npos) {
361 if (attrProperties.isInt() && GNEAttributeCarrier::canParse<double>(
myValueTextField->getText().text())) {
362 double doubleValue = GNEAttributeCarrier::parse<double>(
myValueTextField->getText().text());
363 if ((doubleValue - (
int)doubleValue) == 0) {
379 if (newValue.empty()) {
383 WRITE_DEBUG(
TLF(
"TextField value '%' for attribute % of % isn't valid", newValue, attrProperties.getAttrStr(), attrProperties.getTagPropertyParent().getTagStr()));
398 myAttributeTable(nullptr) {
406 std::set<std::string> values;
410 values.insert(editedAC->getAttribute(
myAttribute));
414 std::ostringstream oss;
415 for (
auto it = values.begin(); it != values.end(); it++) {
416 if (it != values.begin()) {
483 const bool enabled) {
503 const bool enabled) {
535 const bool enabled,
const bool computed) {
537 bool allValuesEqual =
true;
539 std::vector<bool> booleanVector;
542 booleanVector = GNEAttributeCarrier::parse<std::vector<bool> >(value);
545 for (
const auto& booleanValue : booleanVector) {
546 if (booleanValue != booleanVector.front()) {
547 allValuesEqual =
false;
551 if (allValuesEqual) {
558 if ((booleanVector.size() > 0) && booleanVector.front()) {
581 const bool enabled,
const bool computed) {
583 bool allValuesEqual =
true;
585 std::vector<std::string> stringVector;
588 stringVector = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
591 for (
const auto& stringValue : stringVector) {
592 if (stringValue != stringVector.front()) {
593 allValuesEqual =
false;
597 if (allValuesEqual) {
613 }
else if (attrProperty.
isVType()) {
617 std::map<std::string, GNEDemandElement*> sortedTypes;
618 for (
const auto& type : ACs->getDemandElements().at(
SUMO_TAG_VTYPE)) {
619 sortedTypes[type.second->getID()] = type.second;
621 for (
const auto& sortedType : sortedTypes) {
626 sortedTypes[typeDistribution.second->getID()] = typeDistribution.second;
628 for (
const auto& sortedType : sortedTypes) {
709 if ((lane->getIndex() + 1) >= (
int)lane->getParentEdge()->getLanes().size()) {
715 if ((lane->getIndex() - 1) < 0) {
736 }
else if (editModes.isCurrentSupermodeNetwork() && (tagProperty.isNetworkElement() || tagProperty.isAdditionalElement())) {
738 }
else if (editModes.isCurrentSupermodeDemand() && tagProperty.isDemandElement()) {
740 }
else if (editModes.isCurrentSupermodeData() && (tagProperty.isDataElement() || tagProperty.isMeanData())) {
FXDEFMAP(GNEAttributesEditorRow) GNEAttributeRowMap[]
#define TEXTCOLOR_BACKGROUND_WHITE
#define TEXTCOLOR_BACKGROUND_RED
@ MID_GNE_ATTRIBUTESEDITORROW_OPENALLOWDIALLOG
open allow dialog in attributes editor row
@ MID_GNE_ATTRIBUTESEDITORROW_MOVELANEUP
move lane up
@ MID_GNE_ATTRIBUTESEDITORROW_SETATTRIBUTE
set attribute (string, bool, etc.) in attributes editor row
@ MID_GNE_ATTRIBUTESEDITORROW_REPARENT
reparent
@ MID_GNE_ATTRIBUTESEDITORROW_TOGGLEENABLEATTRIBUTE
toogle enable attribute in attributes editor row
@ MID_GNE_ATTRIBUTESEDITORROW_OPENCOLORDIALOG
open color 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 GUIDesignButtonIcon
button only with icon
#define GUIDesignComboBoxAttribute
Combo box static (cannot be edited) extended over the matrix column.
#define GUIDesignComboBoxNCol
number of column of every combo box
#define GUIDesignTextField
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignTextFieldNCol
Num of column of text field.
#define GUIDesignComboBoxVisibleItems
#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
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_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_VTYPE_DISTRIBUTION
distribution of a vehicle type
@ GNE_ATTR_STOPOFFSET
stop offset (virtual, used by edge and lanes)
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_SELECTED
element is selected
@ 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.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Dialog for edit rerouters.
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
bool isDiscrete() const
return true if attribute is discrete
bool isVType() const
return true if attribute is a VType or vTypeDistribution
bool isUnique() const
return true if attribute is unique
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
const GNETagProperties & getTagPropertyParent() const
get reference to tagProperty parent
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
std::vector< GNEAttributeCarrier * > myEditedACs
current edited ACs
GNEFrame * myFrameParent
pointer to GNEFrame parent
void toggleEnableAttribute(SumoXMLAttr attr, const bool value)
set attribute in the current ACs (Callend from row)
void moveLaneDown()
move lane down
void inspectParent()
inspect parent (Callend from row)
void enableReparent()
void enable reparent
void moveLaneUp()
move lane up
void setAttribute(SumoXMLAttr attr, const std::string &value)
set attribute in the current ACs (Callend from row)
SumoXMLAttr myAttribute
edited attribute
bool isAttributeRowShown() const
check if current attribute row is shown
bool showAttributeRow(const GNEAttributeProperties &attrProperty, const bool forceDisable)
return true if attribute row was successfully show
MFXButtonTooltip * myValueLaneUpButton
Button for move lane up.
FXCheckButton * myAttributeToggleEnableCheckButton
pointer to attribute menu check
void enableElements(const GNEAttributeProperties &attrProperty, const bool forceDisable)
check if enable or disable all elements depending of current supermode or forceDisable
long onCmdInspectParent(FXObject *, FXSelector, void *)
called when user press "inspect parent"
long onCmdOpenAllowDialog(FXObject *, FXSelector, void *)
called when user press "open allow" dialog
long onCmdOpenColorDialog(FXObject *, FXSelector, void *)
called when user press "edit color" dialog
MFXButtonTooltip * myValueLaneDownButton
Button for move lane down.
const std::string getAttributeValue(const bool enabled) const
get value from edited ACs
void showAttributeLabel(const GNEAttributeProperties &attrProperty)
show attribute label
MFXLabelTooltip * myAttributeLabel
pointer to attribute label
MFXComboBoxIcon * myValueComboBox
pointer to combo box for select choices
bool hideAttributeRow()
hide attribute row (always return false)
void showValueComboBox(const GNEAttributeProperties &attrProperty, const std::string &value, const bool enabled, const bool computed)
show value for combo Box
long onCmdToggleEnableAttribute(FXObject *, FXSelector, void *)
called when user press the checkBox for toogle enable/disable attribute
GNEAttributesEditorRow()
default constructor (needed for FOX)
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
GNEAttributesEditor * myAttributeTable
check junction merging bool mergeJunction(SumoXMLAttr attr, const std::string& newVal) const;
void showAttributeInspectParent(const GNEAttributeProperties &attrProperty, const bool enabled)
show attribute parent
void showAttributeVClass(const GNEAttributeProperties &attrProperty, const bool enabled)
show attribute vClass
FXCheckButton * myValueCheckButton
pointer to menu check
MFXButtonTooltip * myAttributeColorButton
pointer to attribute color button
void showValueCheckButton(const std::string &value, const bool enabled, const bool computed)
show value for check button
MFXButtonTooltip * myAttributeVClassButton
pointer to attribute vClass button
long onCmdSetAttribute(FXObject *obj, FXSelector, void *)
set new string/bool attribute
void showAttributeColor(const GNEAttributeProperties &attrProperty, const bool enabled)
show attribute color
MFXButtonTooltip * myAttributeReparentButton
pointer to attribute reparent button
void showAttributeReparent(const bool enabled)
show attribute reparent
MFXButtonTooltip * myAttributeInspectParentButton
pointer to attribute inspect parent button
MFXTextFieldTooltip * myValueTextField
pointer to text field for modify values
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
GNEViewNet * getViewNet() const
get view net
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GUIIcon getGUIIcon() const
get GUI icon associated to this Tag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
GNENet * getNet() const
get the net object
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
GNEViewParent * getViewParent() const
get the net object
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXStaticToolTip * getStaticTooltipMenu() const
get static toolTip for menus
long setCurrentItem(const FXint index, FXbool notify=FALSE)
Set the current item (index is zero-based)
FXint findItem(const FXString &text) const
find item
FXint getNumItems() const
Return the number of items in the list.
void setBackColor(FXColor clr)
Set window background color.
FXString getText() const
Get the text.
void setTextColor(FXColor clr)
Change text color.
void clearItems()
Remove all items from the list.
void disable()
Disable combo box.
FXint appendIconItem(const FXString &text, FXIcon *icon=nullptr, FXColor bgColor=FXRGB(255, 255, 255), void *ptr=nullptr)
append icon item in the last position
void enable()
Enable combo box.
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
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
std::vector< T > getValues() const
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