//------------------------------------------------------------
// $Id: material.h,v 1.2 2000/06/14 13:29:37 yamauchi Exp $
//------------------------------------------------------------
//	material.h
//	material data 
//	1996/3/17 
//	(C) Copyright Hitoshi Yamauchi
//------------------------------------------------------------
#ifndef _material_h
#define _material_h 1

#include "Vector3.h"
#include "constants.h"

class materialClass {
private:
    
protected:
    char  	mName[MAX_MATERIAL_NAME_LEN]; // material name 
    
protected:
    Vector3 	mDiffRef;	// diffuse reflectance
    Vector3 	mDiffTrans;	// diffuse transmittance
    Vector3 	mDiffEmit;	// diffuse emittance
    double 	mSpecRefCosN;
    Vector3 	mSpecRef;	// specular reflectance
    double 	mSpecTransCosN;	// specular roughness (未使用) 0 で鏡面
    Vector3 	mSpecTrans;	// specular transmittance (透過率)
    double 	mIdxRefraction; // index of refraction (屈折率)
    // ies (配向データ)
    double      mFrustumHalfTopRad; // 二次光の frustum の 頂角の半分(radian)
    
public:
    materialClass(void);
    ~materialClass(void){}
    materialClass(const materialClass& aMaterial);
    const materialClass& operator=(const materialClass& aMaterial);
    friend ostream& operator<<(ostream& s, const materialClass& m);
    
    // set functions
    void setName(const char *name);
    void setDiffRef(const Vector3& aDiffRef)
    {
	this->mDiffRef = aDiffRef;
    }
    void setDiffTrans(const Vector3& aDiffTrans)
    {
	this->mDiffTrans = aDiffTrans;
    }
    void setDiffEmit(const Vector3& aDiffEmit)
    {
	this->mDiffEmit = aDiffEmit;
    }
    void setSpecRefCosN(double aSpecRefCosN)
    {
	this->mSpecRefCosN = aSpecRefCosN;
    }
    void setSpecRef(const Vector3& aSpecRef)
    {
	this->mSpecRef = aSpecRef;
    }
    void setSpecTransCosN(double aSpecTransCosN)
    {
	this->mSpecTransCosN = aSpecTransCosN;
    }
    void setSpecTrans(const Vector3& aSpecTrans)
    {
	this->mSpecTrans = aSpecTrans;
    }
    void setIdxRefraction(double aIdxRefraction)
    {
	this->mIdxRefraction = aIdxRefraction;
    }
    void setFrustumHalfTopRad(double aFrustumHalfTopRad)
    {
	this->mFrustumHalfTopRad = aFrustumHalfTopRad;
    }
    
    // get functions
    const char* getName(void) const 	
    {
	return(this->mName);		
    }
    Vector3 getDiffRef(void) const	
    {
	return(this->mDiffRef);	
    }
    Vector3 getDiffTrans(void) const	
    {
	return(this->mDiffTrans);	
    }
    Vector3 getDiffEmit(void) const	
    {
	return(this->mDiffEmit);	
    }
    double  getSpecRefCosN(void) const	
    {
	return(this->mSpecRefCosN);	
    }
    Vector3 getSpecRef(void) const	
    {
	return(this->mSpecRef);	
    }
    double  getSpecTransCosN(void) const
    {
	return(this->mSpecTransCosN);	
    }
    Vector3 getSpecTrans(void) const	
    {
	return(this->mSpecTrans);	
    }
    double  getIdxRefraction(void) const
    {
	return(this->mIdxRefraction);	
    }
    double  getFrustumHalfTopRad(void)const
    {
	return(this->mFrustumHalfTopRad);
    }
};

#endif				// #ifndef _material_h
