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-2026 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, GNEGroupBoxModule, GNEAttributeTableMap, ARRAYNUMBER(GNEAttributeTableMap))
65
66// ===========================================================================
67// method definitions
68// ===========================================================================
69
71 const std::string attributesEditorName, EditorType editorType, AttributeType attributeType) :
72 GNEGroupBoxModule(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 to be drawn above everything else"));
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 editing extended attributes"));
105 // create generic attributes editor button (always shown)
107 myOpenGenericParametersEditorButton->setTipText(TL("Open dialog for editing 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 to be drawn above everything else"));
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 GNEVehicleTypeDialog vTypeDialog(demandElement);
449 if (vTypeDialog.getResult() == GNEDialog::Result::ACCEPT) {
451 }
452 }
453 return 1;
454}
455
456
457long
459 // create parameters dialog
460 const GNEParametersDialog singleParametersDialog(myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows(),
461 myEditedACs.front()->getParameters()->getParametersMap());
462 // continue depending of result
463 if (singleParametersDialog.getResult() == GNEDialog::Result::ACCEPT) {
464 if (isEditorTypeCreator()) {
465 // Set new value of attribute in all edited ACs without undo-redo
466 for (const auto& editedAC : myEditedACs) {
467 editedAC->setACParameters(singleParametersDialog.getEditedParameters());
468 }
469 } else if (isEditorTypeEditor()) {
470 const auto undoList = myFrameParent->getViewNet()->getUndoList();
471 const auto tagProperty = myEditedACs.front()->getTagProperty();
472 // first check if we're editing a single attribute or an ID
473 if (myEditedACs.size() > 1) {
474 undoList->begin(tagProperty->getGUIIcon(), TLF("change multiple % attributes", tagProperty->getTagStr()));
475 }
476 // Set new value of attribute in all edited ACs
477 for (const auto& editedAC : myEditedACs) {
478 editedAC->setACParameters(singleParametersDialog.getEditedParameters(), undoList);
479 }
480 // finish change multiple attributes or ID Attributes
481 if (myEditedACs.size() > 1) {
482 undoList->end();
483 }
484 }
486 }
487 return 1;
488}
489
490
491long
493 if (myEditedACs.size() > 0) {
494 myFrameParent->openHelpAttributesDialog(myEditedACs.front());
495 }
496 return 1;
497}
498
499
500long
502 if (myEditedACs.size() > 0) {
503 // continue depending if we're creating or inspecting (undo-redo)
505 for (auto& AC : myEditedACs) {
506 AC->resetDefaultValues(false);
507 }
508 } else {
509 myFrameParent->getViewNet()->getUndoList()->begin(myEditedACs.front()->getTagProperty()->getGUIIcon(), TLF("reset %", myEditedACs.front()->getTagProperty()->getTagStr()));
510 for (auto& AC : myEditedACs) {
511 AC->resetDefaultValues(true);
512 }
513 myFrameParent->getViewNet()->getUndoList()->end();
514 }
515 // refresh all attributes editor types
516 myAttributesEditorParent->refreshAttributesEditor();
517 }
518 return 1;
519}
520
521
522void
524 const auto undoList = myFrameParent->getViewNet()->getUndoList();
525 const auto tagProperty = myEditedACs.front()->getTagProperty();
526 // continue depending if we're creating or inspecting
527 if (isEditorTypeCreator()) {
528 // Set new value of attribute in all edited ACs without undo-redo
529 for (const auto& editedAC : myEditedACs) {
530 editedAC->setAttribute(attr, value);
531 }
532 } else if (isEditorTypeEditor()) {
533 // first check if we're editing a single attribute or an ID
534 if (myEditedACs.size() > 1) {
535 undoList->begin(tagProperty->getGUIIcon(), TLF("change multiple % attributes", tagProperty->getTagStr()));
536 } else if (attr == SUMO_ATTR_ID) {
537 // IDs attribute has to be encapsulated because implies multiple changes in different additionals (due references)
538 undoList->begin(tagProperty->getGUIIcon(), TLF("change % attribute", tagProperty->getTagStr()));
539 }
540 // Set new value of attribute in all edited ACs
541 for (const auto& editedAC : myEditedACs) {
542 editedAC->setAttribute(attr, value, undoList);
543 }
544 // finish change multiple attributes or ID Attributes
545 if ((myEditedACs.size() > 1) || (attr == SUMO_ATTR_ID)) {
546 undoList->end();
547 }
548 }
550 // update frame parent (needed to update other attribute tables)
551 myFrameParent->attributeUpdated(attr);
552}
553
554
555void
557 const auto undoList = myFrameParent->getViewNet()->getUndoList();
558 const auto tagProperty = myEditedACs.front()->getTagProperty();
559 // continue depending if we're creating or inspecting
560 if (isEditorTypeCreator()) {
561 // Set new value of attribute in all edited ACs without undo-redo
562 for (const auto& editedAC : myEditedACs) {
563 editedAC->toggleAttribute(attr, value);
564 }
565 } else if (isEditorTypeEditor()) {
566 // first check if we're editing a single attribute
567 if (myEditedACs.size() > 1) {
568 undoList->begin(tagProperty->getGUIIcon(), TLF("change multiple % attributes", tagProperty->getTagStr()));
569 }
570 // Set new value of attribute in all edited ACs
571 for (const auto& editedAC : myEditedACs) {
572 if (value) {
573 editedAC->enableAttribute(attr, undoList);
574 } else {
575 editedAC->disableAttribute(attr, undoList);
576 }
577 }
578 // finish change multiple attributes or ID Attributes
579 if ((myEditedACs.size() > 1) || (attr == SUMO_ATTR_ID)) {
580 undoList->end();
581 }
582 }
584 // update frame parent (needed to update other attribute tables)
585 myFrameParent->attributeUpdated(attr);
586}
587
588
589void
591 if (myEditedACs.front()->getTagProperty()->getXMLParentTags().size() > 0) {
592 myReparentTag = myEditedACs.front()->getTagProperty()->getXMLParentTags().front();
594 myFrameParent->getViewNet()->update();
595 }
596}
597
598
599void
601 const auto type = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, myEditedACs.front()->getAttribute(SUMO_ATTR_TYPE), false);
602 if (type) {
603 myFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->inspectElement(type, myEditedACs.front());
604 }
605}
606
607
608void
610 const auto lane = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveLane(myEditedACs.front()->getAttribute(SUMO_ATTR_LANE), false);
611 if (lane) {
612 // set next lane
613 setAttribute(SUMO_ATTR_LANE, lane->getParentEdge()->getChildLanes().at(lane->getIndex() + 1)->getID());
614 }
615}
616
617
618void
620 const auto lane = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveLane(myEditedACs.front()->getAttribute(SUMO_ATTR_LANE), false);
621 if (lane) {
622 // set previous lane
623 setAttribute(SUMO_ATTR_LANE, lane->getParentEdge()->getChildLanes().at(lane->getIndex() - 1)->getID());
624 }
625}
626
627
628void
633 // extract parameters
634 const double centerPosition = baseObject->getDoubleAttribute(SUMO_ATTR_POSITION);
635 const double size = baseObject->getDoubleAttribute(GNE_ATTR_SIZE);
636 const double laneLength = baseObject->getDoubleAttribute(GNE_ATTR_LANELENGTH);
637 const bool forceSize = baseObject->getBoolAttribute(GNE_ATTR_FORCESIZE);
638 const auto reference = baseObject->getStringAttribute(GNE_ATTR_REFERENCE);
639 // we fill startPos and endPos using the existent parameters
640 double startPos = centerPosition - (size * 0.5);
641 double endPos = centerPosition + (size * 0.5);
643 startPos = centerPosition - size;
644 endPos = centerPosition;
645 } else if (reference == SUMOXMLDefinitions::ReferencePositions.getString(ReferencePosition::RIGHT)) {
646 startPos = centerPosition;
647 endPos = centerPosition + size;
648 }
649 // adjust values
650 if (startPos < 0) {
651 startPos = 0;
652 if (forceSize) {
653 endPos = size;
654 }
655 }
656 if (endPos > laneLength) {
657 endPos = laneLength;
658 if (forceSize) {
659 startPos = laneLength - size;
660 }
661 }
662 if (startPos < 0) {
663 startPos = 0;
664 }
665 if (endPos > laneLength) {
666 endPos = laneLength;
667 }
668 // add it in baseObject
669 baseObject->addDoubleAttribute(SUMO_ATTR_STARTPOS, startPos);
670 baseObject->addDoubleAttribute(SUMO_ATTR_ENDPOS, endPos);
671 }
672}
673
674
675void
677 // only build one time
679 const auto tagPropertiesDatabase = editorParent->getFrameParent()->getViewNet()->getNet()->getTagPropertiesDatabase();
680 // declare vector of types with rows
682 // iterate over all types and create their correspond rows
683 for (const auto type : types) {
684 int maxNumberOfRows = 0;
685 // get max number of rows
686 if (type == AttributeType::BASIC) {
687 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfEditableAttributeRows();
688 } else if (type == AttributeType::FLOW) {
689 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfFlowAttributeRows();
690 } else if (type == AttributeType::GEO) {
691 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfGeoAttributeRows();
692 } else if (type == AttributeType::NETEDIT) {
693 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfNeteditAttributesRows();
694 } else if (type == AttributeType::PARAMETERS) {
695 maxNumberOfRows = 1;
696 } else {
697 throw ProcessError("Invalid editor option");
698 }
699 // resize myAttributesEditorRows and fill it with attribute rows
700 myFirstSingletonAttributesEditorRows[type].resize(maxNumberOfRows);
701 mySecondSingletonAttributesEditorRows[type].resize(maxNumberOfRows);
702 for (int i = 0; i < (int)myFirstSingletonAttributesEditorRows[type].size(); i++) {
705 }
706 }
707
708 }
709
710}
711
712/****************************************************************************/
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:280
#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
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
GNEViewNet * getViewNet() const
get view net
Definition GNEFrame.cpp:145
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)
Definition GNENet.cpp:162
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)
Definition json.hpp:4471