/**
 * \file EspaceVoxelsUS.h
 * Classe de gestion d'une matrice 3D d'unsigned short.
 * 
 * @author Nicolas Janey
 * @author nicolas.janey@univ-fcomte.fr
 * @version 1.0, 01/01/10
 */

#ifndef ____ESPACEVOXELSUS____
#define ____ESPACEVOXELSUS____

class MatriceD;
class Coord3DD;
class Vecte3DD;

/**
 * \class EspaceVoxelsUS
 * Classe de gestion d'une matrice 3D d'unsigned short.
 * 
 * @author Nicolas Janey
 * @author nicolas.janey@univ-fcomte.fr
 * @version 1.0, 01/01/10
 */

class EspaceVoxelsUS {

  public :
    int dx;
    int dy;
    int dz;
    unsigned short ***p;
    //long cpt;

  private :
    unsigned short *tp;

  public :
    EspaceVoxelsUS(int dx,int dy,int dz);
    EspaceVoxelsUS(char *filename);
    EspaceVoxelsUS(EspaceVoxelsUS *ev,int reduction);
    ~EspaceVoxelsUS(void);
    void allocation(int dx,int dy,int dz);
    void init(unsigned char v);
    void cherche(int x,int y,int z,unsigned short *c);
    unsigned short ***adresseTableau(void);
    unsigned short *adresse(int x,int y,int z);
    void sauve(unsigned short c,int x,int y,int z);
	  int sauvegardeFichier(const char *filename);
    unsigned short *getArray(void);
	  void traceLigne(float xi,float yi,float zi,float xf,float yf,float zf,unsigned short coul);
    void traceCylindre(float xi,float yi,float zi,float xf,float yf,float zf,float r,unsigned short coul);

  private :
    void cylindre(float xi,float yi,float zi,float xf,float yf,float zf,float r,double l,MatriceD *m,unsigned short coul);
    void pixelCylindre(int x,int y,int z,double r2,double l,MatriceD *m,unsigned short coul,int disc);
};

#endif
