source: GTP/trunk/Lib/Vis/Preprocessing/src/Material.h @ 2575

Revision 2575, 1.3 KB checked in by bittner, 17 years ago (diff)

big merge: preparation for havran ray caster, check if everything works

Line 
1#ifndef __MATERIAL_H
2#define __MATERIAL_H
3
4namespace GtpVisibilityPreprocessor {
5
6
7class RgbColor
8{
9public:
10  float r, g, b;
11
12  RgbColor():r(0.5f),g(0.5f),b(0.5f)
13  {
14  }
15
16  RgbColor(const float _r,
17           const float _g,
18           const float _b):r(_r),g(_g),b(_b)
19  {
20  }
21
22  friend RgbColor
23  RandomColor(const float a=0.0f, const float b=1.0f);
24
25  // Mapping from interval 0.0-1.0 to RGB using "rainbow" color map
26  // (range of hue from 0-240)
27
28  friend RgbColor RainbowColorMapping(const float value);
29 
30};
31
32
33// Forward declarations
34RgbColor RandomColor(const float a, const float b);
35
36// Mapping from interval 0.0-1.0 to RGB using "rainbow" color map
37// (range of hue from 0-240)
38RgbColor RainbowColorMapping(const float value);
39
40 
41
42class Material
43{
44public:
45  RgbColor mDiffuseColor;
46  RgbColor mSpecularColor;
47  RgbColor mAmbientColor;
48 
49  Material(): mId(0)
50  {
51  }
52 
53  Material(const int id): mId(id)
54  {
55  }
56
57  Material(const RgbColor &color):mDiffuseColor(color),
58                                                                  mAmbientColor(color),
59                                                                  mSpecularColor(0,0,0), mId(0)
60  {
61  }
62 
63  friend Material RandomMaterial();
64 
65  /** Returns unique material id.
66  */
67  int GetId() const
68  {
69          return mId;
70  }
71
72protected:
73
74        // unique material id
75        int mId;
76};
77
78
79extern Material RandomMaterial();
80
81}
82
83#endif
Note: See TracBrowser for help on using the repository browser.