QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DL_Attributes Class Reference

Storing and passing around attributes. More...

#include <dl_attributes.h>

List of all members.

Public Member Functions

 DL_Attributes ()
 Default constructor.
 DL_Attributes (const std::string &layer, int color, int width, const std::string &lineType)
 Constructor for DXF attributes.
 DL_Attributes (const std::string &layer, int color, int color24, int width, const std::string &lineType, int handle=-1)
 Constructor for DXF attributes.
int getColor () const
int getColor24 () const
int getHandle () const
std::string getLayer () const
std::string getLineType () const
int getWidth () const
void setColor (int color)
 Sets the color.
void setColor24 (int color)
 Sets the 24bit color.
void setHandle (int h)
void setLayer (const std::string &layer)
 Sets the layer.
void setLineType (const std::string &lineType)
 Sets the line type.
void setWidth (int width)
 Sets the width.

Private Attributes

int color
int color24
int handle
std::string layer
std::string lineType
int width

Detailed Description

Storing and passing around attributes.

Attributes are the layer name, color, width and line type.

Author:
Andrew Mustun

Constructor & Destructor Documentation

DL_Attributes::DL_Attributes ( )
inline

Default constructor.

DL_Attributes::DL_Attributes ( const std::string &  layer,
int  color,
int  width,
const std::string &  lineType 
)
inline

Constructor for DXF attributes.

Parameters:
layerLayer name for this entity or NULL for no layer (every entity should be on a named layer!).
colorColor number (0..256). 0 = BYBLOCK, 256 = BYLAYER.
widthLine thickness. Defaults to zero. -1 = BYLAYER, -2 = BYBLOCK, -3 = default width
lineTypeLine type name or "BYLAYER" or "BYBLOCK". Defaults to "BYLAYER"
DL_Attributes::DL_Attributes ( const std::string &  layer,
int  color,
int  color24,
int  width,
const std::string &  lineType,
int  handle = -1 
)
inline

Constructor for DXF attributes.

Parameters:
layerLayer name for this entity or NULL for no layer (every entity should be on a named layer!).
colorColor number (0..256). 0 = BYBLOCK, 256 = BYLAYER.
color2424 bit color (see DXF reference).
widthLine thickness. Defaults to zero. -1 = BYLAYER, -2 = BYBLOCK, -3 = default width
lineTypeLine type name or "BYLAYER" or "BYBLOCK". Defaults to "BYLAYER"

Member Function Documentation

int DL_Attributes::getColor ( ) const
inline
Returns:
Color.
See also:
DL_Codes, dxfColors
int DL_Attributes::getColor24 ( ) const
inline
Returns:
24 bit color or -1 if no 24bit color is defined.
See also:
DL_Codes, dxfColors
int DL_Attributes::getHandle ( ) const
inline
std::string DL_Attributes::getLayer ( ) const
inline
Returns:
Layer name.
std::string DL_Attributes::getLineType ( ) const
inline
Returns:
Line type.
int DL_Attributes::getWidth ( ) const
inline
Returns:
Width.
void DL_Attributes::setColor ( int  color)
inline

Sets the color.

See also:
DL_Codes, dxfColors
void DL_Attributes::setColor24 ( int  color)
inline

Sets the 24bit color.

See also:
DL_Codes, dxfColors
void DL_Attributes::setHandle ( int  h)
inline
void DL_Attributes::setLayer ( const std::string &  layer)
inline

Sets the layer.

If the given pointer points to NULL, the new layer name will be an empty but valid string.

void DL_Attributes::setLineType ( const std::string &  lineType)
inline

Sets the line type.

This can be any string and is not checked to be a valid line type.

void DL_Attributes::setWidth ( int  width)
inline

Sets the width.


Member Data Documentation

int DL_Attributes::color
private
int DL_Attributes::color24
private
int DL_Attributes::handle
private
std::string DL_Attributes::layer
private
std::string DL_Attributes::lineType
private
int DL_Attributes::width
private

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