gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
Material.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (c) 2017, Dr Franck P. Vidal (franck.p.vidal@fpvidal.net),
4 http://www.fpvidal.net/
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without modification,
8 are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11 this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14 this list of conditions and the following disclaimer in the documentation and/or
15 other materials provided with the distribution.
16 
17 3. Neither the name of the Bangor University nor the names of its contributors
18 may be used to endorse or promote products derived from this software without
19 specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 
32 */
33 
34 
35 #ifndef __Material_h
36 #define __Material_h
37 
38 
66 //******************************************************************************
67 // Include
68 //******************************************************************************
69 #ifndef GVXR_CONFIG_H
71 #endif
72 
73 
74 //******************************************************************************
75 // namespace
76 //******************************************************************************
77 namespace gVirtualXRay {
78 
79 
80 //==============================================================================
85 //==============================================================================
86 class Material
87 //------------------------------------------------------------------------------
88 {
89 //******************************************************************************
90 public:
91  //--------------------------------------------------------------------------
93  //--------------------------------------------------------------------------
94  Material();
95 
96 
97  //--------------------------------------------------------------------------
99  //--------------------------------------------------------------------------
100  Material(const Material& aMaterial);
101 
102 
103  //--------------------------------------------------------------------------
105  //--------------------------------------------------------------------------
106  ~Material();
107 
108 
109  //--------------------------------------------------------------------------
111  //--------------------------------------------------------------------------
112  Material& operator=(const Material& aMaterial);
113 
114 
115  //--------------------------------------------------------------------------
117 
123  //--------------------------------------------------------------------------
124  void setAmbientColour(float aRedChannel,
125  float aGreenChannel,
126  float aBlueChannel,
127  float aAlphaChannel);
128 
129 
130  //--------------------------------------------------------------------------
132 
138  //--------------------------------------------------------------------------
139  void setDiffuseColour(float aRedChannel,
140  float aGreenChannel,
141  float aBlueChannel,
142  float aAlphaChannel);
143 
144 
145  //--------------------------------------------------------------------------
147 
153  //--------------------------------------------------------------------------
154  void setSpecularColour(float aRedChannel,
155  float aGreenChannel,
156  float aBlueChannel,
157  float aAlphaChannel);
158 
159 
160  //--------------------------------------------------------------------------
162 
165  //--------------------------------------------------------------------------
166  void setShininess(float aShininessValue);
167 
168 
169  //--------------------------------------------------------------------------
171 
174  //--------------------------------------------------------------------------
175  const float* getAmbientColour() const;
176 
177 
178  //--------------------------------------------------------------------------
180 
183  //--------------------------------------------------------------------------
184  const float* getDiffuseColour() const;
185 
186 
187  //--------------------------------------------------------------------------
189 
192  //--------------------------------------------------------------------------
193  const float* getSpecularColour() const;
194 
195 
196  //--------------------------------------------------------------------------
198 
201  //--------------------------------------------------------------------------
202  float getShininess() const;
203 
204 
205 //******************************************************************************
206 protected:
209 
210 
213 
214 
217 
218 
220  float m_shininess;
221 };
222 
223 
224 } // namespace gVirtualXRay
225 
226 
227 //******************************************************************************
228 #include "Material.inl"
229 
230 
231 #endif // __Material_h
void setShininess(float aShininessValue)
Set the shininess of the material.
Definition: Material.inl:172
float m_shininess
Shininess.
Definition: Material.h:220
Material()
Default constructor.
Definition: Material.inl:68
void setDiffuseColour(float aRedChannel, float aGreenChannel, float aBlueChannel, float aAlphaChannel)
Set the diffuse colour.
Definition: Material.inl:143
Material & operator=(const Material &aMaterial)
Copy operator.
Definition: Material.inl:108
void setSpecularColour(float aRedChannel, float aGreenChannel, float aBlueChannel, float aAlphaChannel)
Set the specular colour.
Definition: Material.inl:158
float m_p_diffuse_colour[4]
Diffuse colour.
Definition: Material.h:212
float m_p_specular_colour[4]
Specular colour.
Definition: Material.h:216
void setAmbientColour(float aRedChannel, float aGreenChannel, float aBlueChannel, float aAlphaChannel)
Set the ambient colour.
Definition: Material.inl:129
float getShininess() const
Accessor on the shininess of the material.
Definition: Material.inl:203
const float * getDiffuseColour() const
Accessor on the diffuse colour.
Definition: Material.inl:187
Material is a class to handle materials.
Definition: Material.h:86
const float * getAmbientColour() const
Accessor on the ambient colour.
Definition: Material.inl:179
~Material()
Destructor.
Definition: Material.inl:101
Class to handle a material.
float m_p_ambient_colour[4]
Ambient colour.
Definition: Material.h:208
const float * getSpecularColour() const
Accessor on the specular colour.
Definition: Material.inl:195