129 if (
myMoveFrameParent->getViewNet()->getEditModes().isCurrentSupermodeNetwork() &&
140 if (
myMoveFrameParent->getViewNet()->getEditModes().isCurrentSupermodeNetwork() &&
151 if (
myMoveFrameParent->getViewNet()->getEditModes().isCurrentSupermodeNetwork() &&
198 if (
myMoveFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand() &&
258 const auto selectedEdges =
myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
262 for (
const auto& edge : selectedEdges) {
268 const Position shapeStart = edgeShape.front();
269 const Position shapeEnd = edgeShape.back();
272 edgeShape.pop_back();
274 if (edgeShape.size() > 0) {
365 const auto selectedJunctions =
myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedJunctions();
367 const auto selectedEdges =
myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
371 for (
const auto& junction : selectedJunctions) {
372 if (junction->getNBNode()->hasCustomShape()) {
376 for (
auto& shapePos : junctionShape) {
378 shapePos.setz(zValue);
380 shapePos.add(
Position(0, 0, zValue));
387 Position junctionPos = junction->getNBNode()->getPosition();
390 junctionPos.
setz(zValue);
398 for (
const auto& edge : selectedEdges) {
402 Position shapeStart = edge->getNBEdge()->getGeometry().front();
403 Position shapeEnd = edge->getNBEdge()->getGeometry().back();
405 for (
auto& shapePos : edgeShape) {
407 shapePos.setz(zValue);
409 shapePos.add(
Position(0, 0, zValue));
414 shapeStart.
setz(zValue);
415 shapeEnd.
setz(zValue);
421 if (edgeShape.size() > 0) {
426 (shapeStart.
distanceSquaredTo2D(edge->getFromJunction()->getNBNode()->getPosition()) < 2)) {
445 const auto selectedJunctions =
myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedJunctions();
447 const auto selectedEdges =
myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
449 if ((selectedJunctions.size() > 0) || (selectedEdges.size() > 0)) {
451 double selectionMinimum = 0;
452 double selectionMaximum = 0;
454 if (selectedJunctions.size() > 0) {
455 selectionMinimum = selectedJunctions.front()->getNBNode()->getPosition().z();
456 selectionMaximum = selectedJunctions.front()->getNBNode()->getPosition().z();
458 selectionMinimum = selectedEdges.front()->getNBEdge()->getGeometry().front().z();
459 selectionMaximum = selectedEdges.front()->getNBEdge()->getGeometry().front().z();
462 double selectionAverage = 0;
466 for (
const auto& junction : selectedJunctions) {
468 const double z = junction->getNBNode()->getPosition().z();
470 if (z < selectionMinimum) {
471 selectionMinimum = z;
474 if (z > selectionMaximum) {
475 selectionMaximum = z;
478 selectionAverage += z;
483 for (
const auto& edge : selectedEdges) {
485 const PositionVector innerGeometry = edge->getNBEdge()->getInnerGeometry();
487 for (
const auto& geometryPoint : innerGeometry) {
489 if (geometryPoint.z() < selectionMinimum) {
490 selectionMinimum = geometryPoint.z();
493 if (geometryPoint.z() > selectionMaximum) {
494 selectionMaximum = geometryPoint.z();
497 selectionAverage += geometryPoint.z();
504 const double z = edge->getNBEdge()->getGeometry().front().z();
506 if (z < selectionMinimum) {
507 selectionMinimum = z;
510 if (z > selectionMaximum) {
511 selectionMaximum = z;
514 selectionAverage += z;
521 const double z = edge->getNBEdge()->getGeometry().back().z();
523 if (z < selectionMinimum) {
524 selectionMinimum = z;
527 if (z > selectionMaximum) {
528 selectionMaximum = z;
531 selectionAverage += z;
537 selectionAverage = (100 * selectionAverage) / (
double)numPoints;
539 selectionAverage = floor(selectionAverage);
540 selectionAverage *= 0.01;
542 const std::string labelStr =
543 TL(
"- Num geometry points: ") +
toString(numPoints) +
"\n" +
544 TL(
"- Selection minimum Z: ") +
toString(selectionMinimum) +
"\n" +
545 TL(
"- Selection maximum Z: ") +
toString(selectionMaximum) +
"\n" +
546 TL(
"- Selection average Z: ") +
toString(selectionAverage);
573 TL(
"Shift shape geometry"),
"",
TL(
"Shift shape geometry orthogonally to driving direction for all selected shapes"),
609 const Position shiftValue(shiftValueX, shiftValueY);
611 const auto selectedShapes =
myMoveFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedShapes();
612 std::vector<GNEAdditional*> polygons, POIs;
613 for (
const auto& shape : selectedShapes) {
615 polygons.push_back(shape);
617 POIs.push_back(shape);
623 for (
const auto& polygon : polygons) {
627 shape.
add(shiftValue);
632 for (
const auto&
POI : POIs) {
638 position.
add(shiftValue);
655 std::string info = std::string(
"- ") +
TL(
"Click over edge to create or edit geometry point.") + std::string(
"\n") +
656 std::string(
"- ") +
TL(
"Shift+click over edge to edit start or end geometry point.");
700 if (
myViewNet->getEditModes().isCurrentSupermodeNetwork()) {
706 if (
myViewNet->getEditModes().isCurrentSupermodeDemand()) {
712 const auto selectedJunctions =
myViewNet->getNet()->getAttributeCarriers()->getSelectedJunctions();
714 const auto selectedEdges =
myViewNet->getNet()->getAttributeCarriers()->getSelectedEdges();
716 if ((selectedJunctions.size() > 0) || (selectedEdges.size() > 0)) {
722 if (selectedEdges.size() > 0) {
728 if (
myViewNet->getNet()->getAttributeCarriers()->getSelectedShapes().size() > 0) {
FXDEFMAP(GNEMoveFrame::NetworkMoveOptions) NetworkMoveOptionsMap[]
@ NETWORK_MOVE
mode for moving network elements
@ DEMAND_MOVE
mode for moving demand elements
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_CHOOSEN_OPERATION
set type of selection
@ MID_GNE_APPLY
apply element
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignTextFieldNCol
Num of column of text field.
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignTextFieldRestricted(type)
text field extended over Frame with thick frame (int)
#define GUIDesignRadioButton
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
@ 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
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
GNEViewNet * myViewNet
FOX need this.
virtual void show()
show Frame
virtual void hide()
hide Frame
GNEFrame(GNEViewParent *viewParent, GNEViewNet *viewNet, const std::string &frameLabel)
Constructor.
void updateInfoLabel()
FOX need this.
GNEMoveFrame * myMoveFrameParent
pointer to move frame parent
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
~ChangeZInSelection()
destructor
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.
FXCheckButton * myMergeGeometryPoints
checkbox for enable/disable merge geometry points
bool getMergeGeometryPoints() const
check if merge geometry points
bool getAllowChangeLane() const
allow change lane
~CommonMoveOptions()
destructor
CommonMoveOptions(GNEMoveFrame *moveFrameParent)
constructor
FXCheckButton * myAllowChangeLanes
checkbox for enable/disable change lanes
void hideDemandMoveOptions()
hide DemandMoveOptions
bool getLeaveStopPersonsConnected() const
check if leave stopPersonConnected is enabled
FXCheckButton * myLeaveStopPersonsConnected
checkbox for enable/disable leave stopPersons connected
~DemandMoveOptions()
destructor
DemandMoveOptions(GNEMoveFrame *moveFrameParent)
constructor
void showDemandMoveOptions()
show DemandMoveOptions
GNEMoveFrame * myMoveFrameParent
pointer to move frame parent
~NetworkMoveOptions()
destructor
bool getMoveWholePolygons() const
check if option "move whole polygons" is enabled
FXCheckButton * myMoveWholePolygons
checkbox for enable/disable move whole polygons
bool getForceDrawGeometryPoints() const
check if option "force draw geometry points" is enabled
GNEMoveFrame * myMoveFrameParent
FOX need this.
long onCmdChangeOption(FXObject *, FXSelector, void *)
bool getMoveOnlyJunctionCenter() const
check if option "move only junction center" is enabled
void showNetworkMoveOptions()
show NetworkMoveOptions
FXCheckButton * myMoveOnlyJunctionCenter
checkbox for move only juntion center
FXCheckButton * myForceDrawGeometryPoints
checkbox for force draw geometry points
void hideNetworkMoveOptions()
hide NetworkMoveOptions
NetworkMoveOptions(GNEMoveFrame *moveFrameParent)
FOX-declaration.
long onCmdChangeShiftValue(FXObject *, FXSelector, void *)
FXButton * myApplyZValue
button for apply Z value
void enableShiftEdgeGeometry()
enable shift edge geometry
GNEMoveFrame * myMoveFrameParent
FOX need this.
void disableShiftEdgeGeometry()
disable change Z in selection
FXTextField * myShiftValueTextField
textField for shift value
~ShiftEdgeSelectedGeometry()
destructor
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.
~ShiftShapeGeometry()
destructor
long onCmdShiftShapeGeometry(FXObject *, FXSelector, void *)
Called when user press the apply Z value button.
GNEMoveFrame * myMoveFrameParent
FOX need this.
void showShiftShapeGeometry()
show shift shape geometry
void show()
show prohibition frame
ChangeZInSelection * myChangeZInSelection
modul for change Z in selection
NetworkMoveOptions * myNetworkMoveOptions
modul for NetworkMove Options
DemandMoveOptions * getDemandMoveOptions() const
get demand mode options
DemandMoveOptions * myDemandMoveOptions
modul for DemandMove Options
CommonMoveOptions * getCommonMoveOptions() const
get common mode options
void hide()
hide prohibition frame
~GNEMoveFrame()
Destructor.
ShiftEdgeSelectedGeometry * myShiftEdgeSelectedGeometry
modul for shift edge selected geometry
GNEMoveFrame(GNEViewParent *viewParent, GNEViewNet *viewNet)
Constructor.
NetworkMoveOptions * getNetworkMoveOptions() const
get network mode options
CommonMoveOptions * myCommonMoveOptions
modul for CommonMove Options
Information * myInformation
modul for show information
ShiftShapeGeometry * myShiftShapeGeometry
modul for shift shape geometry
void processClick(const Position &clickedPosition, const GNEViewNetHelper::ViewObjectsSelector &viewObjects, const GNEViewNetHelper::ViewObjectsSelector &objectsUnderGrippedCursor)
handle processClick and set the relative coloring
class used to group all variables related with objects under cursor after a click over view
A single child window which contains a view of the simulation area.
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 FXRadioButton * buildFXRadioButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXObject *tgt, FXSelector sel, FXuint opts=RADIOBUTTON_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 radio button
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)
MFXGroupBoxModule(GNEFrame *frame, const std::string &text, const int options=Options::COLLAPSIBLE)
constructor for frames
C++ TraCI client API implementation.
A point in 2D or 3D with translation and scaling methods.
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
void add(const Position &pos)
Adds the given position to this one.
void setz(double z)
set position z
void add(double xoff, double yoff, double zoff)
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
void pop_front()
pop first Position