60#define TEXTCOLOR_BLACK FXRGB(0, 0, 0)
61#define TEXTCOLOR_BLUE FXRGB(0, 0, 255)
62#define TEXTCOLOR_RED FXRGB(255, 0, 0)
63#define TEXTCOLOR_BACKGROUND_RED FXRGBA(255, 213, 213, 255)
64#define TEXTCOLOR_BACKGROUND_WHITE FXRGB(255, 255, 255)
72 myAttributeTable(attributeTable) {
133 const bool computedAttribute = multipleEditedACs ? false : firstEditedAC->isAttributeComputed(attribute);
138 if (!multipleEditedACs && attrProperty->
isVType()) {
144 if (ACParent ==
nullptr) {
149 if (multipleEditedACs && attrProperty->
isUnique()) {
157 if (attrProperty->
isFlow() && !attributeEnabled) {
161 if (tagPropertyParent->isVehicleStop() && !attributeEnabled) {
181 }
else if ((attribute ==
SUMO_ATTR_TYPE) && tagPropertyParent->hasTypeParent()) {
193 if (attrProperty->
isBool()) {
201 if (!multipleEditedACs && !tagPropertyParent->isNetworkElement() && (attribute ==
SUMO_ATTR_LANE)) {
285 if (!insertDefaultValues && usingDefaultValue) {
307 if (GNEAttributeCarrier::canParse<int>(
myValueTextField->getText().text())) {
308 const auto intValue = GNEAttributeCarrier::parse<int>(
myValueTextField->getText().text());
325 const auto doubleListValue = GNEAttributeCarrier::parse<std::vector<double> >(
myValueTextField->getText().text());
327 for (
const auto doubleValue : doubleListValue) {
338 }
else if (GNEAttributeCarrier::canParse<double>(
myValueTextField->getText().text())) {
339 const auto doubleValue = GNEAttributeCarrier::parse<double>(
myValueTextField->getText().text());
357 if (GNEAttributeCarrier::canParse<SUMOTime>(
myValueTextField->getText().text())) {
358 const auto timeValue = GNEAttributeCarrier::parse<SUMOTime>(
myValueTextField->getText().text());
374 if (GNEAttributeCarrier::canParse<PositionVector>(
myValueTextField->getText().text())) {
379 }
else if (GNEAttributeCarrier::canParse<Position>(
myValueTextField->getText().text())) {
390 if (GNEAttributeCarrier::canParse<RGBColor>(
myValueTextField->getText().text())) {
417 if (GNEAttributeCarrier::canParse<RGBColor>(
myValueTextField->getText().text())) {
425 if (colordialog.execute()) {
437 bool acceptChanges =
false;
460 if (value.size() > 0) {
514 if (editedAC->isValid(attribute, newValue)) {
522 if (newValue.empty()) {
535 const double angle = fmod(GNEAttributeCarrier::parse<double>(
myValueTextField->getText().text()), 360);
541 while (shape.find(
", ") != std::string::npos) {
548 double doubleValue = GNEAttributeCarrier::parse<double>(
myValueTextField->getText().text());
549 if ((doubleValue - (
int)doubleValue) == 0) {
556 if (editedAC->isValid(attribute, newValue)) {
566 if (newValue.empty()) {
583 myAttributeTable(nullptr) {
595 return ACs->generateEdgeID();
597 return ACs->generateAdditionalID(parentTag);
599 return ACs->generateDemandElementID(parentTag);
601 return ACs->generateMeanDataID(parentTag);
603 return ACs->generateEdgeTypeID();
605 return ACs->generateDataSetID();
610 std::set<std::string> values;
613 if (editedAC->hasAttribute(attribute)) {
614 values.insert(editedAC->getAttribute(attribute));
618 std::ostringstream oss;
619 for (
auto it = values.begin(); it != values.end(); it++) {
620 if (it != values.begin()) {
769 const bool enabled,
const bool computed) {
771 bool allValuesEqual =
true;
773 std::vector<bool> booleanVector;
776 booleanVector = GNEAttributeCarrier::parse<std::vector<bool> >(value);
779 for (
const auto& booleanValue : booleanVector) {
780 if (booleanValue != booleanVector.front()) {
781 allValuesEqual =
false;
785 if (allValuesEqual) {
792 if ((booleanVector.size() > 0) && booleanVector.front()) {
815 const bool enabled,
const bool computed) {
817 bool allValuesEqual =
true;
819 std::vector<std::string> stringVector = GNEAttributeCarrier::parse<std::vector<std::string> >(value);
821 for (
const auto& stringValue : stringVector) {
822 if (stringValue != stringVector.front()) {
823 allValuesEqual =
false;
827 if (allValuesEqual) {
843 }
else if (attrProperty->
isVType()) {
847 std::map<std::string, GNEDemandElement*> sortedTypes;
848 for (
const auto& type : ACs->getDemandElements().at(
SUMO_TAG_VTYPE)) {
849 sortedTypes[type.second->getID()] = type.second;
851 for (
const auto& sortedType : sortedTypes) {
856 sortedTypes[typeDistribution.second->getID()] = typeDistribution.second;
858 for (
const auto& sortedType : sortedTypes) {
939 if ((lane->getIndex() + 1) >= (
int)lane->getParentEdge()->getChildLanes().size()) {
945 if ((lane->getIndex() - 1) < 0) {
966 }
else if (editModes.isCurrentSupermodeNetwork()) {
967 if (tagProperty->isNetworkElement() || tagProperty->isAdditionalElement()) {
972 }
else if (editModes.isCurrentSupermodeDemand() && tagProperty->isDemandElement()) {
974 }
else if (editModes.isCurrentSupermodeData() && (tagProperty->isDataElement() || tagProperty->isMeanData())) {
995 if (AC->isAttributeEnabled(attrProperty->
getAttr())) {
FXDEFMAP(GNEAttributesEditorRow) GNEAttributeRowMap[]
#define TEXTCOLOR_BACKGROUND_WHITE
#define TEXTCOLOR_BACKGROUND_RED
@ 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 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_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|.....
Dialog for edit rerouters.
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 isProbability() const
return true if attribute is a probability
const std::string & getDefaultStringValue() const
get default value in string format
bool isColor() const
return true if attribute is a color
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 isPosition() const
return true if attribute is a position
SUMOTime getDefaultTimeValue() const
get default time value
bool isList() const
return true if attribute is a list
double getDefaultDoubleValue() const
get default double value
bool isInt() const
return true if attribute is an integer
bool isDiscrete() const
return true if attribute is discrete
bool isFileOpen() const
return true if attribute is a filename open
int getDefaultIntValue() const
get default int value
bool isVType() const
return true if attribute is a VType or vTypeDistribution
bool isUnique() const
return true if attribute is unique
bool isFloat() const
return true if attribute is a float
const RGBColor & getDefaultColorValue() const
get default bool value
const GNETagProperties * getTagPropertyParent() const
get reference to tagProperty parent
bool isSUMOTime() const
return true if attribute is a SUMOTime
bool hasDefaultValue() const
return true if attribute owns a default value
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::string & getFilenameExtensions() const
get filename extensions in string format used in open dialogs
bool isPositive() const
return true if attribute is positive
const std::vector< std::string > & getDiscreteValues() const
get discrete values
const Position & getDefaultPositionValue() const
get default position value
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"
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 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)
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
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
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
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
void moveLaneDown()
move lane down
bool isEditorTypeEditor() const
check if this is an attribute editor of type "editor"
GNEFrame * myFrameParent
pointer to GNEFrame parent
std::vector< GNEAttributeCarrier * > myEditedACs
current edited ACs
void setAttribute(SumoXMLAttr attr, const std::string &value)
set attribute in the current ACs (Callend from row)
void moveLaneUp()
move lane up
void inspectParent()
inspect parent (Callend from row)
const EditorType myEditorType
variable use for packing editorType type options
void enableReparent()
void enable reparent
void toggleEnableAttribute(SumoXMLAttr attr, const bool value)
set attribute in the current ACs (Callend from row)
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
bool isMeanData() const
return true if tag correspond to a mean data element
GUIIcon getGUIIcon() const
get GUI icon associated to this tag property
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
bool isDemandElement() const
return true if tag correspond to a demand element
bool isAdditionalElement() const
return true if tag correspond to an additional element (note: this include TAZ, shapes and wires)
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.
virtual void clearItems()
Remove all items from the list.
void disable()
Disable combo box.
FXColor getTextColor() const
Return text color.
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.
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
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
get all keys
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
static std::string openFileDialog(FXWindow *window, const std::string title, GUIIcon icon, const std::string &extensions, bool save, bool multi=false)
open filename dialog (general)