CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
OdCmTransparency Class Reference

#include <CmColorBase.h>

Public Types

enum  transparencyMethod { kByLayer = 0 , kByBlock = 1 , kByAlpha = 2 , kErrorValue = 3 }
 

Public Member Functions

 ODRX_HEAP_OPERATORS ()
 
 OdCmTransparency ()
 
 OdCmTransparency (transparencyMethod method)
 
 OdCmTransparency (OdUInt8 alpha)
 
 OdCmTransparency (double alphaPercent)
 
 OdCmTransparency (const OdCmTransparency &transparency)
 
 ~OdCmTransparency ()
 
OdCmTransparencyoperator= (const OdCmTransparency &transparency)
 
bool operator== (const OdCmTransparency &transparency) const
 
bool operator!= (const OdCmTransparency &transparency) const
 
void setAlpha (OdUInt8 alpha)
 
OdUInt8 alpha () const
 
void setAlphaPercent (double alphaPercent)
 
double alphaPercent () const
 
transparencyMethod method () const
 
void setMethod (transparencyMethod method)
 
bool isByAlpha () const
 
bool isByBlock () const
 
bool isByLayer () const
 
bool isInvalid () const
 
bool isClear () const
 
bool isSolid () const
 
OdUInt32 serializeOut () const
 
void serializeIn (OdUInt32 transparency)
 
void dwgIn (OdDbDwgFiler *pFiler)
 
void dwgOut (OdDbDwgFiler *pFiler) const
 

Detailed Description

<group OdCm_Classes>

This class implements a transparency object, which provides the transparency information about OdGiDrawable objects.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_overview.html">Overview of Classes that Implement Color and Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_method.html">Methods of the Transparency Definition</exref>

Definition at line 1658 of file CmColorBase.h.

Member Enumeration Documentation

◆ transparencyMethod

Represents the transparency method.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_method.html">Methods of the Transparency Definition</exref>
Enumerator
kByLayer 
kByBlock 
kByAlpha 
kErrorValue 

Definition at line 1671 of file CmColorBase.h.

Constructor & Destructor Documentation

◆ OdCmTransparency() [1/5]

OdCmTransparency::OdCmTransparency ( )
inline

Creates a transparency object with default properties.

Remarks
The default transparency method is kByLayer.

Definition at line 1684 of file CmColorBase.h.

◆ OdCmTransparency() [2/5]

OdCmTransparency::OdCmTransparency ( transparencyMethod  method)
inline

Creates a transparency object and sets the specified transparency method for it.

Parameters
method[in] Transparency method.
See also
<exref target="https://docs.opendesign.com/td/cm_transparency_method.html">Methods of the Transparency Definition</exref>

Definition at line 1694 of file CmColorBase.h.

◆ OdCmTransparency() [3/5]

OdCmTransparency::OdCmTransparency ( OdUInt8  alpha)
inline

Creates a transparency object and sets its transparency property using a specified alpha value.

Parameters
alpha[in] An alpha value of transparency as an integer value in the range from 0 to 255.
Remarks
The transparency method is set to kByAlpha. Alpha = 0 corresponds to full transparency. Alpha = 255 corresponds to full opacity.
See also
<exref target="https://docs.opendesign.com/td/cm_transparency_alpha.html">Transparency Functionality as an Alpha-value</exref>

Definition at line 1709 of file CmColorBase.h.

◆ OdCmTransparency() [4/5]

OdCmTransparency::OdCmTransparency ( double  alphaPercent)
inline

Creates a transparency object and sets its transparency property using a specified alpha value as a percentage.

Parameters
alphaPercent[in] An alpha value of transparency in percent as a double value in the range from 0.0 to 1.0.
Remarks
The transparency method is set to kByAlpha. Alpha = 0.0 corresponds to full transparency. Alpha = 1.0 corresponds to full opacity.
See also
<exref target="https://docs.opendesign.com/td/cm_transparency_alpha.html">Transparency Functionality as an Alpha-value</exref>

Definition at line 1724 of file CmColorBase.h.

◆ OdCmTransparency() [5/5]

