/*********************************************
*
* Cedric Pradalier
* DEA 2000/2001
* INRIA Rhones Alpes
* http://cedric.pradalier.free.fr/index.html
* mail : http://cedric.pradalier.free.fr/mail.html
*
* *******************************************/
#include "Balise.h"
#include <math.h>
#include "vector2.h"
#include "Segment.h"
#include <multimap.h>
#include <pair.h>
#include <vector.h>
Balise::Balise(double X,double Y,double Portee,double theta,int num_edges)
{
x = X;
y = Y;
visibility = new Polygon(X,Y,Portee,
theta-M_PI/2,theta+M_PI/2,num_edges);
}
Balise::Balise(double X,double Y,double Portee,
double alpha,double theta,int num_edges)
{
x = X;
y = Y;
visibility = new Polygon(X,Y,Portee,
theta-alpha/2,theta+alpha/2,num_edges);
}
void Balise::Read(FILE * fp)
{
fscanf(fp," %lf %lf \n",&x,&y);
// printf("Balise : read %f %f\n",x,y);
visibility->Read(fp);
}
Polygon* Balise::intersectWith(Polygon * P)
{
Polygon * R = visibility->Intersection(P);
delete visibility;
visibility = R;
return visibility;
}