Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEMoveFrame.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-2023 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>
29
30// ===========================================================================
31// FOX callback mapping
32// ===========================================================================
33
39
44
49
50
51// Object implementation
52FXIMPLEMENT(GNEMoveFrame::ChangeZInSelection, MFXGroupBoxModule, ChangeZInSelectionMap, ARRAYNUMBER(ChangeZInSelectionMap))
53FXIMPLEMENT(GNEMoveFrame::ShiftEdgeSelectedGeometry, MFXGroupBoxModule, ShiftEdgeGeometryMap, ARRAYNUMBER(ShiftEdgeGeometryMap))
54FXIMPLEMENT(GNEMoveFrame::ShiftShapeGeometry, MFXGroupBoxModule, ShiftShapeGeometryMap, ARRAYNUMBER(ShiftShapeGeometryMap))
55
56// ===========================================================================
57// method definitions
58// ===========================================================================
59
60// ---------------------------------------------------------------------------
61// GNEMoveFrame::CommonModeOptions - methods
62// ---------------------------------------------------------------------------
63
65 MFXGroupBoxModule(moveFrameParent, TL("Common move options")) {
66 // Create checkbox for enable/disable allow change lanes
67 myAllowChangeLanes = new FXCheckButton(getCollapsableFrame(), TL("Allow change lanes"), this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
68 myAllowChangeLanes->setCheck(FALSE);
69 // Create checkbox for enable/disable merge geometry points
70 myMergeGeometryPoints = new FXCheckButton(getCollapsableFrame(), TL("Merge geometry points"), this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
71 myMergeGeometryPoints->setCheck(TRUE);
72}
73
74
76
77
78bool
80 return (myAllowChangeLanes->getCheck() == TRUE);
81}
82
83
84bool
86 return (myMergeGeometryPoints->getCheck() == TRUE);
87}
88
89// ---------------------------------------------------------------------------
90// GNEMoveFrame::NetworkModeOptions - methods
91// ---------------------------------------------------------------------------
92
94 MFXGroupBoxModule(moveFrameParent, TL("Network move options")),
95 myMoveFrameParent(moveFrameParent) {
96 // Create checkbox for enable/disable move whole polygons
97 myMoveWholePolygons = new FXCheckButton(getCollapsableFrame(), TL("Move whole polygons"), this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
98 myMoveWholePolygons->setCheck(FALSE);
99}
100
101
103
104
105void
110
111
112void
116
117
118bool
120 if (myMoveFrameParent->getViewNet()->getEditModes().isCurrentSupermodeNetwork() &&
121 (myMoveFrameParent->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_MOVE)) {
122 return (myMoveWholePolygons->getCheck() == TRUE);
123 } else {
124 return false;
125 }
126}
127
128// ---------------------------------------------------------------------------
129// GNEMoveFrame::DemandModeOptions - methods
130// ---------------------------------------------------------------------------
131
133 MFXGroupBoxModule(moveFrameParent, TL("Demand move options")),
134 myMoveFrameParent(moveFrameParent) {
135 // Create checkbox for enable/disable move whole polygons
136 myLeaveStopPersonsConnected = new FXCheckButton(getCollapsableFrame(), TL("Leave stopPersons connected"), this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
137 myLeaveStopPersonsConnected->setCheck(FALSE);
138}
139
140
142
143
144void
149
150
151void
155
156
157bool
159 if (myMoveFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand() &&
160 (myMoveFrameParent->getViewNet()->getEditModes().demandEditMode == DemandEditMode::DEMAND_MOVE)) {
161 return (myLeaveStopPersonsConnected->getCheck() == TRUE);
162 } else {
163 return false;
164 }
165}
166
167// ---------------------------------------------------------------------------
168// GNEMoveFrame::ShiftEdgeSelectedGeometry - methods
169// ---------------------------------------------------------------------------
170
172 MFXGroupBoxModule(moveFrameParent, TL("Shift selected edges geometry")),
173 myMoveFrameParent(moveFrameParent) {
174 // create horizontal frame
175 FXHorizontalFrame* myZValueFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
176 // create elements for Z value
177 new FXLabel(myZValueFrame, "Shift value", 0, GUIDesignLabelThickedFixed(100));
178 myShiftValueTextField = new FXTextField(myZValueFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldRestricted(TEXTFIELD_REAL));
179 myShiftValueTextField->setText("0");
180 // create apply button
181 myApplyZValue = new FXButton(getCollapsableFrame(), (TL("Apply shift value") + std::string("\t\t") + TL("Shift edge geometry orthogonally to driving direction for all selected edges")).c_str(),
183}
184
185
187
188
189void
191 // enable elements
192 myShiftValueTextField->enable();
193 myApplyZValue->enable();
194}
195
196
197void
199 // enable elements
200 myShiftValueTextField->disable();
201 myApplyZValue->disable();
202}
203
204
205long
207 // just call onCmdShiftEdgeGeometry
208 return onCmdShiftEdgeGeometry(nullptr, 0, nullptr);
209}
210
211
212long
214 // get undo-list
215 auto undoList = myMoveFrameParent->getViewNet()->getUndoList();
216 // get value
217 const double shiftValue = GNEAttributeCarrier::parse<double>(myShiftValueTextField->getText().text());
218 // get selected edges
219 const auto selectedEdges = myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
220 // begin undo-redo
221 myMoveFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::EDGE, "shift edge geometries");
222 // iterate over edges
223 for (const auto& edge : selectedEdges) {
224 // get edge geometry
225 PositionVector edgeShape = edge->getNBEdge()->getGeometry();
226 // shift edge geometry
227 edgeShape.move2side(shiftValue);
228 // get first and last position
229 const Position shapeStart = edgeShape.front();
230 const Position shapeEnd = edgeShape.back();
231 // set innen geometry
232 edgeShape.pop_front();
233 edgeShape.pop_back();
234 // set new shape again
235 if (edgeShape.size() > 0) {
236 edge->setAttribute(SUMO_ATTR_SHAPE, toString(edgeShape), undoList);
237 }
238 // set new start and end positions
239 edge->setAttribute(GNE_ATTR_SHAPE_START, toString(shapeStart), undoList);
240 edge->setAttribute(GNE_ATTR_SHAPE_END, toString(shapeEnd), undoList);
241 }
242 // end undo-redo
243 myMoveFrameParent->getViewNet()->getUndoList()->end();
244 return 1;
245}
246
247// ---------------------------------------------------------------------------
248// GNEMoveFrame::ChangeZInSelection - methods
249// ---------------------------------------------------------------------------
250
252 MFXGroupBoxModule(moveFrameParent, TL("Change Z in selection")),
253 myMoveFrameParent(moveFrameParent) {
254 // create horizontal frame
255 FXHorizontalFrame* myZValueFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
256 // create elements for Z value
257 new FXLabel(myZValueFrame, "Z value", 0, GUIDesignLabelThickedFixed(100));
258 myZValueTextField = new FXTextField(myZValueFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldRestricted(TEXTFIELD_REAL));
259 myZValueTextField->setText("0");
260 // Create all options buttons
261 myAbsoluteValue = new FXRadioButton(getCollapsableFrame(), (TL("Absolute value") + std::string("\t\t") + TL("Set Z value as absolute")).c_str(),
263 myRelativeValue = new FXRadioButton(getCollapsableFrame(), (TL("Relative value") + std::string("\t\t") + TL("Set Z value as relative")).c_str(),
265 // create apply button
266 myApplyButton = new FXButton(getCollapsableFrame(), (TL("Apply Z value") + std::string("\t\t") + TL("Apply Z value to all selected junctions")).c_str(),
268 // set absolute value as default
269 myAbsoluteValue->setCheck(true);
270 // set info label
272}
273
274
276
277
278void
280 // enable elements
281 myZValueTextField->enable();
282 myAbsoluteValue->enable();
283 myRelativeValue->enable();
284 myApplyButton->enable();
285 // update info label
286 updateInfoLabel();
287}
288
289
290void
292 // disable elements
293 myZValueTextField->disable();
294 myAbsoluteValue->disable();
295 myRelativeValue->disable();
296 myApplyButton->disable();
297}
298
299
300long
301GNEMoveFrame::ChangeZInSelection::onCmdChangeZValue(FXObject* /*obj*/, FXSelector /*sel*/, void*) {
302 return 1;
303}
304
305
306long
307GNEMoveFrame::ChangeZInSelection::onCmdChangeZMode(FXObject* obj, FXSelector, void*) {
308 if (obj == myAbsoluteValue) {
309 myAbsoluteValue->setCheck(true);
310 myRelativeValue->setCheck(false);
311 } else {
312 myAbsoluteValue->setCheck(false);
313 myRelativeValue->setCheck(true);
314 }
315 return 1;
316}
317
318
319long
321 // get undo-list
322 auto undoList = myMoveFrameParent->getViewNet()->getUndoList();
323 // get value
324 const double zValue = GNEAttributeCarrier::parse<double>(myZValueTextField->getText().text());
325 // get junctions
326 const auto selectedJunctions = myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedJunctions();
327 // get selected edges
328 const auto selectedEdges = myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
329 // begin undo-redo
330 myMoveFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::MODEMOVE, "change Z values in selection");
331 // iterate over junctions
332 for (const auto& junction : selectedJunctions) {
333 if (junction->getNBNode()->hasCustomShape()) {
334 // get junction position
335 PositionVector junctionShape = junction->getNBNode()->getShape();
336 // modify z Value depending of absolute/relative
337 for (auto& shapePos : junctionShape) {
338 if (myAbsoluteValue->getCheck() == TRUE) {
339 shapePos.setz(zValue);
340 } else {
341 shapePos.add(Position(0, 0, zValue));
342 }
343 }
344 // set new position again
345 junction->setAttribute(SUMO_ATTR_SHAPE, toString(junctionShape), undoList);
346 }
347 // get junction position
348 Position junctionPos = junction->getNBNode()->getPosition();
349 // modify z Value depending of absolute/relative
350 if (myAbsoluteValue->getCheck() == TRUE) {
351 junctionPos.setz(zValue);
352 } else {
353 junctionPos.add(Position(0, 0, zValue));
354 }
355 // set new position again
356 junction->setAttribute(SUMO_ATTR_POSITION, toString(junctionPos), undoList);
357 }
358 // iterate over edges
359 for (const auto& edge : selectedEdges) {
360 // get edge geometry
361 PositionVector edgeShape = edge->getNBEdge()->getInnerGeometry();
362 // get first and last position
363 Position shapeStart = edge->getNBEdge()->getGeometry().front();
364 Position shapeEnd = edge->getNBEdge()->getGeometry().back();
365 // modify z Value depending of absolute/relative
366 for (auto& shapePos : edgeShape) {
367 if (myAbsoluteValue->getCheck() == TRUE) {
368 shapePos.setz(zValue);
369 } else {
370 shapePos.add(Position(0, 0, zValue));
371 }
372 }
373 // modify begin an end positions
374 if (myAbsoluteValue->getCheck() == TRUE) {
375 shapeStart.setz(zValue);
376 shapeEnd.setz(zValue);
377 } else {
378 shapeStart.add(Position(0, 0, zValue));
379 shapeEnd.add(Position(0, 0, zValue));
380 }
381 // set new shape again
382 if (edgeShape.size() > 0) {
383 edge->setAttribute(SUMO_ATTR_SHAPE, toString(edgeShape), undoList);
384 }
385 // set new start and end positions
386 if ((edge->getAttribute(GNE_ATTR_SHAPE_START).size() > 0) &&
387 (shapeStart.distanceSquaredTo2D(edge->getFromJunction()->getNBNode()->getPosition()) < 2)) {
388 edge->setAttribute(GNE_ATTR_SHAPE_START, toString(shapeStart), undoList);
389 }
390 if ((edge->getAttribute(GNE_ATTR_SHAPE_END).size() > 0) &&
391 (shapeEnd.distanceSquaredTo2D(edge->getToJunction()->getNBNode()->getPosition()) < 2)) {
392 edge->setAttribute(GNE_ATTR_SHAPE_END, toString(shapeEnd), undoList);
393 }
394 }
395 // end undo-redo
396 myMoveFrameParent->getViewNet()->getUndoList()->end();
397 // update info label
398 updateInfoLabel();
399 return 1;
400}
401
402
403void
405 // get junctions
406 const auto selectedJunctions = myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedJunctions();
407 // get selected edges
408 const auto selectedEdges = myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
409 // check if there is edges or junctions
410 if ((selectedJunctions.size() > 0) || (selectedEdges.size() > 0)) {
411 // declare minimum and maximun
412 double selectionMinimum = 0;
413 double selectionMaximun = 0;
414 // set first values
415 if (selectedJunctions.size() > 0) {
416 selectionMinimum = selectedJunctions.front()->getNBNode()->getPosition().z();
417 selectionMaximun = selectedJunctions.front()->getNBNode()->getPosition().z();
418 } else {
419 selectionMinimum = selectedEdges.front()->getNBEdge()->getGeometry().front().z();
420 selectionMaximun = selectedEdges.front()->getNBEdge()->getGeometry().front().z();
421 }
422 // declare average
423 double selectionAverage = 0;
424 // declare numPoints
425 int numPoints = 0;
426 // iterate over junctions
427 for (const auto& junction : selectedJunctions) {
428 // get z
429 const double z = junction->getNBNode()->getPosition().z();
430 // check min
431 if (z < selectionMinimum) {
432 selectionMinimum = z;
433 }
434 // check max
435 if (z > selectionMaximun) {
436 selectionMaximun = z;
437 }
438 // update average
439 selectionAverage += z;
440 // update numPoints
441 numPoints++;
442 }
443 // iterate over edges
444 for (const auto& edge : selectedEdges) {
445 // get innnen geometry
446 const PositionVector innenGeometry = edge->getNBEdge()->getInnerGeometry();
447 // iterate over innenGeometry
448 for (const auto& geometryPoint : innenGeometry) {
449 // check min
450 if (geometryPoint.z() < selectionMinimum) {
451 selectionMinimum = geometryPoint.z();
452 }
453 // check max
454 if (geometryPoint.z() > selectionMaximun) {
455 selectionMaximun = geometryPoint.z();
456 }
457 // update average
458 selectionAverage += geometryPoint.z();
459 // update numPoints
460 numPoints++;
461 }
462 // check shape start
463 if (edge->getAttribute(GNE_ATTR_SHAPE_START).size() > 0) {
464 // get z
465 const double z = edge->getNBEdge()->getGeometry().front().z();
466 // check min
467 if (z < selectionMinimum) {
468 selectionMinimum = z;
469 }
470 // check max
471 if (z > selectionMaximun) {
472 selectionMaximun = z;
473 }
474 // update average
475 selectionAverage += z;
476 // update numPoints
477 numPoints++;
478 }
479 // check shape end
480 if (edge->getAttribute(GNE_ATTR_SHAPE_END).size() > 0) {
481 // get z
482 const double z = edge->getNBEdge()->getGeometry().back().z();
483 // check min
484 if (z < selectionMinimum) {
485 selectionMinimum = z;
486 }
487 // check max
488 if (z > selectionMaximun) {
489 selectionMaximun = z;
490 }
491 // update average
492 selectionAverage += z;
493 // update numPoints
494 numPoints++;
495 }
496 }
497 // update average
498 selectionAverage = (100 * selectionAverage) / (double)numPoints;
499 // floor average
500 selectionAverage = floor(selectionAverage);
501 selectionAverage *= 0.01;
502 // set label string
503 const std::string labelStr =
504 "- Num geometry points: " + toString(numPoints) + "\n" +
505 "- Selection minimum Z: " + toString(selectionMinimum) + "\n" +
506 "- Selection maximum Z: " + toString(selectionMaximun) + "\n" +
507 "- Selection average Z: " + toString(selectionAverage);
508 // update info label
509 myInfoLabel->setText(labelStr.c_str());
510 }
511}
512
513// ---------------------------------------------------------------------------
514// GNEMoveFrame::ShiftShapeGeometry - methods
515// ---------------------------------------------------------------------------
516
518 MFXGroupBoxModule(moveFrameParent, TL("Shift shape geometry")),
519 myMoveFrameParent(moveFrameParent) {
520 // create horizontal frame
521 FXHorizontalFrame* horizontalFrameX = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
522 // create elements for Z value
523 new FXLabel(horizontalFrameX, "X value", 0, GUIDesignLabelThickedFixed(100));
524 myShiftValueXTextField = new FXTextField(horizontalFrameX, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldRestricted(TEXTFIELD_REAL));
525 myShiftValueXTextField->setText("0");
526 // create horizontal frame
527 FXHorizontalFrame* horizontalFrameY = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);
528 // create elements for Z value
529 new FXLabel(horizontalFrameY, "Y value", 0, GUIDesignLabelThickedFixed(100));
530 myShiftValueYTextField = new FXTextField(horizontalFrameY, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldRestricted(TEXTFIELD_REAL));
531 myShiftValueYTextField->setText("0");
532 // create apply button
533 new FXButton(this,
534 (TL("Shift shape geometry") + std::string("\t\t") + TL("Shift shape geometry orthogonally to driving direction for all selected shapes")).c_str(),
536}
537
538
540
541
542void
547
548
549void
554
555
556long
558 // just call onCmdShiftShapeGeometry
559 return onCmdShiftShapeGeometry(nullptr, 0, nullptr);
560}
561
562
563long
565 // get undo-list
566 auto undoList = myMoveFrameParent->getViewNet()->getUndoList();
567 // get values
568 const double shiftValueX = GNEAttributeCarrier::parse<double>(myShiftValueXTextField->getText().text());
569 const double shiftValueY = GNEAttributeCarrier::parse<double>(myShiftValueYTextField->getText().text());
570 const Position shiftValue(shiftValueX, shiftValueY);
571 // get selected polygons and POIs
572 const auto selectedShapes = myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedShapes();
573 std::vector<GNEAdditional*> polygons, POIs;
574 for (const auto& shape : selectedShapes) {
575 if (shape->getTagProperty().getTag() == SUMO_TAG_POLY) {
576 polygons.push_back(shape);
577 } else {
578 POIs.push_back(shape);
579 }
580 }
581 // begin undo-redo
582 myMoveFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::POLY, "shift shape geometries");
583 // iterate over shapes
584 for (const auto& polygon : polygons) {
585 // get shape geometry
586 PositionVector shape = GNEAttributeCarrier::parse<PositionVector>(polygon->getAttribute(SUMO_ATTR_SHAPE));
587 // shift shape geometry
588 shape.add(shiftValue);
589 // set new shape again
590 polygon->setAttribute(SUMO_ATTR_SHAPE, toString(shape), undoList);
591 }
592 // iterate over POIs
593 for (const auto& POI : POIs) {
594 // currently only for POIs (not for POILanes or POIGEOs
595 if (POI->getTagProperty().hasAttribute(SUMO_ATTR_POSITION)) {
596 // get shape geometry
597 Position position = GNEAttributeCarrier::parse<Position>(POI->getAttribute(SUMO_ATTR_POSITION));
598 // shift shape geometry
599 position.add(shiftValue);
600 // set new shape again
601 POI->setAttribute(SUMO_ATTR_POSITION, toString(position), undoList);
602 }
603 }
604 // end undo-redo
605 myMoveFrameParent->getViewNet()->getUndoList()->end();
606 return 1;
607}
608
609// ---------------------------------------------------------------------------
610// GNEMoveFrame::Information - methods
611// ---------------------------------------------------------------------------
612
614 MFXGroupBoxModule(moveFrameParent, TL("Information")) {
615 // create info label
616 new MFXDynamicLabel(getCollapsableFrame(), (std::string("- ") + TL("Click over edge to create or edit geometry point.") + std::string("\n- ") + TL("Shift+click over edge to edit start or end geometry point.")).c_str(), 0, GUIDesignLabelFrameInformation);
617 // create source label
618 FXLabel* sourceLabel = new FXLabel(getCollapsableFrame(), TL("-Move geometry point"), 0, GUIDesignLabel(JUSTIFY_LEFT));
619 sourceLabel->setBackColor(MFXUtils::getFXColor(RGBColor::ORANGE));
620 // create target label
621 FXLabel* targetLabel = new FXLabel(getCollapsableFrame(), TL("-Merge geometry point"), 0, GUIDesignLabel(JUSTIFY_LEFT));
622 targetLabel->setBackColor(MFXUtils::getFXColor(RGBColor::CYAN));
623}
624
625
627
628// ---------------------------------------------------------------------------
629// GNEMoveFrame - methods
630// ---------------------------------------------------------------------------
631
633 GNEFrame(viewParent, viewNet, "Move") {
634 // create common mode options
636 // create network mode options
638 // create demand mode options
640 // create shift edge geometry modul
642 // create change z selection
644 // create information label
645 myInformation = new Information(this);
646 // create shift shape geometry modul
648}
649
650
652
653
654void
655GNEMoveFrame::processClick(const Position& /*clickedPosition*/,
656 const GNEViewNetHelper::ObjectsUnderCursor& /*objectsUnderCursor*/,
657 const GNEViewNetHelper::ObjectsUnderCursor& /*objectsUnderGrippedCursor*/) {
658 // currently unused
659}
660
661
662void
664 // show network options frames
667 } else {
669 }
670 // show demand options frames
673 } else {
675 }
676 // get selected junctions
677 const auto selectedJunctions = myViewNet->getNet()->getAttributeCarriers()->getSelectedJunctions();
678 // get selected edges
679 const auto selectedEdges = myViewNet->getNet()->getAttributeCarriers()->getSelectedEdges();
680 // check if there are junctions and edge selected
681 if ((selectedJunctions.size() > 0) || (selectedEdges.size() > 0)) {
683 } else {
685 }
686 // check if there are edges selected
687 if (selectedEdges.size() > 0) {
689 } else {
691 }
692 // check if there are shapes selected
693 if (myViewNet->getNet()->getAttributeCarriers()->getSelectedShapes().size() > 0) {
695 } else {
697 }
698 // show
700 // recalc and update
701 recalc();
702 update();
703}
704
705
706void
708 // hide frame
710}
711
712
717
718
723
724
729
730/****************************************************************************/
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:907
@ MID_CHOOSEN_OPERATION
set type of selection
Definition GUIAppEnum.h:590
@ MID_GNE_APPLY
apply element
Definition GUIAppEnum.h:917
#define GUIDesignButton
Definition GUIDesigns.h:74
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition GUIDesigns.h:394
#define GUIDesignLabel(justify)
Definition GUIDesigns.h:238
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition GUIDesigns.h:66
#define GUIDesignCheckButton
checkButton placed in left position
Definition GUIDesigns.h:187
#define GUIDesignTextFieldRestricted(type)
text field extended over Frame with thick frame (int)
Definition GUIDesigns.h:54
#define GUIDesignRadioButton
Definition GUIDesigns.h:224
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
Definition GUIDesigns.h:247
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition GUIDesigns.h:274
#define TL(string)
Definition MsgHandler.h:287
@ 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
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
void updateInfoLabel()
FOX need this.
void disableChangeZInSelection()
disable change Z in selection
ChangeZInSelection(GNEMoveFrame *moveFrameParent)
FOX-declaration.
FXRadioButton * myRelativeValue
radio button for relative value
FXRadioButton * myAbsoluteValue
radio button for absolute value
long onCmdChangeZValue(FXObject *, FXSelector, void *)
FXButton * myApplyButton
apply button
void enableChangeZInSelection()
enabale change Z in selection
FXLabel * myInfoLabel
info label
long onCmdChangeZMode(FXObject *, FXSelector, void *)
Called when user changes Z mode.
FXTextField * myZValueTextField
textField for Z value
long onCmdApplyZ(FXObject *, FXSelector, void *)
Called when user press the apply Z value button.
bool getMergeGeometryPoints() const
check if merge geometry points
bool getAllowChangeLane() const
allow change lane
FXCheckButton * myLeaveStopPersonsConnected
checkbox for enable/disable leave stopPersons connected
bool getLeaveStopPersonsConnected() const
check if leave stopPersonConnected is enabled
DemandModeOptions(GNEMoveFrame *moveFrameParent)
constructor
void hideDemandModeOptions()
hide DemandModeOptions
void showDemandModeOptions()
show DemandModeOptions
Information(GNEMoveFrame *moveFrameParent)
constructor
void hideNetworkModeOptions()
hide NetworkModeOptions
FXCheckButton * myMoveWholePolygons
checkbox for enable/disable move whole polygons
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
void enableShiftEdgeGeometry()
enable shift edge geometry
void disableShiftEdgeGeometry()
disable change Z in selection
FXTextField * myShiftValueTextField
textField for shift value
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
long onCmdChangeShiftValue(FXObject *, FXSelector, void *)
FXTextField * myShiftValueXTextField
textField for shiftX value
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
void show()
show prohibition frame
ChangeZInSelection * myChangeZInSelection
modul for change Z in selection
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
NetworkModeOptions * getNetworkModeOptions() const
get network mode options
void hide()
hide prohibition frame
~GNEMoveFrame()
Destructor.
ShiftEdgeSelectedGeometry * myShiftEdgeSelectedGeometry
modul for shift edge selected geometry
GNEMoveFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
DemandModeOptions * getDemandModeOptions() const
get demand mode options
NetworkModeOptions * myNetworkModeOptions
modul for NetworkMode Options
Information * myInformation
modul for show information
CommonModeOptions * myCommonModeOptions
modul for CommonMode Options
ShiftShapeGeometry * myShiftShapeGeometry
modul for shift shape geometry
CommonModeOptions * getCommonModeOptions() const
get common mode options
std::vector< GNEAdditional * > getSelectedShapes() const
get selected shapes
std::vector< GNEJunction * > getSelectedJunctions() const
return selected junctions
std::vector< GNEEdge * > getSelectedEdges() const
return all edges
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:120
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
A single child window which contains a view of the simulation area.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
A list item which allows for custom coloring.
MFXGroupBoxModule (based on FXGroupBox)
FXVerticalFrame * getCollapsableFrame()
get collapsable frame (used by all elements that will be collapsed if button is toggled)
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition MFXUtils.cpp:112
C++ TraCI client API implementation.
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:259
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
static const RGBColor ORANGE
Definition RGBColor.h:191
static const RGBColor CYAN
Definition RGBColor.h:189
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network