OdCmTransparency::OdCmTransparency ( const OdCmTransparency transparency)
inline

Creates a copy of an existing transparency object.

Parameters
transparency[in] The transparency object to be copied.

Definition at line 1730 of file CmColorBase.h.

◆ ~OdCmTransparency()

OdCmTransparency::~OdCmTransparency ( )
inline

Definition at line 1734 of file CmColorBase.h.

Member Function Documentation

◆ alpha()

OdUInt8 OdCmTransparency::alpha ( ) const
inline

Returns the alpha value in the range from 0 to 255 of the transparency object.

Remarks
An alpha value defines the degree of transparency. Alpha = 0 corresponds to full transparency. Alpha = 255 corresponds to full opacity.
See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_alpha.html">Transparency Functionality as an Alpha-value</exref>

Definition at line 1804 of file CmColorBase.h.

◆ alphaPercent()

double OdCmTransparency::alphaPercent ( ) const
inline

Returns the alpha value in the range from 0.0 to 1.0 of the transparency object.

Remarks
An alpha value defines the degree of transparency. Alpha = 0.0 corresponds to full transparency. Alpha = 1.0 corresponds to full opacity.
See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_alpha.html">Transparency Functionality as an Alpha-value</exref>

Definition at line 1849 of file CmColorBase.h.

◆ dwgIn()

void OdCmTransparency::dwgIn ( OdDbDwgFiler pFiler)

Reads from the specified .dwg filer data for this object.

Parameters
pFiler[in] Pointer to the filer that the data is to be read from.

◆ dwgOut()

void OdCmTransparency::dwgOut ( OdDbDwgFiler pFiler) const

Writes to the specified .dwg filer data of this object.

Parameters
pFiler[in] Pointer to the filer that the data is to be written to.

◆ isByAlpha()

bool OdCmTransparency::isByAlpha ( ) const
inline

Checks whether the transparency method is byAlpha for the transparency object and returns true if and only if the transparency method is set to kByAlpha, otherwise it returns false.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_method.html">Methods of the Transparency Definition</exref>

Definition at line 1913 of file CmColorBase.h.

◆ isByBlock()

bool OdCmTransparency::isByBlock ( ) const
inline

Checks whether the transparency method is byBlock for the transparency object and returns true if and only if the transparency method is set to kByBlock, otherwise it returns false.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_method.html">Methods of the Transparency Definition</exref>

Definition at line 1925 of file CmColorBase.h.

◆ isByLayer()

bool OdCmTransparency::isByLayer ( ) const
inline

Checks whether the transparency method is byLayer for the transparency object and returns true if and only if the transparency method is set to kByLayer, otherwise it returns false.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_method.html">Methods of the Transparency Definition</exref>

Definition at line 1937 of file CmColorBase.h.

◆ isClear()

bool OdCmTransparency::isClear ( ) const
inline

Checks whether the transparency method is byAlpha and the transparency is set to full for this transparency object. It returns true if and only if the transparency method is set to kByAlpha and Alpha = 0, otherwise it returns false.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_method.html">Methods of the Transparency Definition</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_alpha.html">Transparency Functionality as an Alpha-value</exref>

Definition at line 1964 of file CmColorBase.h.

◆ isInvalid()

bool OdCmTransparency::isInvalid ( ) const
inline

Checks whether the transparency method is an error value for the transparency object and returns true if and only if the transparency method is set to kErrorValue, otherwise it returns false.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_method.html">Methods of the Transparency Definition</exref>

Definition at line 1949 of file CmColorBase.h.

◆ isSolid()

bool OdCmTransparency::isSolid ( ) const
inline

Checks whether the transparency method is byAlpha and the opacity is set to full for this transparency object. It returns true if and only if the transparency method is set to kByAlpha and Alpha = 255, otherwise it returns false.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_method.html">Methods of the Transparency Definition</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_alpha.html">Transparency Functionality as an Alpha-value</exref>

Definition at line 1979 of file CmColorBase.h.

◆ method()

transparencyMethod OdCmTransparency::method ( ) const
inline

Returns the transparency method of the transparency object as a value of the transparencyMethod enumeration.

