/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 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 GUICalibrator.h14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Michael Behrisch17/// @date Mon, 26.04.200418///19// Changes flow and speed on a set of lanes (gui version)20/****************************************************************************/21#pragma once22#include <config.h>2324#include <vector>25#include <string>26#include <microsim/trigger/MSCalibrator.h>27#include <utils/gui/globjects/GUIGlObject_AbstractAdd.h>28#include <utils/gui/globjects/GUIGLObjectPopupMenu.h>29#include <gui/GUIManipulator.h>303132// ===========================================================================33// class definitions34// ===========================================================================35/**36* @class GUICalibrator37* @brief Changes the speed allowed on a set of lanes (gui version)38*39* This is the gui-version of the MSCalibrator-object40*/41class GUICalibrator : public GUIGlObject_AbstractAdd {42public:43/** @brief Constructor44* @param[in] calibrator MSCalibrator or METriggeredCalibrator to be wrapped45*/46GUICalibrator(MSCalibrator* calibrator);4748/** destructor */49~GUICalibrator();50515253/// @name inherited from GUIGlObject54//@{5556/** @brief Returns an own popup-menu57*58* @param[in] app The application needed to build the popup-menu59* @param[in] parent The parent window needed to build the popup-menu60* @return The built popup-menu61* @see GUIGlObject::getPopUpMenu62*/63GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app,64GUISUMOAbstractView& parent);6566/** @brief Returns an own parameter window67*68* @param[in] app The application needed to build the parameter window69* @param[in] parent The parent window needed to build the parameter window70* @return The built parameter window71* @see GUIGlObject::getParameterWindow72*/73GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app,74GUISUMOAbstractView& parent);7576/// @brief return exaggeration associated with this GLObject77double getExaggeration(const GUIVisualizationSettings& s) const;7879/** @brief Returns the boundary to which the view shall be centered in order to show the object80*81* @return The boundary the object is within82* @see GUIGlObject::getCenteringBoundary83*/84Boundary getCenteringBoundary() const;8586/** @brief Draws the object87* @param[in] s The settings for the current view (may influence drawing)88* @see GUIGlObject::drawGL89*/90void drawGL(const GUIVisualizationSettings& s) const;91//@}92939495GUIManipulator* openManipulator(GUIMainWindow& app, GUISUMOAbstractView& parent);9697public:98class GUICalibratorPopupMenu : public GUIGLObjectPopupMenu {99FXDECLARE(GUICalibratorPopupMenu)100public:101102GUICalibratorPopupMenu(GUIMainWindow& app, GUISUMOAbstractView& parent, GUIGlObject* o);103104~GUICalibratorPopupMenu();105106/** @brief Called if the object's manipulator shall be shown */107long onCmdOpenManip(FXObject*, FXSelector, void*);108109protected:110GUICalibratorPopupMenu() { }111112};113114class GUIManip_Calibrator : public GUIManipulator {115FXDECLARE(GUIManip_Calibrator)116public:117enum {118MID_USER_DEF = FXDialogBox::ID_LAST,119MID_PRE_DEF,120MID_OPTION,121MID_CLOSE,122ID_LAST123};124/// Constructor125GUIManip_Calibrator(GUIMainWindow& app,126const std::string& name, GUICalibrator& o,127int xpos, int ypos);128129/// Destructor130virtual ~GUIManip_Calibrator();131132long onCmdOverride(FXObject*, FXSelector, void*);133long onCmdClose(FXObject*, FXSelector, void*);134long onCmdUserDef(FXObject*, FXSelector, void*);135long onUpdUserDef(FXObject*, FXSelector, void*);136long onCmdPreDef(FXObject*, FXSelector, void*);137long onUpdPreDef(FXObject*, FXSelector, void*);138long onCmdChangeOption(FXObject*, FXSelector, void*);139140private:141GUIMainWindow* myParent;142143FXint myChosenValue;144145FXDataTarget myChosenTarget;146147double mySpeed;148149FXDataTarget mySpeedTarget;150151FXRealSpinner* myUserDefinedSpeed;152153MFXComboBoxIcon* myPredefinedValues;154155GUICalibrator* myObject;156157protected:158GUIManip_Calibrator() { }159160};161162private:163/// Definition of a positions container164typedef std::vector<Position> PosCont;165166/// Definition of a rotation container167typedef std::vector<double> RotCont;168169/// @brief the calibrator being wrapped170MSCalibrator* myCalibrator;171172/// The positions in full-geometry mode173PosCont myFGPositions;174175/// The rotations in full-geometry mode176RotCont myFGRotations;177178/// The boundary of this rerouter179Boundary myBoundary;180181/// The information whether the speed shall be shown in m/s or km/h182bool myShowAsKMH;183184};185186187