/****************************************************************************/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 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(GUIMainWindow& app, GUISUMOAbstractView& parent) override;101102/// @brief return exaggeration associated with this GLObject103double getExaggeration(const GUIVisualizationSettings& s) const override;104105/** @brief Returns the boundary to which the view shall be centered in order to show the object106*107* @return The boundary the object is within108* @see GUIGlObject::getCenteringBoundary109*/110Boundary getCenteringBoundary() const override;111112/** @brief Draws the object113* @param[in] s The settings for the current view (may influence drawing)114* @see GUIGlObject::drawGL115*/116void drawGL(const GUIVisualizationSettings& s) const override;117//@}118119120/// @brief Returns the detector itself121GUIE3Collector& getDetector();122123124protected:125/** @struct SingleCrossingDefinition126* @brief Representation of a single crossing point127*/128struct SingleCrossingDefinition {129/// @brief The position130Position myFGPosition;131/// @brief The rotation132double myFGRotation;133};134135protected:136/// @brief Builds the description about the position of the entry/exit point137SingleCrossingDefinition buildDefinition(const MSCrossSection& section);138139/// @brief Draws a single entry/exit point140void drawSingleCrossing(const Position& pos, double rot,141double upscale) const;142143private:144/// @brief The wrapped detector145GUIE3Collector& myDetector;146147/// @brief The detector's boundary148Boundary myBoundary;149150/// @brief Definition of a list of cross (entry/exit-point) positions151typedef std::vector<SingleCrossingDefinition> CrossingDefinitions;152153/// @brief The list of entry positions154CrossingDefinitions myEntryDefinitions;155156/// @brief The list of exit positions157CrossingDefinitions myExitDefinitions;158159};160161};162163164