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

#ifndef ____ESPACEVOXELSUCRVBA____
#define ____ESPACEVOXELSUCRVBA____

class MatriceD;
class Coord3DD;
class Vecte3DD;

/**
 * \class EspaceVoxelsUCRVBA
 * 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 EspaceVoxelsUCRVBA {

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

  private :
    unsigned char *tp;

  public :
    EspaceVoxelsUCRVBA(int dx,int dy,int dz);
    EspaceVoxelsUCRVBA(char *filename);
    EspaceVoxelsUCRVBA(EspaceVoxelsUCRVBA *ev,int reduction);
    ~EspaceVoxelsUCRVBA(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);
    unsigned char *getArray(int div,int x,int y,int z);
	  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
