-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMaterial.h
executable file
·63 lines (49 loc) · 1.19 KB
/
Material.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* Material.h
*
*
* Created by House on 9/8/08.
* Copyright 2008 Clemson University. All rights reserved.
*
*/
#ifndef _MATERIAL_H_
#define _MATERIAL_H_
#include "Color.h"
#include "Pixmap.h"
#include <cstring>
//
// Basic structure for storing the shading information about a surface
//
struct Material{
char *name;
Color a;
Color d;
Color s;
double exp;
double alpha;
Color t;
double n;
int illum_model;
Pixmap *amap;
Pixmap *dmap;
Pixmap *smap;
Material(char *mname = NULL);
Material(const Color &ambient, const Color &diffuse, const Color &specular,
double spexp);
~Material(){};
void setName(char *mname);
bool isNamed(char *mname);
void setProperties(const Color &ambient, const Color &diffuse, const Color &specular,
double spexp);
void setProperties(double ambient, double diffuse, double specular,
double spexp);
void setK(int ktype, const Color &c);
void setTransmission(const Color &c);
void setExp(double spexp);
void setAlpha(double alfa);
void setIOR(double ior);
void setIllum(int i);
void setMap(int mtype, Pixmap *p);
friend ostream& operator<< (ostream& os, const Material& m);
};
#endif