CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
OdAveMaterial Class Reference

#include <AveMaterial.h>

Inheritance diagram for OdAveMaterial:
OdRxObject OdAveGraniteMaterial OdAveMarbleMaterial OdAveWoodMaterial

Public Member Functions

 ODRX_DECLARE_MEMBERS (OdAveMaterial)
 
OdResult writeMaterial (OdDbDatabase *pDb=NULL, const OdDbHandle &holderHandle=0)
 
bool attachToObject (OdDbObjectId entityId)
 
bool attachToLayer (OdDbObjectId layerId)
 
bool attachToACI (OdUInt16 colorIndex)
 
virtual OdAve::MaterialType type ()
 
bool isAttribUsed (OdAve::MaterialAttrib attributes)
 
OdString name () const
 
OdString description () const
 
void setName (const OdString &name)
 
void setDescription (const OdString &description)
 
double ambientFactor () const
 
OdUInt32 ambientColor () const
 
bool ambientColorCurrent () const
 
bool ambientLock () const
 
void setAmbientFactor (double ambientFactor)
 
void setAmbientColor (OdUInt32 ambientColor)
 
void setAmbientColorCurrent (bool currentColor)
 
void setAmbientLock (bool ambientLock)
 
double diffuseFactor () const
 
OdUInt32 diffuseColor () const
 
bool diffuseColorCurrent () const
 
OdAveBitmapdiffuseBitmap () const
 
void setDiffuseFactor (double diffuseFactor)
 
void setDiffuseColor (OdUInt32 diffuseColor)
 
void setDiffuseColorCurrent (bool currentColor)
 
double specularFactor () const
 
OdUInt32 specularColor () const
 
bool specularColorCurrent () const
 
bool specularMirror () const
 
bool specularLock () const
 
OdAveBitmapspecularBitmap ()
 
const OdAveBitmapspecularBitmap () const
 
void setSpecularFactor (double specularFactor)
 
void setSpecularColor (OdUInt32 specularColor)
 
void setSpecularColorCurrent (bool colorCurrrent)
 
void setSpecularMirror (bool mirror)
 
void setSpecularLock (bool specularLock)
 
double roughness () const
 
void setRoughness (double)
 
double transparency () const
 
OdAveBitmaptransparencyBitmap () const
 
void setTransparency (double transparency)
 
double refraction () const
 
void setRefraction (double refraction) const
 
OdAveBitmapbumpMap ()
 
const OdAveBitmapbumpMap () const
 
OdDbObjectId holderId () const
 
OdString handleDbMaterial () const
 
void setHandleDbMaterial (const OdString &sDesc)
 
 ~OdAveMaterial ()
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
virtual void addRef ()=0
 
virtual void release ()=0
 
virtual long numRefs () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual void copyFrom (const OdRxObject *pSource)
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Static Public Member Functions

static OdAveMaterialPtr getMaterial (const OdDbObjectId &blockRefId)
 
static OdString getMaterialName (const OdDbObjectId &blockRefId)
 
static void detachFromObject (OdDbObjectId entityId)
 
static void detachFromLayer (OdDbObjectId layerId)
 
static void detachFromACI (OdDbDatabase *pDb, OdUInt16 colorIndex)
 
static bool getAttachedMaterial (const OdDbObjectId &sourceId, OdDbObjectId &blockRefId)
 
static bool getAttachedMaterial (OdDbDatabase *pDb, OdUInt16 colorIndex, OdDbObjectId &blockRefId)
 
static void getAciMaterialMap (OdDbDatabase *pDb, OdDbObjectIdArray &blockRefIds)
 
- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Protected Member Functions

 OdAveMaterial ()
 
 OdAveMaterial (OdAveMaterialImpl *pImpl)
 

Protected Attributes

OdAveMaterialImplm_pImpl
 

Friends

class OdAveMaterialImpl
 

Detailed Description

This class represents AVE Material properties for shaded entities.

Remarks
AVE Material properties may be attached to OdDbEntity and OdDbLayerTableRecord objects, and to color indicies (ACIs).

Corresponding C++ library: TD_Ave <group OdAve_Classes>

Definition at line 55 of file AveMaterial.h.

Constructor & Destructor Documentation

◆ ~OdAveMaterial()

OdAveMaterial::~OdAveMaterial ( )

◆ OdAveMaterial() [1/2]

OdAveMaterial::OdAveMaterial ( )
protected

◆ OdAveMaterial() [2/2]

OdAveMaterial::OdAveMaterial ( OdAveMaterialImpl pImpl)
protected

Member Function Documentation

◆ ambientColor()

OdUInt32 OdAveMaterial::ambientColor ( ) const

Returns the ambient (shadow) color of this Material object.

