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-2017 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 #include <iostream>
32 #include <cassert>
33 #include <cmath>
46 
47 #include "GNEAdditional.h"
48 #include "GNEAdditionalFrame.h"
49 #include "GNEAttributeCarrier.h"
50 #include "GNEChange_Selection.h"
51 #include "GNEConnection.h"
52 #include "GNECrossing.h"
53 #include "GNEDeleteFrame.h"
54 #include "GNEEdge.h"
55 #include "GNEInspectorFrame.h"
56 #include "GNEJunction.h"
57 #include "GNELane.h"
58 #include "GNENet.h"
59 #include "GNEPOI.h"
60 #include "GNEPoly.h"
61 #include "GNEUndoList.h"
62 #include "GNEViewNet.h"
63 #include "GNEViewParent.h"
65 
66 
67 // ===========================================================================
68 // FOX callback mapping
69 // ===========================================================================
70 
71 FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[] = {
77  FXMAPFUNC(SEL_RIGHTBUTTONRELEASE, MID_GNE_CHILDS, GNEInspectorFrame::onCmdShowChildMenu),
81 };
82 
83 
87 };
88 
89 // Object implementation
90 FXIMPLEMENT(GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
91 FXIMPLEMENT(GNEInspectorFrame::AttributeInput, FXHorizontalFrame, AttrInputMap, ARRAYNUMBER(AttrInputMap))
92 
93 // ===========================================================================
94 // method definitions
95 // ===========================================================================
96 
97 GNEInspectorFrame::GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet):
98  GNEFrame(horizontalFrameParent, viewNet, "Inspector"),
99  myEdgeTemplate(NULL),
100  myAdditional(NULL),
101  myPreviousElementInspect(NULL),
102  myPreviousElementDelete(NULL) {
103 
104  // Create back button
105  myBackButton = new FXButton(myHeaderLeftFrame, "", GUIIconSubSys::getIcon(ICON_NETEDITARROW), this, MID_GNE_INSPECT_GOBACK, GUIDesignButtonIconRectangular);
106  myHeaderLeftFrame->hide();
107  myBackButton->hide();
108 
109  // Create groupBox for attributes
110  myGroupBoxForAttributes = new FXGroupBox(myContentFrame, "Internal attributes", GUIDesignGroupBoxFrame);
111  myGroupBoxForAttributes->hide();
112 
113  // Create AttributeInput
114  for (int i = 0; i < (int)GNEAttributeCarrier::getHigherNumberOfAttributes(); i++) {
115  myVectorOfAttributeInputs.push_back(new AttributeInput(myGroupBoxForAttributes, this));
116  }
117 
118  // Create groupBox for Netedit parameters
119  myGroupBoxForEditor = new FXGroupBox(myContentFrame, "Netedit attributes", GUIDesignGroupBoxFrame);
120  myGroupBoxForEditor->hide();
121 
122  // Create check blocked label and button
123  FXHorizontalFrame* blockMovementHorizontalFrame = new FXHorizontalFrame(myGroupBoxForEditor, GUIDesignAuxiliarHorizontalFrame);
124  myCheckBlockedLabel = new FXLabel(blockMovementHorizontalFrame, "block movement", 0, GUIDesignLabelAttribute);
125  myCheckBlocked = new FXCheckButton(blockMovementHorizontalFrame, "", this, MID_GNE_SET_BLOCKING, GUIDesignCheckButtonAttribute);
126  myCheckBlocked->hide();
127 
128  // Create groupbox and tree list
129  myGroupBoxForTreeList = new FXGroupBox(myContentFrame, "Childs", GUIDesignGroupBoxFrame);
130  myTreelist = new FXTreeList(myGroupBoxForTreeList, this, MID_GNE_CHILDS, GUIDesignTreeListFrame);
131  myGroupBoxForTreeList->hide();
132 
133  // Create groupBox for templates
134  myGroupBoxForTemplates = new FXGroupBox(myContentFrame, "Templates", GUIDesignGroupBoxFrame);
135  myGroupBoxForTemplates->hide();
136 
137  // Create copy template button
138  myCopyTemplateButton = new FXButton(myGroupBoxForTemplates, "", 0, this, MID_GNE_COPY_TEMPLATE, GUIDesignButton);
139  myCopyTemplateButton->hide();
140 
141  // Create set template button
142  mySetTemplateButton = new FXButton(myGroupBoxForTemplates, "Set as Template\t\t", 0, this, MID_GNE_SET_TEMPLATE, GUIDesignButton);
143  mySetTemplateButton->hide();
144 }
145 
146 
148  if (myEdgeTemplate) {
149  myEdgeTemplate->decRef("GNEInspectorFrame::~GNEInspectorFrame");
150  if (myEdgeTemplate->unreferenced()) {
151  delete myEdgeTemplate;
152  }
153  }
154 }
155 
156 
157 void
159  inspectElement(NULL);
160  GNEFrame::show();
161 }
162 
163 
164 void
166  // Use the implementation of inspect for multiple AttributeCarriers to avoid repetition of code
167  std::vector<GNEAttributeCarrier*> itemToInspect;
168  if (AC != NULL) {
169  itemToInspect.push_back(AC);
170  }
171  inspectMultisection(itemToInspect);
172 }
173 
174 
175 void
176 GNEInspectorFrame::inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs) {
177  // hide back button
178  myHeaderLeftFrame->hide();
179  myBackButton->hide();
180  // Assing ACs to myACs
181  myACs = ACs;
182  // Hide all elements
183  myGroupBoxForAttributes->hide();
184  myGroupBoxForTemplates->hide();
185  myCopyTemplateButton->hide();
186  mySetTemplateButton->hide();
187  myGroupBoxForEditor->hide();
188  myGroupBoxForEditor->hide();
189  myCheckBlocked->hide();
190  myGroupBoxForTreeList->hide();
191  // If vector of attribute Carriers contain data
192  if (myACs.size() > 0) {
193  // Set header
194  std::string headerString;
195  if (myACs.size() > 1) {
196  headerString = "Selection: " + toString(myACs.size()) + " " + toString(myACs.front()->getTag()) + "s";
197  } else {
198  if (dynamic_cast<GNENetElement*>(myACs.front())) {
199  headerString = "Net: " + toString(myACs.front()->getTag());
200  } else if (dynamic_cast<GNEAdditional*>(myACs.front())) {
201  headerString = "Additional: " + toString(myACs.front()->getTag());
202  }
203  }
204  // Set headerString into header label
205  getFrameHeaderLabel()->setText(headerString.c_str());
206 
207  //Show myGroupBoxForAttributes
208  myGroupBoxForAttributes->show();
209 
210  // Hide all AttributeInput
211  for (std::vector<GNEInspectorFrame::AttributeInput*>::iterator i = myVectorOfAttributeInputs.begin(); i != myVectorOfAttributeInputs.end(); i++) {
212  (*i)->hideAttribute();
213  }
214 
215  // Gets tag and attributes of element
216  SumoXMLTag tag = myACs.front()->getTag();
217  const std::vector<SumoXMLAttr>& attrs = myACs.front()->getAttrs();
218 
219  // Declare iterator over AttrInput
220  std::vector<GNEInspectorFrame::AttributeInput*>::iterator itAttrs = myVectorOfAttributeInputs.begin();
221 
222  // check if current AC is a Junction without TLSs (needed to hidde TLS options)
223  bool disableTLSinJunctions = (dynamic_cast<GNEJunction*>(myACs.front()) && (dynamic_cast<GNEJunction*>(myACs.front())->getNBNode()->getControllingTLS().empty()));
224 
225  // Iterate over attributes
226  for (std::vector<SumoXMLAttr>::const_iterator it = attrs.begin(); it != attrs.end(); it++) {
227  if (myACs.size() > 1 && GNEAttributeCarrier::isUnique(tag, *it)) {
228  // disable editing for some attributes in case of multi-selection
229  // even displaying is problematic because of string rendering restrictions
230  continue;
231  }
232  // Declare a set of occuring values and insert attribute's values of item
233  std::set<std::string> occuringValues;
234  for (std::vector<GNEAttributeCarrier*>::const_iterator it_ac = myACs.begin(); it_ac != myACs.end(); it_ac++) {
235  occuringValues.insert((*it_ac)->getAttribute(*it));
236  }
237  // get current value
238  std::ostringstream oss;
239  for (std::set<std::string>::iterator it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
240  if (it_val != occuringValues.begin()) {
241  oss << " ";
242  }
243  oss << *it_val;
244  }
245  // Show attribute
246  if (((disableTLSinJunctions == true) && (tag == SUMO_TAG_JUNCTION) && ((*it == SUMO_ATTR_TLTYPE) || (*it == SUMO_ATTR_TLID))) == false) {
247  (*itAttrs)->showAttribute(myACs.front()->getTag(), (*it), oss.str());
248  }
249  // update attribute iterator
250  itAttrs++;
251  }
252 
253  // If attributes correspond to an Additional
254  if (dynamic_cast<GNEAdditional*>(myACs.front())) {
255  // Get pointer to additional
256  myAdditional = dynamic_cast<GNEAdditional*>(myACs.front());
257  // Show check blocked if additional is movable
261  myCheckBlocked->setText("true");
262  } else {
263  myCheckBlocked->setText("false");
264  }
265  myCheckBlocked->show();
266  myGroupBoxForEditor->show();
267  }
268  }
269 
270  // if we inspect a single Attribute carrier vector, show their childs
271  if (myACs.size() == 1) {
273  }
274 
275  // If attributes correspond to an Edge
276  if (dynamic_cast<GNEEdge*>(myACs.front())) {
277  // show groupBox for templates
278  myGroupBoxForTemplates->show();
279  // show "Copy Template" (caption supplied via onUpdate)
280  myCopyTemplateButton->show();
281  // show "Set As Template"
282  if (myACs.size() == 1) {
283  mySetTemplateButton->show();
284  }
285  }
286  } else {
287  getFrameHeaderLabel()->setText("No Object selected");
288  myContentFrame->recalc();
289  }
290 }
291 
292 
293 void
295  // Show back button if myPreviousElementInspect was defined
296  myPreviousElementInspect = previousElement;
297  if (myPreviousElementInspect != NULL) {
298  // disable myPreviousElementDelete to avoid inconsistences
300  inspectElement(AC);
301  myHeaderLeftFrame->show();
302  myBackButton->show();
303  }
304 }
305 
306 
307 void GNEInspectorFrame::inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked) {
308  myPreviousElementDelete = previousElement;
309  myPreviousElementDeleteWasMarked = previousElementWasMarked;
310  // Show back button if myPreviousElementDelete is valid
311  if (myPreviousElementDelete != NULL) {
312  // disable myPreviousElementInspect to avoid inconsistences
314  inspectElement(AC);
315  myHeaderLeftFrame->show();
316  myBackButton->show();
317  }
318 }
319 
320 
321 GNEEdge*
323  return myEdgeTemplate;
324 }
325 
326 
327 void
329  if (myEdgeTemplate) {
330  myEdgeTemplate->decRef("GNEInspectorFrame::setEdgeTemplate");
331  if (myEdgeTemplate->unreferenced()) {
332  delete myEdgeTemplate;
333  }
334  }
335  myEdgeTemplate = tpl;
336  myEdgeTemplate->incRef("GNEInspectorFrame::setEdgeTemplate");
337 }
338 
339 
340 long
341 GNEInspectorFrame::onCmdCopyTemplate(FXObject*, FXSelector, void*) {
342  for (std::vector<GNEAttributeCarrier*>::iterator it = myACs.begin(); it != myACs.end(); it++) {
343  GNEEdge* edge = dynamic_cast<GNEEdge*>(*it);
344  assert(edge);
347  }
348  return 1;
349 }
350 
351 
352 long
353 GNEInspectorFrame::onCmdSetTemplate(FXObject*, FXSelector, void*) {
354  assert(myACs.size() == 1);
355  GNEEdge* edge = dynamic_cast<GNEEdge*>(myACs.front());
356  assert(edge);
357  setEdgeTemplate(edge);
358  return 1;
359 }
360 
361 
362 long
363 GNEInspectorFrame::onUpdCopyTemplate(FXObject* sender, FXSelector, void*) {
364  FXString caption;
365  if (myEdgeTemplate) {
366  caption = ("Copy '" + myEdgeTemplate->getMicrosimID() + "'").c_str();
367  sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), NULL);
368  } else {
369  caption = "No Template Set";
370  sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), NULL);
371  }
372  sender->handle(this, FXSEL(SEL_COMMAND, FXLabel::ID_SETSTRINGVALUE), (void*)&caption);
373  return 1;
374 }
375 
376 
377 long
378 GNEInspectorFrame::onCmdSetBlocking(FXObject*, FXSelector, void*) {
379  if (myAdditional) {
380  if (myCheckBlocked->getCheck() == 1) {
381  myAdditional->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, "true", getViewNet()->getUndoList());
382  myCheckBlocked->setText("true");
383  } else {
384  myAdditional->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, "false", getViewNet()->getUndoList());
385  myCheckBlocked->setText("false");
386  }
387  }
388  return 1;
389 }
390 
391 
392 long
393 GNEInspectorFrame::onCmdGoBack(FXObject*, FXSelector, void*) {
394  // Inspect previous element or go back to Delete Frame
398  } else if (myPreviousElementDelete != NULL) {
402  }
404  // Hide inspect frame and show delete frame
405  hide();
407  }
408  return 1;
409 }
410 
411 
412 const std::vector<GNEAttributeCarrier*>&
414  return myACs;
415 }
416 
417 
418 long
419 GNEInspectorFrame::onCmdShowChildMenu(FXObject*, FXSelector, void* data) {
420  // Obtain event
421  FXEvent* e = (FXEvent*) data;
422  FXTreeItem* item = myTreelist->getItemAt(e->win_x, e->win_y);
423  // Check if there are an item in the position and create pop-up menu
424  if (item && (myTreeItemsWithoutAC.find(item) == myTreeItemsWithoutAC.end())) {
425  createPopUpMenu(e->root_x, e->root_y, myTreeItemToACMap[myTreelist->getItemAt(e->win_x, e->win_y)]);
426  }
427  return 1;
428 }
429 
430 
431 long
432 GNEInspectorFrame::onCmdCenterItem(FXObject*, FXSelector, void*) {
433  if (dynamic_cast<GNENetElement*>(myRightClickedAC)) {
434  myViewNet->centerTo(dynamic_cast<GNENetElement*>(myRightClickedAC)->getGlID(), false);
435  } else if (dynamic_cast<GNEAdditional*>(myRightClickedAC)) {
436  myViewNet->centerTo(dynamic_cast<GNEAdditional*>(myRightClickedAC)->getGlID(), false);
437  } else if (dynamic_cast<GNEPOI*>(myRightClickedAC)) {
438  myViewNet->centerTo(dynamic_cast<GNEPOI*>(myRightClickedAC)->getGlID(), false);
439  } else if (dynamic_cast<GNEPoly*>(myRightClickedAC)) {
440  myViewNet->centerTo(dynamic_cast<GNEPoly*>(myRightClickedAC)->getGlID(), false);
441  }
442  myViewNet->update();
443  return 1;
444 }
445 
446 
447 long
448 GNEInspectorFrame::onCmdInspectItem(FXObject*, FXSelector, void*) {
449  assert(myACs.size() == 1);
451  return 1;
452 }
453 
454 
455 long
456 GNEInspectorFrame::onCmdDeleteItem(FXObject*, FXSelector, void*) {
457  // Remove Attribute Carrier
461  // show again childs of attribute carrier
463  return 1;
464 }
465 
466 
467 void
469  // create FXMenuPane
470  FXMenuPane* pane = new FXMenuPane(myTreelist);
471  // set current clicked AC
472  myRightClickedAC = ac;
473  // set name
475  new FXMenuSeparator(pane);
476  // Fill FXMenuCommand
477  new FXMenuCommand(pane, "Center", GUIIconSubSys::getIcon(ICON_RECENTERVIEW), this, MID_GNE_INSPECTFRAME_CENTER);
478  new FXMenuCommand(pane, "Inspect", GUIIconSubSys::getIcon(ICON_MODEINSPECT), this, MID_GNE_INSPECTFRAME_INSPECT);
479  new FXMenuCommand(pane, "Delete", GUIIconSubSys::getIcon(ICON_MODEDELETE), this, MID_GNE_INSPECTFRAME_DELETE);
480  // Center in the mouse position and create pane
481  pane->setX(X);
482  pane->setY(Y);
483  pane->create();
484  pane->show();
485 }
486 
487 
488 void
490  // Only show attributes of ONE attribute carrier
491  assert(myACs.size() == 1);
492  // clear items
493  myTreelist->clearItems();
494  myTreeItemToACMap.clear();
495  myTreeItemsWithoutAC.clear();
496  myGroupBoxForTreeList->show();
497  // Switch gl type of ac
498  switch (dynamic_cast<GUIGlObject*>(myACs.front())->getType()) {
499  case GLO_JUNCTION: {
500  // insert junction root
501  GNEJunction* junction = dynamic_cast<GNEJunction*>(myACs.front());
502  FXTreeItem* junctionItem = myTreelist->insertItem(0, 0, toString(junction->getTag()).c_str(), junction->getIcon(), junction->getIcon());
503  myTreeItemToACMap[junctionItem] = junction;
504  junctionItem->setExpanded(true);
505  // insert edges
506  for (int i = 0; i < (int)junction->getGNEEdges().size(); i++) {
507  GNEEdge* edge = junction->getGNEEdges().at(i);
508  FXTreeItem* edgeItem = myTreelist->insertItem(0, junctionItem, (toString(edge->getTag()) + " " + toString(i)).c_str(), edge->getIcon(), edge->getIcon());
509  myTreeItemToACMap[edgeItem] = edge;
510  edgeItem->setExpanded(true);
511  // insert lanes
512  for (int j = 0; j < (int)edge->getLanes().size(); j++) {
513  GNELane* lane = edge->getLanes().at(j);
514  FXTreeItem* laneItem = myTreelist->insertItem(0, edgeItem, (toString(lane->getTag()) + " " + toString(j)).c_str(), lane->getIcon(), lane->getIcon());
515  myTreeItemToACMap[laneItem] = lane;
516  laneItem->setExpanded(true);
517  // insert additionals of lanes
518  for (int k = 0; k < (int)lane->getAdditionalChilds().size(); k++) {
519  GNEAdditional* additional = lane->getAdditionalChilds().at(k);
520  FXTreeItem* additionalItem = myTreelist->insertItem(0, laneItem, (toString(additional->getTag()) + " " + toString(k)).c_str(), additional->getIcon(), additional->getIcon());
521  myTreeItemToACMap[additionalItem] = additional;
522  additionalItem->setExpanded(true);
523  }
524  // insert incoming connections of lanes (by default isn't expanded)
525  if (lane->getGNEIncomingConnections().size() > 0) {
526  FXTreeItem* incomingConnections = myTreelist->insertItem(0, laneItem, "Incomings", lane->getGNEIncomingConnections().front()->getIcon(), lane->getGNEIncomingConnections().front()->getIcon());
527  myTreeItemsWithoutAC.insert(incomingConnections);
528  incomingConnections->setExpanded(false);
529  for (int k = 0; k < (int)lane->getGNEIncomingConnections().size(); k++) {
530  GNEConnection* connection = lane->getGNEIncomingConnections().at(k);
531  FXTreeItem* connectionItem = myTreelist->insertItem(0, incomingConnections, (toString(connection->getTag()) + " " + toString(k)).c_str(), connection->getIcon(), connection->getIcon());
532  myTreeItemToACMap[connectionItem] = connection;
533  connectionItem->setExpanded(true);
534  }
535  }
536  // insert outcoming connections of lanes (by default isn't expanded)
537  if (lane->getGNEOutcomingConnections().size() > 0) {
538  FXTreeItem* outgoingConnections = myTreelist->insertItem(0, laneItem, "Outcomings", lane->getGNEOutcomingConnections().front()->getIcon(), lane->getGNEOutcomingConnections().front()->getIcon());
539  myTreeItemsWithoutAC.insert(outgoingConnections);
540  outgoingConnections->setExpanded(false);
541  for (int k = 0; k < (int)lane->getGNEOutcomingConnections().size(); k++) {
542  GNEConnection* connection = lane->getGNEOutcomingConnections().at(k);
543  FXTreeItem* connectionItem = myTreelist->insertItem(0, outgoingConnections, (toString(connection->getTag()) + " " + toString(k)).c_str(), connection->getIcon(), connection->getIcon());
544  myTreeItemToACMap[connectionItem] = connection;
545  connectionItem->setExpanded(true);
546  }
547  }
548  }
549  // insert additionals of edge
550  for (int j = 0; j < (int)edge->getAdditionalChilds().size(); j++) {
551  GNEAdditional* additional = edge->getAdditionalChilds().at(j);
552  FXTreeItem* additionalItem = myTreelist->insertItem(0, edgeItem, (toString(additional->getTag()) + " " + toString(j)).c_str(), additional->getIcon(), additional->getIcon());
553  myTreeItemToACMap[additionalItem] = additional;
554  additionalItem->setExpanded(true);
555  }
556 
557  }
558  // insert crossings
559  for (int i = 0; i < (int)junction->getGNECrossings().size(); i++) {
560  GNECrossing* crossing = junction->getGNECrossings().at(i);
561  FXTreeItem* crossingItem = myTreelist->insertItem(0, junctionItem, (toString(crossing->getTag()) + " " + toString(i)).c_str(), crossing->getIcon(), crossing->getIcon());
562  myTreeItemToACMap[crossingItem] = crossing;
563  crossingItem->setExpanded(true);
564  }
565  break;
566  }
567  case GLO_EDGE: {
568  // insert edge root
569  GNEEdge* edge = dynamic_cast<GNEEdge*>(myACs.front());
570  FXTreeItem* edgeItem = myTreelist->insertItem(0, 0, toString(edge->getTag()).c_str(), edge->getIcon(), edge->getIcon());
571  myTreeItemToACMap[edgeItem] = edge;
572  edgeItem->setExpanded(true);
573  // insert lanes
574  for (int i = 0; i < (int)edge->getLanes().size(); i++) {
575  GNELane* lane = edge->getLanes().at(i);
576  FXTreeItem* laneItem = myTreelist->insertItem(0, edgeItem, (toString(lane->getTag()) + " " + toString(i)).c_str(), lane->getIcon(), lane->getIcon());
577  myTreeItemToACMap[laneItem] = lane;
578  laneItem->setExpanded(true);
579  // insert additionals of lanes
580  for (int j = 0; j < (int)lane->getAdditionalChilds().size(); j++) {
581  GNEAdditional* additional = lane->getAdditionalChilds().at(j);
582  FXTreeItem* additionalItem = myTreelist->insertItem(0, laneItem, (toString(additional->getTag()) + " " + toString(j)).c_str(), additional->getIcon(), additional->getIcon());
583  myTreeItemToACMap[additionalItem] = additional;
584  additionalItem->setExpanded(true);
585  }
586  // insert incoming connections of lanes (by default isn't expanded)
587  if (lane->getGNEIncomingConnections().size() > 0) {
588  FXTreeItem* incomingConnections = myTreelist->insertItem(0, laneItem, "Incomings", lane->getGNEIncomingConnections().front()->getIcon(), lane->getGNEIncomingConnections().front()->getIcon());
589  myTreeItemsWithoutAC.insert(incomingConnections);
590  incomingConnections->setExpanded(false);
591  for (int j = 0; j < (int)lane->getGNEIncomingConnections().size(); j++) {
592  GNEConnection* connection = lane->getGNEIncomingConnections().at(j);
593  FXTreeItem* connectionItem = myTreelist->insertItem(0, incomingConnections, (toString(connection->getTag()) + " " + toString(j)).c_str(), connection->getIcon(), connection->getIcon());
594  myTreeItemToACMap[connectionItem] = connection;
595  connectionItem->setExpanded(true);
596  }
597  }
598  // insert outcoming connections of lanes (by default isn't expanded)
599  if (lane->getGNEOutcomingConnections().size() > 0) {
600  FXTreeItem* outgoingConnections = myTreelist->insertItem(0, laneItem, "Outcomings", lane->getGNEOutcomingConnections().front()->getIcon(), lane->getGNEOutcomingConnections().front()->getIcon());
601  myTreeItemsWithoutAC.insert(outgoingConnections);
602  outgoingConnections->setExpanded(false);
603  for (int j = 0; j < (int)lane->getGNEOutcomingConnections().size(); j++) {
604  GNEConnection* connection = lane->getGNEOutcomingConnections().at(j);
605  FXTreeItem* connectionItem = myTreelist->insertItem(0, outgoingConnections, (toString(connection->getTag()) + " " + toString(j)).c_str(), connection->getIcon(), connection->getIcon());
606  myTreeItemToACMap[connectionItem] = connection;
607  connectionItem->setExpanded(true);
608  }
609  }
610  }
611  // insert additionals of edge
612  for (int i = 0; i < (int)edge->getAdditionalChilds().size(); i++) {
613  GNEAdditional* additional = edge->getAdditionalChilds().at(i);
614  FXTreeItem* additionalItem = myTreelist->insertItem(0, edgeItem, (toString(additional->getTag()) + " " + toString(i)).c_str(), additional->getIcon(), additional->getIcon());
615  myTreeItemToACMap[additionalItem] = additional;
616  additionalItem->setExpanded(true);
617  }
618  break;
619  }
620  case GLO_LANE: {
621  // insert lane root
622  GNELane* lane = dynamic_cast<GNELane*>(myACs.front());
623  FXTreeItem* laneItem = myTreelist->insertItem(0, 0, toString(lane->getTag()).c_str(), lane->getIcon(), lane->getIcon());
624  myTreeItemToACMap[laneItem] = lane;
625  laneItem->setExpanded(true);
626  // insert additionals of lanes
627  for (int i = 0; i < (int)lane->getAdditionalChilds().size(); i++) {
628  GNEAdditional* additional = lane->getAdditionalChilds().at(i);
629  FXTreeItem* additionalItem = myTreelist->insertItem(0, laneItem, (toString(additional->getTag()) + " " + toString(i)).c_str(), additional->getIcon(), additional->getIcon());
630  myTreeItemToACMap[additionalItem] = additional;
631  additionalItem->setExpanded(true);
632  }
633  // insert incoming connections of lanes (by default isn't expanded)
634  if (lane->getGNEIncomingConnections().size() > 0) {
635  FXTreeItem* incomingConnections = myTreelist->insertItem(0, laneItem, "Incomings", lane->getGNEIncomingConnections().front()->getIcon(), lane->getGNEIncomingConnections().front()->getIcon());
636  myTreeItemsWithoutAC.insert(incomingConnections);
637  incomingConnections->setExpanded(false);
638  for (int i = 0; i < (int)lane->getGNEIncomingConnections().size(); i++) {
639  GNEConnection* connection = lane->getGNEIncomingConnections().at(i);
640  FXTreeItem* connectionItem = myTreelist->insertItem(0, incomingConnections, (toString(connection->getTag()) + " " + toString(i)).c_str(), connection->getIcon(), connection->getIcon());
641  myTreeItemToACMap[connectionItem] = connection;
642  connectionItem->setExpanded(true);
643  }
644  }
645  // insert outcoming connections of lanes (by default isn't expanded)
646  if (lane->getGNEOutcomingConnections().size() > 0) {
647  FXTreeItem* outgoingConnections = myTreelist->insertItem(0, laneItem, "Outcomings", lane->getGNEOutcomingConnections().front()->getIcon(), lane->getGNEOutcomingConnections().front()->getIcon());
648  myTreeItemsWithoutAC.insert(outgoingConnections);
649  outgoingConnections->setExpanded(false);
650  for (int i = 0; i < (int)lane->getGNEOutcomingConnections().size(); i++) {
651  GNEConnection* connection = lane->getGNEOutcomingConnections().at(i);
652  FXTreeItem* connectionItem = myTreelist->insertItem(0, outgoingConnections, (toString(connection->getTag()) + " " + toString(i)).c_str(), connection->getIcon(), connection->getIcon());
653  myTreeItemToACMap[connectionItem] = connection;
654  connectionItem->setExpanded(true);
655  }
656  }
657  break;
658  }
659  case GLO_POI: {
660  // insert POI root
661  GNEPOI* POI = dynamic_cast<GNEPOI*>(myACs.front());
662  FXTreeItem* POIItem = myTreelist->insertItem(0, 0, toString(POI->getTag()).c_str(), POI->getIcon(), POI->getIcon());
663  myTreeItemToACMap[POIItem] = POI;
664  POIItem->setExpanded(true);
665  break;
666  }
667  case GLO_POLYGON: {
668  // insert polygon root
669  GNEPoly* polygon = dynamic_cast<GNEPoly*>(myACs.front());
670  FXTreeItem* polygonItem = myTreelist->insertItem(0, 0, toString(polygon->getTag()).c_str(), polygon->getIcon(), polygon->getIcon());
671  myTreeItemToACMap[polygonItem] = polygon;
672  polygonItem->setExpanded(true);
673  break;
674  }
675  case GLO_CROSSING: {
676  // insert crossing root
677  GNECrossing* crossing = dynamic_cast<GNECrossing*>(myACs.front());
678  FXTreeItem* crossingItem = myTreelist->insertItem(0, 0, toString(crossing->getTag()).c_str(), crossing->getIcon(), crossing->getIcon());
679  myTreeItemToACMap[crossingItem] = crossing;
680  crossingItem->setExpanded(true);
681  break;
682  }
683  case GLO_ADDITIONAL: {
684  // insert additional root
685  GNEAdditional* additional = dynamic_cast<GNEAdditional*>(myACs.front());
686  FXTreeItem* additionalItem = myTreelist->insertItem(0, 0, toString(additional->getTag()).c_str(), additional->getIcon(), additional->getIcon());
687  myTreeItemToACMap[additionalItem] = additional;
688  additionalItem->setExpanded(true);
689  break;
690  }
691  case GLO_CONNECTION: {
692  // insert connection root
693  GNEConnection* connection = dynamic_cast<GNEConnection*>(myACs.front());
694  FXTreeItem* connectionItem = myTreelist->insertItem(0, 0, toString(connection->getTag()).c_str(), connection->getIcon(), connection->getIcon());
695  myTreeItemToACMap[connectionItem] = connection;
696  connectionItem->setExpanded(true);
697  break;
698  }
699  default: {
700  myGroupBoxForTreeList->hide();
701  break;
702  }
703  }
704 }
705 
706 // ===========================================================================
707 // AttributeInput method definitions
708 // ===========================================================================
709 
710 GNEInspectorFrame::AttributeInput::AttributeInput(FXComposite* parent, GNEInspectorFrame* inspectorFrameParent) :
711  FXHorizontalFrame(parent, GUIDesignAuxiliarHorizontalFrame),
712  myInspectorFrameParent(inspectorFrameParent),
713  myTag(SUMO_TAG_NOTHING),
714  myAttr(SUMO_ATTR_NOTHING) {
715  // Create and hide ButtonCombinableChoices
716  myButtonCombinableChoices = new FXButton(this, "AttributeButton", 0, this, MID_GNE_OPEN_ATTRIBUTE_EDITOR, GUIDesignButtonAttribute);
718  // Create and hide label
719  myLabel = new FXLabel(this, "attributeLabel", 0, GUIDesignLabelAttribute);
720  myLabel->hide();
721  // Create and hide textField for int attributes
723  myTextFieldInt->hide();
724  // Create and hide textField for real/time attributes
726  myTextFieldReal->hide();
727  // Create and hide textField for string attributes
729  myTextFieldStrings->hide();
730  // Create and hide ComboBox
732  myChoicesCombo->hide();
733  // Create and hide checkButton
734  myBoolCheckButton = new FXCheckButton(this, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButtonAttribute);
735  myBoolCheckButton->hide();
736 }
737 
738 
739 void
741  // Set actual Tag and attribute
742  myTag = tag;
743  myAttr = attr;
744  // Show attribute Label
745  myLabel->setText(toString(myAttr).c_str());
746  myLabel->show();
747  // Set field depending of the type of value
749  // this is an special case for inspection of multiple attribute carriers with bools
750  std::vector<bool> boolValues = GNEAttributeCarrier::parse<std::vector<bool> >(value);
751  // set value of checkbox
752  if (boolValues.size() == 1) {
753  myBoolCheckButton->setCheck(boolValues.front());
754  } else {
755  int sum = 0;
756  for (std::vector<bool>::iterator i = boolValues.begin(); i != boolValues.end(); i++) {
757  sum += (int)(*i);
758  }
759  // only set true if all checkbox are true
760  if ((sum == 0) || (sum != (int)boolValues.size())) {
761  myBoolCheckButton->setCheck(false);
762  } else {
763  myBoolCheckButton->setCheck(true);
764  }
765  }
766  // set text
767  if (myBoolCheckButton->getCheck()) {
768  myBoolCheckButton->setText("true");
769  } else {
770  myBoolCheckButton->setText("false");
771  }
772  myBoolCheckButton->show();
774  // Obtain choices
775  const std::vector<std::string> choices = GNEAttributeCarrier::discreteChoices(myTag, myAttr);
776  // Check if are combinable coices
777  if (choices.size() > 0 && GNEAttributeCarrier::discreteCombinableChoices(myTag, myAttr)) {
778  // hide label
779  myLabel->hide();
780  // Show button combinable choices
781  myButtonCombinableChoices->setText(toString(myAttr).c_str());
783  // Show string with the values
784  myTextFieldStrings->setText(value.c_str());
785  myTextFieldStrings->setTextColor(FXRGB(0, 0, 0));
786  myTextFieldStrings->show();
787  } else {
788  // fill comboBox
789  myChoicesCombo->clearItems();
790  for (std::vector<std::string>::const_iterator it = choices.begin(); it != choices.end(); ++it) {
791  myChoicesCombo->appendItem(it->c_str());
792  }
793  myChoicesCombo->setNumVisible((int)choices.size());
794  myChoicesCombo->setCurrentItem(myChoicesCombo->findItem(value.c_str()));
795  myChoicesCombo->show();
796  }
798  // show TextField for real/time values
799  myTextFieldReal->setText(value.c_str());
800  myTextFieldReal->setTextColor(FXRGB(0, 0, 0));
801  myTextFieldReal->show();
802  } else if (GNEAttributeCarrier::isInt(myTag, myAttr)) {
803  // Show textField for int attributes
804  myTextFieldInt->setText(value.c_str());
805  myTextFieldInt->setTextColor(FXRGB(0, 0, 0));
806  myTextFieldInt->show();
807  } else {
808  // In any other case (String, list, etc.), show value as String
809  myTextFieldStrings->setText(value.c_str());
810  myTextFieldStrings->setTextColor(FXRGB(0, 0, 0));
811  myTextFieldStrings->show();
812  }
813  // Show AttributeInput
814  show();
815 }
816 
817 
818 void
820  // Hide all elements
821  myLabel->hide();
822  myTextFieldInt->hide();
823  myTextFieldReal->hide();
824  myTextFieldStrings->hide();
825  myChoicesCombo->hide();
826  myBoolCheckButton->hide();
828  // hide AttributeInput
829  hide();
830 }
831 
832 
835  return myTag;
836 }
837 
838 
841  return myAttr;
842 }
843 
844 
845 long
847  // in XML either allow or disallow can be defined for convenience
848  // In the input dialog, only the positive-list (allow) is defined even when
849  // clicking on 'disallow'
850  std::string allowed = myTextFieldStrings->getText().text();
851  std::string disallowed = "";
852  if (myAttr == SUMO_ATTR_DISALLOW) {
853  std::swap(allowed, disallowed);
854  }
855  // remove special word "(combined!)"
856  std::string::size_type i = allowed.find(" (combined!)");
857  if (i != std::string::npos) {
858  allowed.erase(i, 12);
859  }
860  SVCPermissions permissions;
861  if (allowed == "all") {
862  permissions = SVCAll;
863  } else {
864  permissions = parseVehicleClasses(allowed, disallowed);
865  }
866  // use expanded form
867  allowed = getVehicleClassNames(permissions, true);
868  GNEDialog_AllowDisallow(getApp(), &allowed).execute();
869  if (myAttr == SUMO_ATTR_DISALLOW) {
870  // invert again
871  std::string disallowed = getVehicleClassNames(SVCAll & ~parseVehicleClasses(allowed));
872  myTextFieldStrings->setText((disallowed).c_str());
873  } else {
874  myTextFieldStrings->setText((allowed).c_str());
875  }
876  onCmdSetAttribute(0, 0, 0);
877  return 1;
878 }
879 
880 
881 long
883  // Declare changed value
884  std::string newVal;
885  // First, obtain the string value of the new attribute depending of their type
887  // Set true o false depending of the checBox
888  if (myBoolCheckButton->getCheck()) {
889  myBoolCheckButton->setText("true");
890  newVal = "true";
891  } else {
892  myBoolCheckButton->setText("false");
893  newVal = "false";
894  }
896  // Obtain choices
897  const std::vector<std::string>& choices = GNEAttributeCarrier::discreteChoices(myTag, myAttr);
898  // Check if are combinable coices
899  if (choices.size() > 0 && GNEAttributeCarrier::discreteCombinableChoices(myTag, myAttr)) {
900  // Get value obtained using AttributeEditor
901  newVal = myTextFieldStrings->getText().text();
902  } else {
903  // Get value of ComboBox
904  newVal = myChoicesCombo->getText().text();
905  }
907  // Check if default value of attribute must be set
909  newVal = GNEAttributeCarrier::getDefaultValue<std::string>(myTag, myAttr);
910  myTextFieldReal->setText(newVal.c_str());
911  } else {
912  // obtain value of myTextFieldReal
913  newVal = myTextFieldReal->getText().text();
914  }
915  } else if (GNEAttributeCarrier::isInt(myTag, myAttr)) {
916  // Check if default value of attribute must be set
917  if (myTextFieldInt->getText().empty() && GNEAttributeCarrier::hasDefaultValue(myTag, myAttr)) {
918  newVal = GNEAttributeCarrier::getDefaultValue<std::string>(myTag, myAttr);
919  myTextFieldInt->setText(newVal.c_str());
920  } else {
921  // obtain value of myTextFieldInt
922  newVal = myTextFieldInt->getText().text();
923  }
925  // Check if default value of attribute must be set
927  newVal = GNEAttributeCarrier::getDefaultValue<std::string>(myTag, myAttr);
928  myTextFieldStrings->setText(newVal.c_str());
929  } else {
930  // obtain value of myTextFieldStrings
931  newVal = myTextFieldStrings->getText().text();
932  }
933  }
934 
935  // Check if attribute must be changed
936  if (myInspectorFrameParent->getACs().front()->isValid(myAttr, newVal)) {
937  // if its valid for the first AC than its valid for all (of the same type)
938  if (myInspectorFrameParent->getACs().size() > 1) {
939  myInspectorFrameParent->getViewNet()->getUndoList()->p_begin("Change multiple attributes");
940  }
941  // Set new value of attribute in all selected ACs
942  for (std::vector<GNEAttributeCarrier*>::const_iterator it_ac = myInspectorFrameParent->getACs().begin(); it_ac != myInspectorFrameParent->getACs().end(); it_ac++) {
943  (*it_ac)->setAttribute(myAttr, newVal, myInspectorFrameParent->getViewNet()->getUndoList());
944  }
945  // finish change multiple attributes
946  if (myInspectorFrameParent->getACs().size() > 1) {
948  }
949  // If previously value of TextField was red, change color to black
951  myTextFieldReal->setTextColor(FXRGB(0, 0, 0));
952  myTextFieldReal->killFocus();
954  myTextFieldInt->setTextColor(FXRGB(0, 0, 0));
955  myTextFieldInt->killFocus();
957  myTextFieldStrings->setTextColor(FXRGB(0, 0, 0));
958  myTextFieldStrings->killFocus();
959  }
960  } else {
961  // IF value of TextField isn't valid, change color to Red depending of type
963  myTextFieldReal->setTextColor(FXRGB(255, 0, 0));
965  myTextFieldInt->setTextColor(FXRGB(255, 0, 0));
967  myTextFieldStrings->setTextColor(FXRGB(255, 0, 0));
968  }
969 
970  // Write Warning in console if we're in testing mode
972  WRITE_WARNING("Value '" + newVal + "' for attribute " + toString(myAttr) + " of " + toString(myTag) + " isn't valid");
973  }
974  }
975  // Update view net
976  myInspectorFrameParent->getViewNet()->update();
977  return 1;
978 }
979 
980 
981 void
983  FXHorizontalFrame::show();
984 }
985 
986 
987 void
989  FXHorizontalFrame::hide();
990 }
991 
992 /****************************************************************************/
void copyTemplate(GNEEdge *tpl, GNEUndoList *undolist)
copy edge attributes from tpl
Definition: GNEEdge.cpp:511
std::string getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a &#39; &#39;.
const std::vector< GNEAdditional * > & getAdditionalChilds() const
return list of additionals associated with this edge
Definition: GNEEdge.cpp:1062
a tl-logic
SumoXMLTag
Numbers representing SUMO-XML - element names.
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:197
attribute edited
Definition: GUIAppEnum.h:570
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
Definition: GUIDesigns.h:117
static bool isFloat(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical of type float
bool isAdditionalBlocked() const
Check if additional item is currently blocked (i.e. cannot be moved with mouse)
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
Definition: GUIDesigns.h:60
FXButton * myButtonCombinableChoices
pointer to buttonCombinableChoices
void show()
set show as private function
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
a polygon
void inspectElement(GNEAttributeCarrier *AC)
Inspect a single element.
tree list with the childs
Definition: GUIAppEnum.h:364
begin/end of the description of a junction
FXLabel * getFrameHeaderLabel() const
get the label for the frame&#39;s header
Definition: GNEFrame.cpp:129
static bool isDiscrete(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is Discrete
FXGroupBox * myGroupBoxForTemplates
groupBox for templates
void removeAttributeCarrier(GNEAttributeCarrier *ac)
remove attribute carrier (element)
FXButton * myCopyTemplateButton
copy template button
#define GUIDesignComboBoxAttribute
Combo box static (cannot be edited) extended over the matrix column.
Definition: GUIDesigns.h:193
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
Definition: GNEPOI.h:51
a connection
GNEViewParent * getViewParent() const
get the net object
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
const std::vector< GNEAttributeCarrier * > & getACs() const
get current list of ACs
attribute blocking
Definition: GUIAppEnum.h:572
static int getHigherNumberOfAttributes()
return the number of attributes of the tag with the most highter number of attributes ...
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes ...
link,node: the traffic light id responsible for this link
In GNEInspectFrame, center element.
Definition: GUIAppEnum.h:372
FXIcon * getIcon() const
get FXIcon assigned to this object
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
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:82
long onCmdShowChildMenu(FXObject *, FXSelector, void *data)
called when user press right click over an item of list of childs
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
#define GUIDesignTreeListFrame
Tree list used in frames to represent childs of elements.
Definition: GUIDesigns.h:416
const SVCPermissions SVCAll
all VClasses are allowed
FXButton * mySetTemplateButton
set template button
GNEAdditional * myAdditional
pointer to additional element
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:123
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
bool isTestingModeEnabled() const
check if netedit is running in testing mode
Definition: GNEViewNet.cpp:405
~GNEInspectorFrame()
Destructor.
static bool isString(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type string
GNEViewNet * myViewNet
the window to inform when the tls is modfied
Definition: GNEFrame.h:95
static const std::vector< std::string > & discreteChoices(SumoXMLTag tag, SumoXMLAttr attr)
return a list of discrete choices for this attribute or an empty vector
static bool isInt(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical or type int
long onCmdSetBlocking(FXObject *, FXSelector, void *)
called when user toogle the blocking button
bool myPreviousElementDeleteWasMarked
flag to ckec if myPreviousElementDelete was marked in Delete Frame
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
#define GUIDesignButtonIconRectangular
button only with icon (46x23)
Definition: GUIDesigns.h:69
void showAttributeCarrierChilds()
show child of current attributeCarrier
static bool isTime(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is time
GNEUndoList * getUndoList() const
get the undoList object
void hide()
set hide as private function
FXLabel * myLabel
pointer to label
#define GUIDesignTextField
Definition: GUIDesigns.h:41
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:56
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:104
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:51
FXGroupBox * myGroupBoxForEditor
GropuBox for editor attributes.
static bool hasDefaultValue(SumoXMLTag tag, SumoXMLAttr attr)
check if attribute of an element has a default avlue
go back to the previous element
Definition: GUIAppEnum.h:578
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:89
GNEEdge * myEdgeTemplate
the edge template
std::set< FXTreeItem * > myTreeItemsWithoutAC
set used to save tree items without AC assigned (for example, Incoming/Outcoming connections) ...
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
Definition: GUIDesigns.h:244
GNEAttributeCarrier * myRightClickedAC
pointer to current right clicked Attribute Carrier
In GNEInspectFrame, inspect element.
Definition: GUIAppEnum.h:374
GNEInspectorFrame * myInspectorFrameParent
pointer to GNEInspectorFrame parent
virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist=20)
centers to the chosen artifact
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
Definition: GNELane.cpp:1084
void setEdgeTemplate(GNEEdge *tpl)
seh the template edge (we assume shared responsibility via reference counting)
block movement of a graphic element
invalid attribute
FXFont * getBoldFont()
void markAttributeCarrier(GNEAttributeCarrier *ac)
mark attribute carrier (element)
void showAttribute(SumoXMLTag tag, SumoXMLAttr attr, const std::string &value)
show attribute of ac
node: the type of traffic light
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
const std::string getID() const
function to support debugging
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
Definition: GNELane.cpp:1105
void incRef(const std::string &debugMsg="")
Dialog for edit rerouters.
GNEAttributeCarrier * myPreviousElementInspect
pointer to previous element called by Inspector Frame
long onCmdGoBack(FXObject *, FXSelector, void *)
called when user toogle the go back button
void decRef(const std::string &debugMsg="")
set object as template
Definition: GUIAppEnum.h:660
long onCmdInspectItem(FXObject *, FXSelector, void *)
called when user select option "inspect item" of child menu
copy template
Definition: GUIAppEnum.h:662
SumoXMLAttr getAttr() const
get current Attr
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:57
static bool isUnique(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is unique (may not be edited for a multi-selection and don&#39;t have a default valu...
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:50
long onUpdCopyTemplate(FXObject *, FXSelector, void *)
update the copy button with the name of the template
compound additional
FXGroupBox * myGroupBoxForTreeList
groupBox for AttrConnection
FXTreeList * myTreelist
tree list to show the childs of the element to erase
long onCmdOpenAllowDisallowEditor(FXObject *, FXSelector, void *)
open model dialog for more comfortable attribute editing
#define GUIDesignButton
Definition: GUIDesigns.h:57
void createPopUpMenu(int X, int Y, GNEAttributeCarrier *ac)
FXCheckButton * myBoolCheckButton
pointer to menu check
GNEAttributeCarrier * myPreviousElementDelete
pointer to previous element called by Delete Frame
const std::vector< GNELane * > & getLanes()
returns a reference to the lane vector
Definition: GNEEdge.cpp:543
virtual void show()
show Frame
Definition: GNEFrame.cpp:98
SumoXMLAttr myAttr
current Attr
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:62
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:219
GUIMainWindow * getApp() const
get App (GUIMainWindow)
long onCmdDeleteItem(FXObject *, FXSelector, void *)
called when user select option "delte item" of child menu
static bool isBool(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type bool for a certain tag
long onCmdCenterItem(FXObject *, FXSelector, void *)
called when user select option "center item" of child Menu
bool isAdditionalMovable() const
check if additional element is movable
FXComboBox * myChoicesCombo
pointer to combo box choices
an edge
std::vector< GNEInspectorFrame::AttributeInput * > myVectorOfAttributeInputs
list of Attribute inputs
void showAttributeCarrierChilds(GNEAttributeCarrier *ac)
show child of attributeCarrier in frame if previously there isn&#39;t a marked element ...
#define GUIDesignTextFieldInt
text field extended over Frame with thick frame and limited to Integers
Definition: GUIDesigns.h:44
static bool discreteCombinableChoices(SumoXMLTag tag, SumoXMLAttr attr)
return whether the given attribute allows for a combination of discrete values
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:107
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_MODE_DELETE
void show()
show inspector frame
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to Doubles/doubles
Definition: GUIDesigns.h:47
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[]
std::vector< GNEAttributeCarrier * > myACs
the multi-selection currently being inspected
SumoXMLTag getTag() const
get current tag
std::map< FXTreeItem *, GNEAttributeCarrier * > myTreeItemToACMap
map used to save the Tree items with their AC
FXTextField * myTextFieldStrings
textField to modify the value of string attributes
FXTextField * myTextFieldInt
textField to modify the value of int attributes
FXButton * myBackButton
back Button
long onCmdSetTemplate(FXObject *, FXSelector, void *)
set current edge as new template
void inspectMultisection(const std::vector< GNEAttributeCarrier *> &ACs)
Inspect the given multi-selection.
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
Definition: GUIDesigns.h:165
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
Definition: GNEFrame.h:110
FXTextField * myTextFieldReal
textField to modify the value of real/Time attributes
FXGroupBox * myGroupBoxForAttributes
groupBox for attributes
long onCmdSetAttribute(FXObject *, FXSelector, void *)
try to set new attribute value
const std::vector< GNEAdditional * > & getAdditionalChilds() const
get additional childs of lane
Definition: GNELane.cpp:768
In GNEInspectFrame, delete element.
Definition: GUIAppEnum.h:376
a junction
SumoXMLTag getTag() const
get XML Tag assigned to this object
FXCheckButton * myCheckBlocked
pointer to menu check block