Eclipse SUMO - Simulation of Urban MObility
GNETypeFrame.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 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// The Widget for edit Type elements (vehicle, person and container)
19/****************************************************************************/
20#include <config.h>
21
22#include <netedit/GNENet.h>
23#include <netedit/GNEUndoList.h>
24#include <netedit/GNEViewNet.h>
31
32#include "GNETypeFrame.h"
33
34
35// ===========================================================================
36// FOX callback mapping
37// ===========================================================================
38
41};
42
47};
48
49FXDEFMAP(GNETypeFrame::VTypeDistributions) VTypeDistributionsMap[] = {
51};
52
53// Object implementation
54FXIMPLEMENT(GNETypeFrame::TypeSelector, MFXGroupBoxModule, typeSelectorMap, ARRAYNUMBER(typeSelectorMap))
55FXIMPLEMENT(GNETypeFrame::TypeEditor, MFXGroupBoxModule, typeEditorMap, ARRAYNUMBER(typeEditorMap))
56FXIMPLEMENT(GNETypeFrame::VTypeDistributions, MFXGroupBoxModule, VTypeDistributionsMap, ARRAYNUMBER(VTypeDistributionsMap))
57
58
59// ===========================================================================
60// method definitions
61// ===========================================================================
62
63// ---------------------------------------------------------------------------
64// GNETypeFrame::TypeSelector - methods
65// ---------------------------------------------------------------------------
66
68 MFXGroupBoxModule(typeFrameParent, TL("Current Type")),
69 myTypeFrameParent(typeFrameParent),
70 myCurrentType(nullptr) {
71 // Create FXComboBox
72 myTypeComboBox = new MFXIconComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, true, this, MID_GNE_SET_TYPE, GUIDesignComboBox);
73 // add default Types (always first)
74 for (const auto& vType : myTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) {
75 if (DEFAULT_VTYPES.count(vType->getID()) != 0) {
76 myTypeComboBox->appendIconItem(vType->getID().c_str(), vType->getACIcon(), FXRGB(255, 255, 200));
77 }
78 }
79 // fill myTypeMatchBox with list of VTypes IDs
80 for (const auto& vType : myTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) {
81 if (DEFAULT_VTYPES.count(vType->getID()) == 0) {
82 myTypeComboBox->appendIconItem(vType->getID().c_str(), vType->getACIcon());
83 }
84 }
85 // set DEFAULT_VEHTYPE as default VType
86 myCurrentType = myTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID);
87 // Set visible items
88 if (myTypeComboBox->getNumItems() <= 20) {
89 myTypeComboBox->setNumVisible((int)myTypeComboBox->getNumItems());
90 } else {
91 myTypeComboBox->setNumVisible(20);
92 }
93 // TypeSelector is always shown
94 show();
95}
96
97
99
100
103 return myCurrentType;
104}
105
106
107void
109 myCurrentType = vType;
110 refreshTypeSelector();
111}
112
113
114void
116 bool valid = false;
117 // clear items
118 myTypeComboBox->clearItems();
119 // add default Vehicle an Bike types in the first and second positions
120 for (const auto& vType : myTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) {
121 if (DEFAULT_VTYPES.count(vType->getID()) != 0) {
122 myTypeComboBox->appendIconItem(vType->getID().c_str(), vType->getACIcon(), FXRGB(255, 255, 200));
123 }
124 }
125 // fill myTypeMatchBox with list of VTypes IDs
126 for (const auto& vType : myTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) {
127 if (DEFAULT_VTYPES.count(vType->getID()) == 0) {
128 myTypeComboBox->appendIconItem(vType->getID().c_str(), vType->getACIcon());
129 }
130 }
131 // Set visible items
132 if (myTypeComboBox->getNumItems() <= 20) {
133 myTypeComboBox->setNumVisible((int)myTypeComboBox->getNumItems());
134 } else {
135 myTypeComboBox->setNumVisible(20);
136 }
137 // make sure that tag is in myTypeMatchBox
138 if (myCurrentType) {
139 for (int i = 0; i < (int)myTypeComboBox->getNumItems(); i++) {
140 if (myTypeComboBox->getItem(i).text() == myCurrentType->getID()) {
141 myTypeComboBox->setCurrentItem(i);
142 valid = true;
143 }
144 }
145 }
146 // Check that give vType type is valid
147 if (!valid) {
148 // set DEFAULT_VEHTYPE as default VType
149 myCurrentType = myTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID);
150 // refresh myTypeMatchBox again
151 for (int i = 0; i < (int)myTypeComboBox->getNumItems(); i++) {
152 if (myTypeComboBox->getItem(i).text() == myCurrentType->getID()) {
153 myTypeComboBox->setCurrentItem(i);
154 }
155 }
156 }
157 // refresh vehicle type editor module
158 myTypeFrameParent->myTypeEditor->refreshTypeEditorModule();
159 // set myCurrentType as inspected element
160 myTypeFrameParent->getViewNet()->setInspectedAttributeCarriers({myCurrentType});
161 // show modules
162 myTypeFrameParent->myTypeAttributesEditor->showAttributeEditorModule(false, true);
163 myTypeFrameParent->myAttributesEditorExtended->showAttributesEditorExtendedModule();
164 myTypeFrameParent->myVTypeDistributions->showVTypeDistributionsModule();
165}
166
167
168void
170 if (myCurrentType) {
171 myTypeComboBox->setIconItem(myTypeComboBox->getCurrentItem(), myCurrentType->getID().c_str(), myCurrentType->getACIcon());
172 }
173}
174
175
176long
177GNETypeFrame::TypeSelector::onCmdSelectItem(FXObject*, FXSelector, void*) {
178 // Check if value of myTypeMatchBox correspond of an allowed additional tags
179 for (const auto& vType : myTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) {
180 if (vType->getID() == myTypeComboBox->getText().text()) {
181 // set pointer
182 myCurrentType = vType;
183 // set color of myTypeMatchBox to black (valid)
184 myTypeComboBox->setTextColor(FXRGB(0, 0, 0));
185 // refresh vehicle type editor module
186 myTypeFrameParent->myTypeEditor->refreshTypeEditorModule();
187 // set myCurrentType as inspected element
188 myTypeFrameParent->getViewNet()->setInspectedAttributeCarriers({myCurrentType});
189 // show modules if selected item is valid
190 myTypeFrameParent->myTypeAttributesEditor->showAttributeEditorModule(false, true);
191 myTypeFrameParent->myAttributesEditorExtended->showAttributesEditorExtendedModule();
192 myTypeFrameParent->myVTypeDistributions->showVTypeDistributionsModule();
193 // Write Warning in console if we're in testing mode
194 WRITE_DEBUG(("Selected item '" + myTypeComboBox->getText() + "' in TypeSelector").text());
195 // update viewNet
196 myTypeFrameParent->getViewNet()->updateViewNet();
197 return 1;
198 }
199 }
200 myCurrentType = nullptr;
201 // refresh vehicle type editor module
202 myTypeFrameParent->myTypeEditor->refreshTypeEditorModule();
203 // hide all modules if selected item isn't valid
204 myTypeFrameParent->myTypeAttributesEditor->hideAttributesEditorModule();
205 myTypeFrameParent->myAttributesEditorExtended->hideAttributesEditorExtendedModule();
206 myTypeFrameParent->myVTypeDistributions->hideVTypeDistributionsModule();
207 // set color of myTypeMatchBox to red (invalid)
208 myTypeComboBox->setTextColor(FXRGB(255, 0, 0));
209 // Write Warning in console if we're in testing mode
210 WRITE_DEBUG("Selected invalid item in TypeSelector");
211 // update viewNet
212 myTypeFrameParent->getViewNet()->updateViewNet();
213 return 1;
214}
215
216// ---------------------------------------------------------------------------
217// GNETypeFrame::TypeEditor - methods
218// ---------------------------------------------------------------------------
219
221 MFXGroupBoxModule(typeFrameParent, TL("Type Editor")),
222 myTypeFrameParent(typeFrameParent) {
223 // Create new vehicle type
225 // Create delete/reset vehicle type
227 // Create copy vehicle type
229}
230
231
233
234
235void
237 refreshTypeEditorModule();
238 show();
239}
240
241
242void
244 hide();
245}
246
247
248void
250 // first check if selected VType is valid
251 if (myTypeFrameParent->myTypeSelector->getCurrentType() == nullptr) {
252 // disable buttons
253 myDeleteResetTypeButton->disable();
254 myCopyTypeButton->disable();
255 } else if (GNEAttributeCarrier::parse<bool>(myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(GNE_ATTR_DEFAULT_VTYPE))) {
256 // enable copy button
257 myCopyTypeButton->enable();
258 // enable and set myDeleteTypeButton as "reset")
259 myDeleteResetTypeButton->setText(TL("Reset Type"));
260 myDeleteResetTypeButton->setIcon(GUIIconSubSys::getIcon(GUIIcon::RESET));
261 // check if reset default vehicle type button has to be enabled or disabled
262 if (GNEAttributeCarrier::parse<bool>(myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(GNE_ATTR_DEFAULT_VTYPE_MODIFIED))) {
263 myDeleteResetTypeButton->enable();
264 } else {
265 myDeleteResetTypeButton->disable();
266 }
267 } else {
268 // enable copy button
269 myCopyTypeButton->enable();
270 // enable and set myDeleteTypeButton as "delete")
271 myDeleteResetTypeButton->setText(TL("Delete Type"));
272 myDeleteResetTypeButton->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEDELETE));
273 myDeleteResetTypeButton->enable();
274 }
275 // update module
276 recalc();
277}
278
279
280long
281GNETypeFrame::TypeEditor::onCmdCreateType(FXObject*, FXSelector, void*) {
282 // obtain a new valid Type ID
283 const std::string typeID = myTypeFrameParent->myViewNet->getNet()->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_VTYPE);
284 // create new vehicle type
285 GNEDemandElement* type = new GNEVType(myTypeFrameParent->myViewNet->getNet(), typeID);
286 // add it using undoList (to allow undo-redo)
287 myTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::VTYPE, "create vehicle type");
288 myTypeFrameParent->myViewNet->getUndoList()->add(new GNEChange_DemandElement(type, true), true);
289 myTypeFrameParent->myViewNet->getUndoList()->end();
290 // set created vehicle type in selector
291 myTypeFrameParent->myTypeSelector->setCurrentType(type);
292 // refresh Type Editor Module
293 myTypeFrameParent->myTypeEditor->refreshTypeEditorModule();
294 return 1;
295}
296
297
298long
300 // continue depending of current mode
301 if (myDeleteResetTypeButton->getIcon() == GUIIconSubSys::getIcon(GUIIcon::MODEDELETE)) {
302 deleteType();
303 } else {
304 resetType();
305 }
306 return 1;
307}
308
309
310long
311GNETypeFrame::TypeEditor::onCmdCopyType(FXObject*, FXSelector, void*) {
312 // obtain a new valid Type ID
313 const std::string typeID = myTypeFrameParent->myViewNet->getNet()->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_VTYPE);
314 // obtain vehicle type in which new Type will be based
315 GNEVType* vType = dynamic_cast<GNEVType*>(myTypeFrameParent->myTypeSelector->getCurrentType());
316 // check that vType exist
317 if (vType) {
318 // create a new Type based on the current selected vehicle type
319 GNEDemandElement* typeCopy = new GNEVType(myTypeFrameParent->myViewNet->getNet(), typeID, vType);
320 // begin undo list operation
321 myTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::VTYPE, "copy vehicle type");
322 // add it using undoList (to allow undo-redo)
323 myTypeFrameParent->myViewNet->getUndoList()->add(new GNEChange_DemandElement(typeCopy, true), true);
324 // end undo list operation
325 myTypeFrameParent->myViewNet->getUndoList()->end();
326 // refresh Type Selector (to show the new VType)
327 myTypeFrameParent->myTypeSelector->refreshTypeSelector();
328 // set created vehicle type in selector
329 myTypeFrameParent->myTypeSelector->setCurrentType(typeCopy);
330 // refresh Type Editor Module
331 myTypeFrameParent->myTypeEditor->refreshTypeEditorModule();
332 }
333 return 1;
334}
335
336
337void
339 // begin reset default vehicle type values
340 myTypeFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::VTYPE, "reset default vehicle type values");
341 // reset all values of default vehicle type
342 for (const auto& attrProperty : GNEAttributeCarrier::getTagProperty(SUMO_TAG_VTYPE)) {
343 // change all attributes with "" to reset it (except ID and vClass)
344 if ((attrProperty.getAttr() != SUMO_ATTR_ID) && (attrProperty.getAttr() != SUMO_ATTR_VCLASS)) {
345 myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(attrProperty.getAttr(), "", myTypeFrameParent->myViewNet->getUndoList());
346 }
347 }
348 // change manually VClass (because it depends of Default VType)
349 if (myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(SUMO_ATTR_ID) == DEFAULT_VTYPE_ID) {
350 myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(SUMO_ATTR_VCLASS, toString(SVC_PASSENGER), myTypeFrameParent->myViewNet->getUndoList());
351 } else if (myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(SUMO_ATTR_ID) == DEFAULT_BIKETYPE_ID) {
352 myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(SUMO_ATTR_VCLASS, toString(SVC_BICYCLE), myTypeFrameParent->myViewNet->getUndoList());
353 } else if (myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(SUMO_ATTR_ID) == DEFAULT_TAXITYPE_ID) {
354 myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(SUMO_ATTR_VCLASS, toString(SVC_TAXI), myTypeFrameParent->myViewNet->getUndoList());
355 } else if (myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(SUMO_ATTR_ID) == DEFAULT_PEDTYPE_ID) {
356 myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(SUMO_ATTR_VCLASS, toString(SVC_PEDESTRIAN), myTypeFrameParent->myViewNet->getUndoList());
357 } else if (myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(SUMO_ATTR_ID) == DEFAULT_CONTAINERTYPE_ID) {
358 myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(SUMO_ATTR_VCLASS, toString(SVC_PEDESTRIAN), myTypeFrameParent->myViewNet->getUndoList());
359 }
360 // change special attribute GNE_ATTR_DEFAULT_VTYPE_MODIFIED
361 myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(GNE_ATTR_DEFAULT_VTYPE_MODIFIED, "false", myTypeFrameParent->myViewNet->getUndoList());
362 // finish reset default vehicle type values
363 myTypeFrameParent->getViewNet()->getUndoList()->end();
364 // refresh TypeSelector
365 myTypeFrameParent->myTypeSelector->refreshTypeSelector();
366}
367
368
369void
371 // show question dialog if vtype has already assigned vehicles
372 if (myTypeFrameParent->myTypeSelector->getCurrentType()->getChildDemandElements().size() > 0) {
373 std::string plural = myTypeFrameParent->myTypeSelector->getCurrentType()->getChildDemandElements().size() == 1 ? ("") : ("s");
374 // show warning in gui testing debug mode
375 WRITE_DEBUG("Opening FXMessageBox 'remove vType'");
376 // Ask confirmation to user
377 FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO,
378 ("Remove " + toString(SUMO_TAG_VTYPE) + "s").c_str(), "%s",
379 ("Delete " + toString(SUMO_TAG_VTYPE) + " '" + myTypeFrameParent->myTypeSelector->getCurrentType()->getID() +
380 "' will remove " + toString(myTypeFrameParent->myTypeSelector->getCurrentType()->getChildDemandElements().size()) +
381 " vehicle" + plural + ". Continue?").c_str());
382 if (answer != 1) { // 1:yes, 2:no, 4:esc
383 // write warning if netedit is running in testing mode
384 if (answer == 2) {
385 WRITE_DEBUG("Closed FXMessageBox 'remove vType' with 'No'");
386 } else if (answer == 4) {
387 WRITE_DEBUG("Closed FXMessageBox 'remove vType' with 'ESC'");
388 }
389 } else {
390 // begin undo list operation
391 myTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::VTYPE, "delete vehicle type");
392 // remove vehicle type (and all of their children)
393 myTypeFrameParent->myViewNet->getNet()->deleteDemandElement(myTypeFrameParent->myTypeSelector->getCurrentType(),
394 myTypeFrameParent->myViewNet->getUndoList());
395 // end undo list operation
396 myTypeFrameParent->myViewNet->getUndoList()->end();
397 }
398 } else {
399 // begin undo list operation
400 myTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::VTYPE, "delete vehicle type");
401 // remove vehicle type (and all of their children)
402 myTypeFrameParent->myViewNet->getNet()->deleteDemandElement(myTypeFrameParent->myTypeSelector->getCurrentType(),
403 myTypeFrameParent->myViewNet->getUndoList());
404 // end undo list operation
405 myTypeFrameParent->myViewNet->getUndoList()->end();
406 }
407}
408
409// ---------------------------------------------------------------------------
410// GNEFrameAttributeModules::VTypeDistributions - methods
411// ---------------------------------------------------------------------------
412
414 MFXGroupBoxModule(typeFrameParent, TL("VType Distributions")),
415 myTypeFrameParent(typeFrameParent) {
416 // Create open dialog button
417 new FXButton(getCollapsableFrame(), TL("Show VType Distributions"), nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButton);
418 // create vType distribution dialog
420}
421
422
424
425
428 return myTypeFrameParent;
429}
430
431
432void
434 show();
435}
436
437
438void
440 // always close dialog
441 myVTypeDistributionsDialog->close();
442 hide();
443}
444
445
448 return myVTypeDistributionsDialog;
449}
450
451
452long
454 // open VTypeDistributions Dialog
455 myVTypeDistributionsDialog->openDialog();
456 return 1;
457}
458
459// ---------------------------------------------------------------------------
460// GNETypeFrame - methods
461// ---------------------------------------------------------------------------
462
464 GNEFrame(viewParent, viewNet, "Types") {
465
466 // create module for edit vehicle types (Create, copy, etc.)
467 myTypeEditor = new TypeEditor(this);
468
469 // create vehicle type selector
470 myTypeSelector = new TypeSelector(this);
471
472 // Create vehicle type attributes editor
474
475 // create module for open extended attributes dialog
477
478 // create module for open vType distribution dialog
480
481 // set "VTYPE_DEFAULT" as default vehicle Type
483}
484
485
487
488
489void
491 // refresh vehicle type and Attribute Editor
493 // set myCurrentType as inspected element
495 // show modules
499 // show frame
501}
502
503
506 return myTypeSelector;
507}
508
509
510void
512 // after changing an attribute myTypeSelector, we need to update the list of typeSelector, because ID could be changed
514 //... and typeEditor (due reset)
516}
517
518
519void
521 // open vehicle type dialog
523 GNEVehicleTypeDialog(myTypeSelector->getCurrentType(), true); // NOSONAR, constructor returns after dialog has been closed
524 // set myCurrentType as inspected element
526 // call "showAttributeEditorModule" to refresh attribute list
528 }
529}
530
531
532/****************************************************************************/
FXDEFMAP(GNETypeFrame::TypeSelector) typeSelectorMap[]
@ MID_GNE_DELETE
delete element
Definition: GUIAppEnum.h:874
@ MID_GNE_SET_ATTRIBUTE_DIALOG
attribute edited trough dialog
Definition: GUIAppEnum.h:904
@ MID_GNE_COPY
copy element
Definition: GUIAppEnum.h:884
@ MID_GNE_CREATE
create element
Definition: GUIAppEnum.h:872
@ MID_GNE_SET_TYPE
used to select a type of element in a combo box
Definition: GUIAppEnum.h:888
#define GUIDesignButton
Definition: GUIDesigns.h:77
#define GUIDesignComboBox
Definition: GUIDesigns.h:306
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:321
GLenum myCurrentType
Definition: GUIPolygon.cpp:54
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:276
#define TL(string)
Definition: MsgHandler.h:282
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_TAXI
vehicle is a taxi
@ SVC_PEDESTRIAN
pedestrian
const std::string DEFAULT_TAXITYPE_ID
const std::string DEFAULT_PEDTYPE_ID
const std::set< std::string > DEFAULT_VTYPES
const std::string DEFAULT_VTYPE_ID
const std::string DEFAULT_CONTAINERTYPE_ID
const std::string DEFAULT_BIKETYPE_ID
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ GNE_ATTR_DEFAULT_VTYPE
Flag to check if VType is a default VType.
@ SUMO_ATTR_VCLASS
@ SUMO_ATTR_ID
@ GNE_ATTR_DEFAULT_VTYPE_MODIFIED
Flag to check if a default VType was modified.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
An Element which don't belong to GNENet but has influence in the simulation.
void showAttributesEditorExtendedModule()
show AttributesEditorExtended modul
void showAttributeEditorModule(bool includeExtended, bool forceAttributeEnabled)
show attributes of multiple ACs
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:150
GNEViewNet * myViewNet
FOX need this.
Definition: GNEFrame.h:117
virtual void show()
show Frame
Definition: GNEFrame.cpp:115
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:124
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:132
void resetType()
reset type
long onCmdDeleteResetType(FXObject *, FXSelector, void *)
Called when "Delete/Reset Vehicle Type" button is clicked.
void deleteType()
delete type
void showTypeEditorModule()
show TypeEditor modul
FXButton * myCreateTypeButton
"create vehicle type" button
Definition: GNETypeFrame.h:138
long onCmdCreateType(FXObject *, FXSelector, void *)
FXButton * myDeleteResetTypeButton
"delete/reset vehicle type" button
Definition: GNETypeFrame.h:141
FXButton * myCopyTypeButton
"copy vehicle type"
Definition: GNETypeFrame.h:144
TypeEditor(GNETypeFrame *typeFrameParent)
FOX-declaration.
void hideTypeEditorModule()
hide TypeEditor box
void refreshTypeEditorModule()
update TypeEditor modul
long onCmdCopyType(FXObject *, FXSelector, void *)
Called when "Copy Vehicle Type" button is clicked.
void setCurrentType(GNEDemandElement *vType)
set current Vehicle Type
void refreshTypeSelectorIDs()
refresh vehicle type selector (only IDs, without refreshing attributes)
long onCmdSelectItem(FXObject *, FXSelector, void *)
GNEDemandElement * getCurrentType() const
get current Vehicle Type
void refreshTypeSelector()
refresh vehicle type selector
void showVTypeDistributionsModule()
show VTypeDistributions modul
long onCmdOpenDialog(FXObject *, FXSelector, void *)
GNEVTypeDistributionsDialog * myVTypeDistributionsDialog
VType distribution dialog.
Definition: GNETypeFrame.h:189
GNETypeFrame * getTypeFrameParent() const
get pointer to type frame Parent
void hideVTypeDistributionsModule()
hide group box
VTypeDistributions(GNETypeFrame *typeFrameParent)
FOX-declaration.
GNEVTypeDistributionsDialog * getVTypeDistributionsDialog() const
get vType distribution dialog
GNEFrameAttributeModules::AttributesEditorExtended * myAttributesEditorExtended
modul for open extended attributes dialog
Definition: GNETypeFrame.h:225
void attributesEditorExtendedDialogOpened()
open GNEAttributesCreator extended dialog (used for editing advance attributes of Vehicle Types)
void show()
show Frame
GNETypeFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
TypeSelector * getTypeSelector() const
get vehicle type selector
void attributeUpdated()
function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/....
GNEFrameAttributeModules::AttributesEditor * myTypeAttributesEditor
editorinternal vehicle type attributes
Definition: GNETypeFrame.h:222
VTypeDistributions * myVTypeDistributions
modul for open vType distributions dialog
Definition: GNETypeFrame.h:228
TypeEditor * myTypeEditor
Vehicle Type editor (Create, copy, etc.)
Definition: GNETypeFrame.h:219
~GNETypeFrame()
Destructor.
TypeSelector * myTypeSelector
vehicle type selector
Definition: GNETypeFrame.h:216
Dialog for editing calibrator vehicle types.
GNENet * getNet() const
get the net object
void setInspectedAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
set inspected attributeCarrier
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:84
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)
ComboBox with icon.