Remarks
The transparency method can be a one of the following:

Name Value Description kByLayer 0 Transparency is specified by the layer object that the object is assigned to. kByBlock 1 Transparency is specified by the block object that the object is contained in. kByAlpha 2 Transparency is specified by an alpha value.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_method.html">Methods of the Transparency Definition</exref>

Definition at line 1872 of file CmColorBase.h.

◆ ODRX_HEAP_OPERATORS()

OdCmTransparency::ODRX_HEAP_OPERATORS ( )

◆ operator!=()

bool OdCmTransparency::operator!= ( const OdCmTransparency transparency) const
inline

Compares two transparency objects as integer values, and returns true when their values are not equal or false when their values are equal.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_integer.html">Transparency Functionality as an Integer-value</exref>

Definition at line 1769 of file CmColorBase.h.

◆ operator=()

OdCmTransparency & OdCmTransparency::operator= ( const OdCmTransparency transparency)
inline

Copies a transparency object specified on the right of the operator to the transparency object specified on the left.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_integer.html">Transparency Functionality as an Integer-value</exref>

Definition at line 1745 of file CmColorBase.h.

◆ operator==()

bool OdCmTransparency::operator== ( const OdCmTransparency transparency) const
inline

Compares two transparency objects as integer values, and returns true when their values are equal or false when their values are not equal.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_integer.html">Transparency Functionality as an Integer-value</exref>

Definition at line 1757 of file CmColorBase.h.

◆ serializeIn()

void OdCmTransparency::serializeIn ( OdUInt32  transparency)
inline

Sets the transparency method and transparency components as an integer value for the transparency object.

Parameters
transparency[in] A packed 32-bit integer value that specifies the transparency method and transparency components.
See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_method.html">Methods of the Transparency Definition</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_integer.html">Transparency Functionality as an Integer-value</exref>

Definition at line 2008 of file CmColorBase.h.

◆ serializeOut()

OdUInt32 OdCmTransparency::serializeOut ( ) const
inline

Returns the packed 32-bit integer value that stores the transparency method and transparency components.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_method.html">Methods of the Transparency Definition</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_integer.html">Transparency Functionality as an Integer-value</exref>

Definition at line 1992 of file CmColorBase.h.

◆ setAlpha()

void OdCmTransparency::setAlpha ( OdUInt8  alpha)
inline

Sets the alpha value and switches the transparency method to kByAlpha for the transparency object.

Parameters
alpha[in] Alpha value as an integer value in the range 0 to 255.
Remarks
An alpha value defines the degree of transparency. Alpha = 0 corresponds to full transparency. Alpha = 255 corresponds to full opacity.
See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_alpha.html">Transparency Functionality as an Alpha-value</exref>

Definition at line 1786 of file CmColorBase.h.

◆ setAlphaPercent()

void OdCmTransparency::setAlphaPercent ( double  alphaPercent)
inline

Sets the alpha value as a percentage and switches the transparency method to kByAlpha for the transparency object.

Parameters
alphaPercent[in] Alpha as a double value in the range from 0.0 to 1.0.
Remarks
An alpha value defines the degree of transparency. Alpha = 0.0 corresponds to full transparency. Alpha = 1.0 corresponds to full opacity.
See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_alpha.html">Transparency Functionality as an Alpha-value</exref>

Definition at line 1826 of file CmColorBase.h.

◆ setMethod()

void OdCmTransparency::setMethod ( transparencyMethod  method)
inline

Sets the transparency method for the transparency object.

Parameters
method[in] Transparency method as the transparencyMethod enumeration.
Remarks
The transparency method can be one of the following:

Name Value Description kByLayer 0 Transparency is specified by the layer object that the object is assigned to. kByBlock 1 Transparency is specified by the block object that the object is contained in. kByAlpha 2 Transparency is specified by an alpha value.

See also
<exref target="https://docs.opendesign.com/td/cm_transparency_sample.html">Example of Working with Transparency</exref>

<exref target="https://docs.opendesign.com/td/cm_transparency_method.html">Methods of the Transparency Definition</exref>

Definition at line 1897 of file CmColorBase.h.


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