CFx SDK Documentation 2024 SP0
|
#include <CmColor.h>
Static Public Attributes | |
static TOOLKIT_EXPORT_STATIC const OdUInt16 | MaxColorIndex |
<group OdCm_Classes>
This class implements Color object that represents the unnamed and named colors specified by the byLayer, byBlock, byColor, byACI, byPen, Foreground, byDgnIndex, or None color methods.
The OdCmEntityColor class, the OdCmColorBase class
OdCmColor::OdCmColor | ( | ) |
Default constructor. Sets the color to that of the layer.
OdCmColor::OdCmColor | ( | const OdCmColor & | color | ) |
Copy constructor. Sets the color according to a parameter.
color | [in] New color as OdCmColor. |
OdCmColor::OdCmColor | ( | const OdCmColorBase & | color | ) |
Constructor. Sets the color according to a parameter.
color | [in] New color as OdCmColorBase object. |
OdCmColor::OdCmColor | ( | OdCmEntityColor::ColorMethod | color | ) |
Constructor. Sets the color according to a color method.
color | [in] Color method. |
Name Value Description kByLayer 0xC0 Color is specified by the layer object on which the object resides. kByBlock 0xC1 Color is specified by the block reference color. kByColor 0xC2 Color is specified by an RGB value. kByACI 0xC3 Color is specified by an index (ACI) of a color palette. kByPen 0xC4 Color is specified by an index of a pen color table. kForeground 0xC5 Color is the same as the foreground color. kByDgnIndex 0xC7 Color is specified by an index of a .dgn color table. kNone 0xC8 Color is absent (object is clear).
OdCmColor::~OdCmColor | ( | ) |
Empty destructor.
void OdCmColor::audit | ( | OdDbAuditInfo * | pAuditInfo | ) |
Perform an audit operation on this object.
pAuditInfo | [in] Pointer to an AuditInfo object. |
|
virtual |
Returns the value of the blue component of this color.
Implements OdCmColorBase.
|
virtual |
Returns the current book name.
Implements OdCmColorBase.
|
virtual |
Returns the current color value as integer.
Implements OdCmColorBase.
|
virtual |
Returns the color index (ACI) of the entity color object.
Value Description kACIbyBlock 0 Sets the color method to byBlock. kACIRed 1 Red. kACIYellow 2 Yellow. kACIGreen 3 Green. kACICyan 4 Cyan. kACIBlue 5 Blue. kACIMagenta 6 Magenta. kACIforeground 7 Sets the color method to Foreground. .. 8-255 Defined by current palette. kACIbyLayer 256 Sets the color method to byLayer. kACInone 257 Sets the color method to None.
Implements OdCmColorBase.
|
virtual |
Returns the color method of this color.
Name Value Description kByLayer 0xC0 Color is specified by the layer object on which the object resides. kByBlock 0xC1 Color is specified by the block reference color. kByColor 0xC2 Color is specified by an RGB value. kByACI 0xC3 Color is specified by an index (ACI) of a color palette. kByPen 0xC4 Color is specified by an index of a pen color table. kForeground 0xC5 Color is the same as the foreground color. kByDgnIndex 0xC7 Color is specified by an index of a .dgn color table. kNone 0xC8 Color is absent (object is clear).
Implements OdCmColorBase.
|
virtual |
Returns the name of the current color.
Implements OdCmColorBase.
|
virtual |
If colorName isn't empty, returns it as a string. Otherwise returns color method as a string.
Implements OdCmColorBase.
void OdCmColor::dwgIn | ( | OdDbDwgFiler * | pFiler | ) |
Reads the .dwg file format data of this object from the specified file.
pFiler | [in] Pointer to the filer from which the data are to be read. |
void OdCmColor::dwgInAsTrueColor | ( | OdDbDwgFiler * | pFiler | ) |
DOM
void OdCmColor::dwgOut | ( | OdDbDwgFiler * | pFiler | ) | const |
Writes the .dwg file format data of this object to the specified filer.
pFiler | [in] Pointer to the filer to which the data are to be written. |
void OdCmColor::dwgOutAsTrueColor | ( | OdDbDwgFiler * | pFiler | ) | const |
DOM
void OdCmColor::dxfIn | ( | OdDbDxfFiler * | pFiler, |
int | groupCodeOffset = 0 |
||
) |
Reads the DXF format data of this object from the specified filer.
pFiler | [in] Pointer to the filer from which the data are to be read. |
groupCodeOffset | [in] Group code offset. |
void OdCmColor::dxfOut | ( | OdDbDxfFiler * | pFiler, |
int | groupCodeOffset = 0 |
||
) | const |
Writes the DXF format data of this object to the specified filer.
pFiler | [in] Pointer to the filer to which the data are to be written. |
groupCodeOffset | [in] Group code offset. |
OdCmEntityColor OdCmColor::entityColor | ( | ) | const |
Returns the OdCmEntityColor settings of the database color object.
OdString OdCmColor::getDescription | ( | ) | const |
Returns the description string of the database color object.
OdString OdCmColor::getDictionaryKey | ( | ) | const |
Returns a dictionary key based on the color name and book name of the database color object.
OdString OdCmColor::getExplanation | ( | ) | const |
Returns the explanation string of the database color object.
|
virtual |
Returns the value of the green component of this color.
Implements OdCmColorBase.
|
virtual |
Checks if the color is specified by an index (ACI) of a color palette (color method of this color is set to "kByACI").
Implements OdCmColorBase.
|
virtual |
Checks if the color is specified by the block object in which the object is contained (color method of this color is set to "kByBlock", or it is set to "kByACI" and ACI color method is "kACIbyBlock").
Implements OdCmColorBase.
|
virtual |
Checks if the color is specified by an RGB value (color method of this color is set to "kByColor").
Implements OdCmColorBase.
|
virtual |
Checks if the color is specified by an index of a .dgn color table (color method of this color is set to "kByDgnIndex").
Implements OdCmColorBase.
|
virtual |
Checks if the color is specified by the layer object on which the object resides (color method of this color is set to "kByLayer", or it is set to "kByACI" and ACI color method is "kACIbyLayer").
Implements OdCmColorBase.
|
virtual |
Checks if the color is the same as the foreground color (color method of this color is set to "kForeground", or it is set to "kByACI" and ACI color method is "kACIforeground").
Implements OdCmColorBase.
bool OdCmColor::isNone | ( | ) | const |
Checks if the color is absent (color method of this color is set to "kNone", or it is set to "kByACI" and ACI color method is "kACInone").
bool OdCmColor::operator!= | ( | const OdCmColor & | color | ) | const |
Compares two database color objects using their integer values together with their color names and returns true when their values are not equal, or false when their values are equal.
color | [in] Color as OdCmColor. |
bool OdCmColor::operator!= | ( | const OdCmColorBase & | color | ) | const |
Compares two color objects as OdCmColor and OdCmColorBase their integer values together with their color names and returns true when their values are not equal, or false when their values are equal. For comparison the OdCmColorBase object is converted to OdCmColor.
color | [in] Color as OdCmColorBase. |
Assignment operator. Assigns values of the rhs parameter to the lhs parameter.
color | [in] Color as OdCmdColor object. |
OdCmColor & OdCmColor::operator= | ( | const OdCmColorBase & | color | ) |
Assignment operator. Assigns values of the rhs parameter to the lhs parameter.
color | [in] Color as OdCmColorBase object. |
bool OdCmColor::operator== | ( | const OdCmColor & | color | ) | const |
Compares two database color objects using their integer values together with their color names and returns true when their values are equal, or false when their values are not equal.
color | [in] Color as OdCmColor. |
bool OdCmColor::operator== | ( | const OdCmColorBase & | color | ) | const |
Compares an OdCmColor object and OdCmColorBase object using their integer values together with their color names and returns true when their values are equal, or false when their values are not equal. For comparison the OdCmColorBase object is converted to OdCmColor.
color | [in] Color as OdCmColorBase object. |
|
virtual |
Returns the value of the red component of this color.
Implements OdCmColorBase.
Sets the blue component of this color.
blue | [in] Blue component value. |
Implements OdCmColorBase.
Sets a color and color method from an integer value.
color | [in] Color value as integer. |
Implements OdCmColorBase.
Sets the color index (ACI) of a color palette and sets the color method to byACI for the entity color object.
colorIndex | [in] An integer value that is the index of the color in a palette. |
Value Description kACIbyBlock 0 Sets the color method to byBlock. kACIRed 1 Red. kACIYellow 2 Yellow. kACIGreen 3 Green. kACICyan 4 Cyan. kACIBlue 5 Blue. kACIMagenta 6 Magenta. kACIforeground 7 Sets the color method to Foreground. .. 8-255 Defined by current palette. kACIbyLayer 256 Sets the color method to byLayer. kACInone 257 Sets the color method to None.
An entity does not have a color from the time it is first instantiated until it is assigned one or added to a database.
Implements OdCmColorBase.
|
virtual |
Sets a color method for this color.
colorMethod | [in] Color method. Possible values are listed below. |
Name Value Description kByLayer 0xC0 Color is specified by the layer object on which the object resides. kByBlock 0xC1 Color is specified by the block reference color. kByColor 0xC2 Color is specified by an RGB value. kByACI 0xC3 Color is specified by an index (ACI) of a color palette. kByPen 0xC4 Color is specified by an index of a pen color table. kForeground 0xC5 Color is the same as the foreground color. kByDgnIndex 0xC7 Color is specified by an index of a .dgn color table. kNone 0xC8 Color is absent (object is clear).
Implements OdCmColorBase.
Sets the green component of this color.
green | [in] Green component value. |
Implements OdCmColorBase.
|
virtual |
Sets the color name and the book name.
colorName | [in] Name of the color to be set. |
bookName | [in] Name of the book to be set. |
Implements OdCmColorBase.
bool OdCmColor::setNamesFromDictionaryKey | ( | const OdString & | dictionaryKey | ) |
Sets the book name and color name for the dictionary keyword.
dictionaryKey | [in] Dictionary keyword. |
Sets the red component of this color.
red | [in] Red component value. |
Implements OdCmColorBase.
Sets color using RGB values. Color method is set to "kByColor".
red | [in] Red component value. |
green | [in] Green component value. |
blue | [in] Blue component value. |
Implements OdCmColorBase.
|
static |