VisualizationFoundation CATGraphicMaterial

Usage: you must use this class as is. You should never derive it.


public class CATGraphicMaterial

Class to create graphic material used to increase visual realism.
Usage of this class requires basic knowledge of OpenGL.


Constructor and Destructor Index


o CATGraphicMaterial()
Constructs a default graphic material.
o CATGraphicMaterial(CATGraphicMaterial&)
Copy constructor.
o CATGraphicMaterial(float*,float*,float*,float,float,float,float,float,float)
Constructs a graphic material.
o CATGraphicMaterial(CATTexturePixelImage*,CATTextureFunction,CATTextureFilter,CATTextureFilter,CATMappingFunction,CATTextureWrapping,CATTextureWrapping,float*,CATMappingOperator*)
Constructs a graphic material.

Method Index


o AddReference()
Increments the reference counter of the graphic material.
o GetCoefficient(CATCoefficientType)
Returns the multiplication factors of the graphic material.
o GetColor(CATColorType,float&,float&,float&)
Sets the color components of the material.
o GetMappingOperator()
Returns the mapping operator associated to the graphic material.
o GetMaterialPropertiesActivation()
Returns the activation mode of the graphic material.
o GetReferenceNumber()
Returns the reference counter value of the graphic material.
o GetTextureImage()
Returns the texture of the graphic material.
o GetTexturedMaterialFlag()
Returns TRUE if the material is a texture material
o SetCoefficient(CATCoefficientType,float)
Sets the multiplication factors of the graphic material.
o SetColor(CATColorType,float,float,float)
Sets the color components of the material.
o SetMappingOperator(CATMappingOperator*)
Sets the mapping operator associated to the graphic material.
o SetMaterialPropertiesActivation(int)
Activates the graphic material.
o SetParameterTexture(int,CATPixelImage*,char*,int)
This method is used to put a texture to a sampler in the shader.
o SetTextureImage(CATTexturePixelImage*)
Sets the texture of the graphic material.
o SubReference()
Decrements the reference counter of the graphic material.
o getParameterName(int)
o operator =(CATGraphicMaterial&)
Assignement operator.

Constructor and Destructor


o CATGraphicMaterial
public CATGraphicMaterial()
Constructs a default graphic material.
o CATGraphicMaterial
public CATGraphicMaterial( const material)
Copy constructor.
o CATGraphicMaterial
public CATGraphicMaterial( const iAmbientColor,
const iDiffuseColor,
const iSpecularColor,
const iSpecExponent= .5859,
const iAmbientCoef= 1.0,
const iDiffuseCoef= 1.0,
const iSpecularCoef= 1.0,
const iTransparencyCoef= 0.0,
const iReflectivityCoef= 0.0)
Constructs a graphic material.
Parameters:
iAmbientColor
array of 4 float values in the range [0,1] corresponding to the red, green, blue and alpha channels.
iDiffuseColor
array of 4 float values in the range [0,1] corresponding to the red, green, blue and alpha channels.
iSpecularColor
array of 4 float values in the range [0,1] corresponding to the red, green, blue and alpha channels.
iSpecExponent
Exponent value used for specular calculations.
iAmbientCoef
Multiplication factor applied iAmbientColor.
iDiffuseCoef
Multiplication factor applied iDiffuseColor.
iSpecularCoef
Multiplication factor applied iSpecularColor.
iTransparencyCoef
float value in the range [0,1]. value 0 is totally opaque, value 1 is totally transparent.
iReflectivityCoef
float value in the range [0,1]. value 0 indicate no reflection, value 1 indicates total reflection.
o CATGraphicMaterial
public CATGraphicMaterial( iTexture,
const iFunction= CATModulateTexture,
const iMagnification= CATLinear,
const iMinification= CATLinearMipMapLinear,
const iMappingFunction= CATUserMapping,
const iSValue= CATClampingTexture,
const iTValue= CATClampingTexture,
const iBlendColor= NULL,
iOperator= NULL)
Constructs a graphic material.
Parameters:
iImage
Texture to be applied with the graphic material.
iFunction
Application mode of the texture.
iMagnification
Texture filtering mode for magnification (CATNearest or CATLinear).
iMinification
Texture filtering mode for minification (Any).
iMappingFunction
Mapping function for the texture.
iSValue
Wrapping mode along the horizontal direction of the texture.
iTValue
Wrapping mode along the vertical direction of the texture.
iBlendColor
array of 4 float values in the range [0,1].
iOperator
User mapping operator for texture coordinates calculations.

Methods


o AddReference
public AddReference()
Increments the reference counter of the graphic material.
o GetCoefficient
public virtual GetCoefficient( const iParam)
Returns the multiplication factors of the graphic material.
Parameters:
iParam
indicates which multiplication factor is returned.
o GetColor
public virtual GetColor( const iParam,
oRed,
oGreen,
oBlue)
Sets the color components of the material.
Parameters:
iParam
To indicate ambient, diffuse or specular color component.
iRed
Red channel of given color component.
iGreen
Green channel of given color component.
iBlue
Blue channel of given color component.
o GetMappingOperator
public virtual GetMappingOperator()
Returns the mapping operator associated to the graphic material.
o GetMaterialPropertiesActivation
public GetMaterialPropertiesActivation()
Returns the activation mode of the graphic material.
o GetReferenceNumber
public GetReferenceNumber()
Returns the reference counter value of the graphic material.
o GetTextureImage
public virtual GetTextureImage()
Returns the texture of the graphic material.
o GetTexturedMaterialFlag
public virtual GetTexturedMaterialFlag()
Returns TRUE if the material is a texture material
o SetCoefficient
public virtual SetCoefficient( const iParam,
iValue)
Sets the multiplication factors of the graphic material.
Parameters:
iParam
indicates which multiplication factor is set.
iValue
Value in the range [0,1].
o SetColor
public virtual SetColor( const iParam,
iRed,
iGreen,
iBlue)
Sets the color components of the material.
Parameters:
iParam
To indicate ambient, diffuse or specular color component.
iRed
Red channel of given color component.
iGreen
Green channel of given color component.
iBlue
Blue channel of given color component.
o SetMappingOperator
public virtual SetMappingOperator( iOperator)
Sets the mapping operator associated to the graphic material.
Parameters:
iOperator
Mapping operator used to calculate texture coordinates.
o SetMaterialPropertiesActivation
public virtual SetMaterialPropertiesActivation( const iMode)
Activates the graphic material.
Parameters:
iMode
  • 0 : color is retrieved from the graphic attributes of the associated representation.
  • 1 : color is retrieved from the graphic material.
o SetParameterTexture
public SetParameterTexture( param,
const iImage,
const iProceduralName,
iForceReload=0)
This method is used to put a texture to a sampler in the shader. This method is intended to replace old way to set procedural texture.
Parameters:
param
Use the getParameter method to get the id of the sampler name in the shader.
iImage
The pixel image you want to set. You can call a Release on the image after setting the method because we are working on a copy.
iProceduralName
This parameter is used for CGR streaming. This is the parmater you used to set in the CATPixelImageManager::GenerateImage method.
iForceReload
Same as setParameterString.
o SetTextureImage
public virtual SetTextureImage( iTexture)
Sets the texture of the graphic material.
Parameters:
iTexture
New texture to be used afterwards.
o SubReference
public SubReference()
Decrements the reference counter of the graphic material.
o getParameterName
public getParameterName( param)
o operator =
public operator =( const iMaterial)
Assignement operator.

This object is included in the file: CATGraphicMaterial.h
If needed, your Imakefile.mk should include the module: CATVisFoundation

Copyright © 1999-2015, Dassault Systèmes. All rights reserved.