73 myFrameParent(frameParent),
74 myAttributesEditorParent(attributesEditorParent),
75 myEditorType(editorType),
76 myAttributeType(attributeType) {
78 auto staticTooltipMenu = myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
80 if (attributeType == AttributeType::NETEDIT) {
83 myFrontButton->setTipText(
TL(
"Mark element for draw over the rest"));
84 myFrontButton->hide();
86 myOpenDialogButton->setTipText(
TL(
"Open specific element edit dialog"));
87 myOpenDialogButton->hide();
90 auto helpButton =
new MFXButtonTooltip(myFrameNeteditButtons, staticTooltipMenu,
TL(
"Help"),
nullptr,
92 helpButton->setTipText(
TL(
"Open help attributes dialog"));
95 resetButton->setTipText(
TL(
"Reset attributes"));
100 if (myAttributeType == AttributeType::EXTENDED) {
103 myOpenExtendedAttributesButton->setTipText(
TL(
"Open dialog for edit extended attributes"));
104 }
else if (myAttributeType == AttributeType::PARAMETERS) {
107 myOpenGenericParametersEditorButton->setTipText(
TL(
"Open dialog for edit generic parameters"));
137const std::vector<GNEAttributeCarrier*>&
150 if (primaryAttributeEditor) {
165 for (
const auto& AC : ACs) {
168 if (primaryAttributeEditor) {
183 row->hideAttributeRow();
191 bool showButtons =
false;
194 const auto tagProperty =
myEditedACs.front()->getTagProperty();
198 if (tagProperty->isDrawable()) {
212 if ((
myEditedACs.size() == 1) && tagProperty->hasDialog()) {
231 if (tagProperty->hasExtendedAttributes()) {
235 if (tagProperty->hasParameters()) {
245 for (
const auto& attrProperty : tagProperty->getAttributeProperties()) {
247 bool validEditorType =
false;
249 validEditorType =
true;
252 validEditorType =
true;
255 bool validAttributeType =
true;
257 validAttributeType =
false;
260 validAttributeType =
false;
263 validAttributeType =
false;
266 validAttributeType =
false;
268 if (attrProperty->isExtendedEditor()) {
269 validAttributeType =
false;
272 validAttributeType =
false;
274 if (validEditorType && validAttributeType) {
292 if ((rowIndex == 0) && !showButtons) {
315 if (!row->isValueValid()) {
317 const std::string errorMessage =
TLF(
"Invalid value '%' in attribute %", row->getCurrentValue(), row->getAttrProperty()->getAttrStr());
334 if (row->isAttributeRowShown()) {
335 const auto fillResult = row->fillSumoBaseObject(baseObject, insertDefaultValues);
377 bool allFront =
true;
379 if (!AC->isMarkedForDrawingFront()) {
389 AC->markForDrawingFront();
401 bool allSelected =
true;
403 if (!AC->isMarkedForDrawingFront()) {
424 const auto editedTag =
myEditedACs.front()->getTagProperty()->getTag();
466 editedAC->setACParameters(singleParametersDialog.getEditedParameters());
470 const auto tagProperty =
myEditedACs.front()->getTagProperty();
473 undoList->
begin(tagProperty->getGUIIcon(),
TLF(
"change multiple % attributes", tagProperty->getTagStr()));
477 editedAC->setACParameters(singleParametersDialog.getEditedParameters(), undoList);
505 AC->resetDefaultValues(
false);
510 AC->resetDefaultValues(
true);
524 const auto tagProperty =
myEditedACs.front()->getTagProperty();
529 editedAC->setAttribute(attr, value);
534 undoList->
begin(tagProperty->getGUIIcon(),
TLF(
"change multiple % attributes", tagProperty->getTagStr()));
537 undoList->begin(tagProperty->getGUIIcon(),
TLF(
"change % attribute", tagProperty->getTagStr()));
541 editedAC->setAttribute(attr, value, undoList);
557 const auto tagProperty =
myEditedACs.front()->getTagProperty();
562 editedAC->toggleAttribute(attr, value);
567 undoList->
begin(tagProperty->getGUIIcon(),
TLF(
"change multiple % attributes", tagProperty->getTagStr()));
572 editedAC->enableAttribute(attr, undoList);
574 editedAC->disableAttribute(attr, undoList);
590 if (
myEditedACs.front()->getTagProperty()->getXMLParentTags().size() > 0) {
639 double startPos = centerPosition - (size * 0.5);
640 double endPos = centerPosition + (size * 0.5);
642 startPos = centerPosition - size;
643 endPos = centerPosition;
645 startPos = centerPosition;
646 endPos = centerPosition + size;
655 if (endPos > laneLength) {
658 startPos = laneLength - size;
664 if (endPos > laneLength) {
682 for (
const auto type : types) {
683 int maxNumberOfRows = 0;
688 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfFlowAttributeRows();
690 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfGeoAttributeRows();
692 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfNeteditAttributesRows();
FXDEFMAP(GNEAttributesEditorType) GNEAttributeTableMap[]
@ MID_GNE_ATTRIBUTESEDITOR_PARAMETERS
open generic parameters editor
@ MID_GNE_ATTRIBUTESEDITOR_FRONT
mark element as front
@ MID_GNE_ATTRIBUTESEDITOR_DIALOG
open element dialog
@ MID_GNE_ATTRIBUTESEDITOR_EXTENDED
open extended attributes
@ MID_GNE_ATTRIBUTESEDITOR_RESET
reset attributes
@ MID_GNE_ATTRIBUTESEDITOR_HELP
open help dialog
#define GUIDesignButtonIcon
button only with icon
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
#define WRITE_WARNING(msg)
@ SUMO_TAG_REROUTER
A rerouter.
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ GNE_TAG_CALIBRATOR_LANE
A calibrator placed over lane.
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
@ SUMO_TAG_VSS
A variable speed sign.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_FORCESIZE
size (used in stopping places)
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ GNE_ATTR_SIZE
size (used in stopping places)
@ GNE_ATTR_REFERENCE
reference position (used creating stoppingPlaces)
@ GNE_ATTR_LANELENGTH
size (used in stopping places)
@ SUMO_ATTR_NOTHING
invalid attribute, must be the last one
bool hasBoolAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given bool attribute
bool hasStringAttribute(const SumoXMLAttr attr) const
has function
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
bool hasDoubleAttribute(const SumoXMLAttr attr) const
check if current SumoBaseObject has the given double attribute
bool getBoolAttribute(const SumoXMLAttr attr) const
get bool attribute
double getDoubleAttribute(const SumoXMLAttr attr) const
get double attribute
const std::string & getStringAttribute(const SumoXMLAttr attr) const
get string attribute
const std::string getID() const override
get ID (all Attribute Carriers have one)
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
void refreshAttributesEditor()
refresh attribute editor
static void buildRows(GNEAttributesEditorType *editorParent)
build rows
SumoXMLAttr fillSumoBaseObject(CommonXMLStructure::SumoBaseObject *baseObject, const bool insertDefaultValues) const
fill sumo Base object
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
static AttributesEditorRows mySecondSingletonAttributesEditorRows
second singleton with attributes editor rows
std::vector< GNEAttributesEditorRow * > myAttributesEditorRows
singleton with attributes editor rows
void abortReparenting()
abort selecting parent
bool isReparenting() const
bool isEditorTypeCreator() const
check if this is an attribute editor of type "creator"
const AttributeType myAttributeType
variable use for packing attribute type options
void setNewParent(const GNEAttributeCarrier *AC)
set new parent
MFXButtonTooltip * myFrontButton
pointer to front button
static AttributesEditorRows myFirstSingletonAttributesEditorRows
first singleton with attributes editor rows
long onCmdOpenElementDialog(FXObject *, FXSelector, void *)
called when user press the "Element dialog" button
void hideAttributesEditor()
hide attribute editor
GNEAttributesEditor * myAttributesEditorParent
pointer to GNEAttributesEditor parent
FXHorizontalFrame * myFrameNeteditButtons
frame for netedit buttons (helps and reset)
void moveLaneDown()
move lane down
bool isEditorTypeEditor() const
check if this is an attribute editor of type "editor"
long onUpdMarkAsFront(FXObject *, FXSelector, void *)
called when user update the "Mark as front element" button
long onCmdAttributesEditorReset(FXObject *, FXSelector, void *)
called when user press the reset button
void refreshAttributesEditor()
refresh attribute editor
GNEFrame * myFrameParent
pointer to GNEFrame parent
void showAttributesEditor(GNEAttributeCarrier *AC, const bool primaryAttributeEditor)
edit attributes of the given AC (usually the edited template AC)
std::map< AttributeType, std::vector< GNEAttributesEditorRow * > > AttributesEditorRows
typedef used for pack attributes editor row
MFXButtonTooltip * myOpenDialogButton
pointer to open dialog button (usually additionals)
bool checkAttributes(const bool showWarning)
check if current edited attributes are valid
~GNEAttributesEditorType()
constructor
friend class GNEAttributesEditorRow
FOX-declaration.
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
long onCmdOpenExtendedAttributesDialog(FXObject *, FXSelector, void *)
called when user press the "Extended attributes" button
void fillStartEndAttributes(CommonXMLStructure::SumoBaseObject *baseObject) const
fill start end attributes
void inspectParent()
inspect parent (Callend from row)
long onCmdAttributesEditorHelp(FXObject *, FXSelector, void *)
called when user press the help button
const EditorType myEditorType
variable use for packing editorType type options
long onCmdMarkAsFront(FXObject *, FXSelector, void *)
bool checkNewParent(const GNEAttributeCarrier *AC) const
check if the given AC can be a new parent
AttributeType
Attribute types.
void enableReparent()
void enable reparent
const std::vector< GNEAttributeCarrier * > & getEditedAttributeCarriers() const
get edited attribute carriers
void toggleEnableAttribute(SumoXMLAttr attr, const bool value)
set attribute in the current ACs (Callend from row)
SumoXMLTag myReparentTag
check if we're reparent
MFXButtonTooltip * myOpenGenericParametersEditorButton
pointer to open generic parameters editor button
long onCmdOpenEditParametersDialog(FXObject *, FXSelector, void *)
called when user press the "Edit parameters" button
void disableAttributesEditor()
disable attribute editor
virtual void attributeUpdated(SumoXMLAttr attribute)
function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/....
GNEViewNet * getViewNet() const
get view net
void openHelpAttributesDialog(const GNEAttributeCarrier *AC) const
Open help attributes dialog.
void inspectElement(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousInspectedAC=nullptr)
Inspect a single element.
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
const GNETagPropertiesDatabase * getTagPropertiesDatabase() const
get tag properties database
int getMaxNumberOfEditableAttributeRows() const
max number of editable (non extended) attributes
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void unmarkAll()
unmark all ACs
GNENet * getNet() const
get the net object
GNEViewNetHelper::MarkFrontElements & getMarkFrontElements()
get marked for drawing front elements
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
void setStatusBarText(const std::string &text)
set statusBar text
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXGroupBoxModule (based on FXGroupBox)
static StringBijection< ReferencePosition > ReferencePositions
reference positions (used creating certain elements in netedit)