Remarks
ambientColor() returns a 24-bit RGB color.

◆ ambientColorCurrent()

bool OdAveMaterial::ambientColorCurrent ( ) const

Returns true if and only if the ambient (shadow) color for this Material object is the current entity color, CECOLOR.

◆ ambientFactor()

double OdAveMaterial::ambientFactor ( ) const

Returns the ambient (shadow) factor of this Material object.

Returns
Returns a value in the range [0.0 .. 1.0].

◆ ambientLock()

bool OdAveMaterial::ambientLock ( ) const

Returns true if and only if the ambient lock flag has been set for this Material object.

◆ attachToACI()

bool OdAveMaterial::attachToACI ( OdUInt16  colorIndex)

Attaches this Material object to the specified color index (ACI).

Parameters
colorIndex[in] Color index. [1..255]
Returns
Returns true if and only if successful.
Remarks
The attachment is made in the database of the holder of this Material Object.
See also
OdCmEntityColor

◆ attachToLayer()

bool OdAveMaterial::attachToLayer ( OdDbObjectId  layerId)

Attaches this Material object to the specified OdDbLayerTableRecord.

Parameters
layerId[in] Object ID of the layer table record.
Returns
Returns true if and only if successful.

◆ attachToObject()

bool OdAveMaterial::attachToObject ( OdDbObjectId  entityId)

Attaches this Material object to the specified OdDbEntity.

Parameters
entityId[in] Object ID of the entity.
Returns
Returns true if and only if successful.

◆ bumpMap() [1/2]

OdAveBitmap & OdAveMaterial::bumpMap ( )

Returns a reference to, or a copy of, the bump bitmap of this Material object.

Remarks
The bump bitmap may be used as an opacity map for this Material object.

◆ bumpMap() [2/2]

const OdAveBitmap & OdAveMaterial::bumpMap ( ) const

◆ description()

OdString OdAveMaterial::description ( ) const

Returns the description of this Material object.

◆ detachFromACI()

static void OdAveMaterial::detachFromACI ( OdDbDatabase pDb,
OdUInt16  colorIndex 
)
static

Detaches this Material object from the specified color index (ACI) for the specified database.

Parameters
colorIndex[in] Color index. [1..255]
pDb[in] Pointer to the database for the ACI.
Remarks
See also
OdCmEntityColor

◆ detachFromLayer()

static void OdAveMaterial::detachFromLayer ( OdDbObjectId  layerId)
static

Detaches this Material object from the specified OdDbLayerTableRecord.

Parameters
layerId[in] Object ID of the layer table record.

◆ detachFromObject()

static void OdAveMaterial::detachFromObject ( OdDbObjectId  entityId)
static

Detaches this Material object from the specified OdDbEntity.

Parameters
entityId[in] Object ID of the entity.

◆ diffuseBitmap()

OdAveBitmap & OdAveMaterial::diffuseBitmap ( ) const

Returns a reference to the diffuse (main) bitmap for this Material object.

◆ diffuseColor()

OdUInt32 OdAveMaterial::diffuseColor ( ) const

Returns the diffuse (main) color of this Material object.

Remarks
diffuseColor() returns a 24-bit RGB color.

◆ diffuseColorCurrent()

bool OdAveMaterial::diffuseColorCurrent ( ) const

Returns true if and only if the diffuse (main) color for this Material object is the current entity color, CECOLOR.

◆ diffuseFactor()

double OdAveMaterial::diffuseFactor ( ) const

Returns the diffuse (main) factor of this Material object.

Returns
Returns a value in the range [0.0 .. 1.0].

◆ getAciMaterialMap()

static void OdAveMaterial::getAciMaterialMap ( OdDbDatabase pDb,
OdDbObjectIdArray blockRefIds 
)
static

Returns the ACI Material Map for the specified OdDbDatabase.

Parameters
blockRefIds[out] Receives an array[255] of block reference object IDs.
pDb[in] Pointer to the database for the ACI.
Remarks
The Object ID for ACI==n is in blockRefIds[n-1],
Returns an empty array if not successful.

blockRefIds are the object IDs of the OdDbBlockReferences associated with the materials.

◆ getAttachedMaterial() [1/2]

static bool OdAveMaterial::getAttachedMaterial ( const OdDbObjectId sourceId,
OdDbObjectId blockRefId 
)
static

Returns the object ID of the OdDbBlockReference associated with the material to which the specified OdDbEntity or OdDbLayerTableRecord is attached.

Parameters
sourceId[in] Object ID of the entity or layer table record.
blockRefId[out] Object ID of OdDbBlockReference associated with the material.
Returns
Returns true if and only if a material is attached.

◆ getAttachedMaterial() [2/2]

