Skip to content
Snippets Groups Projects
Select Git revision
  • c3ea25f3a2d93829c4075ed7213890d1567bde58
  • main default protected
  • 2.0.1 protected
  • 2.0.0 protected
  • 2.0.0a4 protected
  • 2.0.0a3 protected
  • 2.0.0a2 protected
  • 2.0.0a1 protected
  • 1.1.2 protected
  • 1.1.1 protected
  • 1.1.0 protected
  • 1.0.5 protected
  • 1.0.4 protected
  • 1.0.3 protected
  • 1.0.2 protected
  • 1.0.1 protected
  • 1.0.0 protected
  • 0.9.1 protected
  • 0.9.0 protected
19 results

_version.py

Blame
  • Goal.h 3.01 KiB
    /**
     * \file        Goal.h
     * \date        Sep 12, 2013
     * \version     v0.7
     * \copyright   <2009-2015> Forschungszentrum Jülich GmbH. All rights reserved.
     *
     * \section License
     * This file is part of JuPedSim.
     *
     * JuPedSim is free software: you can redistribute it and/or modify
     * it under the terms of the GNU Lesser General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * any later version.
     *
     * JuPedSim is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU Lesser General Public License
     * along with JuPedSim. If not, see <http://www.gnu.org/licenses/>.
     *
     * \section Description
     *
     *
     **/
     
    
    #ifndef GOAL_H_
    #define GOAL_H_
    
    #include <string>
    #include <vector>
    
    
    //forward declarations
    class Wall;
    class Point;
    
    
    class Goal {
    
    private:
         int _isFinalGoal;
         int _id;
         Point _centroid;
         std::string _caption;
         std::vector<Wall> _walls;
         std::vector<Point> _poly;
    
    public:
         Goal();
         virtual ~Goal();
    
         /**
          * Set/Get the obstacles' caption
          */
         std::string GetCaption() const;
    
         /**
          * Set/Get the obstacles' caption
          */
         void SetCaption(std::string caption);
    
         /**
          * Set/Get the id of the Goal
          */
         int GetId() const;
    
         /**
          * Set/Get the id of the Goal
          */
         void SetId(int id);
    
         /**
          * construct the Goal by adding more walls
          */
         void AddWall(const Wall& w);
    
         /**
          * @return All walls that constitute the Goal
          */
         const std::vector<Wall>& GetAllWalls() const;
    
         /**
          * @return true if the point p is contained within the Closed Goal
          */
         bool Contains(const Point& p) const;
    
         /**
          * Create the obstacles polygonal structure from the walls
          */
         bool ConvertLineToPoly();
    
         /**
          * @return the Goal as a polygon
          */
         const std::vector<Point>&  GetPolygon() const;
    
         /**
          * agents are remove from the simulation when they reached a final goal
          */
         int GetIsFinalGoal() const;
    
         /**
          * agents are remove from the simulation when they reached a final goal
          */
         void SetIsFinalGoal(int isFinalGoal);
    
         /**
          * @return the centroid of the subroom
          * @see http://en.wikipedia.org/wiki/Centroid
          */
         void ComputeControid() ;
    
         /**
          * @return the centroid of the goal
          * @see ComputeControid
          */
         const Point& GetCentroid() const;
    
         /**
          * @return a nicely formatted string representation of the Goal
          */
         std::string Write();
    
    private:
         int WhichQuad(const Point& vertex, const Point& hitPos) const;
    
         // x-Koordinate der Linie von einer Eccke zur nächsten
         double Xintercept(const Point& point1, const Point& point2,
                           double hitY) const;
    
    };
    
    #endif /* GOAL_H_ */