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 // get ACs
119 const auto& ACs = myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers();
120 // continue if there is edited ACs
121 if (ACs.size() > 0) {
122 // enable all editable elements
123 myTextFieldParentAdditional->enable();
124 myCheckBoxCloseShape->enable();
125 // obtain tag property (only for improve code legibility)
126 const auto& tagValue = ACs.front()->getTagProperty();
127 // check if item can be mark as front element
128 if (ACs.size() == 1) {
129 // show NeteditAttributesEditor
130 show();
131 // show button
132 myMarkFrontElementButton->show();
133 // enable or disable
134 if (myInspectorFrameParent->getViewNet()->getFrontAttributeCarrier() == ACs.front()) {
135 myMarkFrontElementButton->disable();
136 } else {
137 myMarkFrontElementButton->enable();
138 }
139 }
140 // check if item can block their shape
141 if (tagValue.canCloseShape()) {
142 // show NeteditAttributesEditor
143 show();
144 // Iterate over AC to obtain values
145 bool value = true;
146 for (const auto& inspectedAC : ACs) {
147 value &= GNEAttributeCarrier::parse<bool>(inspectedAC->getAttribute(GNE_ATTR_CLOSE_SHAPE));
148 }
149 // show close shape frame
150 myHorizontalFrameCloseShape->show();
151 // show help button
152 myHelpButton->show();
153 // set check box value and update label
154 if (value) {
155 myCheckBoxCloseShape->setCheck(true);
156 myCheckBoxCloseShape->setText("true");
157 } else {
158 myCheckBoxCloseShape->setCheck(false);
159 myCheckBoxCloseShape->setText("false");
160 }
161 }
162 // Check if item has another item as parent and can be reparent
163 if (tagValue.isChild() && tagValue.canBeReparent()) {
164 // show NeteditAttributesEditor
165 show();
166 // obtain additional Parent
167 std::set<std::string> parents;
168 for (const auto& inspectedAC : ACs) {
169 parents.insert(inspectedAC->getAttribute(GNE_ATTR_PARENT));
170 }
171 // show parent additional elements
172 myLabelParentAdditional->show();
173 myTextFieldParentAdditional->show();
174 mySetNewParentButton->show();
175 // reset new parent button
176 mySetNewParentButton->setChecked(false);
177 mySetNewParentButton->setText(TL("Set new parent"));
178 // set parent tag icon
179 const auto& parentTagProperty = GNEAttributeCarrier::getTagProperty(ACs.front()->getTagProperty().getParentTags().front());
180 mySetNewParentButton->setIcon(GUIIconSubSys::getIcon(parentTagProperty.getGUIIcon()));
181 // show help button
182 myHelpButton->show();
183 // set Label and TextField with the Tag and ID of parent
184 myLabelParentAdditional->setText((parentTagProperty.getTagStr() + " parent").c_str());
185 myTextFieldParentAdditional->setText(toString(parents).c_str());
186 }
187 // disable all editable elements if we're in demand mode and inspected AC isn't a demand element
188 if (GNEFrameAttributeModules::isSupermodeValid(myInspectorFrameParent->getViewNet(), ACs.front()) == false) {
189 myTextFieldParentAdditional->disable();
190 myCheckBoxCloseShape->disable();
191 }
192 }
193}
194
195
196void
198 // hide all elements of GroupBox
199 myLabelParentAdditional->hide();
200 myTextFieldParentAdditional->hide();
201 mySetNewParentButton->hide();
202 myHorizontalFrameCloseShape->hide();
203 myMarkFrontElementButton->hide();
204 myHelpButton->hide();
205 // hide groupbox
206 hide();
207}
208
209
210void
212 // get inspected Attribute carriers
213 const auto& ACs = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
214 if (ACs.size() > 0) {
215 // enable or disable mark front element button
216 if (myInspectorFrameParent->getViewNet()->getFrontAttributeCarrier() == ACs.front()) {
217 myMarkFrontElementButton->disable();
218 } else {
219 myMarkFrontElementButton->enable();
220 }
221 // refresh close shape
222 if (myHorizontalFrameCloseShape->shown()) {
223 // Iterate over AC to obtain values
224 bool value = true;
225 for (const auto& i : ACs) {
226 value &= GNEAttributeCarrier::parse<bool>(i->getAttribute(GNE_ATTR_CLOSE_SHAPE));
227 }
228 // set check box value and update label
229 if (value) {
230 myCheckBoxCloseShape->setCheck(true);
231 myCheckBoxCloseShape->setText("true");
232 } else {
233 myCheckBoxCloseShape->setCheck(false);
234 myCheckBoxCloseShape->setText("false");
235 }
236 }
237 // Check if item has another item as parent (Currently only for single Additionals)
238 if (myTextFieldParentAdditional->shown() && ((myTextFieldParentAdditional->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) {
239 // set Label and TextField with the Tag and ID of parent
240 myLabelParentAdditional->setText((toString(ACs.front()->getTagProperty().getParentTags().front()) + " parent").c_str());
241 myTextFieldParentAdditional->setText(ACs.front()->getAttribute(GNE_ATTR_PARENT).c_str());
242 }
243 }
244}
245
246
247bool
249 if (!shown()) {
250 return false;
251 } else {
252 return (mySetNewParentButton->shown() && mySetNewParentButton->amChecked());
253 }
254}
255
256
257void
259 const auto& ACs = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
260 // check number of inspected ACs
261 if ((ACs.size() > 0) && clickedAC) {
262 // check parent tags
263 for (const auto& parentTag : ACs.front()->getTagProperty().getParentTags()) {
264 if (parentTag == clickedAC->getTagProperty().getTag()) {
265 // check if we're changing multiple attributes
266 if (ACs.size() > 1) {
267 myInspectorFrameParent->myViewNet->getUndoList()->begin(ACs.front(), "Change multiple attributes");
268 }
269 // replace the parent of all inspected elements
270 for (const auto& AC : ACs) {
271 AC->setAttribute(GNE_ATTR_PARENT, clickedAC->getID(), myInspectorFrameParent->myViewNet->getUndoList());
272 }
273 // finish change multiple attributes
274 if (ACs.size() > 1) {
275 myInspectorFrameParent->myViewNet->getUndoList()->end();
276 }
277 // stop select parent
278 stopSelectParent();
279 // refresh netedit attributes editor
280 refreshNeteditAttributesEditor(true);
281 }
282 }
283 }
284}
285
286
287void
289 if (mySetNewParentButton->amChecked()) {
290 onCmdSetNeteditAttribute(mySetNewParentButton, 0, nullptr);
291 }
292}
293
294
295long
297 const auto& ACs = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
298 // make sure that ACs has elements
299 if (ACs.size() > 0) {
300 // check if we're changing multiple attributes
301 if (ACs.size() > 1) {
302 myInspectorFrameParent->myViewNet->getUndoList()->begin(ACs.front(), "Change multiple attributes");
303 }
304 if (obj == mySetNewParentButton) {
305 if (mySetNewParentButton->amChecked()) {
306 mySetNewParentButton->setText(TL("Set new parent"));
307 mySetNewParentButton->setChecked(false);
308 } else {
309 mySetNewParentButton->setText(("Click over " + toString(ACs.front()->getTagProperty().getParentTags().front())).c_str());
310 mySetNewParentButton->setChecked(true);
311 }
312 } else if (obj == myCheckBoxCloseShape) {
313 // set new values in all inspected Attribute Carriers
314 for (const auto& AC : ACs) {
315 if (myCheckBoxCloseShape->getCheck() == 1) {
316 AC->setAttribute(GNE_ATTR_CLOSE_SHAPE, "true", myInspectorFrameParent->myViewNet->getUndoList());
317 myCheckBoxCloseShape->setText("true");
318 } else {
319 AC->setAttribute(GNE_ATTR_CLOSE_SHAPE, "false", myInspectorFrameParent->myViewNet->getUndoList());
320 myCheckBoxCloseShape->setText("false");
321 }
322 }
323 } else if (obj == myTextFieldParentAdditional) {
324 if (ACs.front()->isValid(GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text())) {
325 // replace the parent of all inspected elements
326 for (const auto& AC : ACs) {
327 AC->setAttribute(GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text(), myInspectorFrameParent->myViewNet->getUndoList());
328 }
329 myTextFieldParentAdditional->setTextColor(FXRGB(0, 0, 0));
330 myTextFieldParentAdditional->killFocus();
331 } else {
332 myTextFieldParentAdditional->setTextColor(FXRGB(255, 0, 0));
333 }
334 }
335 // finish change multiple attributes
336 if (ACs.size() > 1) {
337 myInspectorFrameParent->myViewNet->getUndoList()->end();
338 }
339 // force refresh values of AttributesEditor and GEOAttributesEditor
340 myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true);
341 myInspectorFrameParent->myGEOAttributesEditor->refreshGEOAttributesEditor(true);
342 }
343 return 1;
344}
345
346
347long
349 // check number of elements
350 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
351 // mark AC as front element
352 myInspectorFrameParent->getViewNet()->setFrontAttributeCarrier(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front());
353 // disable button
354 myMarkFrontElementButton->disable();
355 }
356 return 1;
357}
358
359
360long
362 // Create dialog box
363 FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(getCollapsableFrame(), "Netedit Attributes Help", GUIDesignDialogBox);
364 additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL));
365 // set help text
366 std::ostringstream help;
367 help
368 << TL("- Mark as front element: Mark element as front element (Will be drawn over all other elements)\n")
369 << TL("- Block movement: disable movement in move mode\n")
370 << TL("- Block shape: Disable moving of shape's vertices and edges. Entire shape can be moved'.\n")
371 << TL("- Close shape: Add or remove the last vertex with the same position of first edge'.");
372 // Create label with the help text
373 new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation);
374 // Create horizontal separator
375 new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator);
376 // Create frame for OK Button
377 FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame);
378 // Create Button Close (And two more horizontal frames to center it)
379 new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
380 GUIDesigns::buildFXButton(myHorizontalFrameOKButton, TL("OK"), "", TL("close"), GUIIconSubSys::getIcon(GUIIcon::ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
381 new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
382 // Write Warning in console if we're in testing mode
383 WRITE_DEBUG("Opening NeteditAttributesEditor help dialog");
384 // create Dialog
385 additionalNeteditAttributesHelpDialog->create();
386 // show in the given position
387 additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
388 // refresh APP
389 getApp()->refresh();
390 // open as modal dialog (will block all windows until stop() or stopModal() is called)
391 getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
392 // Write Warning in console if we're in testing mode
393 WRITE_DEBUG("Closing NeteditAttributesEditor help dialog");
394 return 1;
395}
396
397// ---------------------------------------------------------------------------
398// GNEInspectorFrame::GEOAttributesEditor - methods
399// ---------------------------------------------------------------------------
400
402 MFXGroupBoxModule(inspectorFrameParent, TL("GEO Attributes")),
403 myInspectorFrameParent(inspectorFrameParent) {
404
405 // Create Frame for GEOAttribute
407 myGEOAttributeLabel = new FXLabel(myGEOAttributeFrame, "Undefined GEO Attribute", nullptr, GUIDesignLabelThickedFixed(100));
409
410 // Create Frame for use GEO
412 myUseGEOLabel = new FXLabel(myUseGEOFrame, toString(SUMO_ATTR_GEO).c_str(), nullptr, GUIDesignLabelThickedFixed(100));
414
415 // Create help button
417}
418
419
421
422
423void
425 // make sure that ACs has elements
426 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) {
427 // enable all editable elements
428 myGEOAttributeTextField->enable();
429 myUseGEOCheckButton->enable();
430 // obtain tag property (only for improve code legibility)
431 const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->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& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
439 value &= GNEAttributeCarrier::parse<bool>(i->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() && myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
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(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->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(), myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()) == 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 // obtain tag property (only for improve code legibility)
492 const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty();
493 // Check that myGEOAttributeFrame is shown
494 if ((GeoConvHelper::getFinal().getProjString() != "!") && myGEOAttributeFrame->shown() && ((myGEOAttributeTextField->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) {
495 if (tagProperty.hasGEOShape()) {
496 myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(SUMO_ATTR_GEOSHAPE).c_str());
497 }
498 myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0));
499 }
500}
501
502
503long
505 // make sure that ACs has elements
506 if ((GeoConvHelper::getFinal().getProjString() != "!") && (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0)) {
507 if (obj == myGEOAttributeTextField) {
508 // obtain tag property (only for improve code legibility)
509 const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty();
510 // Change GEO Attribute depending of type (Position or shape)
511 if (tagProperty.hasGEOShape()) {
512 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->isValid(SUMO_ATTR_GEOSHAPE, myGEOAttributeTextField->getText().text())) {
513 myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->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& i : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
525 if (myUseGEOCheckButton->getCheck() == 1) {
526 i->setAttribute(SUMO_ATTR_GEO, "true", myInspectorFrameParent->myViewNet->getUndoList());
527 myUseGEOCheckButton->setText("true");
528 } else {
529 i->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->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
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->myAttributesEditor->getFrameParent()->getViewNet()->getViewParent()->getCreateEdgeFrame()->setUseEdgeTemplate();
624 }
625}
626
627
628void
630 if (myEdgeTemplate) {
631 myEdgeTemplate->updateLaneTemplates();
632 // use template by default
633 myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->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->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
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& inspectedAC : myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) {
687 // avoid copy template in the same edge
688 if (inspectedAC->getID() != myEdgeTemplate->getID()) {
689 // retrieve edge ID (and throw exception if edge doesn't exist)
690 myInspectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveEdge(inspectedAC->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& inspectedACs = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers();
715 // only show set template button if we have exactly one inspected edge
716 if (inspectedACs.size() == 1) {
717 mySetTemplateButton->setText((TLF("Set edge '%' as Template", inspectedACs.front()->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 (inspectedACs.size() == 1) {
726 myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate->getID() + "' into edge '" + inspectedACs.front()->getID() + "'").c_str());
727 } else {
728 myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate->getID() + "' into " + toString(inspectedACs.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 // check number of inspected elements
760 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
761 // get AC
762 const GNEAttributeCarrier* AC = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front();
763 // check AC
764 if (AC->getTagProperty().getTag() == SUMO_TAG_REROUTER) {
765 // update button
766 myOpenAdditionalDialog->setText(TL("Open rerouter dialog"));
767 myOpenAdditionalDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::REROUTER));
768 // show module
769 show();
770 } else if (AC->getTagProperty().getTag() == SUMO_TAG_CALIBRATOR) {
771 // update button
772 myOpenAdditionalDialog->setText(TL("Open calibrator dialog"));
773 myOpenAdditionalDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::CALIBRATOR));
774 // show module
775 show();
776 } else if (AC->getTagProperty().getTag() == GNE_TAG_CALIBRATOR_LANE) {
777 // update button
778 myOpenAdditionalDialog->setText(TL("Open calibrator lane dialog"));
779 myOpenAdditionalDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::CALIBRATOR));
780 // show module
781 show();
782 } else if (AC->getTagProperty().getTag() == SUMO_TAG_VSS) {
783 // update button
784 myOpenAdditionalDialog->setText(TL("Open VSS dialog"));
785 myOpenAdditionalDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::VARIABLESPEEDSIGN));
786 // show module
787 show();
788 }
789 } else {
790 // hide module
791 hide();
792 }
793}
794
795
796void
801
802
803long
805 // check number of inspected elements
806 if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) {
807 // get AC
808 GNEAttributeCarrier* AC = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front();
809 // check AC
810 if (AC->getTagProperty().getTag() == SUMO_TAG_REROUTER) {
811 // Open rerouter dialog
812 GNERerouterDialog(dynamic_cast<GNERerouter*>(AC));
814 // Open calibrator dialog
815 GNECalibratorDialog(dynamic_cast<GNECalibrator*>(AC));
816 } else if (AC->getTagProperty().getTag() == SUMO_TAG_VSS) {
817 // Open VSS dialog
819 }
820 }
821 return 1;
822}
823
824// ---------------------------------------------------------------------------
825// GNEInspectorFrame - methods
826// ---------------------------------------------------------------------------
827
829 GNEFrame(viewParent, viewNet, "Inspector"),
833
834 // Create back button
836 myHeaderLeftFrame->hide();
837 myBackButton->hide();
838
839 // Create Overlapped Inspection module
841
842 // Create Attributes Editor module
844
845 // Create GEO Parameters Editor module
847
848 // create parameters Editor module
850
851 // create additional dialog
853
854 // Create Netedit Attributes Editor module
856
857 // Create Template editor module
859
860 // Create GNEElementTree module
862}
863
864
866
867
868void
870 // inspect a null element to reset inspector frame
871 inspectSingleElement(nullptr);
872 // stop select new element
874 // show
876}
877
878
879void
884
885
886bool
888 // get unlocked attribute carrier front
889 auto AC = viewObjects.getAttributeCarrierFront();
890 // first check if we have clicked over an Attribute Carrier
891 if (AC) {
892 // if Control key is Pressed, select instead inspect element
894 // toggle networkElement selection
895 if (AC->isAttributeCarrierSelected()) {
897 } else {
898 AC->selectAttributeCarrier();
899 }
900 } else {
901 // first check if we clicked over a GNEOverlappedInspection point
903 if (!myOverlappedInspection->previousElement(clickedPosition)) {
904 // inspect attribute carrier, (or multiselection if AC is selected)
905 inspectClickedElement(viewObjects, clickedPosition);
906 }
907 } else if (!myOverlappedInspection->nextElement(clickedPosition)) {
908 // inspect attribute carrier, (or multiselection if AC is selected)
909 inspectClickedElement(viewObjects, clickedPosition);
910 }
911 // focus upper element of inspector frame
913 }
914 return true;
915 } else {
916 return false;
917 }
918}
919
920
921bool
923 // get unlocked attribute carrier front
924 auto AC = viewObjects.getAttributeCarrierFront();
925 // first check if we have clicked over a demand element
926 if (AC) {
927 // if Control key is Pressed, select instead inspect element
929 // toggle networkElement selection
930 if (AC->isAttributeCarrierSelected()) {
932 } else {
933 AC->selectAttributeCarrier();
934 }
935 } else {
936 // first check if we clicked over a GNEOverlappedInspection point
938 if (!myOverlappedInspection->previousElement(clickedPosition)) {
939 // inspect attribute carrier, (or multiselection if AC is selected)
940 inspectClickedElement(viewObjects, clickedPosition);
941 }
942 } else if (!myOverlappedInspection->nextElement(clickedPosition)) {
943 // inspect attribute carrier, (or multiselection if AC is selected)
944 inspectClickedElement(viewObjects, clickedPosition);
945 }
946 // focus upper element of inspector frame
948 }
949 return true;
950 } else {
951 return false;
952 }
953}
954
955
956bool
958 // get unlocked attribute carrier front
959 auto AC = viewObjects.getAttributeCarrierFront();
960 // first check if we have clicked over a data element
961 if (AC) {
962 // if Control key is Pressed, select instead inspect element
964 // toggle networkElement selection
965 if (AC->isAttributeCarrierSelected()) {
967 } else {
968 AC->selectAttributeCarrier();
969 }
970 } else {
971 // first check if we clicked over a GNEOverlappedInspection point
973 if (!myOverlappedInspection->previousElement(clickedPosition)) {
974 // inspect attribute carrier, (or multiselection if AC is selected)
975 inspectClickedElement(viewObjects, clickedPosition);
976 }
977 } else if (!myOverlappedInspection->nextElement(clickedPosition)) {
978 // inspect attribute carrier, (or multiselection if AC is selected)
979 inspectClickedElement(viewObjects, clickedPosition);
980 }
981 // focus upper element of inspector frame
983 }
984 return true;
985 } else {
986 return false;
987 }
988}
989
990
991void
993 // Use the implementation of inspect for multiple AttributeCarriers to avoid repetition of code
994 std::vector<GNEAttributeCarrier*> itemsToInspect;
995 if (AC != nullptr) {
998 // obtain selected ACs depending of current supermode
999 const auto selectedACs = myViewNet->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(false);
1000 // iterate over selected ACs
1001 for (const auto& selectedAC : selectedACs) {
1002 // filter ACs to inspect using Tag as criterion
1003 if (selectedAC->getTagProperty().getTag() == AC->getTagProperty().getTag()) {
1004 itemsToInspect.push_back(selectedAC);
1005 }
1006 }
1007 } else {
1008 itemsToInspect.push_back(AC);
1009 }
1010 }
1011 inspectMultisection(itemsToInspect);
1012}
1013
1014
1015void
1016GNEInspectorFrame::inspectMultisection(const std::vector<GNEAttributeCarrier*>& ACs) {
1017 // update inspected ACs in viewNet
1019 // hide back button
1020 myHeaderLeftFrame->hide();
1021 myBackButton->hide();
1022 // Hide all elements
1031 // If vector of attribute Carriers contain data
1032 if (ACs.size() > 0) {
1033 // Set header
1034 std::string headerString;
1035 if (ACs.front()->getTagProperty().isNetworkElement()) {
1036 headerString = "Net: ";
1037 } else if (ACs.front()->getTagProperty().isAdditionalElement()) {
1038 headerString = "Additional: ";
1039 } else if (ACs.front()->getTagProperty().isShapeElement()) {
1040 headerString = "Shape: ";
1041 } else if (ACs.front()->getTagProperty().isTAZElement()) {
1042 headerString = "TAZ: ";
1043 } else if (ACs.front()->getTagProperty().isWireElement()) {
1044 headerString = "WIRE: ";
1045 } else if (ACs.front()->getTagProperty().isVehicle()) {
1046 headerString = "Vehicle: ";
1047 } else if (ACs.front()->getTagProperty().isRoute()) {
1048 headerString = "Route: ";
1049 } else if (ACs.front()->getTagProperty().isPerson()) {
1050 headerString = "Person: ";
1051 } else if (ACs.front()->getTagProperty().isPlanPerson()) {
1052 headerString = "PersonPlan: ";
1053 } else if (ACs.front()->getTagProperty().isContainer()) {
1054 headerString = "Container: ";
1055 } else if (ACs.front()->getTagProperty().isPlanContainer()) {
1056 headerString = "ContainerPlan: ";
1057 } else if (ACs.front()->getTagProperty().isVehicleStop()) {
1058 headerString = "Stop: ";
1059 } else if (ACs.front()->getTagProperty().isDataElement()) {
1060 headerString = "Data: ";
1061 }
1062 if (ACs.size() > 1) {
1063 headerString += toString(ACs.size()) + " ";
1064 }
1065 headerString += ACs.front()->getTagStr();
1066 if (ACs.size() > 1) {
1067 headerString += "s";
1068 }
1069 // Set headerString into header label
1070 getFrameHeaderLabel()->setText(headerString.c_str());
1071
1072 // Show attributes editor
1074
1075 // show netedit attributes editor if we're inspecting elements with Netedit Attributes
1077
1078 // Show GEO Attributes Editor if we're inspecting elements with GEO Attributes
1080
1081 // show parameters editor
1083
1084 // show additional dialog
1086
1087 // If attributes correspond to an Edge and we aren't in demand mode, show template editor
1089
1090 // if we inspect a single Attribute carrier vector, show their children
1091 if (ACs.size() == 1) {
1093 }
1094 } else {
1095 getFrameHeaderLabel()->setText(TL("Inspect"));
1096 }
1097 // update frame width
1099 // update viewNet
1100 myViewNet->update();
1101}
1102
1103
1104void
1106 // Show back button if myPreviousElementInspect was defined
1107 myPreviousElementInspect = previousElement;
1108 if (myPreviousElementInspect != nullptr) {
1109 // disable myPreviousElementDelete to avoid inconsistences
1110 myPreviousElementDelete = nullptr;
1112 myHeaderLeftFrame->show();
1113 myBackButton->show();
1114 }
1115}
1116
1117
1118void
1119GNEInspectorFrame::inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked) {
1120 myPreviousElementDelete = previousElement;
1121 myPreviousElementDeleteWasMarked = previousElementWasMarked;
1122 // Show back button if myPreviousElementDelete is valid
1123 if (myPreviousElementDelete != nullptr) {
1124 // disable myPreviousElementInspect to avoid inconsistences
1125 myPreviousElementInspect = nullptr;
1127 myHeaderLeftFrame->show();
1128 myBackButton->show();
1129 }
1130}
1131
1132
1133void
1135 // Only remove if there is inspected ACs
1138 // Inspect empty selection (to hide all Editors)
1140 }
1141}
1142
1143
1148
1149
1154
1155
1160
1161
1166
1167
1172
1173
1174long
1175GNEInspectorFrame::onCmdGoBack(FXObject*, FXSelector, void*) {
1176 // Inspect previous element or go back to Delete Frame
1179 myPreviousElementInspect = nullptr;
1180 } else if (myPreviousElementDelete != nullptr) {
1181 myPreviousElementDelete = nullptr;
1182 // Hide inspect frame and show delete frame
1183 hide();
1185 }
1186 return 1;
1187}
1188
1189
1190void
1192 // refresh Attribute Editor
1194 // refresh parametersEditor
1196 // refresh AC Hierarchy
1198}
1199
1200
1201void
1204 // update view (due dotted contour)
1206}
1207
1208
1209void
1211 // get front unlocked AC
1212 const auto AC = viewObjects.getAttributeCarrierFront();
1213 // check if selection is blocked
1214 if (AC) {
1215 // inspect front element
1217 // show Overlapped Inspection module
1218 myOverlappedInspection->showOverlappedInspection(viewObjects, clickedPosition);
1219 }
1220}
1221
1222
1223void
1229
1230
1231
1232/****************************************************************************/
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)
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
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
GNEViewNet * getViewNet() const
get view net
Definition GNEFrame.cpp:150
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 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:125
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
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
GNEViewParent * getViewParent() const
get the net object
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
void setInspectedAttributeCarriers(const std::vector< GNEAttributeCarrier * > ACs)
set inspected attributeCarrier
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...
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