1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : Material_Model.h
21 // Author : Margarita KARPUNINA, Open CASCADE S.A.S. (margarita.karpunina@opencascade.com)
23 #ifndef MATERIAL_MODEL_H
24 #define MATERIAL_MODEL_H
32 class Graphic3d_MaterialAspect;
38 class MATERIAL_SALOME_EXPORT Material_Model
43 //! Enumeration of reflection types of material
47 Specular, //!< Specular
48 Emission //!< Emission
53 virtual ~Material_Model();
55 static Material_Model* getMaterialModel( QStringList );
57 QString getMaterialProperty();
59 Graphic3d_MaterialAspect getMaterialOCCAspect();
60 vtkProperty* getMaterialVTKProperty();
63 void fromResources( QtxResourceMgr*, const QString& = QString(), bool theIsFront = true );
64 void save( QtxResourceMgr* = 0, const QString& = QString(), bool theIsFront = true );
66 QtxResourceMgr* resourceMgr() const;
67 QString resourceSection( bool theIsFront ) const;
69 bool hasAmbientReflection();
70 bool hasDiffuseReflection();
71 bool hasSpecularReflection();
72 bool hasEmissionReflection();
74 QColor color( ReflectionType ) const;
75 void setColor( ReflectionType, const QColor& );
76 void setColor( QString,
79 void removeColor( ReflectionType );
81 double coefficient( ReflectionType ) const;
82 void setCoefficient( ReflectionType, double );
83 void setCoefficient( QString,
86 void removeCoefficient( ReflectionType );
88 double shininess() const;
89 void setShininess( double );
95 typedef QMap<ReflectionType, QColor> ColorMap;
96 typedef QMap<ReflectionType, double> CoefficientMap;
98 QtxResourceMgr* myResourceMgr;
99 QString myResourceSection;
102 CoefficientMap myCoefficients;
108 #endif // MATERIAL_MODEL_H