Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEInspectorFrame.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 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/GNEUndoList.h>
25#include <netedit/GNEViewNet.h>
40
41#include "GNEInspectorFrame.h"
42#include "GNEDeleteFrame.h"
43
44
45// ===========================================================================
46// FOX callback mapping
47// ===========================================================================
48
49FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[] = {
51};
52
58
63
69
70
71
75
76// Object implementation
77FXIMPLEMENT(GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
78FXIMPLEMENT(GNEInspectorFrame::NeteditAttributesEditor, MFXGroupBoxModule, NeteditAttributesEditorMap, ARRAYNUMBER(NeteditAttributesEditorMap))
79FXIMPLEMENT(GNEInspectorFrame::GEOAttributesEditor, MFXGroupBoxModule, GEOAttributesEditorMap, ARRAYNUMBER(GEOAttributesEditorMap))
80FXIMPLEMENT(GNEInspectorFrame::TemplateEditor, MFXGroupBoxModule, TemplateEditorMap, ARRAYNUMBER(TemplateEditorMap))
81FXIMPLEMENT(GNEInspectorFrame::AdditionalDialog, MFXGroupBoxModule, AdditionalDialogMap, ARRAYNUMBER(AdditionalDialogMap))
82
83
84// ===========================================================================
85// method definitions
86// ===========================================================================
87
88// ---------------------------------------------------------------------------
89// GNEInspectorFrame::NeteditAttributesEditor - methods
90// ---------------------------------------------------------------------------
91
93 MFXGroupBoxModule(inspectorFrameParent, TL("Netedit attributes")),
94 myInspectorFrameParent(inspectorFrameParent) {
95 // Create mark as front element button
96 myMarkFrontElementButton = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Mark as front element"), "", "", GUIIconSubSys::getIcon(GUIIcon::FRONTELEMENT),
98 // Create elements for parent additional
99 myLabelParentAdditional = new FXLabel(getCollapsableFrame(), "Parent", nullptr, GUIDesignLabelThick(JUSTIFY_NORMAL));
100 myTextFieldParentAdditional = new FXTextField(getCollapsableFrame(), GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
101 mySetNewParentButton = new MFXCheckableButton(false, getCollapsableFrame(),
102 inspectorFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu(),
103 "Set new parent", nullptr, this, MID_GNE_SET_ATTRIBUTE, GUIDesignMFXCheckableButton);
104 // Create elements for close shape
105 myHorizontalFrameCloseShape = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
106 myLabelCloseShape = new FXLabel(myHorizontalFrameCloseShape, "Close shape", nullptr, GUIDesignLabelThickedFixed(100));
107 myCheckBoxCloseShape = new FXCheckButton(myHorizontalFrameCloseShape, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
108 // Create help button
109 myHelpButton = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Help"), "", "", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
110}
111
112
114
115
116void
118 const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
119 // continue if there is edited ACs
120 if (inspectedElements.isInspectingElements()) {
121 // enable all editable elements
122 myTextFieldParentAdditional->enable();
123 myCheckBoxCloseShape->enable();
124 // obtain tag property (only for improve code legibility)
125 const auto& tagValue = inspectedElements.getFirstAC()->getTagProperty();
126 // check if item can be mark as front element
127 if (inspectedElements.isInspectingSingleElement()) {
128 // show NeteditAttributesEditor
129 show();
130 // show button
131 myMarkFrontElementButton->show();
132 // enable or disable
133 if (myInspectorFrameParent->getViewNet()->getFrontAttributeCarrier() == inspectedElements.getFirstAC()) {
134 myMarkFrontElementButton->disable();
135 } else {
136 myMarkFrontElementButton->enable();
137 }
138 }
139 // check if item can block their shape
140 if (tagValue.canCloseShape()) {
141 // show NeteditAttributesEditor
142 show();
143 // Iterate over AC to obtain values
144 bool value = true;
145 for (const auto& inspectedAC : inspectedElements.getACs()) {
146 value &= GNEAttributeCarrier::parse<bool>(inspectedAC->getAttribute(GNE_ATTR_CLOSE_SHAPE));
147 }
148 // show close shape frame
149 myHorizontalFrameCloseShape->show();
150 // show help button
151 myHelpButton->show();
152 // set check box value and update label
153 if (value) {
154 myCheckBoxCloseShape->setCheck(true);
155 myCheckBoxCloseShape->setText("true");
156 } else {
157 myCheckBoxCloseShape->setCheck(false);
158 myCheckBoxCloseShape->setText("false");
159 }
160 }
161 // Check if item has another item as parent and can be reparent
162 if (tagValue.isChild() && tagValue.canBeReparent()) {
163 // show NeteditAttributesEditor
164 show();
165 // obtain additional Parent
166 std::set<std::string> parents;
167 for (const auto& inspectedAC : inspectedElements.getACs()) {
168 parents.insert(inspectedAC->getAttribute(GNE_ATTR_PARENT));
169 }
170 // show parent additional elements
171 myLabelParentAdditional->show();
172 myTextFieldParentAdditional->show();
173 mySetNewParentButton->show();
174 // reset new parent button
175 mySetNewParentButton->setChecked(false);
176 mySetNewParentButton->setText(TL("Set new parent"));
177 // set parent tag icon
178 const auto& parentTagProperty = GNEAttributeCarrier::getTagProperty(inspectedElements.getFirstAC()->getTagProperty().getParentTags().front());
179 mySetNewParentButton->setIcon(GUIIconSubSys::getIcon(parentTagProperty.getGUIIcon()));
180 // show help button
181 myHelpButton->show();
182 // set Label and TextField with the Tag and ID of parent
183 myLabelParentAdditional->setText((parentTagProperty.getTagStr() + " parent").c_str());
184 myTextFieldParentAdditional->setText(toString(parents).c_str());
185 }
186 // disable all editable elements if we're in demand mode and inspected AC isn't a demand element
187 if (GNEFrameAttributeModules::isSupermodeValid(myInspectorFrameParent->getViewNet(), inspectedElements.getFirstAC()) == false) {
188 myTextFieldParentAdditional->disable();
189 myCheckBoxCloseShape->disable();
190 }
191 }
192}
193
194
195void
197 // hide all elements of GroupBox
198 myLabelParentAdditional->hide();
199 myTextFieldParentAdditional->hide();
200 mySetNewParentButton->hide();
201 myHorizontalFrameCloseShape->hide();
202 myMarkFrontElementButton->hide();
203 myHelpButton->hide();
204 // hide groupbox
205 hide();
206}
207
208
209void
211 const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
212 if (inspectedElements.isInspectingElements()) {
213 // enable or disable mark front element button
214 if (myInspectorFrameParent->getViewNet()->getFrontAttributeCarrier() == inspectedElements.getFirstAC()) {
215 myMarkFrontElementButton->disable();
216 } else {
217 myMarkFrontElementButton->enable();
218 }
219 // refresh close shape
220 if (myHorizontalFrameCloseShape->shown()) {
221 // Iterate over AC to obtain values
222 bool value = true;
223 for (const auto& AC : inspectedElements.getACs()) {
224 value &= GNEAttributeCarrier::parse<bool>(AC->getAttribute(GNE_ATTR_CLOSE_SHAPE));
225 }
226 // set check box value and update label
227 if (value) {
228 myCheckBoxCloseShape->setCheck(true);
229 myCheckBoxCloseShape->setText("true");
230 } else {
231 myCheckBoxCloseShape->setCheck(false);
232 myCheckBoxCloseShape->setText("false");
233 }
234 }
235 // Check if item has another item as parent (Currently only for single Additionals)
236 if (myTextFieldParentAdditional->shown() && ((myTextFieldParentAdditional->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) {
237 // set Label and TextField with the Tag and ID of parent
238 myLabelParentAdditional->setText((toString(inspectedElements.getFirstAC()->getTagProperty().getParentTags().front()) + " parent").c_str());
239 myTextFieldParentAdditional->setText(inspectedElements.getFirstAC()->getAttribute(GNE_ATTR_PARENT).c_str());
240 }
241 }
242}
243
244
245bool
247 if (!shown()) {
248 return false;
249 } else {
250 return (mySetNewParentButton->shown() && mySetNewParentButton->amChecked());
251 }
252}
253
254
255void
257 const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
258 // check number of inspected ACs
259 if ((inspectedElements.isInspectingElements()) && clickedAC) {
260 // check parent tags
261 for (const auto& parentTag : inspectedElements.getFirstAC()->getTagProperty().getParentTags()) {
262 if (parentTag == clickedAC->getTagProperty().getTag()) {
263 // check if we're changing multiple attributes
264 if (inspectedElements.isInspectingMultipleElements()) {
265 myInspectorFrameParent->myViewNet->getUndoList()->begin(inspectedElements.getFirstAC(), "Change multiple attributes");
266 }
267 // replace the parent of all inspected elements
268 for (const auto& AC : inspectedElements.getACs()) {
269 AC->setAttribute(GNE_ATTR_PARENT, clickedAC->getID(), myInspectorFrameParent->myViewNet->getUndoList());
270 }
271 // finish change multiple attributes
272 if (inspectedElements.isInspectingMultipleElements()) {
273 myInspectorFrameParent->myViewNet->getUndoList()->end();
274 }
275 // stop select parent
276 stopSelectParent();
277 // refresh netedit attributes editor
278 refreshNeteditAttributesEditor(true);
279 }
280 }
281 }
282}
283
284
285void
287 if (mySetNewParentButton->amChecked()) {
288 onCmdSetNeteditAttribute(mySetNewParentButton, 0, nullptr);
289 }
290}
291
292
293long
295 const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
296 // make sure that ACs has elements
297 if (inspectedElements.isInspectingElements()) {
298 // check if we're changing multiple attributes
299 if (inspectedElements.isInspectingMultipleElements()) {
300 myInspectorFrameParent->myViewNet->getUndoList()->begin(inspectedElements.getFirstAC(), "Change multiple attributes");
301 }
302 if (obj == mySetNewParentButton) {
303 if (mySetNewParentButton->amChecked()) {
304 mySetNewParentButton->setText(TL("Set new parent"));
305 mySetNewParentButton->setChecked(false);
306 } else {
307 mySetNewParentButton->setText(("Click over " + toString(inspectedElements.getFirstAC()->getTagProperty().getParentTags().front())).c_str());
308 mySetNewParentButton->setChecked(true);
309 }
310 } else if (obj == myCheckBoxCloseShape) {
311 // set new values in all inspected Attribute Carriers
312 for (const auto& AC : inspectedElements.getACs()) {
313 if (myCheckBoxCloseShape->getCheck() == 1) {
314 AC->setAttribute(GNE_ATTR_CLOSE_SHAPE, "true", myInspectorFrameParent->myViewNet->getUndoList());
315 myCheckBoxCloseShape->setText("true");
316 } else {
317 AC->setAttribute(GNE_ATTR_CLOSE_SHAPE, "false", myInspectorFrameParent->myViewNet->getUndoList());
318 myCheckBoxCloseShape->setText("false");
319 }
320 }
321 } else if (obj == myTextFieldParentAdditional) {
322 if (inspectedElements.getFirstAC()->isValid(GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text())) {
323 // replace the parent of all inspected elements
324 for (const auto& AC : inspectedElements.getACs()) {
325 AC->setAttribute(GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
326 }
327 myTextFieldParentAdditional->setTextColor(FXRGB(0, 0, 0));
328 myTextFieldParentAdditional->killFocus();
329 } else {
330 myTextFieldParentAdditional->setTextColor(FXRGB(255, 0, 0));
331 }
332 }
333 // finish change multiple attributes
334 if (inspectedElements.isInspectingMultipleElements()) {
335 myInspectorFrameParent->myViewNet->getUndoList()->end();
336 }
337 // force refresh values of AttributesEditor and GEOAttributesEditor
338 myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true);
339 myInspectorFrameParent->myGEOAttributesEditor->refreshGEOAttributesEditor(true);
340 }
341 return 1;
342}
343
344
345long
347 const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
348 // check number of elements
349 if (inspectedElements.isInspectingSingleElement()) {
350 // mark AC as front element
351 myInspectorFrameParent->getViewNet()->setFrontAttributeCarrier(inspectedElements.getFirstAC());
352 // disable button
353 myMarkFrontElementButton->disable();
354 }
355 return 1;
356}
357
358
359long
361 // Create dialog box
362 FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(getCollapsableFrame(), "Netedit Attributes Help", GUIDesignDialogBox);
363 additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL));
364 // set help text
365 std::ostringstream help;
366 help
367 << TL("- Mark as front element: Mark element as front element (Will be drawn over all other elements)\n")
368 << TL("- Block movement: disable movement in move mode\n")
369 << TL("- Block shape: Disable moving of shape's vertices and edges. Entire shape can be moved'.\n")
370 << TL("- Close shape: Add or remove the last vertex with the same position of first edge'.");
371 // Create label with the help text
372 new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation);
373 // Create horizontal separator
374 new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator);
375 // Create frame for OK Button
376 FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame);
377 // Create Button Close (And two more horizontal frames to center it)
378 new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
379 GUIDesigns::buildFXButton(myHorizontalFrameOKButton, TL("OK"), "", TL("close"), GUIIconSubSys::getIcon(GUIIcon::ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
380 new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
381 // Write Warning in console if we're in testing mode
382 WRITE_DEBUG("Opening NeteditAttributesEditor help dialog");
383 // create Dialog
384 additionalNeteditAttributesHelpDialog->create();
385 // show in the given position
386 additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
387 // refresh APP
388 getApp()->refresh();
389 // open as modal dialog (will block all windows until stop() or stopModal() is called)
390 getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
391 // Write Warning in console if we're in testing mode
392 WRITE_DEBUG("Closing NeteditAttributesEditor help dialog");
393 return 1;
394}
395
396// ---------------------------------------------------------------------------
397// GNEInspectorFrame::GEOAttributesEditor - methods
398// ---------------------------------------------------------------------------
399
401 MFXGroupBoxModule(inspectorFrameParent, TL("GEO Attributes")),
402 myInspectorFrameParent(inspectorFrameParent) {
403
404 // Create Frame for GEOAttribute
406 myGEOAttributeLabel = new FXLabel(myGEOAttributeFrame, "Undefined GEO Attribute", nullptr, GUIDesignLabelThickedFixed(100));
408
409 // Create Frame for use GEO
411 myUseGEOLabel = new FXLabel(myUseGEOFrame, toString(SUMO_ATTR_GEO).c_str(), nullptr, GUIDesignLabelThickedFixed(100));
413
414 // Create help button
416}
417
418
420
421
422void
424 const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
425 // make sure that ACs has elements
426 if (inspectedElements.isInspectingElements()) {
427 // enable all editable elements
428 myGEOAttributeTextField->enable();
429 myUseGEOCheckButton->enable();
430 // obtain tag property (only for improve code legibility)
431 const auto& tagProperty = inspectedElements.getFirstAC()->getTagProperty();
432 // check if item can use a geo position
433 if (tagProperty.hasGEOShape()) {
434 // show GEOAttributesEditor
435 show();
436 // Iterate over AC to obtain values
437 bool value = true;
438 for (const auto& AC : inspectedElements.getACs()) {
439 value &= GNEAttributeCarrier::parse<bool>(AC->getAttribute(SUMO_ATTR_GEO));
440 }
441 // show use geo frame
442 myUseGEOFrame->show();
443 // set UseGEOCheckButton value of and update label (only if geo conversion is defined)
444 if (GeoConvHelper::getFinal().getProjString() != "!") {
445 myUseGEOCheckButton->enable();
446 if (value) {
447 myUseGEOCheckButton->setCheck(true);
448 myUseGEOCheckButton->setText("true");
449 } else {
450 myUseGEOCheckButton->setCheck(false);
451 myUseGEOCheckButton->setText("false");
452 }
453 } else {
454 myUseGEOCheckButton->disable();
455 }
456 if (tagProperty.hasGEOShape() && inspectedElements.isInspectingSingleElement()) {
457 myGEOAttributeFrame->show();
458 myGEOAttributeLabel->setText(toString(SUMO_ATTR_GEOSHAPE).c_str());
459 myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
460 // only allow edit if geo conversion is defined
461 if (GeoConvHelper::getFinal().getProjString() != "!") {
462 myGEOAttributeTextField->enable();
463 myGEOAttributeTextField->setText(inspectedElements.getFirstAC()->getAttribute(SUMO_ATTR_GEOSHAPE).c_str());
464 } else {
465 myGEOAttributeTextField->disable();
466 myGEOAttributeTextField->setText(TL("No geo-conversion defined"));
467 }
468 }
469 }
470 // disable all editable elements if we're in demand mode and inspected AC isn't a demand element
471 if (GNEFrameAttributeModules::isSupermodeValid(myInspectorFrameParent->getViewNet(), inspectedElements.getFirstAC()) == false) {
472 myGEOAttributeTextField->disable();
473 myUseGEOCheckButton->disable();
474 }
475 }
476}
477
478
479void
481 // hide all elements of GroupBox
482 myGEOAttributeFrame->hide();
483 myUseGEOFrame->hide();
484 // hide groupbox
485 hide();
486}
487
488
489void
491 const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
492 // Check that myGEOAttributeFrame is shown
493 if (inspectedElements.getFirstAC() && (GeoConvHelper::getFinal().getProjString() != "!") && myGEOAttributeFrame->shown() && ((myGEOAttributeTextField->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) {
494 if (inspectedElements.getFirstAC()->getTagProperty().hasGEOShape()) {
495 myGEOAttributeTextField->setText(inspectedElements.getFirstAC()->getAttribute(SUMO_ATTR_GEOSHAPE).c_str());
496 }
497 myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
498 }
499}
500
501
502long
504 const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
505 // make sure that ACs has elements
506 if (inspectedElements.getFirstAC() && (GeoConvHelper::getFinal().getProjString() != "!")) {
507 if (obj == myGEOAttributeTextField) {
508 // obtain tag property (only for improve code legibility)
509 const auto& tagProperty = inspectedElements.getFirstAC()->getTagProperty();
510 // Change GEO Attribute depending of type (Position or shape)
511 if (tagProperty.hasGEOShape()) {
512 if (inspectedElements.getFirstAC()->isValid(SUMO_ATTR_GEOSHAPE, myGEOAttributeTextField->getText().text())) {
513 inspectedElements.getFirstAC()->setAttribute(SUMO_ATTR_GEOSHAPE, myGEOAttributeTextField->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
514 myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
515 myGEOAttributeTextField->killFocus();
516 } else {
517 myGEOAttributeTextField->setTextColor(FXRGB(255, 0, 0));
518 }
519 } else {
520 throw ProcessError("myGEOAttributeTextField must be hidden because there isn't GEO Attribute to edit");
521 }
522 } else if (obj == myUseGEOCheckButton) {
523 // update GEO Attribute of entire selection
524 for (const auto& AC : inspectedElements.getACs()) {
525 if (myUseGEOCheckButton->getCheck() == 1) {
526 AC->setAttribute(SUMO_ATTR_GEO, "true", myInspectorFrameParent->myViewNet->getUndoList());
527 myUseGEOCheckButton->setText("true");
528 } else {
529 AC->setAttribute(SUMO_ATTR_GEO, "false", myInspectorFrameParent->myViewNet->getUndoList());
530 myUseGEOCheckButton->setText("false");
531 }
532 }
533 }
534 // force refresh values of Attributes editor and NeteditAttributesEditor
535 myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true);
536 myInspectorFrameParent->myNeteditAttributesEditor->refreshNeteditAttributesEditor(true);
537 }
538 return 1;
539}
540
541
542long
544 FXDialogBox* helpDialog = new FXDialogBox(getCollapsableFrame(), "GEO attributes Help", GUIDesignDialogBox);
545 std::ostringstream help;
546 help
547 << TL(" SUMO uses the World Geodetic System 84 (WGS84/UTM).\n")
548 << TL(" For a GEO-referenced network, geo coordinates are represented as pairs of Longitude and Latitude\n")
549 << TL(" in decimal degrees without extra symbols. (N,W..)\n")
550 << TL(" - Longitude: East-west position of a point on the Earth's surface.\n")
551 << TL(" - Latitude: North-south position of a point on the Earth's surface.\n")
552 << TL(" - CheckBox 'geo' enables or disables saving position in GEO coordinates\n");
553 new FXLabel(helpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation);
554 // "OK"
555 GUIDesigns::buildFXButton(helpDialog, TL("OK"), "", TL("close"), GUIIconSubSys::getIcon(GUIIcon::ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
556 helpDialog->create();
557 helpDialog->show();
558 return 1;
559}
560
561// ---------------------------------------------------------------------------
562// GNEInspectorFrame::TemplateEditor - methods
563// ---------------------------------------------------------------------------
564
566 MFXGroupBoxModule(inspectorFrameParent, TL("Templates")),
567 myInspectorFrameParent(inspectorFrameParent),
568 myEdgeTemplate(nullptr) {
569 // Create set template button
571 // Create copy template button
573 // Create copy template button
575}
576
577
580
581
582bool
584 // show template editor only if we're editing an edge in Network mode AND we have at least one inspected edge
585 if (myInspectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeNetwork()) {
586 for (const auto& AC : myInspectorFrameParent->getViewNet()->getInspectedElements().getACs()) {
587 if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
588 // update buttons and show module
589 updateButtons();
590 show();
591 return true;
592 }
593 }
594 }
595 return false;
596}
597
598
599void
601 // hide template editor
602 hide();
603}
604
605
608 return myEdgeTemplate;
609}
610
611
612void
614 // delete previous template edge
615 if (myEdgeTemplate) {
616 delete myEdgeTemplate;
617 myEdgeTemplate = nullptr;
618 }
619 // update edge template
620 if (edge) {
621 myEdgeTemplate = new GNEEdgeTemplate(edge);
622 // use template by default
623 myInspectorFrameParent->myViewNet->getViewParent()->getCreateEdgeFrame()->setUseEdgeTemplate();
624 }
625}
626
627
628void
630 if (myEdgeTemplate) {
631 myEdgeTemplate->updateLaneTemplates();
632 // use template by default
633 myInspectorFrameParent->myViewNet->getViewParent()->getCreateEdgeFrame()->setUseEdgeTemplate();
634 }
635}
636
637void
639 // check if template editor AND mySetTemplateButton is enabled
640 if (shown() && mySetTemplateButton->isEnabled()) {
641 onCmdSetTemplate(nullptr, 0, nullptr);
642 }
643}
644
645
646void
648 // check if template editor AND myCopyTemplateButton is enabled
649 if (shown() && myCopyTemplateButton->isEnabled()) {
650 onCmdCopyTemplate(nullptr, 0, nullptr);
651 }
652}
653
654
655void
657 // check if template editor AND myClearTemplateButton is enabled
658 if (shown() && myClearTemplateButton->isEnabled()) {
659 onCmdClearTemplate(nullptr, 0, nullptr);
660 }
661}
662
663
664long
666 // apply to all selected edges
667 for (const auto& AC : myInspectorFrameParent->myViewNet->getInspectedElements().getACs()) {
668 if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) {
669 // set template
670 setEdgeTemplate(myInspectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveEdge(AC->getID()));
671 // update buttons
672 updateButtons();
673 }
674 }
675 return 1;
676}
677
678
679long
681 // first check
682 if (myEdgeTemplate) {
683 // begin copy template
684 myInspectorFrameParent->myViewNet->getUndoList()->begin(myEdgeTemplate, "copy edge template");
685 // iterate over inspected ACs
686 for (const auto& AC : myInspectorFrameParent->myViewNet->getInspectedElements().getACs()) {
687 // avoid copy template in the same edge
688 if (AC->getID() != myEdgeTemplate->getID()) {
689 // retrieve edge ID (and throw exception if edge doesn't exist)
690 myInspectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveEdge(AC->getID())->copyTemplate(myEdgeTemplate, myInspectorFrameParent->myViewNet->getUndoList());
691 }
692 }
693 // end copy template
694 myInspectorFrameParent->myViewNet->getUndoList()->end();
695 // refresh inspector parent
696 myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true);
697 }
698 return 1;
699}
700
701
702long
704 // set null edge
705 setEdgeTemplate(nullptr);
706 // update buttons
707 updateButtons();
708 return 1;
709}
710
711
712void
714 const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
715 // only show set template button if we have exactly one inspected edge
716 if (inspectedElements.isInspectingSingleElement() && (inspectedElements.getFirstAC()->getTagProperty().getTag() == SUMO_TAG_EDGE)) {
717 mySetTemplateButton->setText((TLF("Set edge '%' as Template", inspectedElements.getFirstAC()->getID())).c_str());
718 mySetTemplateButton->show();
719 } else {
720 mySetTemplateButton->hide();
721 }
722 // enable or disable clear buttons depending of myEdgeTemplate
723 if (myEdgeTemplate) {
724 // update caption of copy button
725 if (inspectedElements.isInspectingSingleElement()) {
726 myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate->getID() + "' into edge '" + inspectedElements.getFirstAC()->getID() + "'").c_str());
727 } else {
728 myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate->getID() + "' into " + toString(inspectedElements.getACs().size()) + " selected edges").c_str());
729 }
730 // enable set and clear buttons
731 myCopyTemplateButton->enable();
732 myClearTemplateButton->enable();
733 } else {
734 // update caption of copy button
735 myCopyTemplateButton->setText(TL("No edge Template Set"));
736 // disable set and clear buttons
737 myCopyTemplateButton->disable();
738 myClearTemplateButton->disable();
739 }
740}
741
742// ---------------------------------------------------------------------------
743// GNEInspectorFrame::AdditionalDialog - methods
744// ---------------------------------------------------------------------------
745
747 MFXGroupBoxModule(inspectorFrameParent, TL("Additional dialog")),
748 myInspectorFrameParent(inspectorFrameParent) {
749 // Create mark as front element button
751}
752
753
755
756
757void
759 const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
760 // check number of inspected elements
761 if (inspectedElements.isInspectingSingleElement()) {
762 // get first inspected AC tag
763 auto firstInspectedACTag = inspectedElements.getFirstAC()->getTagProperty().getTag();
764 // check AC
765 if (firstInspectedACTag == SUMO_TAG_REROUTER) {
766 // update button
767 myOpenAdditionalDialog->setText(TL("Open rerouter dialog"));
768 myOpenAdditionalDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::REROUTER));
769 // show module
770 show();
771 } else if (firstInspectedACTag == SUMO_TAG_CALIBRATOR) {
772 // update button
773 myOpenAdditionalDialog->setText(TL("Open calibrator dialog"));
774 myOpenAdditionalDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::CALIBRATOR));
775 // show module
776 show();
777 } else if (firstInspectedACTag == GNE_TAG_CALIBRATOR_LANE) {
778 // update button
779 myOpenAdditionalDialog->setText(TL("Open calibrator lane dialog"));
780 myOpenAdditionalDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::CALIBRATOR));
781 // show module
782 show();
783 } else if (firstInspectedACTag == SUMO_TAG_VSS) {
784 // update button
785 myOpenAdditionalDialog->setText(TL("Open VSS dialog"));
786 myOpenAdditionalDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::VARIABLESPEEDSIGN));
787 // show module
788 show();
789 }
790 } else {
791 // hide module
792 hide();
793 }
794}
795
796
797void
802
803
804long
806 const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
807 // check number of inspected elements
808 if (inspectedElements.isInspectingSingleElement()) {
809 // check AC
810 if (inspectedElements.getFirstAC()->getTagProperty().getTag() == SUMO_TAG_REROUTER) {
811 // Open rerouter dialog
812 GNERerouterDialog(dynamic_cast<GNERerouter*>(inspectedElements.getFirstAC()));
813 } else if ((inspectedElements.getFirstAC()->getTagProperty().getTag() == SUMO_TAG_CALIBRATOR) ||
814 (inspectedElements.getFirstAC()->getTagProperty().getTag() == GNE_TAG_CALIBRATOR_LANE)) {
815 // Open calibrator dialog
816 GNECalibratorDialog(dynamic_cast<GNECalibrator*>(inspectedElements.getFirstAC()));
817 } else if (inspectedElements.getFirstAC()->getTagProperty().getTag() == SUMO_TAG_VSS) {
818 // Open VSS dialog
819 GNEVariableSpeedSignDialog(dynamic_cast<GNEVariableSpeedSign*>(inspectedElements.getFirstAC()));
820 }
821 }
822 return 1;
823}
824
825// ---------------------------------------------------------------------------
826// GNEInspectorFrame - methods
827// ---------------------------------------------------------------------------
828
830 GNEFrame(viewParent, viewNet, "Inspector"),
834
835 // Create back button
837 myHeaderLeftFrame->hide();
838 myBackButton->hide();
839
840 // Create Overlapped Inspection module
842
843 // Create Attributes Editor module
845
846 // Create GEO Parameters Editor module
848
849 // create parameters Editor module
851
852 // create additional dialog
854
855 // Create Netedit Attributes Editor module
857
858 // Create Template editor module
860
861 // Create GNEElementTree module
863}
864
865
867
868
869void
871 // inspect a null element to reset inspector frame
872 inspectSingleElement(nullptr);
873 // stop select new element
875 // show
877}
878
879
880void
885
886
887bool
889 // get unlocked attribute carrier front
890 auto AC = viewObjects.getAttributeCarrierFront();
891 // first check if we have clicked over an Attribute Carrier
892 if (AC) {
893 // if Control key is Pressed, select instead inspect element
895 // toggle networkElement selection
896 if (AC->isAttributeCarrierSelected()) {
898 } else {
899 AC->selectAttributeCarrier();
900 }
901 } else {
902 // first check if we clicked over a GNEOverlappedInspection point
904 if (!myOverlappedInspection->previousElement(clickedPosition)) {
905 // inspect attribute carrier, (or multiselection if AC is selected)
906 inspectClickedElement(viewObjects, clickedPosition);
907 }
908 } else if (!myOverlappedInspection->nextElement(clickedPosition)) {
909 // inspect attribute carrier, (or multiselection if AC is selected)
910 inspectClickedElement(viewObjects, clickedPosition);
911 }
912 // focus upper element of inspector frame
914 }
915 return true;
916 } else {
917 return false;
918 }
919}
920
921
922bool
924 // get unlocked attribute carrier front
925 auto AC = viewObjects.getAttributeCarrierFront();
926 // first check if we have clicked over a demand element
927 if (AC) {
928 // if Control key is Pressed, select instead inspect element
930 // toggle networkElement selection
931 if (AC->isAttributeCarrierSelected()) {
933 } else {
934 AC->selectAttributeCarrier();
935 }
936 } else {
937 // first check if we clicked over a GNEOverlappedInspection point
939 if (!myOverlappedInspection->previousElement(clickedPosition)) {
940 // inspect attribute carrier, (or multiselection if AC is selected)
941 inspectClickedElement(viewObjects, clickedPosition);
942 }
943 } else if (!myOverlappedInspection->nextElement(clickedPosition)) {
944 // inspect attribute carrier, (or multiselection if AC is selected)
945 inspectClickedElement(viewObjects, clickedPosition);
946 }
947 // focus upper element of inspector frame
949 }
950 return true;
951 } else {
952 return false;
953 }
954}
955
956
957bool
959 // get unlocked attribute carrier front
960 auto AC = viewObjects.getAttributeCarrierFront();
961 // first check if we have clicked over a data element
962 if (AC) {
963 // if Control key is Pressed, select instead inspect element
965 // toggle networkElement selection
966 if (AC->isAttributeCarrierSelected()) {
968 } else {
969 AC->selectAttributeCarrier();
970 }
971 } else {
972 // first check if we clicked over a GNEOverlappedInspection point
974 if (!myOverlappedInspection->previousElement(clickedPosition)) {
975 // inspect attribute carrier, (or multiselection if AC is selected)
976 inspectClickedElement(viewObjects, clickedPosition);
977 }
978 } else if (!myOverlappedInspection->nextElement(clickedPosition)) {
979 // inspect attribute carrier, (or multiselection if AC is selected)
980 inspectClickedElement(viewObjects, clickedPosition);
981 }
982 // focus upper element of inspector frame
984 }
985 return true;
986 } else {
987 return false;
988 }
989}
990
991
992void
994 auto& inspectedElements = myViewNet->getInspectedElements();
995 std::vector<GNEAttributeCarrier*> itemsToInspect;
996 // Use the implementation of inspect for multiple AttributeCarriers to avoid repetition of code
997 if (AC) {
999 // obtain selected ACs depending of current supermode
1000 const auto selectedACs = myViewNet->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1001 // reserve space
1002 itemsToInspect.reserve(selectedACs.size());
1003 // iterate over selected ACs
1004 for (const auto& selectedAC : selectedACs) {
1005 // filter ACs to inspect using Tag as criterion
1006 if (selectedAC->getTagProperty().getTag() == AC->getTagProperty().getTag()) {
1007 itemsToInspect.push_back(selectedAC);
1008 }
1009 }
1010 } else {
1011 itemsToInspect.push_back(AC);
1012 }
1013 }
1014 inspectedElements.inspectACs(itemsToInspect);
1016}
1017
1018void
1019GNEInspectorFrame::inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs) {
1022}
1023
1024void
1026 const auto& inspectedElements = myViewNet->getInspectedElements();
1027 // hide back button
1028 myHeaderLeftFrame->hide();
1029 myBackButton->hide();
1030 // Hide all elements
1039 // If vector of attribute Carriers contain data
1040 if (inspectedElements.isInspectingElements()) {
1041 // Set header
1042 std::string headerString;
1043 if (inspectedElements.getFirstAC()->getTagProperty().isNetworkElement()) {
1044 headerString = "Net: ";
1045 } else if (inspectedElements.getFirstAC()->getTagProperty().isAdditionalElement()) {
1046 headerString = "Additional: ";
1047 } else if (inspectedElements.getFirstAC()->getTagProperty().isShapeElement()) {
1048 headerString = "Shape: ";
1049 } else if (inspectedElements.getFirstAC()->getTagProperty().isTAZElement()) {
1050 headerString = "TAZ: ";
1051 } else if (inspectedElements.getFirstAC()->getTagProperty().isWireElement()) {
1052 headerString = "WIRE: ";
1053 } else if (inspectedElements.getFirstAC()->getTagProperty().isVehicle()) {
1054 headerString = "Vehicle: ";
1055 } else if (inspectedElements.getFirstAC()->getTagProperty().isRoute()) {
1056 headerString = "Route: ";
1057 } else if (inspectedElements.getFirstAC()->getTagProperty().isPerson()) {
1058 headerString = "Person: ";
1059 } else if (inspectedElements.getFirstAC()->getTagProperty().isPlanPerson()) {
1060 headerString = "PersonPlan: ";
1061 } else if (inspectedElements.getFirstAC()->getTagProperty().isContainer()) {
1062 headerString = "Container: ";
1063 } else if (inspectedElements.getFirstAC()->getTagProperty().isPlanContainer()) {
1064 headerString = "ContainerPlan: ";
1065 } else if (inspectedElements.getFirstAC()->getTagProperty().isVehicleStop()) {
1066 headerString = "Stop: ";
1067 } else if (inspectedElements.getFirstAC()->getTagProperty().isDataElement()) {
1068 headerString = "Data: ";
1069 }
1071 headerString += toString(inspectedElements.getACs().size()) + " ";
1072 }
1073 headerString += inspectedElements.getFirstAC()->getTagStr();
1075 headerString += "s";
1076 }
1077 // Set headerString into header label
1078 getFrameHeaderLabel()->setText(headerString.c_str());
1079
1080 // Show attributes editor
1082
1083 // show netedit attributes editor if we're inspecting elements with Netedit Attributes
1085
1086 // Show GEO Attributes Editor if we're inspecting elements with GEO Attributes
1088
1089 // show parameters editor
1091
1092 // show additional dialog
1094
1095 // If attributes correspond to an Edge and we aren't in demand mode, show template editor
1097
1098 // if we inspect a single Attribute carrier vector, show their children
1099 if (inspectedElements.isInspectingSingleElement()) {
1100 myHierarchicalElementTree->showHierarchicalElementTree(inspectedElements.getFirstAC());
1101 }
1102 } else {
1103 getFrameHeaderLabel()->setText(TL("Inspect"));
1104 }
1105 // update frame width
1107 // update viewNet
1108 myViewNet->update();
1109}
1110
1111
1112void
1114 // Show back button if myPreviousElementInspect was defined
1115 myPreviousElementInspect = previousElement;
1116 if (myPreviousElementInspect != nullptr) {
1117 // disable myPreviousElementDelete to avoid inconsistences
1118 myPreviousElementDelete = nullptr;
1120 myHeaderLeftFrame->show();
1121 myBackButton->show();
1122 }
1123}
1124
1125
1126void
1127GNEInspectorFrame::inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked) {
1128 myPreviousElementDelete = previousElement;
1129 myPreviousElementDeleteWasMarked = previousElementWasMarked;
1130 // Show back button if myPreviousElementDelete is valid
1131 if (myPreviousElementDelete != nullptr) {
1132 // disable myPreviousElementInspect to avoid inconsistences
1133 myPreviousElementInspect = nullptr;
1135 myHeaderLeftFrame->show();
1136 myBackButton->show();
1137 }
1138}
1139
1140
1141void
1143 // simply inspect multi selection with empty values
1145}
1146
1147
1152
1153
1158
1159
1164
1165
1170
1171
1176
1177
1178long
1179GNEInspectorFrame::onCmdGoBack(FXObject*, FXSelector, void*) {
1180 // Inspect previous element or go back to Delete Frame
1183 myPreviousElementInspect = nullptr;
1184 } else if (myPreviousElementDelete != nullptr) {
1185 myPreviousElementDelete = nullptr;
1186 // Hide inspect frame and show delete frame
1187 hide();
1189 }
1190 return 1;
1191}
1192
1193
1194void
1196 // refresh Attribute Editor
1198 // refresh parametersEditor
1200 // refresh AC Hierarchy
1202}
1203
1204
1205void
1208 // update view (due dotted contour)
1210}
1211
1212
1213void
1215 // get front unlocked AC
1216 const auto AC = viewObjects.getAttributeCarrierFront();
1217 // check if selection is blocked
1218 if (AC) {
1219 // inspect front element
1221 // show Overlapped Inspection module
1222 myOverlappedInspection->showOverlappedInspection(viewObjects, clickedPosition);
1223 }
1224}
1225
1226
1227void
1233
1234
1235
1236/****************************************************************************/
FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition GUIAppEnum.h:939
@ MID_HELP
help button
Definition GUIAppEnum.h:653
@ MID_GNE_INSPECTORFRAME_GOBACK
go back to the previous element
@ MID_OPEN_ADDITIONAL_DIALOG
open additional dialog (used in netedit)
Definition GUIAppEnum.h:469
@ MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY
copy template
Definition GUIAppEnum.h:264
@ MID_GNE_MARKFRONTELEMENT
mark item as front element
@ MID_HOTKEY_SHIFT_F1_TEMPLATE_SET
set template
Definition GUIAppEnum.h:262
@ MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR
clear template
Definition GUIAppEnum.h:266
#define GUIDesignMFXCheckableButton
checkable button extended over frame
Definition GUIDesigns.h:149
#define GUIDesignButton
Definition GUIDesigns.h:88
#define GUIDesignTextField
Definition GUIDesigns.h:65
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:405
#define GUIDesignDialogBox
Definition GUIDesigns.h:602
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
Definition GUIDesigns.h:100
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:80
#define GUIDesignButtonOK
Definition GUIDesigns.h:159
#define GUIDesignLabelThick(justify)
label extended over frame with thick and with text justify to left
Definition GUIDesigns.h:255
#define GUIDesignCheckButton
checkButton placed in left position
Definition GUIDesigns.h:198
#define GUIDesignHorizontalSeparator
Definition GUIDesigns.h:466
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
Definition GUIDesigns.h:258
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition GUIDesigns.h:285
@ MODEADDITIONAL
@ BIGARROWLEFT
@ FRONTELEMENT
@ VARIABLESPEEDSIGN
#define WRITE_DEBUG(msg)
Definition MsgHandler.h:306
#define TL(string)
Definition MsgHandler.h:315
#define TLF(string,...)
Definition MsgHandler.h:317
@ SUMO_TAG_REROUTER
A rerouter.
@ GNE_TAG_CALIBRATOR_LANE
A calibrator placed over lane.
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
@ SUMO_TAG_VSS
A variable speed sign.
@ SUMO_TAG_EDGE
begin/end of the description of an edge
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_PARENT
parent of an additional element
@ SUMO_ATTR_GEO
@ SUMO_ATTR_GEOSHAPE
@ GNE_ATTR_CLOSE_SHAPE
Close shape of a polygon (Used by GNEPolys)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Dialog for edit calibrators.
void show()
show delete frame
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
void hideHierarchicalElementTree()
hide GNEElementTree
void refreshHierarchicalElementTree()
refresh GNEElementTree
void showHierarchicalElementTree(GNEAttributeCarrier *AC)
show GNEElementTree
void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition)
refresh attribute editor (only the valid values will be refresh)
void showAttributeEditorModule(bool includeExtended)
show attributes of multiple ACs
void refreshParametersEditor()
refresh netedit attributes
void hideParametersEditor()
hide netedit attributes EditorInspector
void showParametersEditor()
show netedit attributes EditorInspector
static bool isSupermodeValid(const GNEViewNet *viewNet, const GNEAttributeCarrier *AC)
return true if AC can be edited in the current supermode
void setFrameWidth(const int newWidth)
set width of GNEFrame
Definition GNEFrame.cpp:133
void focusUpperElement()
focus upper element of frame
Definition GNEFrame.cpp:109
FXLabel * getFrameHeaderLabel() const
get the label for the frame's header
Definition GNEFrame.cpp:162
GNEViewNet * myViewNet
FOX need this.
Definition GNEFrame.h:117
virtual void show()
show Frame
Definition GNEFrame.cpp:115
virtual void hide()
hide Frame
Definition GNEFrame.cpp:124
FXHorizontalFrame * myHeaderLeftFrame
fame for left header elements
Definition GNEFrame.h:126
FXButton * myOpenAdditionalDialog
button for open additional dialog
long onCmdOpenAdditionalDialog(FXObject *, FXSelector, void *)
void hideAdditionalDialog()
hide netedit attributes editor
AdditionalDialog(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
void showAdditionalDialog()
show netedit attributes editor
FXCheckButton * myUseGEOCheckButton
checkBox for use GEO
long onCmdGEOAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
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
bool isSelectingParent() const
check if we're selecting a new parent
long onCmdNeteditAttributeHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
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 setNewParent(GNEAttributeCarrier *clickedAC)
set new parent
void hideNeteditAttributesEditor()
hide netedit attributes editor
void showNeteditAttributesEditor()
show netedit attributes editor
void hideTemplateEditor()
hide template editor
void clearTemplate()
clear template (used by shortcut)
void setEdgeTemplate(const GNEEdge *edge)
set edge template
FXButton * myClearTemplateButton
clear template button
FXButton * mySetTemplateButton
set template button
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
copy edge attributes from edge template
void setTemplate()
set template (used by shortcut)
TemplateEditor(GNEInspectorFrame *inspectorFrameParent)
FOX-declaration.
FXButton * myCopyTemplateButton
copy template button
long onCmdSetTemplate(FXObject *, FXSelector, void *)
GNEEdgeTemplate * getEdgeTemplate() const
get edge template (to copy attributes from)
void copyTemplate()
copy template (used by shortcut)
void updateEdgeTemplate()
update edge template
bool 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
GNEFrameAttributeModules::AttributesEditor * getAttributesEditor() const
get AttributesEditor
void inspectChild(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousElement)
inspect child of already inspected element
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
GNEFrameAttributeModules::AttributesEditor * myAttributesEditor
Attribute editor.
void selectedOverlappedElement(GNEAttributeCarrier *AC)
open GNEAttributesCreator extended dialog (can be reimplemented in frame children)
TemplateEditor * getTemplateEditor() const
get template editor
GNEInspectorFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
bool processDemandSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet in Supermode Demand
GNEElementTree * getHierarchicalElementTree() const
get GNEElementTree modul
void clearInspectedAC()
Clear all current inspected ACs.
long onCmdGoBack(FXObject *, FXSelector, void *)
called when user toggle the go back button
void attributeUpdated(SumoXMLAttr attribute)
function called after set a valid attribute in AttributeEditor
void show()
show inspector frame
GNEFrameAttributeModules::ParametersEditor * myParametersEditor
Parameters editor inspector.
GEOAttributesEditor * myGEOAttributesEditor
GEO Attributes editor.
GNEAttributeCarrier * myPreviousElementInspect
Pointer to previous element called by Inspector Frame.
bool myPreviousElementDeleteWasMarked
flag to ckec if myPreviousElementDelete was marked in Delete Frame
GNEOverlappedInspection * myOverlappedInspection
Overlapped Inspection.
GNEOverlappedInspection * getOverlappedInspection() const
get GNEOverlappedInspection modul
AdditionalDialog * myAdditionalDialog
Additional dialog.
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
bool processNetworkSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet in Supermode Network
FXButton * myBackButton
Back Button.
GNEElementTree * myHierarchicalElementTree
Attribute Carrier Hierarchy.
void refreshInspection()
refresh current inspection
void inspectClickedElement(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const Position &clickedPosition)
FOX need this.
void inspectMultisection(const std::vector< GNEAttributeCarrier * > &ACs)
Inspect the given multi-selection.
~GNEInspectorFrame()
Destructor.
TemplateEditor * myTemplateEditor
Template editor.
void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame (can be reimplemented in frame children)
bool processDataSupermodeClick(const Position &clickedPosition, GNEViewNetHelper::ViewObjectsSelector &viewObjects)
process click over Viewnet in Supermode Data
std::vector< GNEAttributeCarrier * > getSelectedAttributeCarriers(const bool ignoreCurrentSupermode)
get all selected attribute carriers (or only relative to current supermode
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:127
void hideOverlappedInspection()
hide template editor
void showOverlappedInspection(const GNEViewNetHelper::ViewObjectsSelector &viewObjects, 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
Dialog for edit rerouters.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void inspectACs(const std::vector< GNEAttributeCarrier * > &ACs)
inspect multiple ACs
bool isInspectingMultipleElements() const
check if we're inspecting more than one elements
class used to group all variables related with objects under cursor after a click over view
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
GNENet * getNet() const
get the net object
const GNEViewNetHelper::MouseButtonKeyPressed & getMouseButtonKeyPressed() const
get Key Pressed module
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
GNEViewParent * getViewParent() const
get the net object
void updateViewNet(const bool ignoreViewUpdater=true) const
Mark the entire GNEViewNet to be repainted later.
A single child window which contains a view of the simulation area.
GNEDeleteFrame * getDeleteFrame() const
get frame for delete elements
int getFrameAreaWidth() const
get frame area width
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
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...
const std::string & getProjString() const
Returns the original projection definition.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
bool shiftKeyPressed() const
check if SHIFT is pressed during current event
bool altKeyPressed() const
check if ALT is pressed during current event
bool controlKeyPressed() const
check if CONTROL is pressed during current event