#include <Material_Model.h>
Classes | |
| struct | ReflectionData |
Public Types | |
| enum | ReflectionType { Ambient, Diffuse, Specular, Emissive } |
| Reflection type. More... | |
Public Member Functions | |
| Material_Model () | |
| Constructor. More... | |
| virtual | ~Material_Model () |
| Destructor. More... | |
| void | fromProperties (const QString &) |
| Initialize material data from the given properties list. More... | |
| QString | toProperties () |
| Get material properties string representation. More... | |
| void | fromResources (const QString &=QString(), Material_ResourceMgr *=0) |
| Initialize material model from the resources. More... | |
| void | toResources (const QString &, Material_ResourceMgr *) |
| Save material properties to the resource file. More... | |
| bool | isPhysical () const |
| Get material type. More... | |
| void | setPhysical (bool) |
| Set material type. More... | |
| bool | hasReflection (ReflectionType) const |
| Check if given reflection is enabled. More... | |
| void | setReflection (ReflectionType, bool) |
| Enable/disable given reflection type. More... | |
| QColor | color (ReflectionType) const |
| Get color value for the given reflection type. More... | |
| void | setColor (ReflectionType, const QColor &) |
| Set color value for the given reflection type. More... | |
| double | reflection (ReflectionType, bool=true) const |
| Get coefficient value for the given reflection type. More... | |
| void | setReflection (ReflectionType, double, bool=true) |
| Set coefficient value for the given reflection type. More... | |
| double | shininess (bool=true) const |
| Get shininess value. More... | |
| void | setShininess (double, bool=true) |
| Set shininess value. More... | |
| double | transparency () const |
| Get transparency value. More... | |
| void | setTransparency (double) |
| Set transparency value. More... | |
| Graphic3d_MaterialAspect | getMaterialOCCAspect (bool=true) |
| Construct OCCT material aspect from material model. More... | |
| GEOM_VTKPropertyMaterial * | getMaterialVTKProperty (bool=true) |
| Construct VTK property from material model. More... | |
Private Types | |
| typedef QVector< ReflectionData > | ReflectionList |
Private Member Functions | |
| void | init () |
| Initialize material model with default values. More... | |
| void | read (const QString &, Material_ResourceMgr *) |
Private Attributes | |
| bool | myIsPhysical |
| double | myFrontShininess |
| double | myBackShininess |
| double | myTransparency |
| ReflectionList | myReflection |
|
private |
| Material_Model::Material_Model | ( | ) |
Create new SALOME material model with default properties.
References init(), and myReflection.
|
virtual |
| QColor Material_Model::color | ( | ReflectionType | type | ) | const |
| type | reflection type |
References myReflection.
| void Material_Model::fromProperties | ( | const QString & | props | ) |
| props | material properties |
References Ambient, Diffuse, Emissive, init(), setColor(), setPhysical(), setReflection(), setShininess(), setTransparency(), and Specular.
| void Material_Model::fromResources | ( | const QString & | material = QString(), |
| Material_ResourceMgr * | resMgr = 0 |
||
| ) |
This function can be used to retrieve material properties from the resource file.
| material | material name (if not specified, model is initialized by default material) |
| resMgr | resource manager (if not specified, new resources manager is created) |
References init(), Material_ResourceMgr::myMutex, read(), and Material_ResourceMgr::resourceMgr().
| Graphic3d_MaterialAspect Material_Model::getMaterialOCCAspect | ( | bool | theIsFront = true | ) |
| theIsFront | boolean flag for choosing side |
References Ambient, color(), Diffuse, Emissive, hasReflection(), isPhysical(), reflection(), shininess(), Specular, and transparency().
| GEOM_VTKPropertyMaterial * Material_Model::getMaterialVTKProperty | ( | bool | theIsFront = true | ) |
| theIsFront | boolean flag for choosing side |
References Ambient, color(), Diffuse, hasReflection(), isPhysical(), GEOM_VTKPropertyMaterial::New(), reflection(), shininess(), Specular, and transparency().
| bool Material_Model::hasReflection | ( | ReflectionType | type | ) | const |
| type | reflection type |
true if specified reflection type is enabled or false otherwise References myReflection.
|
private |
References Ambient, Diffuse, Emissive, setColor(), setPhysical(), setReflection(), setShininess(), setTransparency(), and Specular.
| bool Material_Model::isPhysical | ( | ) | const |
true if material is physical or false otherwise References myIsPhysical.
|
private |
References Ambient, Diffuse, Emissive, setColor(), setPhysical(), setReflection(), setShininess(), setTransparency(), and Specular.
| double Material_Model::reflection | ( | ReflectionType | type, |
| bool | theIsFront = true |
||
| ) | const |
| type | reflection type |
| theIsFront | boolean flag for choosing side |
References myReflection.
| void Material_Model::setColor | ( | ReflectionType | type, |
| const QColor & | value | ||
| ) |
| type | reflection type |
| value | color to be used for specified reflection type |
References myReflection.
| void Material_Model::setPhysical | ( | bool | value | ) |
| value | true if material is physical or false otherwise |
References myIsPhysical.
| void Material_Model::setReflection | ( | ReflectionType | type, |
| bool | value | ||
| ) |
| void Material_Model::setReflection | ( | ReflectionType | type, |
| double | value, | ||
| bool | theIsFront = true |
||
| ) |
| type | reflection type |
| value | coefficient to be used by the given reflection type |
| theIsFront | boolean flag for choosing side |
References myReflection.
| void Material_Model::setShininess | ( | double | value, |
| bool | theIsFront = true |
||
| ) |
| value | new shininess value |
| theIsFront | boolean flag for choosing side |
References myBackShininess, and myFrontShininess.
| void Material_Model::setTransparency | ( | double | value | ) |
| double Material_Model::shininess | ( | bool | theIsFront = true | ) | const |
| theIsFront | boolean flag for choosing side |
References myBackShininess, and myFrontShininess.
| QString Material_Model::toProperties | ( | ) |
References Ambient, color(), Diffuse, Emissive, hasReflection(), isPhysical(), reflection(), shininess(), Specular, and transparency().
| void Material_Model::toResources | ( | const QString & | material, |
| Material_ResourceMgr * | resMgr | ||
| ) |
| material | material name |
| resMgr | resource manager |
References Ambient, color(), Diffuse, Emissive, hasReflection(), isPhysical(), Material_ResourceMgr::myMutex, reflection(), shininess(), Specular, and transparency().
| double Material_Model::transparency | ( | ) | const |
|
private |
|
private |
|
private |
|
private |
|
private |