static bool OdAveMaterial::getAttachedMaterial ( OdDbDatabase pDb,
OdUInt16  colorIndex,
OdDbObjectId blockRefId 
)
static

Returns the object ID of the OdDbBlockReference associated with the material to which the specified color index (ACI) is attached.

Parameters
colorIndex[in] Color index. [1..255]
blockRefId[out] Object ID of OdDbBlockReference associated with the material.
pDb[in] Pointer to the database of the ACI.
Returns
Returns true if and only if a material is attached.

◆ getMaterial()

static OdAveMaterialPtr OdAveMaterial::getMaterial ( const OdDbObjectId blockRefId)
static

Creates a Material object from the specified OdDbBlockReference.

Parameters
blockRefId[in] Object ID of the block reference.
Remarks
The new Material object is attached to the specified block reference.

Returns a SmartPointer to the new Material object.

◆ getMaterialName()

static OdString OdAveMaterial::getMaterialName ( const OdDbObjectId blockRefId)
static

Returns the Material name from the specified OdDbBlockReference.

Parameters
blockRefId[in] Object ID of the block reference.

◆ handleDbMaterial()

OdString OdAveMaterial::handleDbMaterial ( ) const

Returns the handle of the DbMaterial to which has been converted AveMaterial in A2008.

◆ holderId()

OdDbObjectId OdAveMaterial::holderId ( ) const

Returns the Object ID of the OdDbBlockReference associated with this Material object.

◆ isAttribUsed()

bool OdAveMaterial::isAttribUsed ( OdAve::MaterialAttrib  attributes)

Returns true if and only if any of the specified Material attributes are used in this Material object.

Parameters
attributes[in] Material attributes.
Remarks
attributes must be a combination of one or more of the following:

Value kAmbient 0x1
kDiffuse 0x2
kSpecular 0x4
kTransparency 0x8
kRoughness 0x20 kBumpMap 0x40 kReflectionProp 0x100 kRefraction 0x200

◆ name()

OdString OdAveMaterial::name ( ) const

Returns the name of this Material object.

◆ ODRX_DECLARE_MEMBERS()

OdAveMaterial::ODRX_DECLARE_MEMBERS ( OdAveMaterial  )

◆ refraction()

double OdAveMaterial::refraction ( ) const

Returns the refraction index of this Material object.

◆ roughness()

double OdAveMaterial::roughness ( ) const

Returns the roughness of this Material.

Returns
Returns a value in the range [0.0 .. 1.0].
Remarks

Roughness controls the size of the material's reflective highlight. The higher the level of roughness, the greater the highlight.

◆ setAmbientColor()

void OdAveMaterial::setAmbientColor ( OdUInt32  ambientColor)

Sets the ambient (shadow) color of this Material object.

Parameters
ambientColor[in] 24-bit RGB color.

◆ setAmbientColorCurrent()

void OdAveMaterial::setAmbientColorCurrent ( bool  currentColor)

Controls the use of the current entity color, CECOLOR, as the ambient (shadow) color of this Material object.

Parameters
currentColor[in] Controls the use of CECOLOR.

◆ setAmbientFactor()

void OdAveMaterial::setAmbientFactor ( double  ambientFactor)

Sets the ambient (shadow) factor of this Material object.

Parameters
ambientFactor[in] Ambient factor. [0.0 .. 1.0]

◆ setAmbientLock()

void OdAveMaterial::setAmbientLock ( bool  ambientLock)

Controls the ambient lock flag of this Material object.

Parameters
ambientLock[in] Controls ambient lock.

◆ setDescription()

void OdAveMaterial::setDescription ( const OdString description)

Sets the description of this Material object.

Parameters
description[in] Description.

◆ setDiffuseColor()

void OdAveMaterial::setDiffuseColor ( OdUInt32  diffuseColor)

Sets the diffuse (main) color of this Material object.

Parameters
diffuseColor[in] 24-bit RGB color.

◆ setDiffuseColorCurrent()

void OdAveMaterial::setDiffuseColorCurrent ( bool  currentColor)

Controls the use of the current entity color, CECOLOR, as the diffuse (main) color of this Material object.

Parameters
currentColor[in] Controls the use of CECOLOR.

◆ setDiffuseFactor()

void OdAveMaterial::setDiffuseFactor ( double  diffuseFactor)

Sets the diffuse (main) factor of this Material object.

diffuseFactor () Diffuse factor. [0.0 .. 1.0]

◆ setHandleDbMaterial()

void OdAveMaterial::setHandleDbMaterial ( const OdString sDesc)

Sets the DbMaterial handle of this material in A2008.

◆ setName()

void OdAveMaterial::setName ( const OdString name)

Sets the name of this Material object.

