/****************************************************************************/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 GUIE3Collector.h14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Michael Behrisch17/// @date Jan 200418///19// The gui-version of a MSE3Collector20/****************************************************************************/21#pragma once22#include <config.h>2324#include <string>25#include <vector>26#include "GUIDetectorWrapper.h"27#include <microsim/output/MSE3Collector.h>28#include <utils/geom/PositionVector.h>29#include <utils/common/ValueSource.h>303132// ===========================================================================33// class definitions34// ===========================================================================35/**36* @class GUIE3Collector37* @brief The gui-version of the MSE3Collector.38*39* Allows the building of a wrapper (also declared herein) which draws the40* detector on the gl-canvas.41*/42class GUIE3Collector : public MSE3Collector {43public:44/// @brief Constructor45GUIE3Collector(const std::string& id,46const CrossSectionVector& entries, const CrossSectionVector& exits,47double haltingSpeedThreshold,48SUMOTime haltingTimeThreshold,49const std::string name, const std::string& vTypes,50const std::string& nextEdges,51int detectPersons, bool openEntry, bool expectArrival);5253/// @brief Destructor54~GUIE3Collector();555657/** @brief Returns the list of entry points58* @return The list of entry points59*/60const CrossSectionVector& getEntries() const;616263/** @brief Returns the list of exit points64* @return The list of exit points65*/66const CrossSectionVector& getExits() const;676869/** @brief Returns the wrapper for this detector70* @return The wrapper representing the detector71* @see MyWrapper72*/73GUIDetectorWrapper* buildDetectorGUIRepresentation();747576public:77/**78* @class GUIE3Collector::MyWrapper79* A GUIE3Collector-visualiser80*/81class MyWrapper : public GUIDetectorWrapper {82public:83/// @brief Constructor84MyWrapper(GUIE3Collector& detector);8586/// @brief Destrutor87~MyWrapper();888990/// @name inherited from GUIGlObject91//@{9293/** @brief Returns an own parameter window94*95* @param[in] app The application needed to build the parameter window96* @param[in] parent The parent window needed to build the parameter window97* @return The built parameter window98* @see GUIGlObject::getParameterWindow99*/100GUIParameterTableWindow* getParameterWindow(101GUIMainWindow& app, GUISUMOAbstractView& parent);102103/// @brief return exaggeration associated with this GLObject104double getExaggeration(const GUIVisualizationSettings& s) const;105106/** @brief Returns the boundary to which the view shall be centered in order to show the object107*108* @return The boundary the object is within109* @see GUIGlObject::getCenteringBoundary110*/111Boundary getCenteringBoundary() const;112113/** @brief Draws the object114* @param[in] s The settings for the current view (may influence drawing)115* @see GUIGlObject::drawGL116*/117void drawGL(const GUIVisualizationSettings& s) const;118//@}119120121/// @brief Returns the detector itself122GUIE3Collector& getDetector();123124125protected:126/** @struct SingleCrossingDefinition127* @brief Representation of a single crossing point128*/129struct SingleCrossingDefinition {130/// @brief The position131Position myFGPosition;132/// @brief The rotation133double myFGRotation;134};135136protected:137/// @brief Builds the description about the position of the entry/exit point138SingleCrossingDefinition buildDefinition(const MSCrossSection& section);139140/// @brief Draws a single entry/exit point141void drawSingleCrossing(const Position& pos, double rot,142double upscale) const;143144private:145/// @brief The wrapped detector146GUIE3Collector& myDetector;147148/// @brief The detector's boundary149Boundary myBoundary;150151/// @brief Definition of a list of cross (entry/exit-point) positions152typedef std::vector<SingleCrossingDefinition> CrossingDefinitions;153154/// @brief The list of entry positions155CrossingDefinitions myEntryDefinitions;156157/// @brief The list of exit positions158CrossingDefinitions myExitDefinitions;159160};161162};163164165