Eclipse SUMO - Simulation of Urban MObility
GNEMoveFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2022 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 /****************************************************************************/
18 // The Widget for move elements
19 /****************************************************************************/
20 #include <config.h>
21 
23 #include <netedit/GNEViewNet.h>
24 #include <netedit/GNEUndoList.h>
25 #include <netedit/GNENet.h>
28 
29 // ===========================================================================
30 // FOX callback mapping
31 // ===========================================================================
32 
33 FXDEFMAP(GNEMoveFrame::ChangeZInSelection) ChangeZInSelectionMap[] = {
37 };
38 
42 };
43 
44 FXDEFMAP(GNEMoveFrame::ShiftShapeGeometry) ShiftShapeGeometryMap[] = {
47 };
48 
49 
50 // Object implementation
51 FXIMPLEMENT(GNEMoveFrame::ChangeZInSelection, FXGroupBoxModule, ChangeZInSelectionMap, ARRAYNUMBER(ChangeZInSelectionMap))
52 FXIMPLEMENT(GNEMoveFrame::ShiftEdgeSelectedGeometry, FXGroupBoxModule, ShiftEdgeGeometryMap, ARRAYNUMBER(ShiftEdgeGeometryMap))
53 FXIMPLEMENT(GNEMoveFrame::ShiftShapeGeometry, FXGroupBoxModule, ShiftShapeGeometryMap, ARRAYNUMBER(ShiftShapeGeometryMap))
54 
55 // ===========================================================================
56 // method definitions
57 // ===========================================================================
58 
59 // ---------------------------------------------------------------------------
60 // GNEMoveFrame::CommonModeOptions - methods
61 // ---------------------------------------------------------------------------
62 
64  FXGroupBoxModule(moveFrameParent->myContentFrame, "Common move options") {
65  // Create checkbox for enable/disable move whole polygons
66  myAllowChangeLanes = new FXCheckButton(getCollapsableFrame(), "Allow change Lane", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
67  myAllowChangeLanes->setCheck(FALSE);
68 }
69 
70 
72 
73 
74 bool
76  return (myAllowChangeLanes->getCheck() == TRUE);
77 }
78 
79 // ---------------------------------------------------------------------------
80 // GNEMoveFrame::NetworkModeOptions - methods
81 // ---------------------------------------------------------------------------
82 
84  FXGroupBoxModule(moveFrameParent->myContentFrame, "Network move options"),
85  myMoveFrameParent(moveFrameParent) {
86  // Create checkbox for enable/disable move whole polygons
87  myMoveWholePolygons = new FXCheckButton(getCollapsableFrame(), "Move whole polygons", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
88  myMoveWholePolygons->setCheck(FALSE);
89 }
90 
91 
93 
94 
95 void
97  recalc();
98  show();
99 }
100 
101 
102 void
104  hide();
105 }
106 
107 
108 bool
110  if (myMoveFrameParent->getViewNet()->getEditModes().isCurrentSupermodeNetwork() &&
111  (myMoveFrameParent->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_MOVE)) {
112  return (myMoveWholePolygons->getCheck() == TRUE);
113  } else {
114  return false;
115  }
116 }
117 
118 // ---------------------------------------------------------------------------
119 // GNEMoveFrame::DemandModeOptions - methods
120 // ---------------------------------------------------------------------------
121 
123  FXGroupBoxModule(moveFrameParent->myContentFrame, "Demand move options"),
124  myMoveFrameParent(moveFrameParent) {
125  // Create checkbox for enable/disable move whole polygons
126  myLeaveStopPersonsConnected = new FXCheckButton(getCollapsableFrame(), "Leave stopPersons connected", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
127  myLeaveStopPersonsConnected->setCheck(FALSE);
128 }
129 
130 
132 
133 
134 void
136  recalc();
137  show();
138 }
139 
140 
141 void
143  hide();
144 }
145 
146 
147 bool
149  if (myMoveFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand() &&
150  (myMoveFrameParent->getViewNet()->getEditModes().demandEditMode == DemandEditMode::DEMAND_MOVE)) {
151  return (myLeaveStopPersonsConnected->getCheck() == TRUE);
152  } else {
153  return false;
154  }
155 }
156 
157 // ---------------------------------------------------------------------------
158 // GNEMoveFrame::ShiftEdgeSelectedGeometry - methods
159 // ---------------------------------------------------------------------------
160 
162  FXGroupBoxModule(moveFrameParent->myContentFrame, "Shift selected edges geometry"),
163  myMoveFrameParent(moveFrameParent) {
164  // create horizontal frame
165  FXHorizontalFrame* myZValueFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
166  // create elements for Z value
167  new FXLabel(myZValueFrame, "Shift value", 0, GUIDesignLabelAttribute);
169  myShiftValueTextField->setText("0");
170  // create apply button
171  myApplyZValue = new FXButton(getCollapsableFrame(), "Apply shift value\t\tShift edge geometry orthogonally to driving direction for all selected edges",
173 }
174 
175 
177 
178 
179 void
181  // enable elements
182  myShiftValueTextField->enable();
183  myApplyZValue->enable();
184 }
185 
186 
187 void
189  // enable elements
190  myShiftValueTextField->disable();
191  myApplyZValue->disable();
192 }
193 
194 
195 long
197  // just call onCmdShiftEdgeGeometry
198  return onCmdShiftEdgeGeometry(nullptr, 0, nullptr);
199 }
200 
201 
202 long
204  // get undo-list
205  auto undoList = myMoveFrameParent->getViewNet()->getUndoList();
206  // get value
207  const double shiftValue = GNEAttributeCarrier::parse<double>(myShiftValueTextField->getText().text());
208  // get selected edges
209  const auto selectedEdges = myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
210  // begin undo-redo
211  myMoveFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::EDGE, "shift edge geometries");
212  // iterate over edges
213  for (const auto& edge : selectedEdges) {
214  // get edge geometry
215  PositionVector edgeShape = edge->getNBEdge()->getGeometry();
216  // shift edge geometry
217  edgeShape.move2side(shiftValue);
218  // get first and last position
219  const Position shapeStart = edgeShape.front();
220  const Position shapeEnd = edgeShape.back();
221  // set innen geometry
222  edgeShape.pop_front();
223  edgeShape.pop_back();
224  // set new shape again
225  if (edgeShape.size() > 0) {
226  edge->setAttribute(SUMO_ATTR_SHAPE, toString(edgeShape), undoList);
227  }
228  // set new start and end positions
229  edge->setAttribute(GNE_ATTR_SHAPE_START, toString(shapeStart), undoList);
230  edge->setAttribute(GNE_ATTR_SHAPE_END, toString(shapeEnd), undoList);
231  }
232  // end undo-redo
233  myMoveFrameParent->getViewNet()->getUndoList()->end();
234  return 1;
235 }
236 
237 // ---------------------------------------------------------------------------
238 // GNEMoveFrame::ChangeZInSelection - methods
239 // ---------------------------------------------------------------------------
240 
242  FXGroupBoxModule(moveFrameParent->myContentFrame, "Change Z in selection"),
243  myMoveFrameParent(moveFrameParent) {
244  // create horizontal frame
245  FXHorizontalFrame* myZValueFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
246  // create elements for Z value
247  new FXLabel(myZValueFrame, "Z value", 0, GUIDesignLabelAttribute);
249  myZValueTextField->setText("0");
250  // Create all options buttons
251  myAbsoluteValue = new FXRadioButton(getCollapsableFrame(), "Absolute value\t\tSet Z value as absolute",
253  myRelativeValue = new FXRadioButton(getCollapsableFrame(), "Relative value\t\tSet Z value as relative",
255  // create apply button
256  myApplyButton = new FXButton(getCollapsableFrame(), "Apply Z value\t\tApply Z value to all selected junctions",
258  // set absolute value as default
259  myAbsoluteValue->setCheck(true);
260  // set info label
261  myInfoLabel = new FXLabel(getCollapsableFrame(), "", nullptr, GUIDesignLabelFrameInformation);
262 }
263 
264 
266 
267 
268 void
270  // enable elements
271  myZValueTextField->enable();
272  myAbsoluteValue->enable();
273  myRelativeValue->enable();
274  myApplyButton->enable();
275  // update info label
276  updateInfoLabel();
277 }
278 
279 
280 void
282  // disable elements
283  myZValueTextField->disable();
284  myAbsoluteValue->disable();
285  myRelativeValue->disable();
286  myApplyButton->disable();
287 }
288 
289 
290 long
292  // just call onCmdApplyZ
293  return onCmdApplyZ(nullptr, 0, nullptr);
294 }
295 
296 
297 long
298 GNEMoveFrame::ChangeZInSelection::onCmdChangeZMode(FXObject* obj, FXSelector, void*) {
299  if (obj == myAbsoluteValue) {
300  myAbsoluteValue->setCheck(true);
301  myRelativeValue->setCheck(false);
302  } else {
303  myAbsoluteValue->setCheck(false);
304  myRelativeValue->setCheck(true);
305  }
306  return 1;
307 }
308 
309 
310 long
311 GNEMoveFrame::ChangeZInSelection::onCmdApplyZ(FXObject*, FXSelector, void*) {
312  // get undo-list
313  auto undoList = myMoveFrameParent->getViewNet()->getUndoList();
314  // get value
315  const double zValue = GNEAttributeCarrier::parse<double>(myZValueTextField->getText().text());
316  // get junctions
317  const auto selectedJunctions = myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedJunctions();
318  // get selected edges
319  const auto selectedEdges = myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
320  // begin undo-redo
321  myMoveFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::MODEMOVE, "change Z values in selection");
322  // iterate over junctions
323  for (const auto& junction : selectedJunctions) {
324  if (junction->getNBNode()->hasCustomShape()) {
325  // get junction position
326  PositionVector junctionShape = junction->getNBNode()->getShape();
327  // modify z Value depending of absolute/relative
328  for (auto& shapePos : junctionShape) {
329  if (myAbsoluteValue->getCheck() == TRUE) {
330  shapePos.setz(zValue);
331  } else {
332  shapePos.add(Position(0, 0, zValue));
333  }
334  }
335  // set new position again
336  junction->setAttribute(SUMO_ATTR_SHAPE, toString(junctionShape), undoList);
337  }
338  // get junction position
339  Position junctionPos = junction->getNBNode()->getPosition();
340  // modify z Value depending of absolute/relative
341  if (myAbsoluteValue->getCheck() == TRUE) {
342  junctionPos.setz(zValue);
343  } else {
344  junctionPos.add(Position(0, 0, zValue));
345  }
346  // set new position again
347  junction->setAttribute(SUMO_ATTR_POSITION, toString(junctionPos), undoList);
348  }
349  // iterate over edges
350  for (const auto& edge : selectedEdges) {
351  // get edge geometry
352  PositionVector edgeShape = edge->getNBEdge()->getInnerGeometry();
353  // get first and last position
354  Position shapeStart = edge->getNBEdge()->getGeometry().front();
355  Position shapeEnd = edge->getNBEdge()->getGeometry().back();
356  // modify z Value depending of absolute/relative
357  for (auto& shapePos : edgeShape) {
358  if (myAbsoluteValue->getCheck() == TRUE) {
359  shapePos.setz(zValue);
360  } else {
361  shapePos.add(Position(0, 0, zValue));
362  }
363  }
364  // modify begin an end positions
365  if (myAbsoluteValue->getCheck() == TRUE) {
366  shapeStart.setz(zValue);
367  shapeEnd.setz(zValue);
368  } else {
369  shapeStart.add(Position(0, 0, zValue));
370  shapeEnd.add(Position(0, 0, zValue));
371  }
372  // set new shape again
373  if (edgeShape.size() > 0) {
374  edge->setAttribute(SUMO_ATTR_SHAPE, toString(edgeShape), undoList);
375  }
376  // set new start and end positions
377  if ((edge->getAttribute(GNE_ATTR_SHAPE_START).size() > 0) &&
378  (shapeStart.distanceSquaredTo2D(edge->getFromJunction()->getNBNode()->getPosition()) < 2)) {
379  edge->setAttribute(GNE_ATTR_SHAPE_START, toString(shapeStart), undoList);
380  }
381  if ((edge->getAttribute(GNE_ATTR_SHAPE_END).size() > 0) &&
382  (shapeEnd.distanceSquaredTo2D(edge->getToJunction()->getNBNode()->getPosition()) < 2)) {
383  edge->setAttribute(GNE_ATTR_SHAPE_END, toString(shapeEnd), undoList);
384  }
385  }
386  // end undo-redo
387  myMoveFrameParent->getViewNet()->getUndoList()->end();
388  // update info label
389  updateInfoLabel();
390  return 1;
391 }
392 
393 
394 void
396  // get junctions
397  const auto selectedJunctions = myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedJunctions();
398  // get selected edges
399  const auto selectedEdges = myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
400  // check if there is edges or junctions
401  if ((selectedJunctions.size() > 0) || (selectedEdges.size() > 0)) {
402  // declare minimum and maximun
403  double selectionMinimum = 0;
404  double selectionMaximun = 0;
405  // set first values
406  if (selectedJunctions.size() > 0) {
407  selectionMinimum = selectedJunctions.front()->getNBNode()->getPosition().z();
408  selectionMaximun = selectedJunctions.front()->getNBNode()->getPosition().z();
409  } else {
410  selectionMinimum = selectedEdges.front()->getNBEdge()->getGeometry().front().z();
411  selectionMaximun = selectedEdges.front()->getNBEdge()->getGeometry().front().z();
412  }
413  // declare average
414  double selectionAverage = 0;
415  // declare numPoints
416  int numPoints = 0;
417  // iterate over junctions
418  for (const auto& junction : selectedJunctions) {
419  // get z
420  const double z = junction->getNBNode()->getPosition().z();
421  // check min
422  if (z < selectionMinimum) {
423  selectionMinimum = z;
424  }
425  // check max
426  if (z > selectionMaximun) {
427  selectionMaximun = z;
428  }
429  // update average
430  selectionAverage += z;
431  // update numPoints
432  numPoints++;
433  }
434  // iterate over edges
435  for (const auto& edge : selectedEdges) {
436  // get innnen geometry
437  const PositionVector innenGeometry = edge->getNBEdge()->getInnerGeometry();
438  // iterate over innenGeometry
439  for (const auto& geometryPoint : innenGeometry) {
440  // check min
441  if (geometryPoint.z() < selectionMinimum) {
442  selectionMinimum = geometryPoint.z();
443  }
444  // check max
445  if (geometryPoint.z() > selectionMaximun) {
446  selectionMaximun = geometryPoint.z();
447  }
448  // update average
449  selectionAverage += geometryPoint.z();
450  // update numPoints
451  numPoints++;
452  }
453  // check shape start
454  if (edge->getAttribute(GNE_ATTR_SHAPE_START).size() > 0) {
455  // get z
456  const double z = edge->getNBEdge()->getGeometry().front().z();
457  // check min
458  if (z < selectionMinimum) {
459  selectionMinimum = z;
460  }
461  // check max
462  if (z > selectionMaximun) {
463  selectionMaximun = z;
464  }
465  // update average
466  selectionAverage += z;
467  // update numPoints
468  numPoints++;
469  }
470  // check shape end
471  if (edge->getAttribute(GNE_ATTR_SHAPE_END).size() > 0) {
472  // get z
473  const double z = edge->getNBEdge()->getGeometry().back().z();
474  // check min
475  if (z < selectionMinimum) {
476  selectionMinimum = z;
477  }
478  // check max
479  if (z > selectionMaximun) {
480  selectionMaximun = z;
481  }
482  // update average
483  selectionAverage += z;
484  // update numPoints
485  numPoints++;
486  }
487  }
488  // update average
489  selectionAverage = (100 * selectionAverage) / (double)numPoints;
490  // floor average
491  selectionAverage = floor(selectionAverage);
492  selectionAverage *= 0.01;
493  // set label string
494  const std::string labelStr =
495  "- Num geometry points: " + toString(numPoints) + "\n" +
496  "- Selection minimum Z: " + toString(selectionMinimum) + "\n" +
497  "- Selection maximum Z: " + toString(selectionMaximun) + "\n" +
498  "- Selection average Z: " + toString(selectionAverage);
499  // update info label
500  myInfoLabel->setText(labelStr.c_str());
501  }
502 }
503 
504 // ---------------------------------------------------------------------------
505 // GNEMoveFrame::ShiftShapeGeometry - methods
506 // ---------------------------------------------------------------------------
507 
509  FXGroupBoxModule(moveFrameParent->myContentFrame, "Shift shape geometry"),
510  myMoveFrameParent(moveFrameParent) {
511  // create horizontal frame
512  FXHorizontalFrame* horizontalFrameX = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
513  // create elements for Z value
514  new FXLabel(horizontalFrameX, "X value", 0, GUIDesignLabelAttribute);
516  myShiftValueXTextField->setText("0");
517  // create horizontal frame
518  FXHorizontalFrame* horizontalFrameY = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
519  // create elements for Z value
520  new FXLabel(horizontalFrameY, "Y value", 0, GUIDesignLabelAttribute);
522  myShiftValueYTextField->setText("0");
523  // create apply button
524  new FXButton(this,
525  "Shift shape geometry\t\tShift shape geometry orthogonally to driving direction for all selected shapes",
527 }
528 
529 
531 
532 
533 void
535  // show modul
536  show();
537 }
538 
539 
540 void
542  // hide modul
543  hide();
544 }
545 
546 
547 long
549  // just call onCmdShiftShapeGeometry
550  return onCmdShiftShapeGeometry(nullptr, 0, nullptr);
551 }
552 
553 
554 long
556  // get undo-list
557  auto undoList = myMoveFrameParent->getViewNet()->getUndoList();
558  // get values
559  const double shiftValueX = GNEAttributeCarrier::parse<double>(myShiftValueXTextField->getText().text());
560  const double shiftValueY = GNEAttributeCarrier::parse<double>(myShiftValueYTextField->getText().text());
561  const Position shiftValue(shiftValueX, shiftValueY);
562  // get selected polygons and POIs
563  const auto selectedShapes = myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedShapes();
564  std::vector<GNEShape*> polygons, POIs;
565  for (const auto& shape : selectedShapes) {
566  if (shape->getTagProperty().getTag() == SUMO_TAG_POLY) {
567  polygons.push_back(shape);
568  } else {
569  POIs.push_back(shape);
570  }
571  }
572 
573  // begin undo-redo
574  myMoveFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::POLY, "shift shape geometries");
575  // iterate over shapes
576  for (const auto& polygon : polygons) {
577  // get shape geometry
578  PositionVector shape = GNEAttributeCarrier::parse<PositionVector>(polygon->getAttribute(SUMO_ATTR_SHAPE));
579  // shift shape geometry
580  shape.add(shiftValue);
581  // set new shape again
582  polygon->setAttribute(SUMO_ATTR_SHAPE, toString(shape), undoList);
583  }
584  // iterate over POIs
585  for (const auto& POI : POIs) {
586  // currently only for POIs (not for POILanes or POIGEOs
587  if (POI->getTagProperty().hasAttribute(SUMO_ATTR_POSITION)) {
588  // get shape geometry
589  Position position = GNEAttributeCarrier::parse<Position>(POI->getAttribute(SUMO_ATTR_POSITION));
590  // shift shape geometry
591  position.add(shiftValue);
592  // set new shape again
593  POI->setAttribute(SUMO_ATTR_POSITION, toString(position), undoList);
594  }
595  }
596  // end undo-redo
597  myMoveFrameParent->getViewNet()->getUndoList()->end();
598  return 1;
599 }
600 
601 // ---------------------------------------------------------------------------
602 // GNEMoveFrame - methods
603 // ---------------------------------------------------------------------------
604 
605 GNEMoveFrame::GNEMoveFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) :
606  GNEFrame(horizontalFrameParent, viewNet, "Move") {
607  // create common mode options
609  // create network mode options
611  // create demand mode options
613  // create shift edge geometry modul
615  // create change z selection
617  // create shift shape geometry modul
619 }
620 
621 
623 
624 
625 void
626 GNEMoveFrame::processClick(const Position& /*clickedPosition*/,
627  const GNEViewNetHelper::ObjectsUnderCursor& /*objectsUnderCursor*/,
628  const GNEViewNetHelper::ObjectsUnderCursor& /*objectsUnderGrippedCursor*/) {
629  // currently unused
630 }
631 
632 
633 void
635  // show network options frames
638  } else {
640  }
641  // show demand options frames
644  } else {
646  }
647  // get selected junctions
648  const auto selectedJunctions = myViewNet->getNet()->getAttributeCarriers()->getSelectedJunctions();
649  // get selected edges
650  const auto selectedEdges = myViewNet->getNet()->getAttributeCarriers()->getSelectedEdges();
651  // check if there are junctions and edge selected
652  if ((selectedJunctions.size() > 0) || (selectedEdges.size() > 0)) {
654  } else {
656  }
657  // check if there are edges selected
658  if (selectedEdges.size() > 0) {
660  } else {
662  }
663  // check if there are shapes selected
664  if (myViewNet->getNet()->getAttributeCarriers()->getSelectedShapes().size() > 0) {
666  } else {
668  }
669  // show
670  GNEFrame::show();
671  // recalc and update
672  recalc();
673  update();
674 }
675 
676 
677 void
679  // hide frame
680  GNEFrame::hide();
681 }
682 
683 
686  return myCommonModeOptions;
687 }
688 
689 
692  return myNetworkModeOptions;
693 }
694 
695 
698  return myDemandModeOptions;
699 }
700 
701 /****************************************************************************/
FXDEFMAP(GNEMoveFrame::ChangeZInSelection) ChangeZInSelectionMap[]
@ NETWORK_MOVE
mode for moving network elements
@ DEMAND_MOVE
mode for moving demand elements
@ MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:797
@ MID_CHOOSEN_OPERATION
set type of selection
Definition: GUIAppEnum.h:551
@ MID_GNE_APPLY
aply element
Definition: GUIAppEnum.h:807
#define GUIDesignButton
Definition: GUIDesigns.h:68
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:343
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame
Definition: GUIDesigns.h:217
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:60
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:145
#define GUIDesignRadioButton
Definition: GUIDesigns.h:179
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame (real)
Definition: GUIDesigns.h:48
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:244
@ SUMO_TAG_POLY
begin/end of the description of a polygon
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ GNE_ATTR_SHAPE_END
last coordinate of edge shape
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
@ SUMO_ATTR_POSITION
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
FXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toogled)
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:114
FXVerticalFrame * myContentFrame
Vertical frame that holds all widgets of frame.
Definition: GNEFrame.h:117
virtual void show()
show Frame
Definition: GNEFrame.cpp:108
virtual void hide()
hide Frame
Definition: GNEFrame.cpp:117
void updateInfoLabel()
FOX need this.
void disableChangeZInSelection()
disable change Z in selection
ChangeZInSelection(GNEMoveFrame *moveFrameParent)
FOX-declaration.
FXRadioButton * myRelativeValue
radio button for relative value
Definition: GNEMoveFrame.h:218
FXRadioButton * myAbsoluteValue
radio button for absolute value
Definition: GNEMoveFrame.h:212
long onCmdChangeZValue(FXObject *, FXSelector, void *)
FXButton * myApplyButton
apply button
Definition: GNEMoveFrame.h:215
void enableChangeZInSelection()
enabale change Z in selection
FXLabel * myInfoLabel
info label
Definition: GNEMoveFrame.h:221
long onCmdChangeZMode(FXObject *, FXSelector, void *)
Called when user changes Z mode.
FXTextField * myZValueTextField
textField for Z value
Definition: GNEMoveFrame.h:209
long onCmdApplyZ(FXObject *, FXSelector, void *)
Called when user press the apply Z value button.
bool getAllowChangeLane() const
allow change lane
FXCheckButton * myLeaveStopPersonsConnected
checkbox for enable/disable leave stopPersons connected
Definition: GNEMoveFrame.h:114
bool getLeaveStopPersonsConnected() const
check if leave stopPersonConnected is enabled
DemandModeOptions(GNEMoveFrame *moveFrameParent)
constructor
void hideDemandModeOptions()
hide DemandModeOptions
void showDemandModeOptions()
show DemandModeOptions
void hideNetworkModeOptions()
hide NetworkModeOptions
FXCheckButton * myMoveWholePolygons
checkbox for enable/disable move whole polygons
Definition: GNEMoveFrame.h:84
void showNetworkModeOptions()
show NetworkModeOptions
NetworkModeOptions(GNEMoveFrame *moveFrameParent)
constructor
bool getMoveWholePolygons() const
move whole polygons
long onCmdChangeShiftValue(FXObject *, FXSelector, void *)
FXButton * myApplyZValue
button for apply Z value
Definition: GNEMoveFrame.h:160
void enableShiftEdgeGeometry()
enable shift edge geometry
void disableShiftEdgeGeometry()
disable change Z in selection
FXTextField * myShiftValueTextField
textField for shift value
Definition: GNEMoveFrame.h:157
ShiftEdgeSelectedGeometry(GNEMoveFrame *moveFrameParent)
FOX-declaration.
long onCmdShiftEdgeGeometry(FXObject *, FXSelector, void *)
Called when user press the apply Z value button.
void hideShiftShapeGeometry()
hide change Z in selection
FXTextField * myShiftValueYTextField
textField for shiftY value
Definition: GNEMoveFrame.h:267
long onCmdChangeShiftValue(FXObject *, FXSelector, void *)
FXTextField * myShiftValueXTextField
textField for shiftX value
Definition: GNEMoveFrame.h:264
ShiftShapeGeometry(GNEMoveFrame *moveFrameParent)
FOX-declaration.
long onCmdShiftShapeGeometry(FXObject *, FXSelector, void *)
Called when user press the apply Z value button.
void showShiftShapeGeometry()
show shift shape geometry
GNEMoveFrame(FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
Constructor.
void show()
show prohibition frame
ChangeZInSelection * myChangeZInSelection
modul for change Z in selection
Definition: GNEMoveFrame.h:317
void processClick(const Position &clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderCursor, const GNEViewNetHelper::ObjectsUnderCursor &objectsUnderGrippedCursor)
handle processClick and set the relative colouring
DemandModeOptions * myDemandModeOptions
modul for DemandMode Options
Definition: GNEMoveFrame.h:311
NetworkModeOptions * getNetworkModeOptions() const
get network mode options
void hide()
hide prohibition frame
~GNEMoveFrame()
Destructor.
ShiftEdgeSelectedGeometry * myShiftEdgeSelectedGeometry
modul for shift edge selected geometry
Definition: GNEMoveFrame.h:314
DemandModeOptions * getDemandModeOptions() const
get demand mode options
NetworkModeOptions * myNetworkModeOptions
modul for NetworkMode Options
Definition: GNEMoveFrame.h:308
CommonModeOptions * myCommonModeOptions
modul for CommonMode Options
Definition: GNEMoveFrame.h:305
ShiftShapeGeometry * myShiftShapeGeometry
modul for shift shape geometry
Definition: GNEMoveFrame.h:320
CommonModeOptions * getCommonModeOptions() const
get common mode options
std::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
std::vector< GNEShape * > getSelectedShapes()
get selected shapes
std::vector< GNEEdge * > getSelectedEdges() const
return all edges
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:125
class used to group all variables related with objects under cursor after a click over view
GNENet * getNet() const
get the net object
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:513
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
C++ TraCI client API implementation.
Definition: GUI.h:31
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
Definition: Position.h:257
void add(const Position &pos)
Adds the given position to this one.
Definition: Position.h:125
void setz(double z)
set position z
Definition: Position.h:80
A list of positions.
void add(double xoff, double yoff, double zoff)
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
void pop_front()
pop first Position
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network