Parameters
name[in] Name.
Remarks
Names are truncated to 16 characters.

◆ setRefraction()

void OdAveMaterial::setRefraction ( double  refraction) const

Sets the refraction index of this Material object.

Parameters
refraction[in] Refraction.

◆ setRoughness()

void OdAveMaterial::setRoughness ( double  )

Sets the roughness of this Material object.

Parameters
roughness[in] Roughness. [0.0 .. 1.0]
Remarks
Roughness controls the size of the material's reflective highlight. The higher the level of roughness, the greater the highlight.

◆ setSpecularColor()

void OdAveMaterial::setSpecularColor ( OdUInt32  specularColor)

Sets the specular (reflection) color of this Material object.

Parameters
specularColor[in] 24-bit RGB color.

◆ setSpecularColorCurrent()

void OdAveMaterial::setSpecularColorCurrent ( bool  colorCurrrent)

Controls the use of the current entity color, CECOLOR, as the specular (reflection) color of this Material object.

Parameters
currentColor[in] Controls the use of CECOLOR.

◆ setSpecularFactor()

void OdAveMaterial::setSpecularFactor ( double  specularFactor)

Sets the specular (reflection) factor of this Material object.

Parameters
specularFactor[in] Specular factor. [0.0 .. 1.0]

◆ setSpecularLock()

void OdAveMaterial::setSpecularLock ( bool  specularLock)

Controls the specular lock flag of this Material object.

Parameters
specularLock[in] Controls specular lock
Remarks
The specular component is viewpoint dependent, and most apparent when the entity is highlighted.

◆ setSpecularMirror()

void OdAveMaterial::setSpecularMirror ( bool  mirror)

Controls the mirroring of specular reflections for this Material object.

Parameters
mirror[in] Controls mirroring.

◆ setTransparency()

void OdAveMaterial::setTransparency ( double  transparency)

Returns the transparency of this Material object.

Parameters
transparency[in] Transparency. [0.0 .. 1.0]
Returns
Returns a value in the r1ange [0.0 .. 1.0].

Renders 0.0 Opaque. 1.0 Totally transparent.

◆ specularBitmap() [1/2]

OdAveBitmap & OdAveMaterial::specularBitmap ( )

Returns a reference to, or a copy of, the specular (reflection) bitmap of this Material object.

◆ specularBitmap() [2/2]

const OdAveBitmap & OdAveMaterial::specularBitmap ( ) const

◆ specularColor()

OdUInt32 OdAveMaterial::specularColor ( ) const

Returns the specular (reflection) color of this Material object.

Remarks
specularColor() returns a 24-bit RGB color.

◆ specularColorCurrent()

bool OdAveMaterial::specularColorCurrent ( ) const

Returns true if and only if the specular (reflection) color for this Material object is the current entity color, CECOLOR.

◆ specularFactor()

double OdAveMaterial::specularFactor ( ) const

Returns the specular (reflection) factor of this Material object.

Returns
Returns a value in the range [0.0 .. 1.0].

◆ specularLock()

bool OdAveMaterial::specularLock ( ) const

Returns true if and only if the specular lock flag has been set for this Material object.

◆ specularMirror()

bool OdAveMaterial::specularMirror ( ) const

Returns true if and only if specular reflections are to be mirrored for this Material object.

◆ transparency()

double OdAveMaterial::transparency ( ) const

Returns the transparency of this Material object.

Remarks
Renders 0.0 Opaque. 1.0 Totally transparent.

◆ transparencyBitmap()

OdAveBitmap & OdAveMaterial::transparencyBitmap ( ) const

Returns a reference to the transparency bitmap of this Material object.

◆ type()

virtual OdAve::MaterialType OdAveMaterial::type ( )
virtual

Returns the type of this Material object.

Remarks
type() returns one of the following:

Value kStandard 0 kGranite 1 kMarble 2 kWood 3

Reimplemented in OdAveGraniteMaterial, OdAveMarbleMaterial, and OdAveWoodMaterial.

◆ writeMaterial()

OdResult OdAveMaterial::writeMaterial ( OdDbDatabase pDb = NULL,
const OdDbHandle holderHandle = 0 
)

Saves the Material properties to the OdDbBlockReference to which this Material object is associated.

Parameters
pDb[in] Pointer to the database.
Remarks
If pDb is null, the database containing this Material object is used.

Friends And Related Function Documentation

◆ OdAveMaterialImpl

friend class OdAveMaterialImpl
friend

Definition at line 531 of file AveMaterial.h.

Member Data Documentation

◆ m_pImpl

OdAveMaterialImpl* OdAveMaterial::m_pImpl
protected

Definition at line 530 of file AveMaterial.h.


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