Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Material_Model Class Reference

#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_VTKPropertyMaterialgetMaterialVTKProperty (bool=true)
 Construct VTK property from material model. More...
 

Private Types

typedef QVector< ReflectionDataReflectionList
 

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
 

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
Ambient 

Ambient.

Diffuse 

Diffuse.

Specular 

Specular.

Emissive 

Emissive.

Constructor & Destructor Documentation

Material_Model::Material_Model ( )

Create new SALOME material model with default properties.

References init(), and myReflection.

Material_Model::~Material_Model ( )
virtual

Member Function Documentation

QColor Material_Model::color ( ReflectionType  type) const
Parameters
typereflection type
Returns
color associated with the specified reflection type
See Also
setColor()

References myReflection.

void Material_Model::fromProperties ( const QString &  props)
Parameters
propsmaterial properties
See Also
toProperties()

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.

Parameters
materialmaterial name (if not specified, model is initialized by default material)
resMgrresource manager (if not specified, new resources manager is created)
See Also
toResources()

References init(), Material_ResourceMgr::myMutex, read(), and Material_ResourceMgr::resourceMgr().

Graphic3d_MaterialAspect Material_Model::getMaterialOCCAspect ( bool  theIsFront = true)
Parameters
theIsFrontboolean flag for choosing side
Returns
material aspect object with corresponding properties

References Ambient, color(), Diffuse, Emissive, hasReflection(), isPhysical(), reflection(), shininess(), Specular, and transparency().

GEOM_VTKPropertyMaterial * Material_Model::getMaterialVTKProperty ( bool  theIsFront = true)
Parameters
theIsFrontboolean flag for choosing side
Returns
VTK property with correspondent material properties

References Ambient, color(), Diffuse, hasReflection(), isPhysical(), GEOM_VTKPropertyMaterial::New(), reflection(), shininess(), Specular, and transparency().

bool Material_Model::hasReflection ( ReflectionType  type) const
Parameters
typereflection type
Returns
true if specified reflection type is enabled or false otherwise
See Also
setReflection(ReflectionType, bool)

References myReflection.

void Material_Model::init ( )
private
bool Material_Model::isPhysical ( ) const
Returns
true if material is physical or false otherwise
See Also
setPhysical()

References myIsPhysical.

void Material_Model::read ( const QString &  material,
Material_ResourceMgr resMgr 
)
private
double Material_Model::reflection ( ReflectionType  type,
bool  theIsFront = true 
) const
Parameters
typereflection type
theIsFrontboolean flag for choosing side
Returns
coefficient value for the specified reflection type
See Also
setReflection(ReflectionType, double, bool = true)

References myReflection.

void Material_Model::setColor ( ReflectionType  type,
const QColor &  value 
)
Parameters
typereflection type
valuecolor to be used for specified reflection type
See Also
color()

References myReflection.

void Material_Model::setPhysical ( bool  value)
Parameters
valuetrue if material is physical or false otherwise
See Also
isPhysical()

References myIsPhysical.

void Material_Model::setReflection ( ReflectionType  type,
bool  value 
)
Parameters
typereflection type
valueboolean flag
See Also
hasReflection()

References myReflection.

void Material_Model::setReflection ( ReflectionType  type,
double  value,
bool  theIsFront = true 
)
Parameters
typereflection type
valuecoefficient to be used by the given reflection type
theIsFrontboolean flag for choosing side
See Also
reflection( bool = true)

References myReflection.

void Material_Model::setShininess ( double  value,
bool  theIsFront = true 
)
Parameters
valuenew shininess value
theIsFrontboolean flag for choosing side
See Also
shininess( bool = true )

References myBackShininess, and myFrontShininess.

void Material_Model::setTransparency ( double  value)
Parameters
valuenew transparency value
See Also
transparency()

References myTransparency.

double Material_Model::shininess ( bool  theIsFront = true) const
Parameters
theIsFrontboolean flag for choosing side
Returns
shininess value of the material
See Also
setShininess( double, bool = true )

References myBackShininess, and myFrontShininess.

QString Material_Model::toProperties ( )
Returns
string representing of material properties
See Also
fromProperties()

References Ambient, color(), Diffuse, Emissive, hasReflection(), isPhysical(), reflection(), shininess(), Specular, and transparency().

void Material_Model::toResources ( const QString &  material,
Material_ResourceMgr resMgr 
)
Parameters
materialmaterial name
resMgrresource manager
See Also
fromResources()

References Ambient, color(), Diffuse, Emissive, hasReflection(), isPhysical(), Material_ResourceMgr::myMutex, reflection(), shininess(), Specular, and transparency().

double Material_Model::transparency ( ) const
Returns
transparency value of the material
See Also
setTransparency()

References myTransparency.

Member Data Documentation

double Material_Model::myBackShininess
private
double Material_Model::myFrontShininess
private
bool Material_Model::myIsPhysical
private
ReflectionList Material_Model::myReflection
private
double Material_Model::myTransparency
private

The documentation for this class was generated from the following files: