/****************************************************************************/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 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();5051/// @name inherited from GUIGlObject52//@{5354/** @brief Returns an own popup-menu55*56* @param[in] app The application needed to build the popup-menu57* @param[in] parent The parent window needed to build the popup-menu58* @return The built popup-menu59* @see GUIGlObject::getPopUpMenu60*/61GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) override;6263/** @brief Returns an own parameter window64*65* @param[in] app The application needed to build the parameter window66* @param[in] parent The parent window needed to build the parameter window67* @return The built parameter window68* @see GUIGlObject::getParameterWindow69*/70GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent) override;7172/// @brief return exaggeration associated with this GLObject73double getExaggeration(const GUIVisualizationSettings& s) const override;7475/** @brief Returns the boundary to which the view shall be centered in order to show the object76*77* @return The boundary the object is within78* @see GUIGlObject::getCenteringBoundary79*/80Boundary getCenteringBoundary() const override;8182/** @brief Draws the object83* @param[in] s The settings for the current view (may influence drawing)84* @see GUIGlObject::drawGL85*/86void drawGL(const GUIVisualizationSettings& s) const override;87//@}8889GUIManipulator* openManipulator(GUIMainWindow& app, GUISUMOAbstractView& parent);9091public:92class GUICalibratorPopupMenu : public GUIGLObjectPopupMenu {93FXDECLARE(GUICalibratorPopupMenu)94public:9596GUICalibratorPopupMenu(GUIMainWindow& app, GUISUMOAbstractView& parent, GUIGlObject* o);9798~GUICalibratorPopupMenu();99100/** @brief Called if the object's manipulator shall be shown */101long onCmdOpenManip(FXObject*, FXSelector, void*);102103protected:104GUICalibratorPopupMenu() { }105106};107108class GUIManip_Calibrator : public GUIManipulator {109FXDECLARE(GUIManip_Calibrator)110public:111enum {112MID_USER_DEF = FXDialogBox::ID_LAST,113MID_PRE_DEF,114MID_OPTION,115MID_CLOSE,116ID_LAST117};118/// Constructor119GUIManip_Calibrator(GUIMainWindow& app,120const std::string& name, GUICalibrator& o,121int xpos, int ypos);122123/// Destructor124virtual ~GUIManip_Calibrator();125126long onCmdOverride(FXObject*, FXSelector, void*);127long onCmdClose(FXObject*, FXSelector, void*);128long onCmdUserDef(FXObject*, FXSelector, void*);129long onUpdUserDef(FXObject*, FXSelector, void*);130long onCmdPreDef(FXObject*, FXSelector, void*);131long onUpdPreDef(FXObject*, FXSelector, void*);132long onCmdChangeOption(FXObject*, FXSelector, void*);133134private:135GUIMainWindow* myParent;136137FXint myChosenValue;138139FXDataTarget myChosenTarget;140141double mySpeed;142143FXDataTarget mySpeedTarget;144145FXRealSpinner* myUserDefinedSpeed;146147MFXComboBoxIcon* myPredefinedValues;148149GUICalibrator* myObject;150151protected:152GUIManip_Calibrator() { }153154};155156private:157/// Definition of a positions container158typedef std::vector<Position> PosCont;159160/// Definition of a rotation container161typedef std::vector<double> RotCont;162163/// @brief the calibrator being wrapped164MSCalibrator* myCalibrator;165166/// The positions in full-geometry mode167PosCont myFGPositions;168169/// The rotations in full-geometry mode170RotCont myFGRotations;171172/// The boundary of this rerouter173Boundary myBoundary;174175/// The information whether the speed shall be shown in m/s or km/h176bool myShowAsKMH;177178};179180181