Eclipse SUMO - Simulation of Urban MObility
GNEInspectorFrame.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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // The Widget for modifying network-element attributes (i.e. lane speed)
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
26 #include <netedit/GNENet.h>
27 #include <netedit/GNEViewNet.h>
28 #include <netedit/GNEUndoList.h>
29 #include <netedit/GNEViewParent.h>
33 
34 #include "GNEInspectorFrame.h"
35 #include "GNEDeleteFrame.h"
36 
37 
38 // ===========================================================================
39 // FOX callback mapping
40 // ===========================================================================
41 
42 FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[] = {
44 };
45 
46 FXDEFMAP(GNEInspectorFrame::NeteditAttributesEditor) NeteditAttributesEditorMap[] = {
49 };
50 
51 FXDEFMAP(GNEInspectorFrame::GEOAttributesEditor) GEOAttributesEditorMap[] = {
54 };
55 
56 FXDEFMAP(GNEInspectorFrame::TemplateEditor) TemplateEditorMap[] = {
60 
61 };
62 
63 // Object implementation
64 FXIMPLEMENT(GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
65 FXIMPLEMENT(GNEInspectorFrame::NeteditAttributesEditor, FXGroupBox, NeteditAttributesEditorMap, ARRAYNUMBER(NeteditAttributesEditorMap))
66 FXIMPLEMENT(GNEInspectorFrame::GEOAttributesEditor, FXGroupBox, GEOAttributesEditorMap, ARRAYNUMBER(GEOAttributesEditorMap))
67 FXIMPLEMENT(GNEInspectorFrame::TemplateEditor, FXGroupBox, TemplateEditorMap, ARRAYNUMBER(TemplateEditorMap))
68 
69 
70 // ===========================================================================
71 // method definitions
72 // ===========================================================================
73 
74 GNEInspectorFrame::GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet):
75  GNEFrame(horizontalFrameParent, viewNet, "Inspector"),
76  myPreviousElementInspect(nullptr),
77  myPreviousElementDelete(nullptr) {
78 
79  // Create back button
80  myBackButton = new FXButton(myHeaderLeftFrame, "", GUIIconSubSys::getIcon(ICON_BIGARROWLEFT), this, MID_GNE_INSPECTORFRAME_GOBACK, GUIDesignButtonIconRectangular);
81  myHeaderLeftFrame->hide();
82  myBackButton->hide();
83 
84  // Create Overlapped Inspection modul
85  myOverlappedInspection = new GNEFrameModuls::OverlappedInspection(this);
86 
87  // Create Attributes Editor modul
88  myAttributesEditor = new GNEFrameAttributesModuls::AttributesEditor(this);
89 
90  // Create GEO Parameters Editor modul
91  myGEOAttributesEditor = new GEOAttributesEditor(this);
92 
93  // create parameters Editor modul
94  myParametersEditor = new GNEFrameAttributesModuls::ParametersEditor(this);
95 
96  // Create Netedit Attributes Editor modul
97  myNeteditAttributesEditor = new NeteditAttributesEditor(this);
98 
99  // Create Template editor modul
100  myTemplateEditor = new TemplateEditor(this);
101 
102  // Create AttributeCarrierHierarchy modul
103  myAttributeCarrierHierarchy = new GNEFrameModuls::AttributeCarrierHierarchy(this);
104 }
105 
106 
108 
109 
110 void
112  // inspect a null element to reset inspector frame
113  inspectSingleElement(nullptr);
114  GNEFrame::show();
115 }
116 
117 
118 void
120  myViewNet->setDottedAC(nullptr);
121  GNEFrame::hide();
122 }
123 
124 
125 bool
127  // first check if we have clicked over an Attribute Carrier
128  if (objectsUnderCursor.getAttributeCarrierFront()) {
129  // change the selected attribute carrier if mySelectEdges is enabled and clicked element is a getLaneFront() and shift key isn't pressed
131  objectsUnderCursor.swapLane2Edge();
132  }
133  // if Control key is Pressed, select instead inspect element
135  // Check if this GLobject type is locked
137  // toogle netElement selection
138  if (objectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) {
139  objectsUnderCursor.getAttributeCarrierFront()->unselectAttributeCarrier();
140  } else {
141  objectsUnderCursor.getAttributeCarrierFront()->selectAttributeCarrier();
142  }
143  }
144  } else {
145  // first check if we clicked over a OverlappedInspection point
147  if (!myOverlappedInspection->previousElement(clickedPosition)) {
148  // inspect attribute carrier, (or multiselection if AC is selected)
149  inspectClickedElement(objectsUnderCursor, clickedPosition);
150  }
151  } else if (!myOverlappedInspection->nextElement(clickedPosition)) {
152  // inspect attribute carrier, (or multiselection if AC is selected)
153  inspectClickedElement(objectsUnderCursor, clickedPosition);
154  }
155  // focus upper element of inspector frame
157  }
158  return true;
159  } else {
160  return false;
161  }
162 }
163 
164 
165 bool
167  // first check if we have clicked over a demand element
168  if (objectsUnderCursor.getDemandElementFront()) {
169  // if Control key is Pressed, select instead inspect element
171  // Check if this GLobject type is locked
173  // toogle netElement selection
174  if (objectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) {
175  objectsUnderCursor.getAttributeCarrierFront()->unselectAttributeCarrier();
176  } else {
177  objectsUnderCursor.getAttributeCarrierFront()->selectAttributeCarrier();
178  }
179  }
180  } else {
181  // first check if we clicked over a OverlappedInspection point
183  if (!myOverlappedInspection->previousElement(clickedPosition)) {
184  // inspect attribute carrier, (or multiselection if AC is selected)
185  inspectClickedElement(objectsUnderCursor, clickedPosition);
186  }
187  } else if (!myOverlappedInspection->nextElement(clickedPosition)) {
188  // inspect attribute carrier, (or multiselection if AC is selected)
189  inspectClickedElement(objectsUnderCursor, clickedPosition);
190  }
191  // focus upper element of inspector frame
193  }
194  return true;
195  } else {
196  return false;
197  }
198 }
199 
200 
201 void
203  // Use the implementation of inspect for multiple AttributeCarriers to avoid repetition of code
204  std::vector<GNEAttributeCarrier*> itemsToInspect;
205  if (AC != nullptr) {
206  myViewNet->setDottedAC(AC);
207  if (AC->isAttributeCarrierSelected()) {
208  // obtain selected ACs depending of current supermode
209  std::vector<GNEAttributeCarrier*> selectedACs = myViewNet->getNet()->getSelectedAttributeCarriers(false);
210  // iterate over selected ACs
211  for (const auto& i : selectedACs) {
212  // filter ACs to inspect using Tag as criterium
213  if (i->getTagProperty().getTag() == AC->getTagProperty().getTag()) {
214  itemsToInspect.push_back(i);
215  }
216  }
217  } else {
218  itemsToInspect.push_back(AC);
219  }
220  }
221  inspectMultisection(itemsToInspect);
222 }
223 
224 
225 void
226 GNEInspectorFrame::inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs) {
227  // hide back button
228  myHeaderLeftFrame->hide();
229  myBackButton->hide();
230  // Hide all elements
238  // If vector of attribute Carriers contain data
239  if (ACs.size() > 0) {
240  // Set header
241  std::string headerString;
242  if (ACs.front()->getTagProperty().isNetElement()) {
243  headerString = "Net: ";
244  } else if (ACs.front()->getTagProperty().isAdditional()) {
245  headerString = "Additional: ";
246  } else if (ACs.front()->getTagProperty().isShape()) {
247  headerString = "Shape: ";
248  }
249  if (ACs.size() > 1) {
250  headerString += toString(ACs.size()) + " ";
251  }
252  headerString += ACs.front()->getTagStr();
253  if (ACs.size() > 1) {
254  headerString += "s";
255  }
256  // Set headerString into header label
257  getFrameHeaderLabel()->setText(headerString.c_str());
258 
259  // Show attributes editor
260  myAttributesEditor->showAttributeEditorModul(ACs, true, false);
261 
262  // show netedit attributes editor if we're inspecting elements with Netedit Attributes
264 
265  // Show GEO Attributes Editor if we're inspecting elements with GEO Attributes
267 
268  // show parameters editor
269  if (ACs.size() == 1) {
271  } else {
273  }
274 
275  // If attributes correspond to an Edge and we aren't in demand mode, show template editor
277 
278  // if we inspect a single Attribute carrier vector, show their children
279  if (ACs.size() == 1) {
281  }
282  } else {
283  getFrameHeaderLabel()->setText("Inspect");
284  myContentFrame->recalc();
285  }
286 }
287 
288 
289 void
291  // Show back button if myPreviousElementInspect was defined
292  myPreviousElementInspect = previousElement;
293  if (myPreviousElementInspect != nullptr) {
294  // disable myPreviousElementDelete to avoid inconsistences
295  myPreviousElementDelete = nullptr;
297  myHeaderLeftFrame->show();
298  myBackButton->show();
299  }
300 }
301 
302 
303 void
304 GNEInspectorFrame::inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked) {
305  myPreviousElementDelete = previousElement;
306  myPreviousElementDeleteWasMarked = previousElementWasMarked;
307  // Show back button if myPreviousElementDelete is valid
308  if (myPreviousElementDelete != nullptr) {
309  // disable myPreviousElementInspect to avoid inconsistences
310  myPreviousElementInspect = nullptr;
312  myHeaderLeftFrame->show();
313  myBackButton->show();
314  }
315 }
316 
317 
318 void
320  // Only remove if there is inspected ACs
321  if (myAttributesEditor->getEditedACs().size() > 0) {
322  myViewNet->setDottedAC(nullptr);
323  // Inspect empty selection (to hide all Editors)
325  }
326 }
327 
328 
331  return myAttributesEditor;
332 }
333 
334 
337  return myTemplateEditor;
338 }
339 
340 
343  return myOverlappedInspection;
344 }
345 
346 
347 long
348 GNEInspectorFrame::onCmdGoBack(FXObject*, FXSelector, void*) {
349  // Inspect previous element or go back to Delete Frame
352  myPreviousElementInspect = nullptr;
353  } else if (myPreviousElementDelete != nullptr) {
354  myPreviousElementDelete = nullptr;
355  // Hide inspect frame and show delete frame
356  hide();
358  }
359  return 1;
360 }
361 
362 
363 void
365  // refresh Attribute Editor
367  // refresh parametersEditor
369  // refresh AC Hierarchy
371 }
372 
373 
374 void
376  // if AC is a lane but selectEdges checkBox is enabled, then inspect their parent edge
378  inspectSingleElement(dynamic_cast<GNELane*>(AC)->getParentEdge());
379  } else {
381  }
382  // update view (due dotted contour)
383  myViewNet->update();
384 }
385 
386 
387 void
389  if (objectsUnderCursor.getAttributeCarrierFront()) {
390  // inspect front element
391  inspectSingleElement(objectsUnderCursor.getAttributeCarrierFront());
392  // if element has overlapped elements, show Overlapped Inspection modul
393  if (objectsUnderCursor.getClickedAttributeCarriers().size() > 1) {
394  myOverlappedInspection->showOverlappedInspection(objectsUnderCursor, clickedPosition);
395  } else {
397  }
398  }
399 }
400 
401 
402 void
407 }
408 
409 // ---------------------------------------------------------------------------
410 // GNEInspectorFrame::NeteditAttributesEditor - methods
411 // ---------------------------------------------------------------------------
412 
414  FXGroupBox(inspectorFrameParent->myContentFrame, "Netedit attributes", GUIDesignGroupBoxFrame),
415  myInspectorFrameParent(inspectorFrameParent) {
416 
417  // Create elements for parent additional
421 
422  // Create elements for block movement
424  myLabelBlockMovement = new FXLabel(myHorizontalFrameBlockMovement, "Block move", nullptr, GUIDesignLabelAttribute);
426 
427  // Create elements for block shape
428  myHorizontalFrameBlockShape = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
429  myLabelBlockShape = new FXLabel(myHorizontalFrameBlockShape, "Block shape", nullptr, GUIDesignLabelAttribute);
431 
432  // Create elements for close shape
433  myHorizontalFrameCloseShape = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
434  myLabelCloseShape = new FXLabel(myHorizontalFrameCloseShape, "Close shape", nullptr, GUIDesignLabelAttribute);
436 
437  // Create help button
438  myHelpButton = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
439 }
440 
441 
443 
444 
445 void
447  if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0) {
448  // enable all editable elements
449  myTextFieldParentAdditional->enable();
450  myCheckBoxBlockMovement->enable();
451  myCheckBoxBlockShape->enable();
452  myCheckBoxCloseShape->enable();
453  // obtain tag property (only for improve code legibility)
454  const auto& tagValue = myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty();
455  // Check if item can be moved
456  if (tagValue.canBlockMovement()) {
457  // show NeteditAttributesEditor
458  show();
459  // Iterate over AC to obtain values
460  bool value = true;
461  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
462  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(GNE_ATTR_BLOCK_MOVEMENT));
463  }
464  // show block movement frame
465  myHorizontalFrameBlockMovement->show();
466  // set check box value and update label
467  if (value) {
468  myCheckBoxBlockMovement->setCheck(true);
469  myCheckBoxBlockMovement->setText("true");
470  } else {
471  myCheckBoxBlockMovement->setCheck(false);
472  myCheckBoxBlockMovement->setText("false");
473  }
474  }
475  // check if item can block their shape
476  if (tagValue.canBlockShape()) {
477  // show NeteditAttributesEditor
478  show();
479  // Iterate over AC to obtain values
480  bool value = true;
481  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
482  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(GNE_ATTR_BLOCK_SHAPE));
483  }
484  // show block shape frame
485  myHorizontalFrameBlockShape->show();
486  // set check box value and update label
487  if (value) {
488  myCheckBoxBlockShape->setCheck(true);
489  myCheckBoxBlockShape->setText("true");
490  } else {
491  myCheckBoxBlockShape->setCheck(false);
492  myCheckBoxBlockShape->setText("false");
493  }
494  }
495  // check if item can block their shape
496  if (tagValue.canCloseShape()) {
497  // show NeteditAttributesEditor
498  show();
499  // Iterate over AC to obtain values
500  bool value = true;
501  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
502  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(GNE_ATTR_CLOSE_SHAPE));
503  }
504  // show close shape frame
505  myHorizontalFrameCloseShape->show();
506  // set check box value and update label
507  if (value) {
508  myCheckBoxCloseShape->setCheck(true);
509  myCheckBoxCloseShape->setText("true");
510  } else {
511  myCheckBoxCloseShape->setCheck(false);
512  myCheckBoxCloseShape->setText("false");
513  }
514  }
515  // Check if item has another item as parent and can be reparemt
516  if (tagValue.hasParent() && tagValue.canBeReparent()) {
517  // show NeteditAttributesEditor
518  show();
519  // obtain additional Parent
520  std::set<std::string> parents;
521  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
522  parents.insert(i->getAttribute(GNE_ATTR_PARENT));
523  }
524  // show parent additional frame
525  myHorizontalFrameParentAdditional->show();
526  // set Label and TextField with the Tag and ID of parent
527  myLabelParentAdditional->setText((toString(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().getParentTag()) + " parent").c_str());
528  myTextFieldParentAdditional->setText(toString(parents).c_str());
529  }
530  // disable all editable elements if we're in demand mode and inspected AC isn't a demand element
531  if (((myInspectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().isDemandElement()) ||
532  ((myInspectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && !myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().isDemandElement())) {
533  myTextFieldParentAdditional->disable();
534  myCheckBoxBlockMovement->disable();
535  myCheckBoxBlockShape->disable();
536  myCheckBoxCloseShape->disable();
537  }
538  }
539 }
540 
541 
542 void
544  // hide all elements of GroupBox
545  myHorizontalFrameParentAdditional->hide();
546  myHorizontalFrameBlockMovement->hide();
547  myHorizontalFrameBlockShape->hide();
548  myHorizontalFrameCloseShape->hide();
549  // hide groupbox
550  hide();
551 }
552 
553 
554 void
556  if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0) {
557  // refresh block movement
558  if (myHorizontalFrameBlockMovement->shown()) {
559  // Iterate over AC to obtain values
560  bool value = true;
561  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
562  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(GNE_ATTR_BLOCK_MOVEMENT));
563  }
564  // set check box value and update label
565  if (value) {
566  myCheckBoxBlockMovement->setCheck(true);
567  myCheckBoxBlockMovement->setText("true");
568  } else {
569  myCheckBoxBlockMovement->setCheck(false);
570  myCheckBoxBlockMovement->setText("false");
571  }
572  }
573  // refresh block shape
574  if (myHorizontalFrameBlockShape->shown()) {
575  // Iterate over AC to obtain values
576  bool value = true;
577  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
578  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(GNE_ATTR_BLOCK_SHAPE));
579  }
580  // set check box value and update label
581  if (value) {
582  myCheckBoxBlockShape->setCheck(true);
583  myCheckBoxBlockShape->setText("true");
584  } else {
585  myCheckBoxBlockShape->setCheck(false);
586  myCheckBoxBlockShape->setText("false");
587  }
588  }
589  // refresh close shape
590  if (myHorizontalFrameCloseShape->shown()) {
591  // Iterate over AC to obtain values
592  bool value = true;
593  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
594  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(GNE_ATTR_CLOSE_SHAPE));
595  }
596  // set check box value and update label
597  if (value) {
598  myCheckBoxCloseShape->setCheck(true);
599  myCheckBoxCloseShape->setText("true");
600  } else {
601  myCheckBoxCloseShape->setCheck(false);
602  myCheckBoxCloseShape->setText("false");
603  }
604  }
605  // Check if item has another item as parent (Currently only for single Additionals)
606  if (myHorizontalFrameParentAdditional->shown() && ((myTextFieldParentAdditional->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) {
607  // set Label and TextField with the Tag and ID of parent
608  myLabelParentAdditional->setText((toString(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().getParentTag()) + " parent").c_str());
609  myTextFieldParentAdditional->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(GNE_ATTR_PARENT).c_str());
610  }
611  }
612 }
613 
614 
615 long
617  // make sure that ACs has elements
618  if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0) {
619  // check if we're changing multiple attributes
620  if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 1) {
621  myInspectorFrameParent->myViewNet->getUndoList()->p_begin("Change multiple attributes");
622  }
623  if (obj == myCheckBoxBlockMovement) {
624  // set new values in all inspected Attribute Carriers
625  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
626  if (myCheckBoxBlockMovement->getCheck() == 1) {
627  i->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, "true", myInspectorFrameParent->myViewNet->getUndoList());
628  myCheckBoxBlockMovement->setText("true");
629  } else {
630  i->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, "false", myInspectorFrameParent->myViewNet->getUndoList());
631  myCheckBoxBlockMovement->setText("false");
632  }
633  }
634  } else if (obj == myCheckBoxBlockShape) {
635  // set new values in all inspected Attribute Carriers
636  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
637  if (myCheckBoxBlockShape->getCheck() == 1) {
638  i->setAttribute(GNE_ATTR_BLOCK_SHAPE, "true", myInspectorFrameParent->myViewNet->getUndoList());
639  myCheckBoxBlockShape->setText("true");
640  } else {
641  i->setAttribute(GNE_ATTR_BLOCK_SHAPE, "false", myInspectorFrameParent->myViewNet->getUndoList());
642  myCheckBoxBlockShape->setText("false");
643  }
644  }
645  } else if (obj == myCheckBoxCloseShape) {
646  // set new values in all inspected Attribute Carriers
647  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
648  if (myCheckBoxCloseShape->getCheck() == 1) {
649  i->setAttribute(GNE_ATTR_CLOSE_SHAPE, "true", myInspectorFrameParent->myViewNet->getUndoList());
650  myCheckBoxCloseShape->setText("true");
651  } else {
652  i->setAttribute(GNE_ATTR_CLOSE_SHAPE, "false", myInspectorFrameParent->myViewNet->getUndoList());
653  myCheckBoxCloseShape->setText("false");
654  }
655  }
656  } else if (obj == myTextFieldParentAdditional) {
657  if (myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->isValid(GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text())) {
658  // replace the parent of all inspected elements
659  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
660  i->setAttribute(GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
661  }
662  myTextFieldParentAdditional->setTextColor(FXRGB(0, 0, 0));
663  myTextFieldParentAdditional->killFocus();
664  } else {
665  myTextFieldParentAdditional->setTextColor(FXRGB(255, 0, 0));
666  }
667  }
668  // finish change multiple attributes
669  if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 1) {
670  myInspectorFrameParent->myViewNet->getUndoList()->p_end();
671  }
672  // force refresh values of AttributesEditor and GEOAttributesEditor
673  myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true);
674  myInspectorFrameParent->myGEOAttributesEditor->refreshGEOAttributesEditor(true);
675  }
676  return 1;
677 }
678 
679 
680 long
682  return 0;
683 }
684 
685 // ---------------------------------------------------------------------------
686 // GNEInspectorFrame::GEOAttributesEditor - methods
687 // ---------------------------------------------------------------------------
688 
690  FXGroupBox(inspectorFrameParent->myContentFrame, "GEO Attributes", GUIDesignGroupBoxFrame),
691  myInspectorFrameParent(inspectorFrameParent) {
692 
693  // Create Frame for GEOAttribute
694  myGEOAttributeFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
695  myGEOAttributeLabel = new FXLabel(myGEOAttributeFrame, "Undefined GEO Attribute", nullptr, GUIDesignLabelAttribute);
697 
698  // Create Frame for use GEO
699  myUseGEOFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
700  myUseGEOLabel = new FXLabel(myUseGEOFrame, toString(SUMO_ATTR_GEO).c_str(), nullptr, GUIDesignLabelAttribute);
701  myUseGEOCheckButton = new FXCheckButton(myUseGEOFrame, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
702 
703  // Create help button
704  myHelpButton = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
705 }
706 
707 
709 
710 
711 void
713  // make sure that ACs has elements
714  if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0) {
715  // enable all editable elements
716  myGEOAttributeTextField->enable();
717  myUseGEOCheckButton->enable();
718  // obtain tag property (only for improve code legibility)
719  const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty();
720  // check if item can use a geo position
721  if (tagProperty.hasGEOPosition() || tagProperty.hasGEOShape()) {
722  // show GEOAttributesEditor
723  show();
724  // Iterate over AC to obtain values
725  bool value = true;
726  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
727  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(SUMO_ATTR_GEO));
728  }
729  // show use geo frame
730  myUseGEOFrame->show();
731  // set UseGEOCheckButton value of and update label (only if geo conversion is defined)
732  if (GeoConvHelper::getFinal().getProjString() != "!") {
733  myUseGEOCheckButton->enable();
734  if (value) {
735  myUseGEOCheckButton->setCheck(true);
736  myUseGEOCheckButton->setText("true");
737  } else {
738  myUseGEOCheckButton->setCheck(false);
739  myUseGEOCheckButton->setText("false");
740  }
741  } else {
742  myUseGEOCheckButton->disable();
743  }
744  // now specify if a single position or an entire shape must be shown (note: cannot be shown both at the same time, and GEO Shape/Position only works for single selections)
745  if (tagProperty.hasGEOPosition() && myInspectorFrameParent->myAttributesEditor->getEditedACs().size() == 1) {
746  myGEOAttributeFrame->show();
747  myGEOAttributeLabel->setText(toString(SUMO_ATTR_GEOPOSITION).c_str());
748  myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
749  // only allow edit if geo conversion is defined
750  if (GeoConvHelper::getFinal().getProjString() != "!") {
751  myGEOAttributeTextField->enable();
752  myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(SUMO_ATTR_GEOPOSITION).c_str());
753  } else {
754  myGEOAttributeTextField->disable();
755  myGEOAttributeTextField->setText("No geo-conversion defined");
756  }
757  } else if (tagProperty.hasGEOShape() && myInspectorFrameParent->myAttributesEditor->getEditedACs().size() == 1) {
758  myGEOAttributeFrame->show();
759  myGEOAttributeLabel->setText(toString(SUMO_ATTR_GEOSHAPE).c_str());
760  myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
761  // only allow edit if geo conversion is defined
762  if (GeoConvHelper::getFinal().getProjString() != "!") {
763  myGEOAttributeTextField->enable();
764  myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(SUMO_ATTR_GEOSHAPE).c_str());
765  } else {
766  myGEOAttributeTextField->disable();
767  myGEOAttributeTextField->setText("No geo-conversion defined");
768  }
769  }
770  }
771  // disable all editable elements if we're in demand mode and inspected AC isn't a demand element
772  if (((myInspectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().isDemandElement()) ||
773  ((myInspectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && !myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().isDemandElement())) {
774  myGEOAttributeTextField->disable();
775  myUseGEOCheckButton->disable();
776  }
777  }
778 }
779 
780 
781 void
783  // hide all elements of GroupBox
784  myGEOAttributeFrame->hide();
785  myUseGEOFrame->hide();
786  // hide groupbox
787  hide();
788 }
789 
790 
791 void
793  // obtain tag property (only for improve code legibility)
794  const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty();
795  // Check that myGEOAttributeFrame is shown
796  if ((GeoConvHelper::getFinal().getProjString() != "!") && myGEOAttributeFrame->shown() && ((myGEOAttributeTextField->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) {
797  if (tagProperty.hasGEOPosition()) {
798  myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(SUMO_ATTR_GEOPOSITION).c_str());
799  } else if (tagProperty.hasGEOShape()) {
800  myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(SUMO_ATTR_GEOSHAPE).c_str());
801  }
802  myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
803  }
804 }
805 
806 
807 long
809  // make sure that ACs has elements
810  if ((GeoConvHelper::getFinal().getProjString() != "!") && (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0)) {
811  if (obj == myGEOAttributeTextField) {
812  // obtain tag property (only for improve code legibility)
813  const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty();
814  // Change GEO Attribute depending of type (Position or shape)
815  if (tagProperty.hasGEOPosition()) {
816  if (myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->isValid(SUMO_ATTR_GEOPOSITION, myGEOAttributeTextField->getText().text())) {
817  myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->setAttribute(SUMO_ATTR_GEOPOSITION, myGEOAttributeTextField->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
818  myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
819  myGEOAttributeTextField->killFocus();
820  } else {
821  myGEOAttributeTextField->setTextColor(FXRGB(255, 0, 0));
822  }
823  } else if (tagProperty.hasGEOShape()) {
824  if (myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->isValid(SUMO_ATTR_GEOSHAPE, myGEOAttributeTextField->getText().text())) {
825  myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->setAttribute(SUMO_ATTR_GEOSHAPE, myGEOAttributeTextField->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
826  myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
827  myGEOAttributeTextField->killFocus();
828  } else {
829  myGEOAttributeTextField->setTextColor(FXRGB(255, 0, 0));
830  }
831  } else {
832  throw ProcessError("myGEOAttributeTextField must be hidden becaurse there isn't GEO Attribute to edit");
833  }
834  } else if (obj == myUseGEOCheckButton) {
835  // update GEO Attribute of entire selection
836  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
837  if (myUseGEOCheckButton->getCheck() == 1) {
838  i->setAttribute(SUMO_ATTR_GEO, "true", myInspectorFrameParent->myViewNet->getUndoList());
839  myUseGEOCheckButton->setText("true");
840  } else {
841  i->setAttribute(SUMO_ATTR_GEO, "false", myInspectorFrameParent->myViewNet->getUndoList());
842  myUseGEOCheckButton->setText("false");
843  }
844  }
845  }
846  // force refresh values of Attributes editor and NeteditAttributesEditor
847  myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true);
848  myInspectorFrameParent->myNeteditAttributesEditor->refreshNeteditAttributesEditor(true);
849  }
850  return 1;
851 }
852 
853 
854 long
856  FXDialogBox* helpDialog = new FXDialogBox(this, "GEO attributes Help", GUIDesignDialogBox);
857  std::ostringstream help;
858  help
859  << " SUMO uses the World Geodetic System 84 (WGS84/UTM).\n"
860  << " For a GEO-referenced network, geo coordinates are represented as pairs of Longitude and Latitude\n"
861  << " in decimal degrees without extra symbols. (N,W..)\n"
862  << " - Longitude: East-west position of a point on the Earth's surface.\n"
863  << " - Latitude: North-south position of a point on the Earth's surface.\n"
864  << " - CheckBox 'geo' enables or disables saving position in GEO coordinates\n";
865  new FXLabel(helpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation);
866  // "OK"
867  new FXButton(helpDialog, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
868  helpDialog->create();
869  helpDialog->show();
870  return 1;
871 }
872 
873 // ---------------------------------------------------------------------------
874 // GNEInspectorFrame::TemplateEditor - methods
875 // ---------------------------------------------------------------------------
876 
878  FXGroupBox(inspectorFrameParent->myContentFrame, "Templates", GUIDesignGroupBoxFrame),
879  myInspectorFrameParent(inspectorFrameParent),
880  myEdgeTemplate(nullptr) {
881  // Create set template button
882  mySetTemplateButton = new FXButton(this, "Set as Template\t\t", nullptr, this, MID_HOTKEY_SHIFT_F1_TEMPLATE_SET, GUIDesignButton);
883  // Create copy template button
884  myCopyTemplateButton = new FXButton(this, "", nullptr, this, MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY, GUIDesignButton);
885  // Create copy template button
886  myClearTemplateButton = new FXButton(this, "clear Edge Template", nullptr, this, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR, GUIDesignButton);
887 }
888 
889 
891  // before destroy template editor, we need to check if there is an active edge template
892  if (myEdgeTemplate) {
893  // decrease reference
894  myEdgeTemplate->decRef("GNEInspectorFrame::~GNEInspectorFrame");
895  // delete edge template if is unreferenced
896  if (myEdgeTemplate->unreferenced()) {
897  delete myEdgeTemplate;
898  }
899  }
900 }
901 
902 
903 void
905  // show template editor only if we're editing an edge in Network mode
906  if ((myInspectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) &&
907  (myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().getTag() == SUMO_TAG_EDGE)) {
908  // show "Set As Template"
909  if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() == 1) {
910  mySetTemplateButton->show();
911  mySetTemplateButton->setText(("Set edge '" + myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getID() + "' as Template").c_str());
912  }
913  // update buttons
914  updateButtons();
915  // show modul
916  show();
917  }
918 }
919 
920 
921 void
923  // hide template editor
924  hide();
925 }
926 
927 
928 GNEEdge*
930  return myEdgeTemplate;
931 }
932 
933 
934 void
936  // check if template editor AND mySetTemplateButton is enabled
937  if (shown() && mySetTemplateButton->isEnabled()) {
938  onCmdSetTemplate(nullptr, 0, nullptr);
939  }
940 }
941 
942 
943 void
945  // check if template editor AND myCopyTemplateButton is enabled
946  if (shown() && myCopyTemplateButton->isEnabled()) {
947  onCmdCopyTemplate(nullptr, 0, nullptr);
948  }
949 }
950 
951 
952 void
954  // check if template editor AND myClearTemplateButton is enabled
955  if (shown() && myClearTemplateButton->isEnabled()) {
956  onCmdClearTemplate(nullptr, 0, nullptr);
957  }
958 }
959 
960 
961 long
963  // first check that there is exactly an inspected edge
964  if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() != 1) {
965  throw ProcessError("Only one edge must be inspected");
966  }
967  // retrieve edge ID (and throw exception if edge doesn't exist)
968  GNEEdge* edge = myInspectorFrameParent->myViewNet->getNet()->retrieveEdge(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getID());
969  // set template
970  setEdgeTemplate(edge);
971  // update buttons
972  updateButtons();
973  return 1;
974 }
975 
976 
977 long
979  for (const auto& it : myInspectorFrameParent->myAttributesEditor->getEditedACs()) {
980  // retrieve edge ID (and throw exception if edge doesn't exist)
981  GNEEdge* edge = myInspectorFrameParent->myViewNet->getNet()->retrieveEdge(it->getID());
982  // copy template
983  edge->copyTemplate(myEdgeTemplate, myInspectorFrameParent->myViewNet->getUndoList());
984  // refresh inspector parent
985  myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true);
986  }
987  // update view (to see visual changes)
988  myInspectorFrameParent->myViewNet->update();
989  return 1;
990 }
991 
992 
993 long
995  setEdgeTemplate(nullptr);
996  // update buttons
997  updateButtons();
998  return 1;
999 }
1000 
1001 
1002 void
1004  // before change edge template, we need to check if there is another active edge template
1005  if (myEdgeTemplate) {
1006  // decrease reference
1007  myEdgeTemplate->decRef("GNEInspectorFrame::setEdgeTemplate");
1008  // delete edge template if is unreferenced
1009  if (myEdgeTemplate->unreferenced()) {
1010  delete myEdgeTemplate;
1011  }
1012  }
1013  // check if we're setting a new edge template or removing it
1014  if (tpl) {
1015  // set new edge template
1016  myEdgeTemplate = tpl;
1017  // increase reference
1018  myEdgeTemplate->incRef("GNEInspectorFrame::setEdgeTemplate");
1019  } else {
1020  // clear edge template
1021  myEdgeTemplate = nullptr;
1022  }
1023 }
1024 
1025 
1026 void
1028  // enable or disable clear buttons depending of myEdgeTemplate
1029  if (myEdgeTemplate) {
1030  // update caption of copy button
1031  if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() == 1) {
1032  myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate->getMicrosimID() + "' into edge '" + myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getID() + "'").c_str());
1033  } else {
1034  myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate->getMicrosimID() + "' into " + toString(myInspectorFrameParent->myAttributesEditor->getEditedACs().size()) + " selected edges").c_str());
1035  }
1036  // enable set and clear buttons
1037  myCopyTemplateButton->enable();
1038  myClearTemplateButton->enable();
1039  } else {
1040  // update caption of copy button
1041  myCopyTemplateButton->setText("No edge Template Set");
1042  // disable set and clear buttons
1043  myCopyTemplateButton->disable();
1044  myClearTemplateButton->disable();
1045  }
1046 }
1047 
1048 /****************************************************************************/
GNEInspectorFrame::TemplateEditor::onCmdCopyTemplate
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
copy edge attributes from edge template
Definition: GNEInspectorFrame.cpp:978
GNEViewParent::getSelectorFrame
GNESelectorFrame * getSelectorFrame() const
get frame for GNE_NMODE_SELECT
Definition: GNEViewParent.cpp:186
GNEFrameModuls::AttributeCarrierHierarchy::hideAttributeCarrierHierarchy
void hideAttributeCarrierHierarchy()
hide AttributeCarrierHierarchy
Definition: GNEFrameModuls.cpp:877
GNEInspectorFrame::inspectMultisection
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
Definition: GNEInspectorFrame.cpp:226
GUIDesignAuxiliarHorizontalFrame
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:273
GNEInspectorFrame::NeteditAttributesEditor::myHorizontalFrameCloseShape
FXHorizontalFrame * myHorizontalFrameCloseShape
@frame horizontal frame for close shape
Definition: GNEInspectorFrame.h:106
GNEInspectorFrame::GEOAttributesEditor::myGEOAttributeLabel
FXLabel * myGEOAttributeLabel
Label for GEOAttribute.
Definition: GNEInspectorFrame.h:163
ICON_ACCEPT
Definition: GUIIcons.h:386
GNEInspectorFrame::NeteditAttributesEditor::hideNeteditAttributesEditor
void hideNeteditAttributesEditor()
hide netedit attributes editor
Definition: GNEInspectorFrame.cpp:543
GNEFrameModuls::AttributeCarrierHierarchy::showAttributeCarrierHierarchy
void showAttributeCarrierHierarchy(GNEAttributeCarrier *AC)
show AttributeCarrierHierarchy
Definition: GNEFrameModuls.cpp:866
GNEInspectorFrame::clearInspectedAC
void clearInspectedAC()
Clear all current inspected ACs.
Definition: GNEInspectorFrame.cpp:319
SUMO_ATTR_GEOSHAPE
Definition: SUMOXMLDefinitions.h:817
GNEInspectorFrame::GEOAttributesEditor::~GEOAttributesEditor
~GEOAttributesEditor()
destructor
Definition: GNEInspectorFrame.cpp:708
GNEInspectorFrame::myBackButton
FXButton * myBackButton
back Button
Definition: GNEInspectorFrame.h:351
GUIDesignTextFieldNCol
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:42
GNEEdge::copyTemplate
void copyTemplate(GNEEdge *tpl, GNEUndoList *undolist)
copy edge attributes from tpl
Definition: GNEEdge.cpp:839
GNEViewNetHelper::KeyPressed::shiftKeyPressed
bool shiftKeyPressed() const
check if SHIFT key was pressed during click
Definition: GNEViewNetHelper.cpp:376
MID_GNE_INSPECTORFRAME_GOBACK
go back to the previous element
Definition: GUIAppEnum.h:736
GNEInspectorFrame::inspectSingleElement
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
Definition: GNEInspectorFrame.cpp:202
GNEFrameAttributesModuls::ParametersEditor::hideParametersEditor
void hideParametersEditor()
hide netedit attributes editor
Definition: GNEFrameAttributesModuls.cpp:2162
GNEInspectorFrame::onCmdGoBack
long onCmdGoBack(FXObject *, FXSelector, void *)
called when user toogle the go back button
Definition: GNEInspectorFrame.cpp:348
GUIDesignLabelAttribute
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame and height of 23
Definition: GUIDesigns.h:170
GNEInspectorFrame::NeteditAttributesEditor::myHorizontalFrameBlockMovement
FXHorizontalFrame * myHorizontalFrameBlockMovement
@frame horizontal frame for block movement
Definition: GNEInspectorFrame.h:88
GNEFrameAttributesModuls::ParametersEditor::refreshParametersEditor
void refreshParametersEditor()
refresh netedit attributes
Definition: GNEFrameAttributesModuls.cpp:2170
GNEFrameAttributesModuls::AttributesEditor::getEditedACs
const std::vector< GNEAttributeCarrier * > & getEditedACs() const
get current edited ACs
Definition: GNEFrameAttributesModuls.cpp:1644
GNEInspectorFrame::NeteditAttributesEditor::myLabelParentAdditional
FXLabel * myLabelParentAdditional
Label for parent additional.
Definition: GNEInspectorFrame.h:82
GNEFrameModuls::OverlappedInspection
Definition: GNEFrameModuls.h:520
GNEInspectorFrame::TemplateEditor::updateButtons
void updateButtons()
update buttons
Definition: GNEInspectorFrame.cpp:1027
GNEInspectorFrame::myAttributeCarrierHierarchy
GNEFrameModuls::AttributeCarrierHierarchy * myAttributeCarrierHierarchy
Attribute Carrier Hierarchy.
Definition: GNEInspectorFrame.h:348
GNEFrame::myHeaderLeftFrame
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
Definition: GNEFrame.h:130
GNEViewNetHelper::KeyPressed::controlKeyPressed
bool controlKeyPressed() const
check if CONTROL key was pressed during click
Definition: GNEViewNetHelper.cpp:386
GNEInspectorFrame::myPreviousElementInspect
GNEAttributeCarrier * myPreviousElementInspect
pointer to previous element called by Inspector Frame
Definition: GNEInspectorFrame.h:354
GNEInspectorFrame::NeteditAttributesEditor::refreshNeteditAttributesEditor
void refreshNeteditAttributesEditor(bool forceRefresh)
refresh netedit attributes
Definition: GNEInspectorFrame.cpp:555
GNEInspectorFrame::inspectClickedElement
void inspectClickedElement(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition)
Inspect a singe element (the front of AC AttributeCarriers of ObjectUnderCursor.
Definition: GNEInspectorFrame.cpp:388
GNENet::getSelectedAttributeCarriers
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
Definition: GNENet.cpp:2123
SUMO_TAG_LANE
begin/end of the description of a single lane
Definition: SUMOXMLDefinitions.h:49
GUIDesignButtonOK
#define GUIDesignButtonOK
Definition: GUIDesigns.h:98
GNEAttributeCarrier::selectAttributeCarrier
virtual void selectAttributeCarrier(bool changeFlag=true)=0
GNEFrame
Definition: GNEFrame.h:34
GNEInspectorFrame::myPreviousElementDelete
GNEAttributeCarrier * myPreviousElementDelete
pointer to previous element called by Delete Frame
Definition: GNEInspectorFrame.h:357
GNEViewNet
Definition: GNEViewNet.h:42
GNEViewParent::getDeleteFrame
GNEDeleteFrame * getDeleteFrame() const
get frame for GNE_NMODE_DELETE
Definition: GNEViewParent.cpp:222
GNEInspectorFrame::GEOAttributesEditor::myUseGEOLabel
FXLabel * myUseGEOLabel
Label for use GEO.
Definition: GNEInspectorFrame.h:172
GNEInspectorFrame::TemplateEditor::copyTemplate
void copyTemplate()
copy template (used by shortcut)
Definition: GNEInspectorFrame.cpp:944
GNEInspectorFrame::myGEOAttributesEditor
GEOAttributesEditor * myGEOAttributesEditor
GEO Attributes editor.
Definition: GNEInspectorFrame.h:339
GNEInspectorFrame::GEOAttributesEditor::refreshGEOAttributesEditor
void refreshGEOAttributesEditor(bool forceRefresh)
refresh GEO attributes editor
Definition: GNEInspectorFrame.cpp:792
GUIDesigns.h
ICON_BIGARROWLEFT
Definition: GUIIcons.h:185
GUIDesignTextField
#define GUIDesignTextField
Definition: GUIDesigns.h:33
MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:646
GNEViewNet::update
void update() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:299
GNEInspectorFrame::NeteditAttributesEditor::myCheckBoxCloseShape
FXCheckButton * myCheckBoxCloseShape
pointer to check box "Block movement"
Definition: GNEInspectorFrame.h:112
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:609
GNEInspectorFrame::NeteditAttributesEditor::myLabelCloseShape
FXLabel * myLabelCloseShape
Label for close shape.
Definition: GNEInspectorFrame.h:109
GNEInspectorFrame::TemplateEditor::~TemplateEditor
~TemplateEditor()
destructor
Definition: GNEInspectorFrame.cpp:890
GNEInspectorFrame::attributeUpdated
void attributeUpdated()
function called after set a valid attribute in AttributeEditor
Definition: GNEInspectorFrame.cpp:403
GNEInspectorFrame::inspectFromDeleteFrame
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
Definition: GNEInspectorFrame.cpp:304
GNEFrame::myContentFrame
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:124
GNEInspectorFrame::GEOAttributesEditor::showGEOAttributesEditor
void showGEOAttributesEditor()
show GEO attributes editor
Definition: GNEInspectorFrame.cpp:712
GNEInspectorFrame::NeteditAttributesEditor::onCmdSetNeteditAttribute
long onCmdSetNeteditAttribute(FXObject *, FXSelector, void *)
Definition: GNEInspectorFrame.cpp:616
GUIDesignButton
#define GUIDesignButton
Definition: GUIDesigns.h:50
GNEAttributeCarrier::TagProperties::getTag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
Definition: GNEAttributeCarrier.cpp:523
GNEFrameAttributesModuls::ParametersEditor::showParametersEditor
void showParametersEditor(GNEAttributeCarrier *AC)
show netedit attributes editor (used for edit parameters of an existent AC)
Definition: GNEFrameAttributesModuls.cpp:2090
GNEFrameAttributesModuls::AttributesEditor
Definition: GNEFrameAttributesModuls.h:374
GUIAppEnum.h
GUIDesignLabelFrameInformation
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:194
GUIDesignButtonRectangular
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons)
Definition: GUIDesigns.h:56
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
GNEInspectorFrame::GEOAttributesEditor::myGEOAttributeTextField
FXTextField * myGEOAttributeTextField
textField for GEOAttribute
Definition: GNEInspectorFrame.h:166
GNEDeleteFrame.h
MID_HELP
help button
Definition: GUIAppEnum.h:553
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:1014
GNEInspectorFrame::TemplateEditor::mySetTemplateButton
FXButton * mySetTemplateButton
set template button
Definition: GNEInspectorFrame.h:241
GNEInspectorFrame::GEOAttributesEditor::GEOAttributesEditor
GEOAttributesEditor(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
Definition: GNEInspectorFrame.cpp:689
GNEFrameModuls::OverlappedInspection::nextElement
bool nextElement(const Position &clickedPosition)
try to go to next element if clicked position is near to saved position
Definition: GNEFrameModuls.cpp:1885
GNEInspectorFrame::NeteditAttributesEditor::myLabelBlockMovement
FXLabel * myLabelBlockMovement
Label for Check blocked movement.
Definition: GNEInspectorFrame.h:91
GNEFrame::focusUpperElement
void focusUpperElement()
focus upper element of frame
Definition: GNEFrame.cpp:101
GNEInspectorFrame::NeteditAttributesEditor::showNeteditAttributesEditor
void showNeteditAttributesEditor()
show netedit attributes editor
Definition: GNEInspectorFrame.cpp:446
GNEInspectorFrame::~GNEInspectorFrame
~GNEInspectorFrame()
Destructor.
Definition: GNEInspectorFrame.cpp:107
GNEInspectorFrame::TemplateEditor::getEdgeTemplate
GNEEdge * getEdgeTemplate() const
get the template edge (to copy attributes from)
Definition: GNEInspectorFrame.cpp:929
GNEInspectorFrame::NeteditAttributesEditor::myHorizontalFrameBlockShape
FXHorizontalFrame * myHorizontalFrameBlockShape
@frame horizontal frame for block shape
Definition: GNEInspectorFrame.h:97
GNEAttributeCarrier::getTagProperty
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
Definition: GNEAttributeCarrier.cpp:1273
GNEInspectorFrame::selectedOverlappedElement
void selectedOverlappedElement(GNEAttributeCarrier *AC)
open AttributesCreator extended dialog (can be reimplemented in frame children)
Definition: GNEInspectorFrame.cpp:375
GNEInspectorFrame::NeteditAttributesEditor::myLabelBlockShape
FXLabel * myLabelBlockShape
Label for Check blocked shape.
Definition: GNEInspectorFrame.h:100
GNEInspectorFrame::NeteditAttributesEditor::onCmdNeteditAttributeHelp
long onCmdNeteditAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
Definition: GNEInspectorFrame.cpp:681
GeoConvHelper::getFinal
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
Definition: GeoConvHelper.h:105
GNEViewNetHelper::ObjectsUnderCursor
class used to group all variables related with objects under cursor after a click over view
Definition: GNEViewNetHelper.h:148
GNEViewNet::getNetworkViewOptions
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
Definition: GNEViewNet.cpp:452
GNEViewNet.h
GNEInspectorFrame::NeteditAttributesEditor::myCheckBoxBlockMovement
FXCheckButton * myCheckBoxBlockMovement
pointer to check box "Block movement"
Definition: GNEInspectorFrame.h:94
GNEInspectorFrame::GEOAttributesEditor::onCmdGEOAttributeHelp
long onCmdGEOAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
Definition: GNEInspectorFrame.cpp:855
GNEInspectorFrame::TemplateEditor::showTemplateEditor
void showTemplateEditor()
show template editor
Definition: GNEInspectorFrame.cpp:904
SUMO_TAG_EDGE
begin/end of the description of an edge
Definition: SUMOXMLDefinitions.h:47
GNE_ATTR_CLOSE_SHAPE
Close shape of a polygon (Used by GNEPolys)
Definition: SUMOXMLDefinitions.h:985
GNE_SUPERMODE_NETWORK
Network mode (Edges, junctions, etc..)
Definition: GNEViewNetHelper.h:46
ProcessError
Definition: UtilExceptions.h:39
GNEInspectorFrame::updateFrameAfterUndoRedo
void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame (can be reimplemented in frame children)
Definition: GNEInspectorFrame.cpp:364
GNEInspectorFrame::getTemplateEditor
TemplateEditor * getTemplateEditor() const
get template editor
Definition: GNEInspectorFrame.cpp:336
GNEInspectorFrame::myTemplateEditor
TemplateEditor * myTemplateEditor
Template editor.
Definition: GNEInspectorFrame.h:345
GNEViewNet::getKeyPressed
const GNEViewNetHelper::KeyPressed & getKeyPressed() const
get Key Pressed modul
Definition: GNEViewNet.cpp:464
GUIDesignCheckButton
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:115
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNEFrameAttributesModuls::AttributesEditor::showAttributeEditorModul
void showAttributeEditorModul(const std::vector< GNEAttributeCarrier * > &ACs, bool includeExtended, bool forceAttributeEnabled)
show attributes of multiple ACs
Definition: GNEFrameAttributesModuls.cpp:1461
GNEInspectorFrame::GEOAttributesEditor
Definition: GNEInspectorFrame.h:122
GNEEdge.h
GUIDesignButtonIconRectangular
#define GUIDesignButtonIconRectangular
button only with icon (46x23)
Definition: GUIDesigns.h:62
GNE_ATTR_BLOCK_SHAPE
block shape of a graphic element (Used mainly in GNEShapes)
Definition: SUMOXMLDefinitions.h:983
GNEFrame::myViewNet
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:121
GNEFrameModuls::AttributeCarrierHierarchy
Definition: GNEFrameModuls.h:287
GNEInspectorFrame::myAttributesEditor
GNEFrameAttributesModuls::AttributesEditor * myAttributesEditor
Attribute editor.
Definition: GNEInspectorFrame.h:333
GNEFrameModuls::OverlappedInspection::showOverlappedInspection
void showOverlappedInspection(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition)
show template editor
Definition: GNEFrameModuls.cpp:1826
SUMO_ATTR_GEOPOSITION
Definition: SUMOXMLDefinitions.h:818
GNEInspectorFrame::getOverlappedInspection
GNEFrameModuls::OverlappedInspection * getOverlappedInspection() const
get OverlappedInspection modul
Definition: GNEInspectorFrame.cpp:342
GUIDesignGroupBoxFrame
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:239
GNEInspectorFrame::NeteditAttributesEditor::~NeteditAttributesEditor
~NeteditAttributesEditor()
destructor
Definition: GNEInspectorFrame.cpp:442
GNEFrameAttributesModuls::AttributesEditor::hideAttributesEditorModul
void hideAttributesEditorModul()
hide attribute editor
Definition: GNEFrameAttributesModuls.cpp:1550
GNEDeleteFrame::show
void show()
show delete frame
Definition: GNEDeleteFrame.cpp:99
GNEInspectorFrame::NeteditAttributesEditor::myHelpButton
FXButton * myHelpButton
button for help
Definition: GNEInspectorFrame.h:115
GNEInspectorFrame::myParametersEditor
GNEFrameAttributesModuls::ParametersEditor * myParametersEditor
parameters editor
Definition: GNEInspectorFrame.h:342
GNEInspectorFrame::GEOAttributesEditor::myUseGEOFrame
FXHorizontalFrame * myUseGEOFrame
horizontal frame for use GEO
Definition: GNEInspectorFrame.h:169
GNEInspectorFrame::myOverlappedInspection
GNEFrameModuls::OverlappedInspection * myOverlappedInspection
Overlapped Inspection.
Definition: GNEInspectorFrame.h:330
GNEFrameAttributesModuls::ParametersEditor
Definition: GNEFrameAttributesModuls.h:554
GNEInspectorFrame::GEOAttributesEditor::onCmdSetGEOAttribute
long onCmdSetGEOAttribute(FXObject *, FXSelector, void *)
Called when user change the current GEO Attribute.
Definition: GNEInspectorFrame.cpp:808
MID_HOTKEY_SHIFT_F1_TEMPLATE_SET
set template
Definition: GUIAppEnum.h:192
GNELane.h
GNEInspectorFrame::TemplateEditor::clearTemplate
void clearTemplate()
clear template (used by shortcut)
Definition: GNEInspectorFrame.cpp:953
GNEInspectorFrame::getAttributesEditor
GNEFrameAttributesModuls::AttributesEditor * getAttributesEditor() const
get AttributesEditor
Definition: GNEInspectorFrame.cpp:330
GNEAttributeCarrier::isAttributeCarrierSelected
virtual bool isAttributeCarrierSelected() const =0
check if attribute carrier is selected
GNEInspectorFrame::myNeteditAttributesEditor
NeteditAttributesEditor * myNeteditAttributesEditor
Netedit Attributes editor.
Definition: GNEInspectorFrame.h:336
GNEViewNetHelper::ObjectsUnderCursor::getGlTypeFront
GUIGlObjectType getGlTypeFront() const
get front GUI GL object type (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:198
GNEViewParent.h
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
GNESelectorFrame.h
GNEInspectorFrame::GEOAttributesEditor::myHelpButton
FXButton * myHelpButton
button for help
Definition: GNEInspectorFrame.h:178
GNEInspectorFrame::TemplateEditor::setEdgeTemplate
void setEdgeTemplate(GNEEdge *tpl)
seh the template edge (we assume shared responsibility via reference counting)
Definition: GNEInspectorFrame.cpp:1003
GNEInspectorFrame::NeteditAttributesEditor::myCheckBoxBlockShape
FXCheckButton * myCheckBoxBlockShape
pointer to check box "Block Shape"
Definition: GNEInspectorFrame.h:103
GNEInspectorFrame::NeteditAttributesEditor
FOX-declaration.
Definition: GNEInspectorFrame.h:42
GNENetElement::getNet
GNENet * getNet() const
get Net in which this element is placed
Definition: GNENetElement.cpp:58
GNEInspectorFrame::TemplateEditor::onCmdClearTemplate
long onCmdClearTemplate(FXObject *, FXSelector, void *)
clear current edge template
Definition: GNEInspectorFrame.cpp:994
GNEInspectorFrame::inspectChild
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
Definition: GNEInspectorFrame.cpp:290
GNE_SUPERMODE_DEMAND
Demanding mode (Routes, Vehicles etc..)
Definition: GNEViewNetHelper.h:48
GNEInspectorFrame::hide
void hide()
hide inspector frame
Definition: GNEInspectorFrame.cpp:119
GNEInspectorFrame::TemplateEditor::hideTemplateEditor
void hideTemplateEditor()
hide template editor
Definition: GNEInspectorFrame.cpp:922
GNEViewNetHelper::ObjectsUnderCursor::getDemandElementFront
GNEDemandElement * getDemandElementFront() const
get front net element element (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:248
GNE_ATTR_BLOCK_MOVEMENT
block movement of a graphic element
Definition: SUMOXMLDefinitions.h:981
GNEFrameAttributesModuls::AttributesEditor::refreshAttributeEditor
void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition)
refresh attribute editor (only the valid values will be refresh)
Definition: GNEFrameAttributesModuls.cpp:1561
GNEInspectorFrame::TemplateEditor
Definition: GNEInspectorFrame.h:185
GNEReferenceCounter::incRef
void incRef(const std::string &debugMsg="")
Increarse reference.
Definition: GNEReferenceCounter.h:67
GNEInspectorFrame::TemplateEditor::myClearTemplateButton
FXButton * myClearTemplateButton
clear template button
Definition: GNEInspectorFrame.h:247
GNEViewNetHelper::NetworkViewOptions::selectEdges
bool selectEdges() const
check if select edges checkbox is enabled
Definition: GNEViewNetHelper.cpp:1627
MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR
clear template
Definition: GUIAppEnum.h:196
GNEFrameModuls::OverlappedInspection::hideOverlappedInspection
void hideOverlappedInspection()
hide template editor
Definition: GNEFrameModuls.cpp:1860
GNEInspectorFrame::myPreviousElementDeleteWasMarked
bool myPreviousElementDeleteWasMarked
flag to ckec if myPreviousElementDelete was marked in Delete Frame
Definition: GNEInspectorFrame.h:360
GNENet::retrieveEdge
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:1069
GNEViewNet::setDottedAC
void setDottedAC(const GNEAttributeCarrier *AC)
set attributeCarrier under cursor
Definition: GNEViewNet.cpp:1032
GNEInspectorFrame::processDemandSupermodeClick
bool processDemandSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Demand
Definition: GNEInspectorFrame.cpp:166
config.h
GNEInspectorFrame::GEOAttributesEditor::myUseGEOCheckButton
FXCheckButton * myUseGEOCheckButton
checkBox for use GEO
Definition: GNEInspectorFrame.h:175
FXDEFMAP
FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[]
GNEViewNetHelper::ObjectsUnderCursor::getClickedAttributeCarriers
const std::vector< GNEAttributeCarrier * > & getClickedAttributeCarriers() const
get vector with clicked ACs
Definition: GNEViewNetHelper.cpp:338
GNEViewNetHelper::ObjectsUnderCursor::getAttributeCarrierFront
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier (or a pointer to nullptr if there isn't)
Definition: GNEViewNetHelper.cpp:208
GNEFrameModuls::OverlappedInspection::previousElement
bool previousElement(const Position &clickedPosition)
try to go to previous element if clicked position is near to saved position
Definition: GNEFrameModuls.cpp:1903
GNESelectorFrame::LockGLObjectTypes::IsObjectTypeLocked
bool IsObjectTypeLocked(const GUIGlObjectType type) const
check if an object is locked
Definition: GNESelectorFrame.cpp:579
GNEInspectorFrame.h
GNEFrameModuls::AttributeCarrierHierarchy::refreshAttributeCarrierHierarchy
void refreshAttributeCarrierHierarchy()
refresh AttributeCarrierHierarchy
Definition: GNEFrameModuls.cpp:895
GNEInspectorFrame::TemplateEditor::onCmdSetTemplate
long onCmdSetTemplate(FXObject *, FXSelector, void *)
set current edge as new template
Definition: GNEInspectorFrame.cpp:962
GNEInspectorFrame::GEOAttributesEditor::hideGEOAttributesEditor
void hideGEOAttributesEditor()
hide GEO attributes editor
Definition: GNEInspectorFrame.cpp:782
GNEInspectorFrame::TemplateEditor::myCopyTemplateButton
FXButton * myCopyTemplateButton
copy template button
Definition: GNEInspectorFrame.h:244
GNEInspectorFrame::TemplateEditor::TemplateEditor
TemplateEditor(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
Definition: GNEInspectorFrame.cpp:877
GNEInspectorFrame::NeteditAttributesEditor::myHorizontalFrameParentAdditional
FXHorizontalFrame * myHorizontalFrameParentAdditional
@frame horizontal frame for replace the parent additional
Definition: GNEInspectorFrame.h:79
GNEFrame::show
virtual void show()
show Frame
Definition: GNEFrame.cpp:107
GNEInspectorFrame
Definition: GNEInspectorFrame.h:33
GNEAttributeCarrier
Definition: GNEAttributeCarrier.h:54
GNEFrame::getFrameHeaderLabel
FXLabel * getFrameHeaderLabel() const
get the label for the frame's header
Definition: GNEFrame.cpp:138
SUMO_ATTR_GEO
Definition: SUMOXMLDefinitions.h:816
GNEFrame::hide
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:116
GNEInspectorFrame::GEOAttributesEditor::myGEOAttributeFrame
FXHorizontalFrame * myGEOAttributeFrame
horizontal frame for GEOAttribute
Definition: GNEInspectorFrame.h:160
GNENet.h
GNEViewNet::getViewParent
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:1008
GNEInspectorFrame::NeteditAttributesEditor::myTextFieldParentAdditional
FXTextField * myTextFieldParentAdditional
pointer for replace the parent additional
Definition: GNEInspectorFrame.h:85
GNESelectorFrame::getLockGLObjectTypes
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
Definition: GNESelectorFrame.cpp:459
MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY
copy template
Definition: GUIAppEnum.h:194
GNEAttributeCarrier::unselectAttributeCarrier
virtual void unselectAttributeCarrier(bool changeFlag=true)=0
unselect attribute carrier using GUIGlobalSelection
GNEInspectorFrame::processNetworkSupermodeClick
bool processNetworkSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Network
Definition: GNEInspectorFrame.cpp:126
GNEViewNetHelper::ObjectsUnderCursor::swapLane2Edge
void swapLane2Edge()
swap lane to edge
Definition: GNEViewNetHelper.cpp:171
GNEInspectorFrame::TemplateEditor::setTemplate
void setTemplate()
set template (used by shortcut)
Definition: GNEInspectorFrame.cpp:935
GNEUndoList.h
GNEInspectorFrame::show
void show()
show inspector frame
Definition: GNEInspectorFrame.cpp:111
GUIDesignDialogBox
#define GUIDesignDialogBox
Definition: GUIDesigns.h:433
GNE_ATTR_PARENT
parent of an additional element
Definition: SUMOXMLDefinitions.h:987
GNEInspectorFrame::NeteditAttributesEditor::NeteditAttributesEditor
NeteditAttributesEditor(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
Definition: GNEInspectorFrame.cpp:413