#ifndef BALISE_H
#define BALISE_H
/*********************************************
*
* Cedric Pradalier
* DEA 2000/2001
* INRIA Rhones Alpes
* http://cedric.pradalier.free.fr/index.html
* mail : http://cedric.pradalier.free.fr/mail.html
*
* *******************************************/
#include "Polygon.h"
// Représentation des balises (amers) utilisees pour la localisation
// du robot
class Balise : public Object
{
private :
double x;
double y;
// Polygone de visibilite de la balise
Polygon * visibility;
public :
Balise() {x=0;y=0;visibility=new Polygon();}
Balise(double X,double Y,Polygon * v) {x=X;y=Y;visibility=v;}
// Construit une balise de visibilite semi-circulaire
// correspondant a une orientation theta du capteur (laser)
Balise(double X,double Y,double Portee,double theta_rad,int num_edges);
// Construit une balise de visibilite alpha radians
// correspondant a une orientation theta du capteur (laser)
Balise(double X,double Y,double Portee,
double alpha_rad,double theta_rad,int num_edges);
// copie
Balise(const Balise & b)
{
x=b.x;y=b.y;
visibility=new Polygon(b.visibility);
}
virtual ~Balise() {delete visibility;}
virtual void Print() {printf("%f %f \n",x,y);visibility->Print();}
void PrintCoord() {printf("[%f;%f]",x,y);}
void Read(FILE * fp);
Polygon * getVisibility() {return visibility;}
double getX() {return x;}
double getY() {return y;}
// visibility = visibility inter P
Polygon* intersectWith(Polygon * P);
};
#endif // BALISE_H