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

#ifndef ____ESPACEVOXELSUC____
#define ____ESPACEVOXELSUC____

class MatriceD;
class Coord3DD;
class Vecte3DD;

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

class EspaceVoxelsUC {

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

  private :
    unsigned char *tp;

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

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

#endif
