Path: blob/main/src/netedit/frames/common/GNEMoveFrame.h
193833 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GNEMoveFrame.h14/// @author Pablo Alvarez Lopez15/// @date Jun 202016///17// The Widget for move elements18/****************************************************************************/19#pragma once20#include <config.h>2122#include <netedit/frames/GNEFrame.h>23#include <netedit/frames/common/GNEGroupBoxModule.h>2425// ===========================================================================26// class definitions27// ===========================================================================2829class GNEMoveFrame : public GNEFrame {3031public:32// ===========================================================================33// class CommonMoveOptions34// ===========================================================================3536class CommonMoveOptions : public GNEGroupBoxModule {3738public:39/// @brief constructor40CommonMoveOptions(GNEMoveFrame* moveFrameParent);4142/// @brief destructor43~CommonMoveOptions();4445/// @brief allow change lane46bool getAllowChangeLane() const;4748/// @brief check if merge geometry points49bool getMergeGeometryPoints() const;5051private:52/// @brief checkbox for enable/disable change lanes53FXCheckButton* myAllowChangeLanes;5455/// @brief checkbox for enable/disable merge geometry points56FXCheckButton* myMergeGeometryPoints;57};5859// ===========================================================================60// class NetworkMoveOptions61// ===========================================================================6263class NetworkMoveOptions : public GNEGroupBoxModule {64/// @brief FOX-declaration65FXDECLARE(GNEMoveFrame::NetworkMoveOptions)6667public:68/// @brief constructor69NetworkMoveOptions(GNEMoveFrame* moveFrameParent);7071/// @brief destructor72~NetworkMoveOptions();7374/// @brief show NetworkMoveOptions75void showNetworkMoveOptions();7677/// @brief hide NetworkMoveOptions78void hideNetworkMoveOptions();7980/// @brief check if option "move whole polygons" is enabled81bool getMoveWholePolygons() const;8283/// @brief check if option "force draw geometry points" is enabled84bool getForceDrawGeometryPoints() const;8586/// @brief check if option "move only junction center" is enabled87bool getMoveOnlyJunctionCenter() const;8889/// @name FOX-callbacks90/// @{91/// @brief Called after change option92long onCmdChangeOption(FXObject*, FXSelector, void*);9394/// @}9596protected:97/// @brief FOX need this98FOX_CONSTRUCTOR(NetworkMoveOptions)99100private:101/// @brief pointer to move frame parent102GNEMoveFrame* myMoveFrameParent;103104/// @brief checkbox for enable/disable move whole polygons105FXCheckButton* myMoveWholePolygons = nullptr;106107/// @brief checkbox for force draw geometry points108FXCheckButton* myForceDrawGeometryPoints = nullptr;109110/// @brief checkbox for move only juntion center111FXCheckButton* myMoveOnlyJunctionCenter = nullptr;112};113114// ===========================================================================115// class DemandMoveOptions116// ===========================================================================117118class DemandMoveOptions : public GNEGroupBoxModule {119120public:121/// @brief constructor122DemandMoveOptions(GNEMoveFrame* moveFrameParent);123124/// @brief destructor125~DemandMoveOptions();126127/// @brief show DemandMoveOptions128void showDemandMoveOptions();129130/// @brief hide DemandMoveOptions131void hideDemandMoveOptions();132133/// @brief check if leave stopPersonConnected is enabled134bool getLeaveStopPersonsConnected() const;135136private:137/// @brief pointer to move frame parent138GNEMoveFrame* myMoveFrameParent = nullptr;139140/// @brief checkbox for enable/disable leave stopPersons connected141FXCheckButton* myLeaveStopPersonsConnected = nullptr;142};143144// ===========================================================================145// class ShiftEdgeSelectedGeometry146// ===========================================================================147148class ShiftEdgeSelectedGeometry : public GNEGroupBoxModule {149/// @brief FOX-declaration150FXDECLARE(GNEMoveFrame::ShiftEdgeSelectedGeometry)151152public:153/// @brief constructor154ShiftEdgeSelectedGeometry(GNEMoveFrame* moveFrameParent);155156/// @brief destructor157~ShiftEdgeSelectedGeometry();158159/// @brief enable shift edge geometry160void enableShiftEdgeGeometry();161162/// @brief disable change Z in selection163void disableShiftEdgeGeometry();164165/// @name FOX-callbacks166/// @{167/// @brief Called when user changes Z value168long onCmdChangeShiftValue(FXObject*, FXSelector, void*);169170/// @brief Called when user press the apply Z value button171long onCmdShiftEdgeGeometry(FXObject*, FXSelector, void*);172173/// @}174175protected:176/// @brief FOX need this177FOX_CONSTRUCTOR(ShiftEdgeSelectedGeometry)178179private:180/// @brief pointer to move frame parent181GNEMoveFrame* myMoveFrameParent;182183/// @brief textField for shift value184FXTextField* myShiftValueTextField = nullptr;185186/// @brief button for apply Z value187FXButton* myApplyZValue = nullptr;188};189190// ===========================================================================191// class ChangeZInSelection192// ===========================================================================193194class ChangeZInSelection : public GNEGroupBoxModule {195/// @brief FOX-declaration196FXDECLARE(GNEMoveFrame::ChangeZInSelection)197198public:199/// @brief constructor200ChangeZInSelection(GNEMoveFrame* moveFrameParent);201202/// @brief destructor203~ChangeZInSelection();204205/// @brief enabale change Z in selection206void enableChangeZInSelection();207208/// @brief disable change Z in selection209void disableChangeZInSelection();210211/// @name FOX-callbacks212/// @{213/// @brief Called when user changes Z value214long onCmdChangeZValue(FXObject*, FXSelector, void*);215216/// @brief Called when user changes Z mode217long onCmdChangeZMode(FXObject*, FXSelector, void*);218219/// @brief Called when user press the apply Z value button220long onCmdApplyZ(FXObject*, FXSelector, void*);221222/// @}223224protected:225/// @brief FOX need this226FOX_CONSTRUCTOR(ChangeZInSelection)227228/// @brief update label229void updateInfoLabel();230231private:232/// @brief pointer to move frame parent233GNEMoveFrame* myMoveFrameParent;234235/// @brief textField for Z value236FXTextField* myZValueTextField = nullptr;237238/// @brief radio button for absolute value239FXRadioButton* myAbsoluteValue = nullptr;240241/// @brief apply button242FXButton* myApplyButton = nullptr;243244/// @brief radio button for relative value245FXRadioButton* myRelativeValue = nullptr;246247/// @brief info label248FXLabel* myInfoLabel = nullptr;249};250251// ===========================================================================252// class ShiftShapeGeometry253// ===========================================================================254255class ShiftShapeGeometry : public GNEGroupBoxModule {256/// @brief FOX-declaration257FXDECLARE(GNEMoveFrame::ShiftShapeGeometry)258259public:260/// @brief constructor261ShiftShapeGeometry(GNEMoveFrame* moveFrameParent);262263/// @brief destructor264~ShiftShapeGeometry();265266/// @brief show shift shape geometry267void showShiftShapeGeometry();268269/// @brief hide change Z in selection270void hideShiftShapeGeometry();271272/// @name FOX-callbacks273/// @{274/// @brief Called when user changes Z value275long onCmdChangeShiftValue(FXObject*, FXSelector, void*);276277/// @brief Called when user press the apply Z value button278long onCmdShiftShapeGeometry(FXObject*, FXSelector, void*);279280/// @}281282protected:283/// @brief FOX need this284FOX_CONSTRUCTOR(ShiftShapeGeometry)285286private:287/// @brief pointer to move frame parent288GNEMoveFrame* myMoveFrameParent;289290/// @brief textField for shiftX value291FXTextField* myShiftValueXTextField = nullptr;292293/// @brief textField for shiftY value294FXTextField* myShiftValueYTextField = nullptr;295};296297// ===========================================================================298// class Information299// ===========================================================================300301class Information : public GNEGroupBoxModule {302303public:304/// @brief constructor305Information(GNEMoveFrame* moveFrameParent);306307/// @brief destructor308~Information();309};310311/**@brief Constructor312* @brief viewParent GNEViewParent in which this GNEFrame is placed313* @brief viewNet viewNet that uses this GNEFrame314*/315GNEMoveFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);316317/// @brief Destructor318~GNEMoveFrame();319320/**@brief handle processClick and set the relative coloring321* @param[in] clickedPosition clicked position over ViewNet322* @param viewObjects collection of objects under cursor after click over view323* @param objectsUnderGrippedCursor collection of objects under gripped cursor after click over view324*/325void processClick(const Position& clickedPosition,326const GNEViewNetHelper::ViewObjectsSelector& viewObjects,327const GNEViewNetHelper::ViewObjectsSelector& objectsUnderGrippedCursor);328329/// @brief show prohibition frame330void show();331332/// @brief hide prohibition frame333void hide();334335/// @brief get common mode options336CommonMoveOptions* getCommonMoveOptions() const;337338/// @brief get network mode options339NetworkMoveOptions* getNetworkMoveOptions() const;340341/// @brief get demand mode options342DemandMoveOptions* getDemandMoveOptions() const;343344private:345/// @brief modul for CommonMove Options346CommonMoveOptions* myCommonMoveOptions = nullptr;347348/// @brief modul for NetworkMove Options349NetworkMoveOptions* myNetworkMoveOptions = nullptr;350351/// @brief modul for DemandMove Options352DemandMoveOptions* myDemandMoveOptions = nullptr;353354/// @brief modul for shift edge selected geometry355ShiftEdgeSelectedGeometry* myShiftEdgeSelectedGeometry = nullptr;356357/// @brief modul for change Z in selection358ChangeZInSelection* myChangeZInSelection = nullptr;359360/// @brief modul for show information361Information* myInformation = nullptr;362363/// @brief modul for shift shape geometry364ShiftShapeGeometry* myShiftShapeGeometry = nullptr;365};366367368