SUMO - Simulation of Urban MObility
GNEInspectorFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
7 // The Widget for modifying network-element attributes (i.e. lane speed)
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
31 #ifdef HAVE_VERSION_H
32 #include <version.h>
33 #endif
34 
35 #include <cmath>
36 #include <cassert>
37 #include <iostream>
41 #include "GNEInspectorFrame.h"
42 #include "GNEUndoList.h"
43 #include "GNEEdge.h"
44 #include "GNEAttributeCarrier.h"
45 #include "GNEAdditional.h"
46 #include "GNEViewNet.h"
47 #include "GNEViewParent.h"
48 
49 #ifdef CHECK_MEMORY_LEAKS
50 #include <foreign/nvwa/debug_new.h>
51 #endif // CHECK_MEMORY_LEAKS
52 
53 
54 // ===========================================================================
55 // FOX callback mapping
56 // ===========================================================================
57 
58 FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[] = {
63 };
64 
65 
66 FXDEFMAP(GNEInspectorFrame::AttrInput) AttrInputMap[] = {
69 };
70 
71 FXDEFMAP(GNEInspectorFrame::AttrEditor) AttrEditorMap[] = {
73 };
74 
75 // Object implementation
76 FXIMPLEMENT(GNEInspectorFrame, FXScrollWindow, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
77 FXIMPLEMENT(GNEInspectorFrame::AttrInput, FXMatrix, AttrInputMap, ARRAYNUMBER(AttrInputMap))
78 FXIMPLEMENT(GNEInspectorFrame::AttrEditor, FXDialogBox, AttrEditorMap, ARRAYNUMBER(AttrEditorMap))
79 
80 // ===========================================================================
81 // method definitions
82 // ===========================================================================
83 
84 GNEInspectorFrame::GNEInspectorFrame(FXComposite* parent, GNEViewNet* viewNet):
85  GNEFrame(parent, viewNet, "Inspector"),
86  myEdgeTemplate(0) {
87 
88  // Create groupBox for attributes
89  myGroupBoxForAttributes = new FXGroupBox(myContentFrame, "attributes", GROUPBOX_TITLE_CENTER | FRAME_GROOVE | LAYOUT_FILL_X);
90  myGroupBoxForAttributes->hide();
91 
92  // Create AttrInput
93  for (int i = 0; i < GNEAttributeCarrier::getHigherNumberOfAttributes(); i++) {
94  vectorOfAttrInput.push_back(new AttrInput(myGroupBoxForAttributes, this));
95  }
96 
97  // Create groupBox for templates
98  myGroupBoxForTemplates = new FXGroupBox(myContentFrame, "templates", GROUPBOX_TITLE_CENTER | FRAME_GROOVE | LAYOUT_FILL_X);
99  myGroupBoxForTemplates->hide();
100 
101  // Create copy template button
102  myCopyTemplateButton = new FXButton(myGroupBoxForTemplates, "", 0, this, MID_GNE_COPY_TEMPLATE, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 4, 4, 3, 3);
103  myCopyTemplateButton->hide();
104 
105  // Create set template button
106  mySetTemplateButton = new FXButton(myGroupBoxForTemplates, "Set as Template\t\t", 0, this, MID_GNE_SET_TEMPLATE, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 4, 4, 3, 3);
107  mySetTemplateButton->hide();
108 
109  // Create groupBox for editor parameters
110  myGroupBoxForEditor = new FXGroupBox(myContentFrame, "editor", GROUPBOX_TITLE_CENTER | FRAME_GROOVE | LAYOUT_FILL_X);
111  myGroupBoxForEditor->hide();
112 
113  // Create check blocked button
114  myCheckBlocked = new FXCheckButton(myGroupBoxForEditor, "Block movement", this, MID_GNE_SET_BLOCKING);
115  myCheckBlocked->hide();
116 }
117 
119  if (myEdgeTemplate) {
120  myEdgeTemplate->decRef("GNEInspectorFrame::~GNEInspectorFrame");
121  if (myEdgeTemplate->unreferenced()) {
122  delete myEdgeTemplate;
123  }
124  }
125 }
126 
127 
128 void
130  // Show Scroll window
131  FXScrollWindow::show();
132  // Show and update Frame Area in which this GNEFrame is placed
134 }
135 
136 
137 void
139  // Hide ScrollWindow
140  FXScrollWindow::hide();
141  // Hide Frame Area in which this GNEFrame is placed
143 }
144 
145 
146 void
147 GNEInspectorFrame::inspect(const std::vector<GNEAttributeCarrier*>& ACs) {
148  // Assing ACS to myACs
149  myACs = ACs;
150 
151  // If vector of attribute Carriers contain data
152  if (myACs.size() > 0) {
153  // Set header
154  std::string headerString = toString(myACs.front()->getTag());
155  if (myACs.size() > 1) {
156  headerString = toString(myACs.size()) + " " + headerString + "s";
157  }
158  getFrameHeaderLabel()->setText(headerString.c_str());
159 
160  //Show myGroupBoxForAttributes
161  myGroupBoxForAttributes->show();
162 
163  // Hide all AttrInput
164  for (std::vector<GNEInspectorFrame::AttrInput*>::iterator i = vectorOfAttrInput.begin(); i != vectorOfAttrInput.end(); i++) {
165  (*i)->hiddeAttribute();
166  }
167 
168  // Gets attributes of element
169  const std::vector<SumoXMLAttr>& attrs = myACs.front()->getAttrs();
170 
171  // Declare iterator over AttrImput
172  std::vector<GNEInspectorFrame::AttrInput*>::iterator itAttrs = vectorOfAttrInput.begin();
173 
174  // Iterate over attributes
175  for (std::vector<SumoXMLAttr>::const_iterator it = attrs.begin(); it != attrs.end(); it++) {
176  if (myACs.size() > 1 && GNEAttributeCarrier::isUnique(*it)) {
177  // disable editing for some attributes in case of multi-selection
178  // even displaying is problematic because of string rendering restrictions
179  continue;
180  }
181  // Declare a set of occuring values and insert attribute's values of item
182  std::set<std::string> occuringValues;
183  for (std::vector<GNEAttributeCarrier*>::const_iterator it_ac = myACs.begin(); it_ac != myACs.end(); it_ac++) {
184  occuringValues.insert((*it_ac)->getAttribute(*it));
185  }
186  // get current value
187  std::ostringstream oss;
188  for (std::set<std::string>::iterator it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
189  if (it_val != occuringValues.begin()) {
190  oss << " ";
191  }
192  oss << *it_val;
193  }
194  // Show attribute
195  (*itAttrs)->showAttribute(myACs.front()->getTag(), *it, oss.str());
196  itAttrs++;
197  }
198 
199  // If attributes correspond to an Edge
200  if (dynamic_cast<GNEEdge*>(myACs.front())) {
201  // show groupBox for templates
202  myGroupBoxForTemplates->show();
203  // show "Copy Template" (caption supplied via onUpdate)
204  myCopyTemplateButton->show();
205  // show "Set As Template"
206  if (myACs.size() == 1) {
207  mySetTemplateButton->show();
208  }
209  } else {
210  // Hidde all template elements
211  myGroupBoxForTemplates->hide();
212  myCopyTemplateButton->hide();
213  mySetTemplateButton->hide();
214  }
215 
216  // If attributes correspond to an Additional
217  if (dynamic_cast<GNEAdditional*>(myACs.front())) {
218  // Get pointer to additional
219  myAdditional = dynamic_cast<GNEAdditional*>(myACs.front());
220  bool showGroupBoxForEditor = false;
221 
222  // Show check blocked if additional is movable
225  myCheckBlocked->show();
226  showGroupBoxForEditor = true;
227  }
228  // Show groupBox for editor Attributes if some of additional attributes are editable
229  if (showGroupBoxForEditor == true) {
230  myGroupBoxForEditor->show();
231  }
232 
233  } else {
234  // Hide all additional elements
235  myGroupBoxForEditor->hide();
236  myGroupBoxForEditor->hide();
237  myCheckBlocked->hide();
238  }
239  } else {
240  getFrameHeaderLabel()->setText("No Object selected");
241  // Hide all elements
242  myGroupBoxForAttributes->hide();
243  myGroupBoxForTemplates->hide();
244  myCopyTemplateButton->hide();
245  mySetTemplateButton->hide();
246  myGroupBoxForEditor->hide();
247  myGroupBoxForEditor->hide();
248  myCheckBlocked->hide();
249  }
250 }
251 
252 GNEEdge*
254  return myEdgeTemplate;
255 }
256 
257 
258 void
260  if (myEdgeTemplate) {
261  myEdgeTemplate->decRef("GNEInspectorFrame::setEdgeTemplate");
262  if (myEdgeTemplate->unreferenced()) {
263  delete myEdgeTemplate;
264  }
265  }
266  myEdgeTemplate = tpl;
267  myEdgeTemplate->incRef("GNEInspectorFrame::setEdgeTemplate");
268 }
269 
270 
271 long
272 GNEInspectorFrame::onCmdCopyTemplate(FXObject*, FXSelector, void*) {
273  for (std::vector<GNEAttributeCarrier*>::iterator it = myACs.begin(); it != myACs.end(); it++) {
274  GNEEdge* edge = dynamic_cast<GNEEdge*>(*it);
275  assert(edge);
277  inspect(myACs);
278  }
279  return 1;
280 }
281 
282 
283 long
284 GNEInspectorFrame::onCmdSetTemplate(FXObject*, FXSelector, void*) {
285  assert(myACs.size() == 1);
286  GNEEdge* edge = dynamic_cast<GNEEdge*>(myACs.front());
287  assert(edge);
288  setEdgeTemplate(edge);
289  return 1;
290 }
291 
292 
293 long
294 GNEInspectorFrame::onUpdCopyTemplate(FXObject* sender, FXSelector, void*) {
295  FXString caption;
296  if (myEdgeTemplate) {
297  caption = ("Copy '" + myEdgeTemplate->getMicrosimID() + "'").c_str();
298  sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), NULL);
299  } else {
300  caption = "No Template Set";
301  sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), NULL);
302  }
303  sender->handle(this, FXSEL(SEL_COMMAND, FXLabel::ID_SETSTRINGVALUE), (void*)&caption);
304  return 1;
305 }
306 
307 
308 long
309 GNEInspectorFrame::onCmdSetBlocking(FXObject*, FXSelector, void*) {
310  if (myAdditional) {
311  myAdditional->setBlocked(myCheckBlocked->getCheck() == 1 ? true : false);
312  myViewNet->update();
313  }
314  return 1;
315 }
316 
317 
318 const std::vector<GNEAttributeCarrier*>&
320  return myACs;
321 }
322 
323 // ===========================================================================
324 // AttrInput method definitions
325 // ===========================================================================
326 
327 GNEInspectorFrame::AttrInput::AttrInput(FXComposite* parent, GNEInspectorFrame* inspectorFrameParent) :
328  FXMatrix(parent, 8, MATRIX_BY_COLUMNS | LAYOUT_FILL_X | PACK_UNIFORM_WIDTH),
329  myInspectorFrameParent(inspectorFrameParent),
330  myTag(SUMO_TAG_NOTHING),
331  myAttr(SUMO_ATTR_NOTHING) {
332  // Create and hidde ButtonCombinableChoices
333  myButtonCombinableChoices = new FXButton(this, "AttributeButton", 0, this, MID_GNE_OPEN_ATTRIBUTE_EDITOR, ICON_BEFORE_TEXT | LAYOUT_FILL_COLUMN | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED);
335  // Create and hide label
336  myLabel = new FXLabel(this, "attributeLabel", 0, FRAME_THICK | LAYOUT_FILL_COLUMN | LAYOUT_FILL_X);
337  myLabel->hide();
338  // Create and hide textField int
339  myTextFieldInt = new FXTextField(this, 1, this, MID_GNE_SET_ATTRIBUTE, FRAME_THICK | TEXTFIELD_INTEGER | LAYOUT_FILL_COLUMN | LAYOUT_FILL_X);
340  myTextFieldInt->hide();
341  // Create and hide textField real
342  myTextFieldReal = new FXTextField(this, 1, this, MID_GNE_SET_ATTRIBUTE, FRAME_THICK | TEXTFIELD_REAL | LAYOUT_FILL_COLUMN | LAYOUT_FILL_X);
343  myTextFieldReal->hide();
344  // Create and hide textField string
345  myTextFieldStrings = new FXTextField(this, 1, this, MID_GNE_SET_ATTRIBUTE, TEXTFIELD_NORMAL | LAYOUT_FILL_COLUMN | LAYOUT_FILL_X);
346  myTextFieldStrings->hide();
347  // Create and hide ComboBox
348  myChoicesCombo = new FXComboBox(this, 1, this, MID_GNE_SET_ATTRIBUTE, FRAME_THICK | LAYOUT_CENTER_Y | LAYOUT_FILL_COLUMN | LAYOUT_FILL_X);
349  myChoicesCombo->hide();
350  // Create and hide checkButton
351  myCheckBox = new FXCheckButton(this, "", this, MID_GNE_SET_ATTRIBUTE, JUSTIFY_LEFT | ICON_BEFORE_TEXT | LAYOUT_FILL_COLUMN | LAYOUT_FILL_X);
352  myCheckBox->hide();
353 }
354 
355 
356 void
358  // Set actual Tag and attribute
359  myTag = tag;
360  myAttr = attr;
361  // ShowLabel
362  myLabel->setText(toString(myAttr).c_str());
363  myLabel->show();
364  // Set field depending of the type of value
366  // set value of checkbox
367  if (value == "true") {
368  myCheckBox->setCheck(true);
369  } else {
370  myCheckBox->setCheck(false);
371  }
372  myCheckBox->show();
374  // Obtain choices
375  const std::vector<std::string>& choices = GNEAttributeCarrier::discreteChoices(myTag, myAttr);
376  // Check if are combinable coices
377  if (choices.size() > 0 && GNEAttributeCarrier::discreteCombinableChoices(myTag, myAttr)) {
378  // hide label
379  myLabel->hide();
380  // Show button combinable choices
381  myButtonCombinableChoices->setText(toString(myAttr).c_str());
383  // Show string with the values
384  myTextFieldStrings->setText(value.c_str());
385  myTextFieldStrings->setTextColor(FXRGB(0, 0, 0));
386  myTextFieldStrings->show();
387  } else {
388  // fill comboBox
389  myChoicesCombo->clearItems();
390  for (std::vector<std::string>::const_iterator it = choices.begin(); it != choices.end(); ++it) {
391  myChoicesCombo->appendItem(it->c_str());
392  }
393  myChoicesCombo->setNumVisible((int)choices.size());
394  myChoicesCombo->setCurrentItem(myChoicesCombo->findItem(value.c_str()));
395  myChoicesCombo->show();
396  }
397  } else if (GNEAttributeCarrier::isFloat(myAttr)) {
398  // show TextField for real values
399  myTextFieldReal->setText(value.c_str());
400  myTextFieldReal->setTextColor(FXRGB(0, 0, 0));
401  myTextFieldReal->show();
402  } else if (GNEAttributeCarrier::isInt(myAttr)) {
403  // Show textField for int attributes
404  myTextFieldInt->setText(value.c_str());
405  myTextFieldInt->setTextColor(FXRGB(0, 0, 0));
406  myTextFieldInt->show();
407  } else {
408  // In any other case (String, list, etc.), show value as String
409  myTextFieldStrings->setText(value.c_str());
410  myTextFieldStrings->setTextColor(FXRGB(0, 0, 0));
411  myTextFieldStrings->show();
412  }
413  // Show AttrInput
414  show();
415 }
416 
417 
418 void
420  // Hide all elements
421  myLabel->hide();
422  myTextFieldInt->hide();
423  myTextFieldReal->hide();
424  myTextFieldStrings->hide();
425  myChoicesCombo->hide();
426  myCheckBox->hide();
428  // hide AttrInput
429  hide();
430 }
431 
432 
435  return myTag;
436 }
437 
438 
441  return myAttr;
442 }
443 
444 
445 long
447  // Open AttrEditor
449  return 1;
450 }
451 
452 
453 long
454 GNEInspectorFrame::AttrInput::onCmdSetAttribute(FXObject*, FXSelector, void*) {
455  // Declare changed value
456  std::string newVal;
457  // First, obtain the string value of the new attribute depending of their type
459  // Set true o false depending of the checBox
460  if (myCheckBox->getCheck()) {
461  newVal = "true";
462  } else {
463  newVal = "false";
464  }
466  // Obtain choices
467  const std::vector<std::string>& choices = GNEAttributeCarrier::discreteChoices(myTag, myAttr);
468  // Check if are combinable coices
469  if (choices.size() > 0 && GNEAttributeCarrier::discreteCombinableChoices(myTag, myAttr)) {
470  // Get value obtained using AttrEditor
471  newVal = myTextFieldStrings->getText().text();
472  } else {
473  // Get value of ComboBox
474  newVal = myChoicesCombo->getText().text();
475  }
476  } else if (GNEAttributeCarrier::isFloat(myAttr)) {
477  // obtain value of myTextFieldReal
478  newVal = myTextFieldReal->getText().text();
479  } else if (GNEAttributeCarrier::isInt(myAttr)) {
480  // obtain value of myTextFieldInt
481  newVal = myTextFieldInt->getText().text();
483  // obtain value of myTextFieldStrings
484  newVal = myTextFieldStrings->getText().text();
485  }
486 
487  // Check if newvalue is valid
488  if (myInspectorFrameParent->getACs().front()->isValid(myAttr, newVal)) {
489  // if its valid for the first AC than its valid for all (of the same type)
490  if (myInspectorFrameParent->getACs().size() > 1) {
491  myInspectorFrameParent->getViewNet()->getUndoList()->p_begin("Change multiple attributes");
492  }
493  // Set all attributes
494  for (std::vector<GNEAttributeCarrier*>::const_iterator it_ac = myInspectorFrameParent->getACs().begin(); it_ac != myInspectorFrameParent->getACs().end(); it_ac++) {
495  (*it_ac)->setAttribute(myAttr, newVal, myInspectorFrameParent->getViewNet()->getUndoList());
496  }
497  if (myInspectorFrameParent->getACs().size() > 1) {
499  }
500  // If previously value of TextField was red, change color to black
502  myTextFieldReal->setTextColor(FXRGB(0, 0, 0));
503  myTextFieldReal->killFocus();
505  myTextFieldInt->setTextColor(FXRGB(0, 0, 0));
506  myTextFieldInt->killFocus();
508  myTextFieldStrings->setTextColor(FXRGB(0, 0, 0));
509  myTextFieldStrings->killFocus();
510  }
511  } else {
512  // IF value of TextField isn't valid, change color to Red depending of type
514  myTextFieldReal->setTextColor(FXRGB(255, 0, 0));
516  myTextFieldInt->setTextColor(FXRGB(255, 0, 0));
518  myTextFieldStrings->setTextColor(FXRGB(255, 0, 0));
519  }
520  }
521  // Update view net
522  myInspectorFrameParent->getViewNet()->update();
523  return 1;
524 }
525 
526 
527 void
529  FXMatrix::show();
530 }
531 
532 
533 void
535  FXMatrix::hide();
536 }
537 
538 // ===========================================================================
539 // AttrEditor method definitions
540 // ===========================================================================
541 
542 GNEInspectorFrame::AttrEditor::AttrEditor(AttrInput* attrInputParent, FXTextField* textFieldAttr) :
543  FXDialogBox(attrInputParent->getApp(), ("Editing attribute '" + toString(attrInputParent->getAttr()) + "'").c_str(), DECOR_CLOSE | DECOR_TITLE),
544  myAttrInputParent(attrInputParent),
545  myTextFieldAttr(textFieldAttr) {
546  // Create matrix
547  myCheckBoxMatrix = new FXMatrix(this, 2, MATRIX_BY_COLUMNS);
548 
549  // Obtain vector with the choices
550  const std::vector<std::string>& choices = GNEAttributeCarrier::discreteChoices(myAttrInputParent->getTag(), myAttrInputParent->getAttr());
551 
552  // Get old value
553  const std::string oldValue = myTextFieldAttr->getText().text();
554 
555  // Resize myVectorOfCheckBox
556  myVectorOfCheckBox.resize(choices.size(), NULL);
557 
558  // Iterate over choices
559  for (int i = 0; i < (int)choices.size(); i++) {
560  // Create checkBox
561  myVectorOfCheckBox.at(i) = new FXCheckButton(myCheckBoxMatrix, choices.at(i).c_str());
562  // Set initial value
563  if (oldValue.find(choices.at(i)) != std::string::npos) {
564  myVectorOfCheckBox.at(i)->setCheck(true);
565  }
566  }
567 
568  // Add separator
569  new FXHorizontalSeparator(this, SEPARATOR_GROOVE | LAYOUT_FILL_X, 0, 0, 0, 2, 2, 2, 4, 4);
570 
571  // Create frame for buttons
572  frameButtons = new FXHorizontalFrame(this, LAYOUT_FILL_X);
573 
574  // Create accept button
575  myAcceptButton = new FXButton(frameButtons, "Accept", 0, this, FXDialogBox::ID_ACCEPT, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED);
576 
577  // Create cancel button
578  myCancelButton = new FXButton(frameButtons, "Cancel", 0, this, FXDialogBox::ID_CANCEL, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED);
579 
580  // Create reset button
581  myResetButton = new FXButton(frameButtons, "Reset", 0, this, MID_GNE_MODE_INSPECT_RESET, ICON_BEFORE_TEXT | LAYOUT_FILL_X | FRAME_THICK | FRAME_RAISED);
582 
583  // Execute dialog to make it modal, and if user press button "accept", save attribute
584  if (execute()) {
585  std::vector<std::string> attrSolution;
586  // Iterate over myVectorOfCheckBox
587  for (int i = 0; i < (int)myVectorOfCheckBox.size(); i++) {
588  // If checkBox is cheked, save attribute
589  if (myVectorOfCheckBox.at(i)->getCheck()) {
590  attrSolution.push_back(std::string(myVectorOfCheckBox.at(i)->getText().text()));
591  }
592  }
593  // join to string
594  myTextFieldAttr->setText(joinToString(attrSolution, " ").c_str());
595  // Set attribute
597  }
598 }
599 
600 
602 
603 long
604 GNEInspectorFrame::AttrEditor::onCmdReset(FXObject*, FXSelector, void*) {
605  // Obtain vector with the choices
606  const std::vector<std::string>& choices = GNEAttributeCarrier::discreteChoices(myAttrInputParent->getTag(), myAttrInputParent->getAttr());
607  // Get old value
608  const std::string oldValue = myTextFieldAttr->getText().text();
609  // Reset values
610  for (int i = 0; i < (int)choices.size(); i++) {
611  if (oldValue.find(choices.at(i)) != std::string::npos) {
612  myVectorOfCheckBox.at(i)->setCheck(true);
613  } else {
614  myVectorOfCheckBox.at(i)->setCheck(false);
615  }
616  }
617  return 1;
618 }
619 
620 /****************************************************************************/
void copyTemplate(GNEEdge *tpl, GNEUndoList *undolist)
copy edge attributes from tpl
Definition: GNEEdge.cpp:392
FXCheckButton * myCheckBox
pointer to checkBox
FXHorizontalFrame * frameButtons
frame for the buttons
SumoXMLTag
Numbers representing SUMO-XML - element names.
FXComboBox * myChoicesCombo
pointer to combo box choices
GNEInspectorFrame * myInspectorFrameParent
pointer to GNEInspectorFrame parent
void hideFramesArea()
hide frames area if all GNEFrames are hidden
FXTextField * myTextFieldStrings
textField to modify the value of strings values
SumoXMLAttr myAttr
current Attr
static bool isDiscrete(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is Discrete
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
FXGroupBox * myGroupBoxForTemplates
groupBox for templates
FXButton * myCopyTemplateButton
copy template button
long onCmdReset(FXObject *, FXSelector, void *)
call when user press button reset
void hide()
set hide as private function
void show()
set show as private function
void showFramesArea()
show frames area if at least a GNEFrame is showed
SumoXMLTag getTag() const
get current tag
static int getHigherNumberOfAttributes()
return the number of attributes of the tag with the most highter number of attributes ...
SumoXMLTag myTag
current tag
long onCmdSetAttribute(FXObject *, FXSelector, void *)
try to set new attribute value
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
copy edge attributes from edge template
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
Definition: GNEUndoList.cpp:86
FXTextField * myTextFieldReal
textField to modify the value of real values
FXButton * myCancelButton
Button Cancel.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void setBlocked(bool value)
Block or unblock additional element(i.e. cannot be moved with mouse)
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:839
FXButton * mySetTemplateButton
set template button
GNEAdditional * myAdditional
pointer to additional element
FXButton * myButtonCombinableChoices
pointer to buttonCombinableChoices
long onCmdOpenAttributeEditor(FXObject *, FXSelector, void *)
open model dialog for more comfortable attribute editing
FXButton * myAcceptButton
Button Accept.
void showAttribute(SumoXMLTag tag, SumoXMLAttr attr, const std::string &value)
show attribute
~GNEInspectorFrame()
Destructor.
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:851
GNEViewNet * myViewNet
the window to inform when the tls is modfied
Definition: GNEFrame.h:85
void hide()
hide Frame
static const std::vector< std::string > & discreteChoices(SumoXMLTag tag, SumoXMLAttr attr)
return a list of discrete choices for this attribute or an empty vector
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
long onCmdSetBlocking(FXObject *, FXSelector, void *)
called when user toogle the blocking button
FXGroupBox * myGroupBoxForEditor
GropuBox for editor attributes.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
Definition: GNEUndoList.cpp:93
GNEEdge * myEdgeTemplate
the edge template
FXTextField * myTextFieldInt
textField to modify the value of int values
void inspect(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
void setEdgeTemplate(GNEEdge *tpl)
seh the template edge (we assume shared responsibility via reference counting)
AttrInput * myAttrInputParent
Pointer to AttrInput parent.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:55
void incRef(const std::string &debugMsg="")
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:82
void hiddeAttribute()
show attribute
void decRef(const std::string &debugMsg="")
FXButton * myResetButton
Button Reset.
static bool isFloat(SumoXMLAttr attr)
whether an attribute is numerical of type float
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:54
long onUpdCopyTemplate(FXObject *, FXSelector, void *)
update the copy button with the name of the template
static bool isInt(SumoXMLAttr attr)
whether an attribute is numerical or type int
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:63
FXLabel * getFrameHeaderLabel() const
get the label for the frame&#39;s header
Definition: GNEFrame.cpp:88
static bool discreteCombinableChoices(SumoXMLTag tag, SumoXMLAttr attr)
return whether the given attribute allows for a combination of discrete values
void show()
show Frame
bool isAdditionalBlocked() const
Check if additional item is currently blocked (i.e. cannot be moved with mouse)
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:188
static bool isUnique(SumoXMLAttr attr)
whether an attribute is unique (may not be edited for a multi-selection)
const std::vector< GNEAttributeCarrier * > & getACs() const
get current list of ACs
FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[]
static bool isString(SumoXMLAttr attr)
whether an attribute is of type string
std::vector< GNEAttributeCarrier * > myACs
the multi-selection currently being inspected
FXLabel * myLabel
pointer to label
long onCmdSetTemplate(FXObject *, FXSelector, void *)
set current edge as new template
static bool isBool(SumoXMLAttr attr)
whether an attribute is of type bool
std::vector< FXCheckButton * > myVectorOfCheckBox
vector of CheckBoxs
SumoXMLAttr getAttr() const
get current Attr
FXGroupBox * myGroupBoxForAttributes
groupBox for attributes
std::vector< GNEInspectorFrame::AttrInput * > vectorOfAttrInput
list of Attribute inputs
bool isAdditionalMovable() const
check if additional element is movable
FXCheckButton * myCheckBlocked
pointer to check button block