Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEAttributesEditorType.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// Row used for edit attributes
19/****************************************************************************/
20
31#include <netedit/GNENet.h>
33#include <netedit/GNEUndoList.h>
34#include <netedit/GNEViewNet.h>
37
38#include "GNEAttributesEditor.h"
41
42// ===========================================================================
43// static members
44// ===========================================================================
45
48
49// ===========================================================================
50// FOX callback mapping
51// ===========================================================================
52
62
63// Object implementation
64FXIMPLEMENT(GNEAttributesEditorType, MFXGroupBoxModule, GNEAttributeTableMap, ARRAYNUMBER(GNEAttributeTableMap))
65
66// ===========================================================================
67// method definitions
68// ===========================================================================
69
71 const std::string attributesEditorName, EditorType editorType, AttributeType attributeType) :
72 MFXGroupBoxModule(frameParent, attributesEditorName.c_str()),
73 myFrameParent(frameParent),
74 myAttributesEditorParent(attributesEditorParent),
75 myEditorType(editorType),
76 myAttributeType(attributeType) {
77 // get tooltip
78 auto staticTooltipMenu = myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
79 // create netedit especific buttons (before row)
80 if (attributeType == AttributeType::NETEDIT) {
81 // create netedit editor buttons
83 myFrontButton->setTipText(TL("Mark element for draw over the rest"));
84 myFrontButton->hide();
85 myOpenDialogButton = new MFXButtonTooltip(getCollapsableFrame(), staticTooltipMenu, TL("Open element dialog"), nullptr, this, MID_GNE_ATTRIBUTESEDITOR_DIALOG, GUIDesignButton);
86 myOpenDialogButton->setTipText(TL("Open specific element edit dialog"));
87 myOpenDialogButton->hide();
88 // Create buttons
90 auto helpButton = new MFXButtonTooltip(myFrameNeteditButtons, staticTooltipMenu, TL("Help"), nullptr,
92 helpButton->setTipText(TL("Open help attributes dialog"));
93 auto resetButton = new MFXButtonTooltip(myFrameNeteditButtons, staticTooltipMenu, "", GUIIconSubSys::getIcon(GUIIcon::RESET),
95 resetButton->setTipText(TL("Reset attributes"));
96 }
97 // build rows
98 buildRows(this);
99 // create specific buttons for extended and parameteres
101 // create extended attributes (always shown)
102 myOpenExtendedAttributesButton = new MFXButtonTooltip(getCollapsableFrame(), staticTooltipMenu, TL("Edit extended attributes"), nullptr, this, MID_GNE_ATTRIBUTESEDITOR_EXTENDED, GUIDesignButton);
103 myOpenExtendedAttributesButton->setTipText(TL("Open dialog for edit extended attributes"));
105 // create generic attributes editor button (always shown)
107 myOpenGenericParametersEditorButton->setTipText(TL("Open dialog for edit generic parameters"));
108 }
109}
110
111
113 // drow singletons (important if we're reloading)
116}
117
118
123
124
125bool
129
130
131bool
135
136
137const std::vector<GNEAttributeCarrier*>&
141
142
143void
145 // clean previous rows and ACs
146 myEditedACs.clear();
148 // set new ACs and Rows
149 myEditedACs.push_back(AC);
150 if (primaryAttributeEditor) {
152 } else {
154 }
156}
157
158
159void
160GNEAttributesEditorType::showAttributesEditor(const std::unordered_set<GNEAttributeCarrier*>& ACs, const bool primaryAttributeEditor) {
161 // clean previous rows and ACs
162 myEditedACs.clear();
164 // set new ACs and rows
165 for (const auto& AC : ACs) {
166 myEditedACs.push_back(AC);
167 }
168 if (primaryAttributeEditor) {
170 } else {
172 }
174}
175
176
177void
179 myEditedACs.clear();
181 // hide all rows before hidding table
182 for (const auto& row : myAttributesEditorRows) {
183 row->hideAttributeRow();
184 }
185 hide();
186}
187
188
189void
191 bool showButtons = false;
192 int rowIndex = 0;
193 if (myEditedACs.size() > 0) {
194 const auto tagProperty = myEditedACs.front()->getTagProperty();
195 // check if show netedit attributes (only in edit mode)
197 // front button
198 if (tagProperty->isDrawable()) {
199 myFrontButton->show();
200 myFrontButton->forceRefresh();
201 // disable if we're reparenting
202 if (isReparenting()) {
203 myOpenDialogButton->disable();
204 } else {
205 myOpenDialogButton->enable();
206 }
207 showButtons = true;
208 } else {
209 myFrontButton->hide();
210 }
211 // specific for single edited attributes
212 if ((myEditedACs.size() == 1) && tagProperty->hasDialog()) {
213 // update and show edit dialog
214 myOpenDialogButton->setText(TLF("Open % dialog", tagProperty->getTagStr()).c_str());
215 myOpenDialogButton->setIcon(GUIIconSubSys::getIcon(tagProperty->getGUIIcon()));
216 myOpenDialogButton->show();
217 // disable if we're reparenting
218 if (isReparenting()) {
219 myOpenDialogButton->disable();
220 } else {
221 myOpenDialogButton->enable();
222 }
223 showButtons = true;
224 } else {
225 myOpenDialogButton->hide();
226 }
227 }
228 // continue depending of attribute type
230 // only show extended attributes button (already created)
231 if (tagProperty->hasExtendedAttributes()) {
232 showButtons = true;
233 }
235 if (tagProperty->hasParameters()) {
236 // only show parameters row
237 myAttributesEditorRows[rowIndex]->showAttributeRow(this, tagProperty->getAttributeProperties(GNE_ATTR_PARAMETERS), isReparenting());
238 // set parameters button at the end
240 // only show open parameters editor
241 showButtons = true;
242 }
243 } else {
244 // Iterate over tag property of first AC and show row for every attribute
245 for (const auto& attrProperty : tagProperty->getAttributeProperties()) {
246 // filter editor type
247 bool validEditorType = false;
248 if (isEditorTypeCreator() && attrProperty->isCreateMode()) {
249 validEditorType = true;
250 }
251 if (isEditorTypeEditor() && attrProperty->isEditMode()) {
252 validEditorType = true;
253 }
254 // filter types
255 bool validAttributeType = true;
256 if ((myAttributeType == AttributeType::BASIC) && !attrProperty->isBasicEditor()) {
257 validAttributeType = false;
258 }
259 if ((myAttributeType == AttributeType::FLOW) && !attrProperty->isFlowEditor()) {
260 validAttributeType = false;
261 }
262 if ((myAttributeType == AttributeType::GEO) && !attrProperty->isGeoEditor()) {
263 validAttributeType = false;
264 }
265 if ((myAttributeType == AttributeType::NETEDIT) && !attrProperty->isNeteditEditor()) {
266 validAttributeType = false;
267 }
268 if (attrProperty->isExtendedEditor()) {
269 validAttributeType = false;
270 }
271 if (attrProperty->getAttr() == GNE_ATTR_PARAMETERS) {
272 validAttributeType = false;
273 }
274 if (validEditorType && validAttributeType) {
275 if (rowIndex < (int)myAttributesEditorRows.size()) {
276 // only update if row was show successfully
277 if (myAttributesEditorRows[rowIndex]->showAttributeRow(this, attrProperty, isReparenting())) {
278 rowIndex++;
279 }
280 } else {
281 throw ProcessError("Invalid maximum number of rows");
282 }
283 }
284 }
285 // hide rest of rows before showing table
286 for (int i = rowIndex; i < (int)myAttributesEditorRows.size(); i++) {
287 myAttributesEditorRows[i]->hideAttributeRow();
288 }
289 }
290 }
291 // check if show row
292 if ((rowIndex == 0) && !showButtons) {
294 } else {
296 myFrameNeteditButtons->reparent(this);
297 }
298 show();
299 }
300}
301
302
303void
305 for (const auto& row : myAttributesEditorRows) {
306 row->disable();
307 }
308}
309
310
311bool
313 // iterate over all rows and check if values are valid
314 for (const auto& row : myAttributesEditorRows) {
315 if (!row->isValueValid()) {
316 if (showWarning) {
317 const std::string errorMessage = TLF("Invalid value '%' in attribute %", row->getCurrentValue(), row->getAttrProperty()->getAttrStr());
318 // show warning
319 WRITE_WARNING(errorMessage);
320 // set message in status bar
321 myFrameParent->getViewNet()->setStatusBarText(errorMessage);
322 return false;
323 }
324 }
325 }
326 return true;
327}
328
329
331GNEAttributesEditorType::fillSumoBaseObject(CommonXMLStructure::SumoBaseObject* baseObject, const bool insertDefaultValues) const {
332 // iterate over every attribute row and stop if there was an error
333 for (const auto& row : myAttributesEditorRows) {
334 if (row->isAttributeRowShown()) {
335 const auto fillResult = row->fillSumoBaseObject(baseObject, insertDefaultValues);
336 if (fillResult != SUMO_ATTR_NOTHING) {
337 return fillResult;
338 }
339 }
340 }
341 // handle special case for elemnt with start-end position over lanes
342 fillStartEndAttributes(baseObject);
343 // all ok, then return nothing
344 return SUMO_ATTR_NOTHING;
345}
346
347
348bool
352
353
354bool
358
359
360void
362 myEditedACs.front()->setAttribute(GNE_ATTR_PARENT, AC->getID(), myFrameParent->getViewNet()->getUndoList());
364}
365
366
367void
372
373
374long
375GNEAttributesEditorType::onCmdMarkAsFront(FXObject*, FXSelector, void*) {
376 // check if all element are selectd
377 bool allFront = true;
378 for (auto& AC : myEditedACs) {
379 if (!AC->isMarkedForDrawingFront()) {
380 allFront = false;
381 break;
382 }
383 }
384 // first unfront all elements
385 myFrameParent->getViewNet()->getMarkFrontElements().unmarkAll();
386 // only mark front elements if we have at least one non-front element
387 if (!allFront) {
388 for (auto& AC : myEditedACs) {
389 AC->markForDrawingFront();
390 }
391 }
392 // update after front/unfront
393 myFrameParent->getViewNet()->update();
394 return 1;
395}
396
397
398long
399GNEAttributesEditorType::onUpdMarkAsFront(FXObject*, FXSelector, void*) {
400 // check if all element are selectd
401 bool allSelected = true;
402 for (auto& AC : myEditedACs) {
403 if (!AC->isMarkedForDrawingFront()) {
404 allSelected = false;
405 break;
406 }
407 }
408 // set button text depending of all selected
409 if (allSelected) {
410 myFrontButton->setText(TL("Unfront element"));
411 myFrontButton->setTipText(TL("Unfront inspected elements"));
412 } else {
413 myFrontButton->setText(TL("Front element"));
414 myFrontButton->setTipText(TL("Mark element for draw over the rest"));
415 }
416 return 1;
417}
418
419
420long
422 // check number of inspected elements
423 if (myEditedACs.size() == 1) {
424 const auto editedTag = myEditedACs.front()->getTagProperty()->getTag();
425 // check AC
426 if (editedTag == SUMO_TAG_REROUTER) {
427 // Open rerouter dialog
428 GNERerouterDialog(dynamic_cast<GNERerouter*>(myEditedACs.front()));
429 } else if ((editedTag == SUMO_TAG_CALIBRATOR) || (editedTag == GNE_TAG_CALIBRATOR_LANE)) {
430 // Open calibrator dialog
431 GNECalibratorDialog(dynamic_cast<GNECalibrator*>(myEditedACs.front()));
432 } else if (editedTag == SUMO_TAG_VSS) {
433 // Open VSS dialog
435 }
436 }
437 return 1;
438}
439
440
441long
443 // obtain edited AC (temporal), until unification of
444 auto demandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(myEditedACs.front()->getTagProperty()->getTag(), myEditedACs.front()->getID(), false);
445 // open vehicle type dialog
446 if (demandElement) {
447 // open dialog
448 const auto vTypeDialog = GNEVehicleTypeDialog(demandElement);
449 if (vTypeDialog.getResult() == GNEDialog::Result::ACCEPT) {
451 }
452 }
453 return 1;
454}
455
456
457long
459 // create parameters dialog
460 const auto singleParametersDialog = GNEParametersDialog(myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows(), myEditedACs.front()->getParameters()->getParametersMap());
461 // continue depending of result
462 if (singleParametersDialog.getResult() == GNEDialog::Result::ACCEPT) {
463 if (isEditorTypeCreator()) {
464 // Set new value of attribute in all edited ACs without undo-redo
465 for (const auto& editedAC : myEditedACs) {
466 editedAC->setACParameters(singleParametersDialog.getEditedParameters());
467 }
468 } else if (isEditorTypeEditor()) {
469 const auto undoList = myFrameParent->getViewNet()->getUndoList();
470 const auto tagProperty = myEditedACs.front()->getTagProperty();
471 // first check if we're editing a single attribute or an ID
472 if (myEditedACs.size() > 1) {
473 undoList->begin(tagProperty->getGUIIcon(), TLF("change multiple % attributes", tagProperty->getTagStr()));
474 }
475 // Set new value of attribute in all edited ACs
476 for (const auto& editedAC : myEditedACs) {
477 editedAC->setACParameters(singleParametersDialog.getEditedParameters(), undoList);
478 }
479 // finish change multiple attributes or ID Attributes
480 if (myEditedACs.size() > 1) {
481 undoList->end();
482 }
483 }
485 }
486 return 1;
487}
488
489
490long
492 if (myEditedACs.size() > 0) {
493 myFrameParent->openHelpAttributesDialog(myEditedACs.front());
494 }
495 return 1;
496}
497
498
499long
501 if (myEditedACs.size() > 0) {
502 // continue depending if we're creating or inspecting (undo-redo)
504 for (auto& AC : myEditedACs) {
505 AC->resetDefaultValues(false);
506 }
507 } else {
508 myFrameParent->getViewNet()->getUndoList()->begin(myEditedACs.front()->getTagProperty()->getGUIIcon(), TLF("reset %", myEditedACs.front()->getTagProperty()->getTagStr()));
509 for (auto& AC : myEditedACs) {
510 AC->resetDefaultValues(true);
511 }
512 myFrameParent->getViewNet()->getUndoList()->end();
513 }
514 // refresh all attributes editor types
515 myAttributesEditorParent->refreshAttributesEditor();
516 }
517 return 1;
518}
519
520
521void
523 const auto undoList = myFrameParent->getViewNet()->getUndoList();
524 const auto tagProperty = myEditedACs.front()->getTagProperty();
525 // continue depending if we're creating or inspecting
526 if (isEditorTypeCreator()) {
527 // Set new value of attribute in all edited ACs without undo-redo
528 for (const auto& editedAC : myEditedACs) {
529 editedAC->setAttribute(attr, value);
530 }
531 } else if (isEditorTypeEditor()) {
532 // first check if we're editing a single attribute or an ID
533 if (myEditedACs.size() > 1) {
534 undoList->begin(tagProperty->getGUIIcon(), TLF("change multiple % attributes", tagProperty->getTagStr()));
535 } else if (attr == SUMO_ATTR_ID) {
536 // IDs attribute has to be encapsulated because implies multiple changes in different additionals (due references)
537 undoList->begin(tagProperty->getGUIIcon(), TLF("change % attribute", tagProperty->getTagStr()));
538 }
539 // Set new value of attribute in all edited ACs
540 for (const auto& editedAC : myEditedACs) {
541 editedAC->setAttribute(attr, value, undoList);
542 }
543 // finish change multiple attributes or ID Attributes
544 if ((myEditedACs.size() > 1) || (attr == SUMO_ATTR_ID)) {
545 undoList->end();
546 }
547 }
549 // update frame parent (needed to update other attribute tables)
550 myFrameParent->attributeUpdated(attr);
551}
552
553
554void
556 const auto undoList = myFrameParent->getViewNet()->getUndoList();
557 const auto tagProperty = myEditedACs.front()->getTagProperty();
558 // continue depending if we're creating or inspecting
559 if (isEditorTypeCreator()) {
560 // Set new value of attribute in all edited ACs without undo-redo
561 for (const auto& editedAC : myEditedACs) {
562 editedAC->toggleAttribute(attr, value);
563 }
564 } else if (isEditorTypeEditor()) {
565 // first check if we're editing a single attribute
566 if (myEditedACs.size() > 1) {
567 undoList->begin(tagProperty->getGUIIcon(), TLF("change multiple % attributes", tagProperty->getTagStr()));
568 }
569 // Set new value of attribute in all edited ACs
570 for (const auto& editedAC : myEditedACs) {
571 if (value) {
572 editedAC->enableAttribute(attr, undoList);
573 } else {
574 editedAC->disableAttribute(attr, undoList);
575 }
576 }
577 // finish change multiple attributes or ID Attributes
578 if ((myEditedACs.size() > 1) || (attr == SUMO_ATTR_ID)) {
579 undoList->end();
580 }
581 }
583 // update frame parent (needed to update other attribute tables)
584 myFrameParent->attributeUpdated(attr);
585}
586
587
588void
590 if (myEditedACs.front()->getTagProperty()->getXMLParentTags().size() > 0) {
591 myReparentTag = myEditedACs.front()->getTagProperty()->getXMLParentTags().front();
593 myFrameParent->getViewNet()->update();
594 }
595}
596
597
598void
600 const auto type = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, myEditedACs.front()->getAttribute(SUMO_ATTR_TYPE), false);
601 if (type) {
602 myFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->inspectElement(type, myEditedACs.front());
603 }
604}
605
606
607void
609 const auto lane = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveLane(myEditedACs.front()->getAttribute(SUMO_ATTR_LANE), false);
610 if (lane) {
611 // set next lane
612 setAttribute(SUMO_ATTR_LANE, lane->getParentEdge()->getChildLanes().at(lane->getIndex() + 1)->getID());
613 }
614}
615
616
617void
619 const auto lane = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveLane(myEditedACs.front()->getAttribute(SUMO_ATTR_LANE), false);
620 if (lane) {
621 // set previous lane
622 setAttribute(SUMO_ATTR_LANE, lane->getParentEdge()->getChildLanes().at(lane->getIndex() - 1)->getID());
623 }
624}
625
626
627void
632 // extract parameters
633 const double centerPosition = baseObject->getDoubleAttribute(SUMO_ATTR_POSITION);
634 const double size = baseObject->getDoubleAttribute(GNE_ATTR_SIZE);
635 const double laneLength = baseObject->getDoubleAttribute(GNE_ATTR_LANELENGTH);
636 const bool forceSize = baseObject->getBoolAttribute(GNE_ATTR_FORCESIZE);
637 const auto reference = baseObject->getStringAttribute(GNE_ATTR_REFERENCE);
638 // we fill startPos and endPos using the existent parameters
639 double startPos = centerPosition - (size * 0.5);
640 double endPos = centerPosition + (size * 0.5);
642 startPos = centerPosition - size;
643 endPos = centerPosition;
644 } else if (reference == SUMOXMLDefinitions::ReferencePositions.getString(ReferencePosition::RIGHT)) {
645 startPos = centerPosition;
646 endPos = centerPosition + size;
647 }
648 // adjust values
649 if (startPos < 0) {
650 startPos = 0;
651 if (forceSize) {
652 endPos = size;
653 }
654 }
655 if (endPos > laneLength) {
656 endPos = laneLength;
657 if (forceSize) {
658 startPos = laneLength - size;
659 }
660 }
661 if (startPos < 0) {
662 startPos = 0;
663 }
664 if (endPos > laneLength) {
665 endPos = laneLength;
666 }
667 // add it in baseObject
668 baseObject->addDoubleAttribute(SUMO_ATTR_STARTPOS, startPos);
669 baseObject->addDoubleAttribute(SUMO_ATTR_ENDPOS, endPos);
670 }
671}
672
673
674void
676 // only build one time
678 const auto tagPropertiesDatabase = editorParent->getFrameParent()->getViewNet()->getNet()->getTagPropertiesDatabase();
679 // declare vector of types with rows
681 // iterate over all types and create their correspond rows
682 for (const auto type : types) {
683 int maxNumberOfRows = 0;
684 // get max number of rows
685 if (type == AttributeType::BASIC) {
686 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfEditableAttributeRows();
687 } else if (type == AttributeType::FLOW) {
688 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfFlowAttributeRows();
689 } else if (type == AttributeType::GEO) {
690 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfGeoAttributeRows();
691 } else if (type == AttributeType::NETEDIT) {
692 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfNeteditAttributesRows();
693 } else if (type == AttributeType::PARAMETERS) {
694 maxNumberOfRows = 1;
695 } else {
696 throw ProcessError("Invalid editor option");
697 }
698 // resize myAttributesEditorRows and fill it with attribute rows
699 myFirstSingletonAttributesEditorRows[type].resize(maxNumberOfRows);
700 mySecondSingletonAttributesEditorRows[type].resize(maxNumberOfRows);
701 for (int i = 0; i < (int)myFirstSingletonAttributesEditorRows[type].size(); i++) {
704 }
705 }
706
707 }
708
709}
710
711/****************************************************************************/
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
Definition GUIDesigns.h:109
#define GUIDesignButton
Definition GUIDesigns.h:100
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:430
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
Definition GUIDesigns.h:112
@ FRONTELEMENT
Definition GUIIcons.h:278
#define WRITE_WARNING(msg)
Definition MsgHandler.h:286
#define TL(string)
Definition MsgHandler.h:304
#define TLF(string,...)
Definition MsgHandler.h:306
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.
@ SUMO_ATTR_STARTPOS
@ SUMO_ATTR_LANE
@ GNE_ATTR_FORCESIZE
size (used in stopping places)
@ SUMO_ATTR_ENDPOS
@ 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)
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_ID
@ GNE_ATTR_LANELENGTH
size (used in stopping places)
@ SUMO_ATTR_POSITION
@ 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 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)
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
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)
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
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
GNEViewNet * getViewNet() const
get view net
Definition GNEFrame.cpp:145
const GNETagPropertiesDatabase * getTagPropertiesDatabase() const
get tag properties database
Definition GNENet.cpp:138
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
MFXGroupBoxModule (based on FXGroupBox).
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
MFXGroupBoxModule(GNEFrame *frame, const std::string &text, const int options=Options::COLLAPSIBLE)
constructor for frames
static StringBijection< ReferencePosition > ReferencePositions
reference positions (used creating certain elements in netedit)
Definition json.hpp:4471