Commit 2998a084 authored by Andrijana Brkic's avatar Andrijana Brkic

commiting after I have erased all the unnecesarry things

parent b5c868b8
......@@ -83,7 +83,7 @@ SubRoom::~SubRoom()
}
_obstacles.clear();
}
/*
void SubRoom::SetHelpVariables()
{
unsigned int i, j= _poly.size()-1;
......@@ -105,7 +105,7 @@ void SubRoom::SetHelpVariables()
j=i;
}
}
*/
void SubRoom::SetSubRoomID(int ID)
{
_id = ID;
......@@ -763,81 +763,6 @@ bool SubRoom::IsPartOfPolygon(const Point& ptw)
return true;
}
bool SubRoom::IsInsideOfPolygonSquare(const Point& ptw)
{
//works only for squares for now
double x1=_poly[0].GetX() ,x2;
double y1=_poly[0].GetY(), y2;
if(_poly[1].GetX() != x1 ) x2=_poly[1].GetX();
else x2=_poly[2].GetX();
if(_poly[1].GetY() != y1 ) y2=_poly[1].GetY();
else y2=_poly[2].GetY();
if( x1 > x2)
{
double temp=x1;
x1=x2;
x2=temp;
}
if( y1 > y2 )
{
double temp=y1;
y1=y2;
y2=temp;
}
if( ptw.GetX()>x1 && ptw.GetX()<x2 && ptw.GetY()>y1 && ptw.GetY()<y2 )
return true;
else
return false;
}
bool SubRoom::IsInsideOfPolygon(const Point& ptw)
{
int vector_size = (_poly).size();
double x = ptw.GetX(), y = ptw.GetY();
int i, j = vector_size-1;
bool result = false;
for ( i=0; i<vector_size; i++ )
{
if ( ( (_poly[i].GetY() < y && _poly[j].GetY()>=y)
|| (_poly[j].GetY()<y && _poly[i].GetY()>=y ) )
&& (_poly[i].GetX() <= x || _poly[j].GetX() <= x) )
{
result ^= (_poly[i].GetX() + ( y-_poly[i].GetY() )/( _poly[j].GetY()-_poly[i].GetY() )*(_poly[j].GetX() - _poly[i].GetX() )<x);
}
j=i;
}
return result;
}
bool SubRoom::IsInsideOfPolygonHelp(const Point& ptw)
{
int vector_size = (_poly).size();
double x = ptw.GetX(), y = ptw.GetY();
int i, j = vector_size-1;
bool result = false;
for ( i=0; i<vector_size; i++ )
{
if ( ( (_poly[i].GetY() < y && _poly[j].GetY()>=y)
|| (_poly[j].GetY()<y && _poly[i].GetY()>=y ) )
&& (_poly[i].GetX() <= x || _poly[j].GetX() <= x) )
{
result ^= ( _poly_help_constatnt[i] + _poly_help_multiple[i]*y < x );
}
j=i;
}
return result;
}
bool SubRoom::IsInObstacle(const Point& pt)
{
//write the obstacles
......
......@@ -99,7 +99,7 @@ public:
*/
virtual ~SubRoom();
void SetHelpVariables();
// void SetHelpVariables();
/**
* Set/Get the subroom id
......@@ -287,23 +287,6 @@ public:
*/
bool IsPartOfPolygon(const Point& pt);
/**
* @return true if the point is inside of the polygon.
*/
bool IsInsideOfPolygonSquare(const Point& ptw);
/**
* @return true if ptw is inside of the polygon (subroom)
*/
bool IsInsideOfPolygon(const Point& ptw);
/**
* @return true if ptw is inside of the polygon (subroom), but using help variables, need to SetHelpVariables beforehand
*/
bool IsInsideOfPolygonHelp(const Point& ptw);
/**
*
* @return true if the Point is inside any obstacle
......
This diff is collapsed.
......@@ -35,18 +35,6 @@
#include <memory>
#include <atomic>
//jaaa
/*
#include "boost/polygon/voronoi.hpp"
using boost::polygon::voronoi_builder;
using boost::polygon::voronoi_diagram;
using boost::polygon::x;
using boost::polygon::y;
using boost::polygon::low;
using boost::polygon::high;
#include "../geometry/SubRoom.h"
*/
//Forward declarations
class AgentsSource;
class Building;
......@@ -136,44 +124,8 @@ private:
*/
void ComputeBestPositionVoronoi(AgentsSource* src, Pedestrian* agent) const;
/*bool IsEnoughInSubroom( SubRoom* subroom, Point& pt ) const; */
/**
* Position incoming pedestrian using voronoi from boost library
* @param src
* @param ped
*/
/* void ComputeBestPositionVoronoiBoost(AgentsSource* src,Pedestrian* ped) const;*/
/**
* Position incoming pedestrian using voronoi from boost library
* @param src
* @param peds
*/
/*bool ComputeBestPositionVoronoiBoost(AgentsSource* src, std::vector<Pedestrian*>& peds) const;*/
void ComputeBestPositionDummy(AgentsSource* src, std::vector<Pedestrian*>& peds) const;
/**Position incoming pedestrian on the vertex with the greatest distance
*
*/
/*void VoronoiBestVertexMax (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor,
voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis ) const ; */
/**Position incoming pedestrian on the vertex with greater probability for greater distances
*
*/
/*void VoronoiBestVertexRandMax (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor,
voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis ) const ;*/
/**Position incoming pedestrian on a random vertex
*
*/
/*void VoronoiBestVertexRand (const std::vector<Point>& discrete_positions, const voronoi_diagram<double>& vd, SubRoom* subroom, double factor,
voronoi_diagram<double>::const_vertex_iterator& max_it, double& max_dis ) const ;*/
/* void VoronoiAdjustVelocityNeighbour( const voronoi_diagram<double>& vd, voronoi_diagram<double>::const_vertex_iterator& chosen_it,
Pedestrian* ped, const std::vector<Point>& velocities_vector ) const;*/
void ComputeBestPositionDummy(AgentsSource* src, std::vector<Pedestrian*>& peds) const;
/**
* Position incoming pedestrians randomly
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment