78 auto staticTooltipMenu =
myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
83 myFrontButton->setTipText(
TL(
"Mark element to be drawn above everything else"));
92 helpButton->setTipText(
TL(
"Open help attributes dialog"));
95 resetButton->setTipText(
TL(
"Reset attributes"));
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()) {
385 myFrameParent->getViewNet()->getMarkFrontElements().unmarkAll();
389 AC->markForDrawingFront();
401 bool allSelected =
true;
403 if (!AC->isMarkedForDrawingFront()) {
414 myFrontButton->setTipText(
TL(
"Mark element to be drawn above everything else"));
424 const auto editedTag =
myEditedACs.front()->getTagProperty()->getTag();
444 auto demandElement =
myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(
myEditedACs.front()->getTagProperty()->getTag(),
myEditedACs.front()->getID(),
false);
461 myEditedACs.front()->getParameters()->getParametersMap());
470 const auto undoList =
myFrameParent->getViewNet()->getUndoList();
471 const auto tagProperty =
myEditedACs.front()->getTagProperty();
474 undoList->begin(tagProperty->getGUIIcon(),
TLF(
"change multiple % attributes", tagProperty->getTagStr()));
506 AC->resetDefaultValues(
false);
511 AC->resetDefaultValues(
true);
524 const auto undoList =
myFrameParent->getViewNet()->getUndoList();
525 const auto tagProperty =
myEditedACs.front()->getTagProperty();
530 editedAC->setAttribute(attr,
value);
535 undoList->begin(tagProperty->getGUIIcon(),
TLF(
"change multiple % attributes", tagProperty->getTagStr()));
538 undoList->begin(tagProperty->getGUIIcon(),
TLF(
"change % attribute", tagProperty->getTagStr()));
542 editedAC->setAttribute(attr,
value, undoList);
557 const auto undoList =
myFrameParent->getViewNet()->getUndoList();
558 const auto tagProperty =
myEditedACs.front()->getTagProperty();
563 editedAC->toggleAttribute(attr,
value);
568 undoList->begin(tagProperty->getGUIIcon(),
TLF(
"change multiple % attributes", tagProperty->getTagStr()));
573 editedAC->enableAttribute(attr, undoList);
575 editedAC->disableAttribute(attr, undoList);
591 if (
myEditedACs.front()->getTagProperty()->getXMLParentTags().size() > 0) {
640 double startPos = centerPosition - (size * 0.5);
641 double endPos = centerPosition + (size * 0.5);
643 startPos = centerPosition - size;
644 endPos = centerPosition;
646 startPos = centerPosition;
647 endPos = centerPosition + size;
656 if (endPos > laneLength) {
659 startPos = laneLength - size;
665 if (endPos > laneLength) {
683 for (
const auto type : types) {
684 int maxNumberOfRows = 0;
687 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfEditableAttributeRows();
689 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfFlowAttributeRows();
691 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfGeoAttributeRows();
693 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)
const std::string invalid_return< std::string >::value
@ 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
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
GNEAttributesEditorType(GNEFrame *frameParent, GNEAttributesEditor *attributesEditorParent, const std::string attributesEditorName, EditorType editorType, AttributeType attributeType)
constructor
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
MFXButtonTooltip * myOpenExtendedAttributesButton
pointer to open extended attributes button
long onCmdOpenEditParametersDialog(FXObject *, FXSelector, void *)
called when user press the "Edit parameters" button
void disableAttributesEditor()
disable attribute editor
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
GNEViewNet * getViewNet() const
get view net
GNEGroupBoxModule (based on FXGroupBox).
GNEGroupBoxModule(GNEFrame *frame, const std::string &text, const int options=Options::COLLAPSIBLE)
constructor for frames
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
const GNETagPropertiesDatabase * getTagPropertiesDatabase() const
get tag properties database (used for simplify code)
std::vector< std::pair< std::string, std::string > > getEditedParameters() const
get edited parameters
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
GNENet * getNet() const
get the net object
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static StringBijection< ReferencePosition > ReferencePositions
reference positions (used creating certain elements in netedit)