50 #ifndef MATERIAL_HH_INCLUDED 51 #define MATERIAL_HH_INCLUDED 53 #ifndef DOXY_IGNORE_THIS 92 map_Kd_is_set_ =
false;
95 bool is_valid(
void)
const 96 {
return Kd_is_set_ || Ka_is_set_ || Ks_is_set_ || Tr_is_set_; }
99 bool has_Kd(
void) {
return Kd_is_set_; }
102 bool has_Ka(
void) {
return Ka_is_set_; }
105 bool has_Ks(
void) {
return Ks_is_set_; }
108 bool has_Tr(
void) {
return Tr_is_set_; }
111 bool has_Texture()
const {
return map_Kd_is_set_; }
114 bool operator== (Material& _mat) {
115 if( _mat.Kd_ != Kd_ ||
119 _mat.map_Kd_ != map_Kd_ ||
120 _mat.index_Kd_ != index_Kd_ )
126 bool operator!= (Material& _mat) {
return !(*
this == _mat); }
129 int material_number()
const {
return localNum_; }
130 void material_number(
unsigned int _n) { localNum_ = _n; }
133 void set_Kd(
float r,
float g,
float b )
137 void set_Ka(
float r,
float g,
float b )
141 void set_Ks(
float r,
float g,
float b )
145 void set_Tr(
float t )
146 { Tr_=t; Tr_is_set_=
true; }
149 void set_map_Kd( std::string _name,
int _index_Kd )
150 { map_Kd_ = _name, index_Kd_ = _index_Kd; map_Kd_is_set_ =
true; };
162 float Tr(
void )
const {
return Tr_; }
165 const std::string& map_Kd(
void ) {
return map_Kd_ ; }
168 const int& map_Kd_index(
void ) {
return index_Kd_ ; }
172 unsigned int localNum_;
176 float Tr_;
bool Tr_is_set_;
178 std::string map_Kd_;
int index_Kd_;
bool map_Kd_is_set_;
182 operator<< (std::ostream& _os,
const Material& _mat) {
183 _os <<
"mat" << std::setfill(
'0') << std::setw(3) << _mat.material_number();
188 typedef std::map<std::string, Material> MaterialList;
192 #endif // MATERIAL_HH_INCLUDED
VectorT< float, 3 > Vec3f