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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
19 // The Widget for modifying network-element attributes (i.e. lane speed)
20 /****************************************************************************/
21 #include <config.h>
22 
23 #include <netedit/GNENet.h>
24 #include <netedit/GNEViewNet.h>
25 #include <netedit/GNEUndoList.h>
26 #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[] = {
50 };
51 
52 FXDEFMAP(GNEInspectorFrame::GEOAttributesEditor) GEOAttributesEditorMap[] = {
55 };
56 
61 };
62 
63 FXDEFMAP(GNEInspectorFrame::ParametersEditorInspector) ParametersEditorInspectorMap[] = {
66 };
67 
68 // Object implementation
69 FXIMPLEMENT(GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
70 FXIMPLEMENT(GNEInspectorFrame::NeteditAttributesEditor, FXGroupBox, NeteditAttributesEditorMap, ARRAYNUMBER(NeteditAttributesEditorMap))
71 FXIMPLEMENT(GNEInspectorFrame::GEOAttributesEditor, FXGroupBox, GEOAttributesEditorMap, ARRAYNUMBER(GEOAttributesEditorMap))
72 FXIMPLEMENT(GNEInspectorFrame::TemplateEditor, FXGroupBox, TemplateEditorMap, ARRAYNUMBER(TemplateEditorMap))
73 FXIMPLEMENT(GNEInspectorFrame::ParametersEditorInspector, FXGroupBox, ParametersEditorInspectorMap, ARRAYNUMBER(ParametersEditorInspectorMap))
74 
75 
76 // ===========================================================================
77 // method definitions
78 // ===========================================================================
79 
80 GNEInspectorFrame::GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet):
81  GNEFrame(horizontalFrameParent, viewNet, "Inspector"),
82  myPreviousElementInspect(nullptr),
83  myPreviousElementDelete(nullptr),
84  myPreviousElementDeleteWasMarked(false) {
85 
86  // Create back button
87  myBackButton = new FXButton(myHeaderLeftFrame, "", GUIIconSubSys::getIcon(GUIIcon::BIGARROWLEFT), this, MID_GNE_INSPECTORFRAME_GOBACK, GUIDesignButtonIconRectangular);
88  myHeaderLeftFrame->hide();
89  myBackButton->hide();
90 
91  // Create Overlapped Inspection modul
92  myOverlappedInspection = new GNEFrameModuls::OverlappedInspection(this);
93 
94  // Create Attributes Editor modul
95  myAttributesEditor = new GNEFrameAttributesModuls::AttributesEditor(this);
96 
97  // Create GEO Parameters Editor modul
98  myGEOAttributesEditor = new GEOAttributesEditor(this);
99 
100  // create parameters Editor modul
101  myParametersEditorInspector = new ParametersEditorInspector(this);
102 
103  // Create Netedit Attributes Editor modul
104  myNeteditAttributesEditor = new NeteditAttributesEditor(this);
105 
106  // Create Template editor modul
107  myTemplateEditor = new TemplateEditor(this);
108 
109  // Create HierarchicalElementTree modul
110  myHierarchicalElementTree = new GNEFrameModuls::HierarchicalElementTree(this);
111 }
112 
113 
115 
116 
117 void
119  // inspect a null element to reset inspector frame
120  inspectSingleElement(nullptr);
121  GNEFrame::show();
122 }
123 
124 
125 void
128  GNEFrame::hide();
129 }
130 
131 
132 bool
134  // first check if we have clicked over an Attribute Carrier
135  if (objectsUnderCursor.getAttributeCarrierFront()) {
136  // if Control key is Pressed, select instead inspect element
138  // Check if this GLobject type is locked
140  // toogle networkElement selection
141  if (objectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) {
142  objectsUnderCursor.getAttributeCarrierFront()->unselectAttributeCarrier();
143  } else {
144  objectsUnderCursor.getAttributeCarrierFront()->selectAttributeCarrier();
145  }
146  }
147  } else {
148  // first check if we clicked over a OverlappedInspection point
150  if (!myOverlappedInspection->previousElement(clickedPosition)) {
151  // inspect attribute carrier, (or multiselection if AC is selected)
152  inspectClickedElement(objectsUnderCursor, clickedPosition);
153  }
154  } else if (!myOverlappedInspection->nextElement(clickedPosition)) {
155  // inspect attribute carrier, (or multiselection if AC is selected)
156  inspectClickedElement(objectsUnderCursor, clickedPosition);
157  }
158  // focus upper element of inspector frame
160  }
161  return true;
162  } else {
163  return false;
164  }
165 }
166 
167 
168 bool
170  // first check if we have clicked over a demand element
171  if (objectsUnderCursor.getDemandElementFront()) {
172  // if Control key is Pressed, select instead inspect element
174  // Check if this GLobject type is locked
176  // toogle networkElement selection
177  if (objectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) {
178  objectsUnderCursor.getAttributeCarrierFront()->unselectAttributeCarrier();
179  } else {
180  objectsUnderCursor.getAttributeCarrierFront()->selectAttributeCarrier();
181  }
182  }
183  } else {
184  // first check if we clicked over a OverlappedInspection point
186  if (!myOverlappedInspection->previousElement(clickedPosition)) {
187  // inspect attribute carrier, (or multiselection if AC is selected)
188  inspectClickedElement(objectsUnderCursor, clickedPosition);
189  }
190  } else if (!myOverlappedInspection->nextElement(clickedPosition)) {
191  // inspect attribute carrier, (or multiselection if AC is selected)
192  inspectClickedElement(objectsUnderCursor, clickedPosition);
193  }
194  // focus upper element of inspector frame
196  }
197  return true;
198  } else {
199  return false;
200  }
201 }
202 
203 
204 bool
206  // first check if we have clicked over a data element
207  if (objectsUnderCursor.getGenericDataElementFront()) {
208  // if Control key is Pressed, select instead inspect element
210  // Check if this GLobject type is locked
212  // toogle networkElement selection
213  if (objectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) {
214  objectsUnderCursor.getAttributeCarrierFront()->unselectAttributeCarrier();
215  } else {
216  objectsUnderCursor.getAttributeCarrierFront()->selectAttributeCarrier();
217  }
218  }
219  } else {
220  // first check if we clicked over a OverlappedInspection point
222  if (!myOverlappedInspection->previousElement(clickedPosition)) {
223  // inspect attribute carrier, (or multiselection if AC is selected)
224  inspectClickedElement(objectsUnderCursor, clickedPosition);
225  }
226  } else if (!myOverlappedInspection->nextElement(clickedPosition)) {
227  // inspect attribute carrier, (or multiselection if AC is selected)
228  inspectClickedElement(objectsUnderCursor, clickedPosition);
229  }
230  // focus upper element of inspector frame
232  }
233  return true;
234  } else {
235  return false;
236  }
237 }
238 
239 
240 void
242  // Use the implementation of inspect for multiple AttributeCarriers to avoid repetition of code
243  std::vector<GNEAttributeCarrier*> itemsToInspect;
244  if (AC != nullptr) {
246  if (AC->isAttributeCarrierSelected()) {
247  // obtain selected ACs depending of current supermode
248  std::vector<GNEAttributeCarrier*> selectedACs = myViewNet->getNet()->getSelectedAttributeCarriers(false);
249  // iterate over selected ACs
250  for (const auto& i : selectedACs) {
251  // filter ACs to inspect using Tag as criterium
252  if (i->getTagProperty().getTag() == AC->getTagProperty().getTag()) {
253  itemsToInspect.push_back(i);
254  }
255  }
256  } else {
257  itemsToInspect.push_back(AC);
258  }
259  }
260  inspectMultisection(itemsToInspect);
261 }
262 
263 
264 void
265 GNEInspectorFrame::inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs) {
266  // update inspected ACs in viewNet
268  // hide back button
269  myHeaderLeftFrame->hide();
270  myBackButton->hide();
271  // Hide all elements
279  // If vector of attribute Carriers contain data
280  if (ACs.size() > 0) {
281  // Set header
282  std::string headerString;
283  if (ACs.front()->getTagProperty().isNetworkElement()) {
284  headerString = "Net: ";
285  } else if (ACs.front()->getTagProperty().isAdditionalElement()) {
286  headerString = "Additional: ";
287  } else if (ACs.front()->getTagProperty().isShape()) {
288  headerString = "Shape: ";
289  } else if (ACs.front()->getTagProperty().isTAZElement()) {
290  headerString = "TAZ: ";
291  } else if (ACs.front()->getTagProperty().isVehicle()) {
292  headerString = "Vehicle: ";
293  } else if (ACs.front()->getTagProperty().isRoute()) {
294  headerString = "Route: ";
295  } else if (ACs.front()->getTagProperty().isPerson()) {
296  headerString = "Person: ";
297  } else if (ACs.front()->getTagProperty().isPersonPlan()) {
298  headerString = "PersonPlan: ";
299  } else if (ACs.front()->getTagProperty().isStop()) {
300  headerString = "Stop: ";
301  } else if (ACs.front()->getTagProperty().isDataElement()) {
302  headerString = "Data: ";
303  }
304  if (ACs.size() > 1) {
305  headerString += toString(ACs.size()) + " ";
306  }
307  headerString += ACs.front()->getTagStr();
308  if (ACs.size() > 1) {
309  headerString += "s";
310  }
311  // Set headerString into header label
312  getFrameHeaderLabel()->setText(headerString.c_str());
313 
314  // Show attributes editor
316 
317  // show netedit attributes editor if we're inspecting elements with Netedit Attributes
319 
320  // Show GEO Attributes Editor if we're inspecting elements with GEO Attributes
322 
323  // show parameters editor
325 
326  // If attributes correspond to an Edge and we aren't in demand mode, show template editor
328 
329  // if we inspect a single Attribute carrier vector, show their children
330  if (ACs.size() == 1) {
332  }
333  } else {
334  getFrameHeaderLabel()->setText("Inspect");
335  myContentFrame->recalc();
336  }
337 }
338 
339 
340 void
342  // Show back button if myPreviousElementInspect was defined
343  myPreviousElementInspect = previousElement;
344  if (myPreviousElementInspect != nullptr) {
345  // disable myPreviousElementDelete to avoid inconsistences
346  myPreviousElementDelete = nullptr;
348  myHeaderLeftFrame->show();
349  myBackButton->show();
350  }
351 }
352 
353 
354 void
355 GNEInspectorFrame::inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked) {
356  myPreviousElementDelete = previousElement;
357  myPreviousElementDeleteWasMarked = previousElementWasMarked;
358  // Show back button if myPreviousElementDelete is valid
359  if (myPreviousElementDelete != nullptr) {
360  // disable myPreviousElementInspect to avoid inconsistences
361  myPreviousElementInspect = nullptr;
363  myHeaderLeftFrame->show();
364  myBackButton->show();
365  }
366 }
367 
368 
369 void
371  // Only remove if there is inspected ACs
374  // Inspect empty selection (to hide all Editors)
376  }
377 }
378 
379 
382  return myAttributesEditor;
383 }
384 
385 
389 }
390 
391 
394  return myTemplateEditor;
395 }
396 
397 
400  return myOverlappedInspection;
401 }
402 
403 
407 }
408 
409 
410 long
411 GNEInspectorFrame::onCmdGoBack(FXObject*, FXSelector, void*) {
412  // Inspect previous element or go back to Delete Frame
415  myPreviousElementInspect = nullptr;
416  } else if (myPreviousElementDelete != nullptr) {
417  myPreviousElementDelete = nullptr;
418  // Hide inspect frame and show delete frame
419  hide();
421  }
422  return 1;
423 }
424 
425 
426 void
428  // refresh Attribute Editor
430  // refresh parametersEditor
432  // refresh AC Hierarchy
434 }
435 
436 
437 void
439  // if AC is a lane but selectEdges checkBox is enabled, then inspect their parent edge
441  inspectSingleElement(dynamic_cast<GNELane*>(AC)->getParentEdge());
442  } else {
444  }
445  // update view (due dotted contour)
447 }
448 
449 
450 void
452  if (objectsUnderCursor.getAttributeCarrierFront()) {
453  // inspect front element
454  inspectSingleElement(objectsUnderCursor.getAttributeCarrierFront());
455  // if element has overlapped elements, show Overlapped Inspection modul
456  if (objectsUnderCursor.getClickedAttributeCarriers().size() > 1) {
457  myOverlappedInspection->showOverlappedInspection(objectsUnderCursor, clickedPosition);
458  } else {
460  }
461  }
462 }
463 
464 
465 void
470 }
471 
472 // ---------------------------------------------------------------------------
473 // GNEInspectorFrame::NeteditAttributesEditor - methods
474 // ---------------------------------------------------------------------------
475 
477  FXGroupBox(inspectorFrameParent->myContentFrame, "Netedit attributes", GUIDesignGroupBoxFrame),
478  myInspectorFrameParent(inspectorFrameParent) {
479 
480  // Create mark as front element button
482 
483  // Create elements for parent additional
487 
488  // Create elements for block movement
490  myLabelBlockMovement = new FXLabel(myHorizontalFrameBlockMovement, "Block move", nullptr, GUIDesignLabelAttribute);
492 
493  // Create elements for block shape
494  myHorizontalFrameBlockShape = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
495  myLabelBlockShape = new FXLabel(myHorizontalFrameBlockShape, "Block shape", nullptr, GUIDesignLabelAttribute);
497 
498  // Create elements for close shape
499  myHorizontalFrameCloseShape = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
500  myLabelCloseShape = new FXLabel(myHorizontalFrameCloseShape, "Close shape", nullptr, GUIDesignLabelAttribute);
502 
503  // Create help button
504  myHelpButton = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
505 }
506 
507 
509 
510 
511 void
513  // continue if there is edited ACs
514  if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
515  // enable all editable elements
516  myTextFieldParentAdditional->enable();
517  myCheckBoxBlockMovement->enable();
518  myCheckBoxBlockShape->enable();
519  myCheckBoxCloseShape->enable();
520  // obtain tag property (only for improve code legibility)
521  const auto& tagValue = myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty();
522  // check if item can be mark as front elmenet
523  if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
524  // show NeteditAttributesEditor
525  show();
526  // show button
527  myMarkFrontElementButton->show();
528  // enable or disable
529  if (myInspectorFrameParent->getViewNet()->getFrontAttributeCarrier() == myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front()) {
530  myMarkFrontElementButton->disable();
531  } else {
532  myMarkFrontElementButton->enable();
533  }
534  }
535  // Check if item can be moved
536  if (tagValue.canBlockMovement()) {
537  // show NeteditAttributesEditor
538  show();
539  // Iterate over AC to obtain values
540  bool value = true;
541  for (const auto& i : myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
542  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(GNE_ATTR_BLOCK_MOVEMENT));
543  }
544  // show block movement frame
545  myHorizontalFrameBlockMovement->show();
546  // show help button
547  myHelpButton->show();
548  // set check box value and update label
549  if (value) {
550  myCheckBoxBlockMovement->setCheck(true);
551  myCheckBoxBlockMovement->setText("true");
552  } else {
553  myCheckBoxBlockMovement->setCheck(false);
554  myCheckBoxBlockMovement->setText("false");
555  }
556  }
557  // check if item can block their shape
558  if (tagValue.canBlockShape()) {
559  // show NeteditAttributesEditor
560  show();
561  // Iterate over AC to obtain values
562  bool value = true;
563  for (const auto& i : myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
564  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(GNE_ATTR_BLOCK_SHAPE));
565  }
566  // show block shape frame
567  myHorizontalFrameBlockShape->show();
568  // show help button
569  myHelpButton->show();
570  // set check box value and update label
571  if (value) {
572  myCheckBoxBlockShape->setCheck(true);
573  myCheckBoxBlockShape->setText("true");
574  } else {
575  myCheckBoxBlockShape->setCheck(false);
576  myCheckBoxBlockShape->setText("false");
577  }
578  }
579  // check if item can block their shape
580  if (tagValue.canCloseShape()) {
581  // show NeteditAttributesEditor
582  show();
583  // Iterate over AC to obtain values
584  bool value = true;
585  for (const auto& i : myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
586  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(GNE_ATTR_CLOSE_SHAPE));
587  }
588  // show close shape frame
589  myHorizontalFrameCloseShape->show();
590  // show help button
591  myHelpButton->show();
592  // set check box value and update label
593  if (value) {
594  myCheckBoxCloseShape->setCheck(true);
595  myCheckBoxCloseShape->setText("true");
596  } else {
597  myCheckBoxCloseShape->setCheck(false);
598  myCheckBoxCloseShape->setText("false");
599  }
600  }
601  // Check if item has another item as parent and can be reparemt
602  if (tagValue.isSlave() && tagValue.canBeReparent()) {
603  // show NeteditAttributesEditor
604  show();
605  // obtain additional Parent
606  std::set<std::string> parents;
607  for (const auto& i : myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
608  parents.insert(i->getAttribute(GNE_ATTR_PARENT));
609  }
610  // show parent additional frame
611  myHorizontalFrameParentAdditional->show();
612  // show help button
613  myHelpButton->show();
614  // set Label and TextField with the Tag and ID of parent
615  myLabelParentAdditional->setText((toString(myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().isSlave()) + " parent").c_str());
616  myTextFieldParentAdditional->setText(toString(parents).c_str());
617  }
618  // disable all editable elements if we're in demand mode and inspected AC isn't a demand element
619  if (GNEFrameAttributesModuls::isSupermodeValid(myInspectorFrameParent->getViewNet(), myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front()) == false) {
620  myTextFieldParentAdditional->disable();
621  myCheckBoxBlockMovement->disable();
622  myCheckBoxBlockShape->disable();
623  myCheckBoxCloseShape->disable();
624  }
625  }
626 }
627 
628 
629 void
631  // hide all elements of GroupBox
632  myHorizontalFrameParentAdditional->hide();
633  myHorizontalFrameBlockMovement->hide();
634  myHorizontalFrameBlockShape->hide();
635  myHorizontalFrameCloseShape->hide();
636  myMarkFrontElementButton->hide();
637  myHelpButton->hide();
638  // hide groupbox
639  hide();
640 }
641 
642 
643 void
645  if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
646  // enable or disable mark front element button
647  if (myInspectorFrameParent->getViewNet()->getFrontAttributeCarrier() == myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()) {
648  myMarkFrontElementButton->disable();
649  } else {
650  myMarkFrontElementButton->enable();
651  }
652  // refresh block movement
653  if (myHorizontalFrameBlockMovement->shown()) {
654  // Iterate over AC to obtain values
655  bool value = true;
656  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
657  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(GNE_ATTR_BLOCK_MOVEMENT));
658  }
659  // set check box value and update label
660  if (value) {
661  myCheckBoxBlockMovement->setCheck(true);
662  myCheckBoxBlockMovement->setText("true");
663  } else {
664  myCheckBoxBlockMovement->setCheck(false);
665  myCheckBoxBlockMovement->setText("false");
666  }
667  }
668  // refresh block shape
669  if (myHorizontalFrameBlockShape->shown()) {
670  // Iterate over AC to obtain values
671  bool value = true;
672  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
673  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(GNE_ATTR_BLOCK_SHAPE));
674  }
675  // set check box value and update label
676  if (value) {
677  myCheckBoxBlockShape->setCheck(true);
678  myCheckBoxBlockShape->setText("true");
679  } else {
680  myCheckBoxBlockShape->setCheck(false);
681  myCheckBoxBlockShape->setText("false");
682  }
683  }
684  // refresh close shape
685  if (myHorizontalFrameCloseShape->shown()) {
686  // Iterate over AC to obtain values
687  bool value = true;
688  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
689  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(GNE_ATTR_CLOSE_SHAPE));
690  }
691  // set check box value and update label
692  if (value) {
693  myCheckBoxCloseShape->setCheck(true);
694  myCheckBoxCloseShape->setText("true");
695  } else {
696  myCheckBoxCloseShape->setCheck(false);
697  myCheckBoxCloseShape->setText("false");
698  }
699  }
700  // Check if item has another item as parent (Currently only for single Additionals)
701  if (myHorizontalFrameParentAdditional->shown() && ((myTextFieldParentAdditional->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) {
702  // set Label and TextField with the Tag and ID of parent
703  myLabelParentAdditional->setText((toString(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().getMasterTags().front()) + " parent").c_str());
704  myTextFieldParentAdditional->setText(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(GNE_ATTR_PARENT).c_str());
705  }
706  }
707 }
708 
709 
710 long
712  // make sure that ACs has elements
713  if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
714  // check if we're changing multiple attributes
715  if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
716  myInspectorFrameParent->myViewNet->getUndoList()->p_begin("Change multiple attributes");
717  }
718  if (obj == myCheckBoxBlockMovement) {
719  // set new values in all inspected Attribute Carriers
720  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
721  if (myCheckBoxBlockMovement->getCheck() == 1) {
722  i->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, "true", myInspectorFrameParent->myViewNet->getUndoList());
723  myCheckBoxBlockMovement->setText("true");
724  } else {
725  i->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, "false", myInspectorFrameParent->myViewNet->getUndoList());
726  myCheckBoxBlockMovement->setText("false");
727  }
728  }
729  } else if (obj == myCheckBoxBlockShape) {
730  // set new values in all inspected Attribute Carriers
731  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
732  if (myCheckBoxBlockShape->getCheck() == 1) {
733  i->setAttribute(GNE_ATTR_BLOCK_SHAPE, "true", myInspectorFrameParent->myViewNet->getUndoList());
734  myCheckBoxBlockShape->setText("true");
735  } else {
736  i->setAttribute(GNE_ATTR_BLOCK_SHAPE, "false", myInspectorFrameParent->myViewNet->getUndoList());
737  myCheckBoxBlockShape->setText("false");
738  }
739  }
740  } else if (obj == myCheckBoxCloseShape) {
741  // set new values in all inspected Attribute Carriers
742  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
743  if (myCheckBoxCloseShape->getCheck() == 1) {
744  i->setAttribute(GNE_ATTR_CLOSE_SHAPE, "true", myInspectorFrameParent->myViewNet->getUndoList());
745  myCheckBoxCloseShape->setText("true");
746  } else {
747  i->setAttribute(GNE_ATTR_CLOSE_SHAPE, "false", myInspectorFrameParent->myViewNet->getUndoList());
748  myCheckBoxCloseShape->setText("false");
749  }
750  }
751  } else if (obj == myTextFieldParentAdditional) {
752  if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->isValid(GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text())) {
753  // replace the parent of all inspected elements
754  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
755  i->setAttribute(GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
756  }
757  myTextFieldParentAdditional->setTextColor(FXRGB(0, 0, 0));
758  myTextFieldParentAdditional->killFocus();
759  } else {
760  myTextFieldParentAdditional->setTextColor(FXRGB(255, 0, 0));
761  }
762  }
763  // finish change multiple attributes
764  if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
765  myInspectorFrameParent->myViewNet->getUndoList()->p_end();
766  }
767  // force refresh values of AttributesEditor and GEOAttributesEditor
768  myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true);
769  myInspectorFrameParent->myGEOAttributesEditor->refreshGEOAttributesEditor(true);
770  }
771  return 1;
772 }
773 
774 
775 long
777  // check number of elements
778  if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
779  // mark AC as front elemnet
780  myInspectorFrameParent->getViewNet()->setFrontAttributeCarrier(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front());
781  // disable button
782  myMarkFrontElementButton->disable();
783  }
784  return 1;
785 }
786 
787 
788 long
790  // Create dialog box
791  FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(this, "Netedit Attributes Help", GUIDesignDialogBox);
792  additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL));
793  // set help text
794  std::ostringstream help;
795  help
796  << "- Mark as front element: Mark element as front element (Will be drawn over all other elements)\n"
797  << "- Block movement: disable movement in move mode\n"
798  << "- Block shape: Disable moving of shape's vertices and edges. Entire shape can be moved'.\n"
799  << "- Close shape: Add or remove the last vertex with the same position of first edge'.";
800  // Create label with the help text
801  new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation);
802  // Create horizontal separator
803  new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator);
804  // Create frame for OK Button
805  FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame);
806  // Create Button Close (And two more horizontal frames to center it)
807  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
808  new FXButton(myHorizontalFrameOKButton, "OK\t\tclose", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
809  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
810  // Write Warning in console if we're in testing mode
811  WRITE_DEBUG("Opening NeteditAttributesEditor help dialog");
812  // create Dialog
813  additionalNeteditAttributesHelpDialog->create();
814  // show in the given position
815  additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
816  // refresh APP
817  getApp()->refresh();
818  // open as modal dialog (will block all windows until stop() or stopModal() is called)
819  getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
820  // Write Warning in console if we're in testing mode
821  WRITE_DEBUG("Closing NeteditAttributesEditor help dialog");
822  return 1;
823 }
824 
825 // ---------------------------------------------------------------------------
826 // GNEInspectorFrame::GEOAttributesEditor - methods
827 // ---------------------------------------------------------------------------
828 
830  FXGroupBox(inspectorFrameParent->myContentFrame, "GEO Attributes", GUIDesignGroupBoxFrame),
831  myInspectorFrameParent(inspectorFrameParent) {
832 
833  // Create Frame for GEOAttribute
834  myGEOAttributeFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
835  myGEOAttributeLabel = new FXLabel(myGEOAttributeFrame, "Undefined GEO Attribute", nullptr, GUIDesignLabelAttribute);
837 
838  // Create Frame for use GEO
839  myUseGEOFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
840  myUseGEOLabel = new FXLabel(myUseGEOFrame, toString(SUMO_ATTR_GEO).c_str(), nullptr, GUIDesignLabelAttribute);
841  myUseGEOCheckButton = new FXCheckButton(myUseGEOFrame, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
842 
843  // Create help button
844  myHelpButton = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
845 }
846 
847 
849 
850 
851 void
853  // make sure that ACs has elements
854  if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
855  // enable all editable elements
856  myGEOAttributeTextField->enable();
857  myUseGEOCheckButton->enable();
858  // obtain tag property (only for improve code legibility)
859  const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty();
860  // check if item can use a geo position
861  if (tagProperty.hasGEOPosition() || tagProperty.hasGEOShape()) {
862  // show GEOAttributesEditor
863  show();
864  // Iterate over AC to obtain values
865  bool value = true;
866  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
867  value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(SUMO_ATTR_GEO));
868  }
869  // show use geo frame
870  myUseGEOFrame->show();
871  // set UseGEOCheckButton value of and update label (only if geo conversion is defined)
872  if (GeoConvHelper::getFinal().getProjString() != "!") {
873  myUseGEOCheckButton->enable();
874  if (value) {
875  myUseGEOCheckButton->setCheck(true);
876  myUseGEOCheckButton->setText("true");
877  } else {
878  myUseGEOCheckButton->setCheck(false);
879  myUseGEOCheckButton->setText("false");
880  }
881  } else {
882  myUseGEOCheckButton->disable();
883  }
884  // 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)
885  if (tagProperty.hasGEOPosition() && myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
886  myGEOAttributeFrame->show();
887  myGEOAttributeLabel->setText(toString(SUMO_ATTR_GEOPOSITION).c_str());
888  myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
889  // only allow edit if geo conversion is defined
890  if (GeoConvHelper::getFinal().getProjString() != "!") {
891  myGEOAttributeTextField->enable();
892  myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(SUMO_ATTR_GEOPOSITION).c_str());
893  } else {
894  myGEOAttributeTextField->disable();
895  myGEOAttributeTextField->setText("No geo-conversion defined");
896  }
897  } else if (tagProperty.hasGEOShape() && myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
898  myGEOAttributeFrame->show();
899  myGEOAttributeLabel->setText(toString(SUMO_ATTR_GEOSHAPE).c_str());
900  myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
901  // only allow edit if geo conversion is defined
902  if (GeoConvHelper::getFinal().getProjString() != "!") {
903  myGEOAttributeTextField->enable();
904  myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(SUMO_ATTR_GEOSHAPE).c_str());
905  } else {
906  myGEOAttributeTextField->disable();
907  myGEOAttributeTextField->setText("No geo-conversion defined");
908  }
909  }
910  }
911  // disable all editable elements if we're in demand mode and inspected AC isn't a demand element
912  if (GNEFrameAttributesModuls::isSupermodeValid(myInspectorFrameParent->getViewNet(), myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()) == false) {
913  myGEOAttributeTextField->disable();
914  myUseGEOCheckButton->disable();
915  }
916  }
917 }
918 
919 
920 void
922  // hide all elements of GroupBox
923  myGEOAttributeFrame->hide();
924  myUseGEOFrame->hide();
925  // hide groupbox
926  hide();
927 }
928 
929 
930 void
932  // obtain tag property (only for improve code legibility)
933  const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty();
934  // Check that myGEOAttributeFrame is shown
935  if ((GeoConvHelper::getFinal().getProjString() != "!") && myGEOAttributeFrame->shown() && ((myGEOAttributeTextField->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) {
936  if (tagProperty.hasGEOPosition()) {
937  myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(SUMO_ATTR_GEOPOSITION).c_str());
938  } else if (tagProperty.hasGEOShape()) {
939  myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(SUMO_ATTR_GEOSHAPE).c_str());
940  }
941  myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
942  }
943 }
944 
945 
946 long
948  // make sure that ACs has elements
949  if ((GeoConvHelper::getFinal().getProjString() != "!") && (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0)) {
950  if (obj == myGEOAttributeTextField) {
951  // obtain tag property (only for improve code legibility)
952  const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty();
953  // Change GEO Attribute depending of type (Position or shape)
954  if (tagProperty.hasGEOPosition()) {
955  if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->isValid(SUMO_ATTR_GEOPOSITION, myGEOAttributeTextField->getText().text())) {
956  myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->setAttribute(SUMO_ATTR_GEOPOSITION, myGEOAttributeTextField->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
957  myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
958  myGEOAttributeTextField->killFocus();
959  } else {
960  myGEOAttributeTextField->setTextColor(FXRGB(255, 0, 0));
961  }
962  } else if (tagProperty.hasGEOShape()) {
963  if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->isValid(SUMO_ATTR_GEOSHAPE, myGEOAttributeTextField->getText().text())) {
964  myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->setAttribute(SUMO_ATTR_GEOSHAPE, myGEOAttributeTextField->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
965  myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
966  myGEOAttributeTextField->killFocus();
967  } else {
968  myGEOAttributeTextField->setTextColor(FXRGB(255, 0, 0));
969  }
970  } else {
971  throw ProcessError("myGEOAttributeTextField must be hidden becaurse there isn't GEO Attribute to edit");
972  }
973  } else if (obj == myUseGEOCheckButton) {
974  // update GEO Attribute of entire selection
975  for (const auto& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
976  if (myUseGEOCheckButton->getCheck() == 1) {
977  i->setAttribute(SUMO_ATTR_GEO, "true", myInspectorFrameParent->myViewNet->getUndoList());
978  myUseGEOCheckButton->setText("true");
979  } else {
980  i->setAttribute(SUMO_ATTR_GEO, "false", myInspectorFrameParent->myViewNet->getUndoList());
981  myUseGEOCheckButton->setText("false");
982  }
983  }
984  }
985  // force refresh values of Attributes editor and NeteditAttributesEditor
986  myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true);
987  myInspectorFrameParent->myNeteditAttributesEditor->refreshNeteditAttributesEditor(true);
988  }
989  return 1;
990 }
991 
992 
993 long
995  FXDialogBox* helpDialog = new FXDialogBox(this, "GEO attributes Help", GUIDesignDialogBox);
996  std::ostringstream help;
997  help
998  << " SUMO uses the World Geodetic System 84 (WGS84/UTM).\n"
999  << " For a GEO-referenced network, geo coordinates are represented as pairs of Longitude and Latitude\n"
1000  << " in decimal degrees without extra symbols. (N,W..)\n"
1001  << " - Longitude: East-west position of a point on the Earth's surface.\n"
1002  << " - Latitude: North-south position of a point on the Earth's surface.\n"
1003  << " - CheckBox 'geo' enables or disables saving position in GEO coordinates\n";
1004  new FXLabel(helpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation);
1005  // "OK"
1006  new FXButton(helpDialog, "OK\t\tclose", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
1007  helpDialog->create();
1008  helpDialog->show();
1009  return 1;
1010 }
1011 
1012 // ---------------------------------------------------------------------------
1013 // GNEInspectorFrame::TemplateEditor::EdgeTemplate - methods
1014 // ---------------------------------------------------------------------------
1015 
1017 }
1018 
1019 
1021  // copy ID
1022  edgeParameters[SUMO_ATTR_ID] = edge->getAttribute(SUMO_ATTR_ID);
1023  // copy edge-specific attributes
1024  edgeParameters[SUMO_ATTR_NUMLANES] = edge->getAttribute(SUMO_ATTR_NUMLANES);
1025  edgeParameters[SUMO_ATTR_TYPE] = edge->getAttribute(SUMO_ATTR_TYPE);
1026  edgeParameters[SUMO_ATTR_PRIORITY] = edge->getAttribute(SUMO_ATTR_PRIORITY);
1027  edgeParameters[SUMO_ATTR_SPREADTYPE] = edge->getAttribute(SUMO_ATTR_SPREADTYPE);
1028  edgeParameters[GNE_ATTR_PARAMETERS] = edge->getAttribute(GNE_ATTR_PARAMETERS);
1029  // copy raw values for lane-specific attributes
1030  edgeParameters[SUMO_ATTR_ALLOW] = edge->getAttribute(SUMO_ATTR_ALLOW);
1031  edgeParameters[SUMO_ATTR_DISALLOW] = edge->getAttribute(SUMO_ATTR_DISALLOW); // only used in GNECreateEdgeFrame
1032  edgeParameters[SUMO_ATTR_SPEED] = edge->getAttribute(SUMO_ATTR_SPEED);
1033  edgeParameters[SUMO_ATTR_WIDTH] = edge->getAttribute(SUMO_ATTR_WIDTH);
1034  edgeParameters[SUMO_ATTR_ENDOFFSET] = edge->getAttribute(SUMO_ATTR_ENDOFFSET);
1035  // copy lane attributes as well
1036  for (int i = 0; i < (int)edge->getLanes().size(); i++) {
1037  std::map<SumoXMLAttr, std::string> laneParameter;
1038  laneParameter[SUMO_ATTR_ALLOW] = edge->getLanes().at(i)->getAttribute(SUMO_ATTR_ALLOW);
1039  laneParameter[SUMO_ATTR_DISALLOW] = edge->getLanes().at(i)->getAttribute(SUMO_ATTR_DISALLOW); // only used in GNECreateEdgeFrame
1040  laneParameter[SUMO_ATTR_SPEED] = edge->getLanes().at(i)->getAttribute(SUMO_ATTR_SPEED);
1041  laneParameter[SUMO_ATTR_WIDTH] = edge->getLanes().at(i)->getAttribute(SUMO_ATTR_WIDTH);
1042  laneParameter[SUMO_ATTR_ENDOFFSET] = edge->getLanes().at(i)->getAttribute(SUMO_ATTR_ENDOFFSET);
1043  laneParameter[GNE_ATTR_PARAMETERS] = edge->getLanes().at(i)->getAttribute(GNE_ATTR_PARAMETERS);
1044  laneParameters.push_back(laneParameter);
1045  }
1046 }
1047 
1048 // ---------------------------------------------------------------------------
1049 // GNEInspectorFrame::TemplateEditor - methods
1050 // ---------------------------------------------------------------------------
1051 
1053  FXGroupBox(inspectorFrameParent->myContentFrame, "Templates", GUIDesignGroupBoxFrame),
1054  myInspectorFrameParent(inspectorFrameParent),
1055  myHasEdgeTemplate(false) {
1056  // Create set template button
1057  mySetTemplateButton = new FXButton(this, "Set as Template\t\t", nullptr, this, MID_HOTKEY_SHIFT_F1_TEMPLATE_SET, GUIDesignButton);
1058  // Create copy template button
1059  myCopyTemplateButton = new FXButton(this, "", nullptr, this, MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY, GUIDesignButton);
1060  // Create copy template button
1061  myClearTemplateButton = new FXButton(this, "clear Edge Template", nullptr, this, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR, GUIDesignButton);
1062 }
1063 
1064 
1066 }
1067 
1068 
1069 void
1071  // show template editor only if we're editing an edge in Network mode
1072  if ((myInspectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeNetwork()) &&
1073  (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().getTag() == SUMO_TAG_EDGE)) {
1074  // show "Set As Template"
1075  if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1076  mySetTemplateButton->show();
1077  mySetTemplateButton->setText(("Set edge '" + myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getID() + "' as Template").c_str());
1078  }
1079  // update buttons
1080  updateButtons();
1081  // show modul
1082  show();
1083  }
1084 }
1085 
1086 
1087 void
1089  // hide template editor
1090  hide();
1091 }
1092 
1093 
1094 bool
1096  return myHasEdgeTemplate;
1097 }
1098 
1099 
1102  return myEdgeTemplate;
1103 }
1104 
1105 
1106 void
1108  // check if template editor AND mySetTemplateButton is enabled
1109  if (shown() && mySetTemplateButton->isEnabled()) {
1110  onCmdSetTemplate(nullptr, 0, nullptr);
1111  }
1112 }
1113 
1114 
1115 void
1117  // check if template editor AND myCopyTemplateButton is enabled
1118  if (shown() && myCopyTemplateButton->isEnabled()) {
1119  onCmdCopyTemplate(nullptr, 0, nullptr);
1120  }
1121 }
1122 
1123 
1124 void
1126  // check if template editor AND myClearTemplateButton is enabled
1127  if (shown() && myClearTemplateButton->isEnabled()) {
1128  onCmdClearTemplate(nullptr, 0, nullptr);
1129  }
1130 }
1131 
1132 
1133 long
1135  // first check that there is exactly an inspected edge
1136  if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() != 1) {
1137  throw ProcessError("Only one edge must be inspected");
1138  }
1139  // retrieve edge ID (and throw exception if edge doesn't exist)
1140  GNEEdge* edge = myInspectorFrameParent->myViewNet->getNet()->retrieveEdge(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getID());
1141  // set template
1142  setEdgeTemplate(edge);
1143  // update buttons
1144  updateButtons();
1145  return 1;
1146 }
1147 
1148 
1149 long
1151  // first check
1152  if (myHasEdgeTemplate) {
1153  // begin copy template
1154  myInspectorFrameParent->myViewNet->getUndoList()->p_begin("copy edge template");
1155  // iterate over inspected ACs
1156  for (const auto& inspectedAC : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
1157  // retrieve edge ID (and throw exception if edge doesn't exist)
1158  myInspectorFrameParent->myViewNet->getNet()->retrieveEdge(inspectedAC->getID())->copyTemplate(myEdgeTemplate, myInspectorFrameParent->myViewNet->getUndoList());
1159  }
1160  // end copy template
1161  myInspectorFrameParent->myViewNet->getUndoList()->p_end();
1162  // refresh inspector parent
1163  myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true);
1164  // update view (to see visual changes)
1165  myInspectorFrameParent->myViewNet->updateViewNet();
1166  }
1167  return 1;
1168 }
1169 
1170 
1171 long
1173  // change flag
1174  myHasEdgeTemplate = false;
1175  // update buttons
1176  updateButtons();
1177  return 1;
1178 }
1179 
1180 
1181 void
1183  // change flag
1184  myHasEdgeTemplate = true;
1185  // set edge template
1186  myEdgeTemplate = GNEInspectorFrame::TemplateEditor::EdgeTemplate(edgeTemplate);
1187 }
1188 
1189 
1190 void
1192  // enable or disable clear buttons depending of myEdgeTemplate
1193  if (myHasEdgeTemplate) {
1194  // update caption of copy button
1195  if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1196  myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate.edgeParameters.at(SUMO_ATTR_ID) + "' into edge '" + myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getID() + "'").c_str());
1197  } else {
1198  myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate.edgeParameters.at(SUMO_ATTR_ID) + "' into " + toString(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) + " selected edges").c_str());
1199  }
1200  // enable set and clear buttons
1201  myCopyTemplateButton->enable();
1202  myClearTemplateButton->enable();
1203  } else {
1204  // update caption of copy button
1205  myCopyTemplateButton->setText("No edge Template Set");
1206  // disable set and clear buttons
1207  myCopyTemplateButton->disable();
1208  myClearTemplateButton->disable();
1209  }
1210 }
1211 
1212 // ---------------------------------------------------------------------------
1213 // GNEFrameAttributesModuls::ParametersEditorInspector - methods
1214 // ---------------------------------------------------------------------------
1215 
1217  FXGroupBox(inspectorFrameParent->myContentFrame, "Parameters", GUIDesignGroupBoxFrame),
1218  myInspectorFrameParent(inspectorFrameParent) {
1219  // create textfield and buttons
1221  myButtonEditParameters = new FXButton(this, "Edit parameters", nullptr, this, MID_GNE_OPEN_PARAMETERS_DIALOG, GUIDesignButton);
1222 }
1223 
1224 
1226 
1227 
1228 void
1230  // firt check if there is
1231  if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1232  // refresh ParametersEditorInspector
1233  refreshParametersEditorInspector();
1234  // show groupbox
1235  show();
1236  } else {
1237  hide();
1238  }
1239 }
1240 
1241 
1242 void
1244  // hide groupbox
1245  hide();
1246 }
1247 
1248 
1249 void
1251  // get front AC
1252  const GNEAttributeCarrier* frontAC = myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0 ? myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front() : nullptr;
1253  // continue depending of frontAC
1254  if (frontAC && frontAC->getTagProperty().hasParameters()) {
1255  // check if we're editing a single or a multiple AC
1256  if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1257  // set text field parameters
1258  myTextFieldParameters->setText(frontAC->getAttribute(GNE_ATTR_PARAMETERS).c_str());
1259  } else if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1260  // check if parameters of all inspected ACs are different
1261  std::string parameters = frontAC->getAttribute(GNE_ATTR_PARAMETERS);
1262  for (const auto& AC : myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
1263  if (parameters != AC->getAttribute(GNE_ATTR_PARAMETERS)) {
1264  parameters = "different parameters";
1265  }
1266  }
1267  // set text field
1268  myTextFieldParameters->setText(parameters.c_str());
1269  }
1270  // reset color
1271  myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
1272  // disable myTextFieldParameters if Tag correspond to an network element but we're in demand mode (or vice versa), disable all elements
1273  if (GNEFrameAttributesModuls::isSupermodeValid(myInspectorFrameParent->myViewNet, frontAC)) {
1274  myTextFieldParameters->enable();
1275  myButtonEditParameters->enable();
1276  } else {
1277  myTextFieldParameters->disable();
1278  myButtonEditParameters->disable();
1279  }
1280  }
1281 }
1282 
1283 
1286  return myInspectorFrameParent;
1287 }
1288 
1289 
1290 long
1292  // get front AC
1293  const GNEAttributeCarrier* frontAC = myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0 ? myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front() : nullptr;
1294  // continue depending of frontAC
1295  if (frontAC && frontAC->getTagProperty().hasParameters()) {
1296  if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 1) {
1297  // write debug information
1298  WRITE_DEBUG("Open multiple parameters dialog");
1299  // open multiple parameters dialog
1300  if (GNEMultipleParametersDialog(this).execute()) {
1301  // write debug information
1302  WRITE_DEBUG("Close multiple parameters dialog");
1303  // update frame parent after attribute sucesfully set
1304  myInspectorFrameParent->attributeUpdated();
1305  // Refresh parameter EditorInspector
1306  refreshParametersEditorInspector();
1307  } else {
1308  // write debug information
1309  WRITE_DEBUG("Cancel multiple parameters dialog");
1310  }
1311  } else {
1312  // write debug information
1313  WRITE_DEBUG("Open single parameters dialog");
1314  if (GNESingleParametersDialog(this).execute()) {
1315  // write debug information
1316  WRITE_DEBUG("Close single parameters dialog");
1317  // update frame parent after attribute sucesfully set
1318  myInspectorFrameParent->attributeUpdated();
1319  // Refresh parameter EditorInspector
1320  refreshParametersEditorInspector();
1321  } else {
1322  // write debug information
1323  WRITE_DEBUG("Cancel single parameters dialog");
1324  }
1325  }
1326  }
1327  return 1;
1328 }
1329 
1330 
1331 long
1333  // get front AC
1334  GNEAttributeCarrier* frontAC = myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0 ? myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front() : nullptr;
1335  // continue depending of frontAC
1336  if (frontAC && frontAC->getTagProperty().hasParameters()) {
1337  // declare attribute type
1339  // update flag
1340  if (frontAC->getTagProperty().hasDoubleParameters()) {
1342  } else {
1344  }
1345  // check if current given string is valid
1346  if (Parameterised::areParametersValid(myTextFieldParameters->getText().text(), true, attrType)) {
1347  // parsed parameters ok, then set text field black and continue
1348  myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
1349  myTextFieldParameters->killFocus();
1350  // check inspected parameters
1351  if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
1352  // begin undo list
1353  myInspectorFrameParent->myViewNet->getUndoList()->p_begin("change parameters");
1354  // set parameters
1355  frontAC->setACParameters(myTextFieldParameters->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
1356  // end undo list
1357  myInspectorFrameParent->myViewNet->getUndoList()->p_end();
1358  } else if (myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
1359  // begin undo list
1360  myInspectorFrameParent->myViewNet->getUndoList()->p_begin("change multiple parameters");
1361  // set parameters in all ACs
1362  for (const auto& inspectedAC : myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers()) {
1363  inspectedAC->setACParameters(myTextFieldParameters->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
1364  }
1365  // end undo list
1366  myInspectorFrameParent->myViewNet->getUndoList()->p_end();
1367  }
1368  // update frame parent after attribute sucesfully set
1369  myInspectorFrameParent->attributeUpdated();
1370  } else {
1371  myTextFieldParameters->setTextColor(FXRGB(255, 0, 0));
1372  }
1373  }
1374  return 1;
1375 }
1376 
1377 /****************************************************************************/
FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:717
@ MID_GNE_OPEN_PARAMETERS_DIALOG
open parameters dialog
Definition: GUIAppEnum.h:751
@ MID_HELP
help button
Definition: GUIAppEnum.h:578
@ MID_GNE_INSPECTORFRAME_GOBACK
go back to the previous element
Definition: GUIAppEnum.h:832
@ MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY
copy template
Definition: GUIAppEnum.h:210
@ MID_GNE_MARKFRONTELEMENT
mark item as front element
Definition: GUIAppEnum.h:791
@ MID_HOTKEY_SHIFT_F1_TEMPLATE_SET
set template
Definition: GUIAppEnum.h:208
@ MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR
clear template
Definition: GUIAppEnum.h:212
#define GUIDesignButton
Definition: GUIDesigns.h:62
#define GUIDesignTextField
Definition: GUIDesigns.h:36
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:313
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
Definition: GUIDesigns.h:199
#define GUIDesignDialogBox
Definition: GUIDesigns.h:494
#define GUIDesignButtonRectangular
little button rectangula used in frames (For example, in "help" buttons)
Definition: GUIDesigns.h:68
#define GUIDesignButtonIconRectangular
button only with icon
Definition: GUIDesigns.h:74
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:54
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:278
#define GUIDesignButtonOK
Definition: GUIDesigns.h:115
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:133
#define GUIDesignHorizontalSeparator
Definition: GUIDesigns.h:362
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:223
@ MODEADDITIONAL
@ BIGARROWLEFT
@ FRONTELEMENT
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:286
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ SUMO_ATTR_DISALLOW
@ SUMO_ATTR_ALLOW
@ SUMO_ATTR_SPEED
@ SUMO_ATTR_GEOPOSITION
@ GNE_ATTR_BLOCK_MOVEMENT
block movement of a graphic element
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_GEO
@ SUMO_ATTR_PRIORITY
@ SUMO_ATTR_GEOSHAPE
@ SUMO_ATTR_NUMLANES
@ GNE_ATTR_CLOSE_SHAPE
Close shape of a polygon (Used by GNEPolys)
@ SUMO_ATTR_SPREADTYPE
The information about how to spread the lanes from the given position.
@ SUMO_ATTR_ENDOFFSET
@ GNE_ATTR_BLOCK_SHAPE
block shape of a graphic element (Used mainly in GNEShapes)
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_ID
@ SUMO_ATTR_WIDTH
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:44
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
void setACParameters(const std::string &parameters, GNEUndoList *undoList)
set parameters (string)
const GNETagProperties & getTagProperty() const
get Tag Property assigned to this object
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
GNENet * getNet() const
get pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
virtual std::string getAttribute(SumoXMLAttr key) const =0
void show()
show delete frame
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:49
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:723
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEEdge.cpp:741
void showAttributeEditorModul(bool includeExtended, bool forceAttributeEnabled)
show attributes of multiple ACs
void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition)
refresh attribute editor (only the valid values will be refresh)
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
static bool isSupermodeValid(const GNEViewNet *viewNet, const GNEAttributeCarrier *AC)
return true if AC can be edited in the current supermode
void focusUpperElement()
focus upper element of frame
Definition: GNEFrame.cpp:102
GNEViewNet * getViewNet() const
get view net
Definition: GNEFrame.cpp:133
FXLabel * getFrameHeaderLabel() const
get the label for the frame's header
Definition: GNEFrame.cpp:139
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:113
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:116
virtual void show()
show Frame
Definition: GNEFrame.cpp:108
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:117
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
Definition: GNEFrame.h:122
void refreshHierarchicalElementTree()
refresh HierarchicalElementTree
void showHierarchicalElementTree(GNEAttributeCarrier *AC)
show HierarchicalElementTree
void hideHierarchicalElementTree()
hide HierarchicalElementTree
void showOverlappedInspection(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition)
show template editor
bool nextElement(const Position &clickedPosition)
try to go to next element if clicked position is near to saved position
bool previousElement(const Position &clickedPosition)
try to go to previous element if clicked position is near to saved position
void hideOverlappedInspection()
hide template editor
FXCheckButton * myUseGEOCheckButton
checkBox for use GEO
long onCmdGEOAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
FXButton * myHelpButton
button for help
void showGEOAttributesEditor()
show GEO attributes editor
FXTextField * myGEOAttributeTextField
textField for GEOAttribute
FXLabel * myUseGEOLabel
Label for use GEO.
FXHorizontalFrame * myUseGEOFrame
horizontal frame for use GEO
GEOAttributesEditor(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
long onCmdSetGEOAttribute(FXObject *, FXSelector, void *)
Called when user change the current GEO Attribute.
FXLabel * myGEOAttributeLabel
Label for GEOAttribute.
void refreshGEOAttributesEditor(bool forceRefresh)
refresh GEO attributes editor
void hideGEOAttributesEditor()
hide GEO attributes editor
FXHorizontalFrame * myGEOAttributeFrame
horizontal frame for GEOAttribute
FXHorizontalFrame * myHorizontalFrameBlockShape
@frame horizontal frame for block shape
FXLabel * myLabelBlockMovement
Label for Check blocked movement.
FXCheckButton * myCheckBoxBlockShape
pointer to check box "Block Shape"
FXLabel * myLabelParentAdditional
Label for parent additional.
FXHorizontalFrame * myHorizontalFrameBlockMovement
@frame horizontal frame for block movement
FXCheckButton * myCheckBoxCloseShape
pointer to check box "Block movement"
long onCmdNeteditAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
FXHorizontalFrame * myHorizontalFrameCloseShape
@frame horizontal frame for close shape
long onCmdSetNeteditAttribute(FXObject *, FXSelector, void *)
long onCmdMarkFrontElement(FXObject *, FXSelector, void *)
Called when user press button "Mark front element".
void refreshNeteditAttributesEditor(bool forceRefresh)
refresh netedit attributes
void hideNeteditAttributesEditor()
hide netedit attributes editor
FXLabel * myLabelCloseShape
Label for close shape.
FXHorizontalFrame * myHorizontalFrameParentAdditional
@frame horizontal frame for replace the parent additional
NeteditAttributesEditor(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
FXTextField * myTextFieldParentAdditional
pointer for replace the parent additional
FXCheckButton * myCheckBoxBlockMovement
pointer to check box "Block movement"
FXButton * myMarkFrontElementButton
button for set element as front button
void showNeteditAttributesEditor()
show netedit attributes editor
FXLabel * myLabelBlockShape
Label for Check blocked shape.
FXButton * myButtonEditParameters
button for edit parameters using specific dialog
long onCmdEditParameters(FXObject *, FXSelector, void *)
void showParametersEditorInspector()
show netedit attributes EditorInspector
void refreshParametersEditorInspector()
refresh netedit attributes
FXTextField * myTextFieldParameters
text field for write parameters
GNEInspectorFrame * getInspectorFrameParent() const
get inspector frame parent
ParametersEditorInspector(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
void hideParametersEditorInspector()
hide netedit attributes EditorInspector
long onCmdSetParameters(FXObject *, FXSelector, void *)
Called when user udpate the parameter text field.
void hideTemplateEditor()
hide template editor
void clearTemplate()
clear template (used by shortcut)
FXButton * myClearTemplateButton
clear template button
FXButton * mySetTemplateButton
set template button
const TemplateEditor::EdgeTemplate & getEdgeTemplate() const
get the template edge (to copy attributes from)
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
copy edge attributes from edge template
bool hasTemplate() const
there is a template
void setTemplate()
set template (used by shortcut)
TemplateEditor(GNEInspectorFrame *inspectorFrameParent)
constructor
FXButton * myCopyTemplateButton
copy template button
long onCmdSetTemplate(FXObject *, FXSelector, void *)
void copyTemplate()
copy template (used by shortcut)
void setEdgeTemplate(GNEEdge *edgeTemplate)
FOX need this.
void showTemplateEditor()
show template editor
long onCmdClearTemplate(FXObject *, FXSelector, void *)
clear current edge template
NeteditAttributesEditor * myNeteditAttributesEditor
Netedit Attributes editor.
GNEAttributeCarrier * myPreviousElementDelete
pointer to previous element called by Delete Frame
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
GNEFrameAttributesModuls::AttributesEditor * getAttributesEditor() const
get AttributesEditor
void selectedOverlappedElement(GNEAttributeCarrier *AC)
open AttributesCreator extended dialog (can be reimplemented in frame children)
TemplateEditor * getTemplateEditor() const
get template editor
GNEFrameAttributesModuls::AttributesEditor * myAttributesEditor
Attribute editor.
void clearInspectedAC()
Clear all current inspected ACs.
long onCmdGoBack(FXObject *, FXSelector, void *)
called when user toogle the go back button
bool processDataSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Data
void show()
show inspector frame
GEOAttributesEditor * myGEOAttributesEditor
GEO Attributes editor.
GNEFrameModuls::HierarchicalElementTree * myHierarchicalElementTree
Attribute Carrier Hierarchy.
GNEFrameModuls::HierarchicalElementTree * getHierarchicalElementTree() const
get HierarchicalElementTree modul
GNEAttributeCarrier * myPreviousElementInspect
pointer to previous element called by Inspector Frame
void attributeUpdated()
function called after set a valid attribute in AttributeEditor
bool myPreviousElementDeleteWasMarked
flag to ckec if myPreviousElementDelete was marked in Delete Frame
void inspectClickedElement(const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const Position &clickedPosition)
Inspect a singe element (the front of AC AttributeCarriers of ObjectUnderCursor.
ParametersEditorInspector * myParametersEditorInspector
parameters editor inspector
void hide()
hide inspector frame
void inspectFromDeleteFrame(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement, bool previousElementWasMarked)
inspect called from DeleteFrame
GNEInspectorFrame::NeteditAttributesEditor * getNeteditAttributesEditor() const
get Netedit Attributes editor
FXButton * myBackButton
back Button
bool processNetworkSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Network
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
~GNEInspectorFrame()
Destructor.
TemplateEditor * myTemplateEditor
Template editor.
GNEFrameModuls::OverlappedInspection * getOverlappedInspection() const
get OverlappedInspection modul
bool processDemandSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor)
process click over Viewnet in Supermode Demand
GNEFrameModuls::OverlappedInspection * myOverlappedInspection
Overlapped Inspection.
void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame (can be reimplemented in frame children)
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true) const
get edge by id
Definition: GNENet.cpp:1141
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
Definition: GNENet.cpp:2251
bool IsObjectTypeLocked(const GUIGlObjectType type) const
check if an object is locked
LockGLObjectTypes * getLockGLObjectTypes() const
get selected items Modul
Dialog for edit parameters.
bool hasDoubleParameters() const
return true if Tag correspond to an element that supports double parameters "key1=double1|key2=double...
bool hasParameters() const
return true if Tag correspond to an element that supports parameters "key1=value1|key2=value2|....
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
class used to group all variables related with objects under cursor after a click over view
GNEGenericData * getGenericDataElementFront() const
get generic data element or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
GUIGlObjectType getGlTypeFront() const
get front GUI GL object type or a pointer to nullptr
GNEDemandElement * getDemandElementFront() const
get front demand element or a pointer to nullptr
const std::vector< GNEAttributeCarrier * > & getClickedAttributeCarriers() const
get vector with clicked ACs
GNENet * getNet() const
get the net object
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed modul
Definition: GNEViewNet.cpp:497
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
Definition: GNEViewNet.cpp:479
GNEViewParent * getViewParent() const
get the net object
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
void updateViewNet() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:318
void setInspectedAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
set inspected attributeCarrier
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
GNEDeleteFrame * getDeleteFrame() const
get frame for delete elements
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
ParameterisedAttrType
@brie enum for Parameterised type
Definition: Parameterised.h:43
@ STRING
Parameterised accept strings.
@ DOUBLE
Parameterised only accept doubles.
static bool areParametersValid(const std::string &value, bool report=false, ParameterisedAttrType attrType=ParameterisedAttrType::STRING, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36
bool shiftKeyPressed() const
check if SHIFT is pressed during current event
bool controlKeyPressed() const
check if CONTROL is pressed during current event
bool selectEdges() const
check if select edges checkbox is enabled