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
22#include <netedit/GNENet.h>
24#include <netedit/GNEUndoList.h>
25#include <netedit/GNEViewNet.h>
37
38#include "GNEAttributesEditor.h"
41
42// ===========================================================================
43// static members
44// ===========================================================================
45
48
49// ===========================================================================
50// FOX callback mapping
51// ===========================================================================
52
61
62// Object implementation
63FXIMPLEMENT(GNEAttributesEditorType, MFXGroupBoxModule, GNEAttributeTableMap, ARRAYNUMBER(GNEAttributeTableMap))
64
65// ===========================================================================
66// method definitions
67// ===========================================================================
68
70 const std::string attributesEditorName, EditorType editorType, AttributeType attributeType) :
71 MFXGroupBoxModule(frameParent, attributesEditorName.c_str()),
72 myFrameParent(frameParent),
73 myAttributesEditorParent(attributesEditorParent),
74 myEditorType(editorType),
75 myAttributeType(attributeType) {
76 // create netedit especific buttons (before row)
77 if (attributeType == AttributeType::NETEDIT) {
78 // create netedit editor buttons
79 myFrontButton = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Front element"), "", "", GUIIconSubSys::getIcon(GUIIcon::FRONTELEMENT), this, MID_GNE_ATTRIBUTESEDITOR_FRONT, GUIDesignButton);
80 myFrontButton->hide();
81 myOpenDialogButton = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Open element dialog"), "", "", nullptr, this, MID_GNE_ATTRIBUTESEDITOR_DIALOG, GUIDesignButton);
82 myOpenDialogButton->hide();
83 // Create buttons
84 myFrameNeteditButtons = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
85 GUIDesigns::buildFXButton(myFrameNeteditButtons, TL("Help"), TL("Open help attributes dialog"), TL("Open help attributes dialog"), nullptr,
87 GUIDesigns::buildFXButton(myFrameNeteditButtons, "", TL("Reset attributes"), TL("Reset attributes"), GUIIconSubSys::getIcon(GUIIcon::RESET),
89 }
90 // build rows
91 buildRows(this);
92 // create specific buttons for extended and parameteres
93 if (myAttributeType == AttributeType::EXTENDED) {
94 // create extended attributes (always shown)
95 myOpenExtendedAttributesButton = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Edit extended attributes"), "", "", nullptr, this, MID_GNE_ATTRIBUTESEDITOR_EXTENDED, GUIDesignButton);
96 } else if (myAttributeType == AttributeType::PARAMETERS) {
97 // create generic attributes editor button (always shown)
98 myOpenGenericParametersEditorButton = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Edit parameters"), "", "", nullptr, this, MID_GNE_ATTRIBUTESEDITOR_PARAMETERS, GUIDesignButton);
99 }
100}
101
102
104 // drow singletons (important if we're reloading)
107}
108
109
114
115
116bool
120
121
122bool
126
127
128const std::vector<GNEAttributeCarrier*>&
132
133
134void
136 // clean previous rows and ACs
137 myEditedACs.clear();
139 // set new ACs and Rows
140 myEditedACs.push_back(AC);
141 if (primaryAttributeEditor) {
143 } else {
145 }
147}
148
149
150void
151GNEAttributesEditorType::showAttributesEditor(const std::unordered_set<GNEAttributeCarrier*>& ACs, const bool primaryAttributeEditor) {
152 // clean previous rows and ACs
153 myEditedACs.clear();
155 // set new ACs and rows
156 for (const auto& AC : ACs) {
157 myEditedACs.push_back(AC);
158 }
159 if (primaryAttributeEditor) {
161 } else {
163 }
165}
166
167
168void
170 myEditedACs.clear();
172 // hide all rows before hidding table
173 for (const auto& row : myAttributesEditorRows) {
174 row->hideAttributeRow();
175 }
176 hide();
177}
178
179
180void
182 bool showButtons = false;
183 int rowIndex = 0;
184 if (myEditedACs.size() > 0) {
185 const auto tagProperty = myEditedACs.front()->getTagProperty();
186 // check if show netedit attributes (only in edit mode)
188 // front button
189 if (tagProperty->isDrawable()) {
190 myFrontButton->show();
191 // disable if we're reparenting
192 if (isReparenting()) {
193 myOpenDialogButton->disable();
194 } else {
195 myOpenDialogButton->enable();
196 }
197 showButtons = true;
198 } else {
199 myFrontButton->hide();
200 }
201 // specific for single edited attributes
202 if ((myEditedACs.size() == 1) && tagProperty->hasDialog()) {
203 // udpate and show edit dialog
204 myOpenDialogButton->setText(TLF("Open % dialog", tagProperty->getTagStr()).c_str());
205 myOpenDialogButton->setIcon(GUIIconSubSys::getIcon(tagProperty->getGUIIcon()));
206 myOpenDialogButton->show();
207 // disable if we're reparenting
208 if (isReparenting()) {
209 myOpenDialogButton->disable();
210 } else {
211 myOpenDialogButton->enable();
212 }
213 showButtons = true;
214 } else {
215 myOpenDialogButton->hide();
216 }
217 }
218 // continue depending of attribute type
220 // only show extended attributes button (already created)
221 if (tagProperty->hasExtendedAttributes()) {
222 showButtons = true;
223 }
225 if (tagProperty->hasParameters()) {
226 // only show parameters row
227 myAttributesEditorRows[rowIndex]->showAttributeRow(this, tagProperty->getAttributeProperties(GNE_ATTR_PARAMETERS), isReparenting());
228 // set parameters button at the end
230 // only show open parameters editor
231 showButtons = true;
232 }
233 } else {
234 // Iterate over tag property of first AC and show row for every attribute
235 for (const auto& attrProperty : tagProperty->getAttributeProperties()) {
236 // filter editor type
237 bool validEditorType = false;
238 if (isEditorTypeCreator() && attrProperty->isCreateMode()) {
239 validEditorType = true;
240 }
241 if (isEditorTypeEditor() && attrProperty->isEditMode()) {
242 validEditorType = true;
243 }
244 // filter types
245 bool validAttributeType = true;
246 if ((myAttributeType == AttributeType::BASIC) && !attrProperty->isBasicEditor()) {
247 validAttributeType = false;
248 }
249 if ((myAttributeType == AttributeType::FLOW) && !attrProperty->isFlowEditor()) {
250 validAttributeType = false;
251 }
252 if ((myAttributeType == AttributeType::GEO) && !attrProperty->isGeoEditor()) {
253 validAttributeType = false;
254 }
255 if ((myAttributeType == AttributeType::NETEDIT) && !attrProperty->isNeteditEditor()) {
256 validAttributeType = false;
257 }
258 if (attrProperty->isExtendedEditor()) {
259 validAttributeType = false;
260 }
261 if (attrProperty->getAttr() == GNE_ATTR_PARAMETERS) {
262 validAttributeType = false;
263 }
264 if (validEditorType && validAttributeType) {
265 if (rowIndex < (int)myAttributesEditorRows.size()) {
266 // only update if row was show successfully
267 if (myAttributesEditorRows[rowIndex]->showAttributeRow(this, attrProperty, isReparenting())) {
268 rowIndex++;
269 }
270 } else {
271 throw ProcessError("Invalid maximum number of rows");
272 }
273 }
274 }
275 // hide rest of rows before showing table
276 for (int i = rowIndex; i < (int)myAttributesEditorRows.size(); i++) {
277 myAttributesEditorRows[i]->hideAttributeRow();
278 }
279 }
280 }
281 // check if show row
282 if ((rowIndex == 0) && !showButtons) {
284 } else {
286 myFrameNeteditButtons->reparent(this);
287 }
288 show();
289 }
290}
291
292
293void
295 for (const auto& row : myAttributesEditorRows) {
296 row->disable();
297 }
298}
299
300
301bool
303 // iterate over all rows and check if values are valid
304 for (const auto& row : myAttributesEditorRows) {
305 if (!row->isValueValid()) {
306 if (showWarning) {
307 const std::string errorMessage = TLF("Invalid value '%' in attribute %", row->getCurrentValue(), row->getAttrProperty()->getAttrStr());
308 // show warning
309 WRITE_WARNING(errorMessage);
310 // set message in status bar
311 myFrameParent->getViewNet()->setStatusBarText(errorMessage);
312 return false;
313 }
314 }
315 }
316 return true;
317}
318
319
321GNEAttributesEditorType::fillSumoBaseObject(CommonXMLStructure::SumoBaseObject* baseObject, const bool insertDefaultValues) const {
322 // iterate over every attribute row and stop if there was an error
323 for (const auto& row : myAttributesEditorRows) {
324 if (row->isAttributeRowShown()) {
325 const auto fillResult = row->fillSumoBaseObject(baseObject, insertDefaultValues);
326 if (fillResult != SUMO_ATTR_NOTHING) {
327 return fillResult;
328 }
329 }
330 }
331 // handle special case for elemnt with start-end position over lanes
332 fillStartEndAttributes(baseObject);
333 // all ok, then return nothing
334 return SUMO_ATTR_NOTHING;
335}
336
337
338bool
342
343
344bool
348
349
350void
355
356
357void
362
363
364long
365GNEAttributesEditorType::onCmdMarkAsFront(FXObject*, FXSelector, void*) {
366 // front all edited ACs
367 for (auto& AC : myEditedACs) {
368 AC->markForDrawingFront();
369 }
370 return 1;
371}
372
373
374long
376 // check number of inspected elements
377 if (myEditedACs.size() == 1) {
378 const auto editedTag = myEditedACs.front()->getTagProperty()->getTag();
379 // check AC
380 if (editedTag == SUMO_TAG_REROUTER) {
381 // Open rerouter dialog
382 GNERerouterDialog(dynamic_cast<GNERerouter*>(myEditedACs.front()));
383 } else if ((editedTag == SUMO_TAG_CALIBRATOR) || (editedTag == GNE_TAG_CALIBRATOR_LANE)) {
384 // Open calibrator dialog
385 GNECalibratorDialog(dynamic_cast<GNECalibrator*>(myEditedACs.front()));
386 } else if (editedTag == SUMO_TAG_VSS) {
387 // Open VSS dialog
389 }
390 }
391 return 1;
392}
393
394
395long
397 // obtain edited AC (temporal), until unification of
398 const auto demandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(myEditedACs.front()->getTagProperty()->getTag(), myEditedACs.front()->getID(), false);
399 // open vehicle type dialog
400 if (demandElement) {
401 GNEVehicleTypeDialog(demandElement, true); // NOSONAR, constructor returns after dialog has been closed
403 }
404 return 1;
405}
406
407
408long
410 // get internal test (for code legibly)
411 const auto internalTest = myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getInternalTest();
412 if (GNESingleParametersDialog(this).openModalDialog(internalTest)) {
414 }
415 return 1;
416}
417
418
419long
421 if (myEditedACs.size() > 0) {
423 }
424 return 1;
425}
426
427
428long
430 if (myEditedACs.size() > 0) {
431 // continue depending if we're creating or inspecting (undo-redo)
433 for (auto& AC : myEditedACs) {
434 AC->resetDefaultValues(false);
435 }
436 } else {
437 myFrameParent->getViewNet()->getUndoList()->begin(myEditedACs.front()->getTagProperty()->getGUIIcon(), TLF("reset %", myEditedACs.front()->getTagProperty()->getTagStr()));
438 for (auto& AC : myEditedACs) {
439 AC->resetDefaultValues(true);
440 }
442 }
443 // refresh all attributes editor types
445 }
446 return 1;
447}
448
449
450void
451GNEAttributesEditorType::setAttribute(SumoXMLAttr attr, const std::string& value) {
452 const auto undoList = myFrameParent->getViewNet()->getUndoList();
453 const auto tagProperty = myEditedACs.front()->getTagProperty();
454 // continue depending if we're creating or inspecting
455 if (isEditorTypeCreator()) {
456 // Set new value of attribute in all edited ACs without undo-redo
457 for (const auto& editedAC : myEditedACs) {
458 editedAC->setAttribute(attr, value);
459 }
460 } else if (isEditorTypeEditor()) {
461 // first check if we're editing a single attribute or an ID
462 if (myEditedACs.size() > 1) {
463 undoList->begin(tagProperty->getGUIIcon(), TLF("change multiple % attributes", tagProperty->getTagStr()));
464 } else if (attr == SUMO_ATTR_ID) {
465 // IDs attribute has to be encapsulated because implies multiple changes in different additionals (due references)
466 undoList->begin(tagProperty->getGUIIcon(), TLF("change % attribute", tagProperty->getTagStr()));
467 }
468 // Set new value of attribute in all edited ACs
469 for (const auto& editedAC : myEditedACs) {
470 editedAC->setAttribute(attr, value, undoList);
471 }
472 // finish change multiple attributes or ID Attributes
473 if ((myEditedACs.size() > 1) || (attr == SUMO_ATTR_ID)) {
474 undoList->end();
475 }
476 }
478 // update frame parent (needed to update other attribute tables)
480}
481
482
483void
485 const auto undoList = myFrameParent->getViewNet()->getUndoList();
486 const auto tagProperty = myEditedACs.front()->getTagProperty();
487 // continue depending if we're creating or inspecting
488 if (isEditorTypeCreator()) {
489 // Set new value of attribute in all edited ACs without undo-redo
490 for (const auto& editedAC : myEditedACs) {
491 editedAC->toggleAttribute(attr, value);
492 }
493 } else if (isEditorTypeEditor()) {
494 // first check if we're editing a single attribute
495 if (myEditedACs.size() > 1) {
496 undoList->begin(tagProperty->getGUIIcon(), TLF("change multiple % attributes", tagProperty->getTagStr()));
497 }
498 // Set new value of attribute in all edited ACs
499 for (const auto& editedAC : myEditedACs) {
500 if (value) {
501 editedAC->enableAttribute(attr, undoList);
502 } else {
503 editedAC->disableAttribute(attr, undoList);
504 }
505 }
506 // finish change multiple attributes or ID Attributes
507 if ((myEditedACs.size() > 1) || (attr == SUMO_ATTR_ID)) {
508 undoList->end();
509 }
510 }
512 // update frame parent (needed to update other attribute tables)
514}
515
516
517void
519 if (myEditedACs.front()->getTagProperty()->getXMLParentTags().size() > 0) {
520 myReparentTag = myEditedACs.front()->getTagProperty()->getXMLParentTags().front();
522 myFrameParent->getViewNet()->update();
523 }
524}
525
526
527void
534
535
536void
538 const auto lane = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveLane(myEditedACs.front()->getAttribute(SUMO_ATTR_LANE), false);
539 if (lane) {
540 // set next lane
541 setAttribute(SUMO_ATTR_LANE, lane->getParentEdge()->getChildLanes().at(lane->getIndex() + 1)->getID());
542 }
543}
544
545
546void
548 const auto lane = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveLane(myEditedACs.front()->getAttribute(SUMO_ATTR_LANE), false);
549 if (lane) {
550 // set previous lane
551 setAttribute(SUMO_ATTR_LANE, lane->getParentEdge()->getChildLanes().at(lane->getIndex() - 1)->getID());
552 }
553}
554
555
556void
561 // extract parameters
562 const double centerPosition = baseObject->getDoubleAttribute(SUMO_ATTR_POSITION);
563 const double size = baseObject->getDoubleAttribute(GNE_ATTR_SIZE);
564 const double laneLength = baseObject->getDoubleAttribute(GNE_ATTR_LANELENGTH);
565 const bool forceSize = baseObject->getBoolAttribute(GNE_ATTR_FORCESIZE);
566 const auto reference = baseObject->getStringAttribute(GNE_ATTR_REFERENCE);
567 // we fill startPos and endPos using the existent parameters
568 double startPos = centerPosition - (size * 0.5);
569 double endPos = centerPosition + (size * 0.5);
571 startPos = centerPosition - size;
572 endPos = centerPosition;
573 } else if (reference == SUMOXMLDefinitions::ReferencePositions.getString(ReferencePosition::RIGHT)) {
574 startPos = centerPosition;
575 endPos = centerPosition + size;
576 }
577 // adjust values
578 if (startPos < 0) {
579 startPos = 0;
580 if (forceSize) {
581 endPos = size;
582 }
583 }
584 if (endPos > laneLength) {
585 endPos = laneLength;
586 if (forceSize) {
587 startPos = laneLength - size;
588 }
589 }
590 if (startPos < 0) {
591 startPos = 0;
592 }
593 if (endPos > laneLength) {
594 endPos = laneLength;
595 }
596 // add it in baseObject
597 baseObject->addDoubleAttribute(SUMO_ATTR_STARTPOS, startPos);
598 baseObject->addDoubleAttribute(SUMO_ATTR_ENDPOS, endPos);
599 }
600}
601
602
603void
605 // only build one time
607 const auto tagPropertiesDatabase = editorParent->getFrameParent()->getViewNet()->getNet()->getTagPropertiesDatabase();
608 // declare vector of types with rows
610 // iterate over all types and create their correspond rows
611 for (const auto type : types) {
612 int maxNumberOfRows = 0;
613 // get max number of rows
614 if (type == AttributeType::BASIC) {
615 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfEditableAttributeRows();
616 } else if (type == AttributeType::FLOW) {
617 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfFlowAttributeRows();
618 } else if (type == AttributeType::GEO) {
619 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfGeoAttributeRows();
620 } else if (type == AttributeType::NETEDIT) {
621 maxNumberOfRows = tagPropertiesDatabase->getMaxNumberOfNeteditAttributesRows();
622 } else if (type == AttributeType::PARAMETERS) {
623 maxNumberOfRows = 1;
624 } else {
625 throw ProcessError("Invalid editor option");
626 }
627 // resize myAttributesEditorRows and fill it with attribute rows
628 myFirstSingletonAttributesEditorRows[type].resize(maxNumberOfRows);
629 mySecondSingletonAttributesEditorRows[type].resize(maxNumberOfRows);
630 for (int i = 0; i < (int)myFirstSingletonAttributesEditorRows[type].size(); i++) {
633 }
634 }
635
636 }
637
638}
639
640/****************************************************************************/
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:91
#define GUIDesignButton
Definition GUIDesigns.h:82
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:399
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
Definition GUIDesigns.h:94
@ FRONTELEMENT
#define WRITE_WARNING(msg)
Definition MsgHandler.h:287
#define TL(string)
Definition MsgHandler.h:305
#define TLF(string,...)
Definition MsgHandler.h:307
@ 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
GNEInternalTest * getInternalTest() const
get netedit test system
const std::string getID() const
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 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
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 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
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)
FXButton * myOpenDialogButton
pointer to open dialog button (usually additionals)
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)
FXButton * myOpenGenericParametersEditorButton
pointer to open generic parameters editor button
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
long onCmdOpenEditParametersDialog(FXObject *, FXSelector, void *)
called when user press the "Edit parameters" button
void disableAttributesEditor()
disable attribute editor
FXButton * myFrontButton
pointer to front button
Dialog for edit calibrators.
virtual void attributeUpdated(SumoXMLAttr attribute)
function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/....
Definition GNEFrame.cpp:296
GNEViewNet * getViewNet() const
get view net
Definition GNEFrame.cpp:155
void openHelpAttributesDialog(const GNEAttributeCarrier *AC) const
Open help attributes dialog.
Definition GNEFrame.cpp:189
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
Definition GNENet.cpp:147
const GNETagPropertiesDatabase * getTagPropertiesDatabase() const
get tag properties database
Definition GNENet.cpp:141
Dialog for edit rerouters.
Dialog for edit parameters.
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...
Dialog for editing calibrator vehicle types.
GNENet * getNet() const
get the net object
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 FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
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)
Definition json.hpp:4471