Chemical Data Processing Library C++ API - Version 1.3.0
Material.hpp
Go to the documentation of this file.
1 /*
2  * Material.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_VIS_MATERIAL_HPP
30 #define CDPL_VIS_MATERIAL_HPP
31 
32 #include "CDPL/Vis/APIPrefix.hpp"
33 #include "CDPL/Vis/Color.hpp"
34 
35 
36 namespace CDPL
37 {
38 
39  namespace Vis
40  {
41 
56  {
57 
58  public:
68  Material(const Color& amb_color, double amb_factor, const Color& diff_color, const Color& spec_color, double shininess, double transp = 0.0);
69 
78  Material(double amb_factor, const Color& diff_color, const Color& spec_color, double shininess, double transp = 0.0);
79 
84  void setAmbientColor(const Color& color);
85 
90  const Color& getAmbientColor() const;
91 
96  void setAmbientFactor(double factor);
97 
102  double getAmbientFactor() const;
103 
108  void setDiffuseColor(const Color& color);
109 
114  const Color& getDiffuseColor() const;
115 
120  void setSpecularColor(const Color& color);
121 
126  const Color& getSpecularColor() const;
127 
132  void setShininess(double shininess);
133 
138  double getShininess() const;
139 
144  void setTransparency(double transp);
145 
150  double getTransparency() const;
151 
157  bool operator==(const Material& material) const;
158 
167  bool operator!=(const Material& material) const;
168 
169  private:
170  Color ambient;
171  double ambientFactor;
172  Color diffuse;
173  Color specular;
174  double shininess;
175  double transparency;
176  };
177  } // namespace Vis
178 } // namespace CDPL
179 
180 #endif // CDPL_VIS_MATERIAL_HPP
Definition of the class CDPL::Vis::Color.
Definition of the preprocessor macro CDPL_VIS_API.
#define CDPL_VIS_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Specifies a color in terms of its red, green and blue components and an alpha-channel for transparenc...
Definition: Color.hpp:52
Defines material properties of Vis::Object3D instances.
Definition: Material.hpp:56
double getShininess() const
Returns the shininess of the material.
Material(double amb_factor, const Color &diff_color, const Color &spec_color, double shininess, double transp=0.0)
Constructs an new Material instance with the specified properties.
const Color & getDiffuseColor() const
Returns the diffuse color component.
void setTransparency(double transp)
Sets the transparency of the material.
bool operator==(const Material &material) const
Equality comparison operator.
void setAmbientFactor(double factor)
Sets the scaling factor to use for calculating the ambient from the diffuse color component.
void setDiffuseColor(const Color &color)
Sets the diffuse color component.
bool operator!=(const Material &material) const
Inequality comparison operator.
double getAmbientFactor() const
Returns the scaling factor used for calculating the ambient from the diffuse color component.
const Color & getSpecularColor() const
Returns the specular color component.
void setSpecularColor(const Color &color)
Sets the specular color component.
double getTransparency() const
Returns the transparency of the material.
Material(const Color &amb_color, double amb_factor, const Color &diff_color, const Color &spec_color, double shininess, double transp=0.0)
Constructs an new Material instance with the specified properties.
void setShininess(double shininess)
Sets the shininess of the material.
const Color & getAmbientColor() const
Returns the ambient color component.
void setAmbientColor(const Color &color)
Sets the ambient color component.
The namespace of the Chemical Data Processing Library.