ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
DL_Attributes Class Reference

#include <dl_attributes.h>

Public Member Functions

 DL_Attributes ()
 
 DL_Attributes (const std::string &layer, int color, int width, const std::string &linetype, double linetypeScale)
 
 DL_Attributes (const std::string &layer, int color, int color24, int width, const std::string &linetype, int handle=-1)
 
void setLayer (const std::string &layer)
 
std::string getLayer () const
 
void setColor (int color)
 
void setColor24 (int color)
 
int getColor () const
 
int getColor24 () const
 
void setWidth (int width)
 
int getWidth () const
 
void setLinetype (const std::string &linetype)
 
void setLinetypeScale (double linetypeScale)
 
double getLinetypeScale () const
 
std::string getLinetype () const
 
void setHandle (int h)
 
int getHandle () const
 
void setInPaperSpace (bool on)
 
bool isInPaperSpace () const
 

Detailed Description

Storing and passing around attributes. Attributes are the layer name, color, width and line type.

Author
Andrew Mustun

Definition at line 40 of file dl_attributes.h.

Constructor & Destructor Documentation

◆ DL_Attributes() [1/3]

DL_Attributes::DL_Attributes ( )
inline

Default constructor.

Definition at line 45 of file dl_attributes.h.

◆ DL_Attributes() [2/3]

DL_Attributes::DL_Attributes ( const std::string &  layer,
int  color,
int  width,
const std::string &  linetype,
double  linetypeScale 
)
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"

Definition at line 66 of file dl_attributes.h.

◆ DL_Attributes() [3/3]

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 (0x00RRGGBB, 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"

Definition at line 92 of file dl_attributes.h.

Member Function Documentation

◆ getColor()

int DL_Attributes::getColor ( ) const
inline

◆ getColor24()

int DL_Attributes::getColor24 ( ) const
inline
Returns
24 bit color or -1 if no 24bit color is defined.
See also
DL_Codes, dxfColors

Definition at line 144 of file dl_attributes.h.

Referenced by DL_Writer::entityAttributes(), and DL_Dxf::writeLayer().

◆ getHandle()

int DL_Attributes::getHandle ( ) const
inline

Definition at line 184 of file dl_attributes.h.

◆ getLayer()

std::string DL_Attributes::getLayer ( ) const
inline
Returns
Layer name.

Definition at line 116 of file dl_attributes.h.

Referenced by DL_Writer::entityAttributes(), Test_CreationClass::printAttributes(), and DL_Dxf::writePolyline().

◆ getLinetype()

std::string DL_Attributes::getLinetype ( ) const
inline

◆ getLinetypeScale()

double DL_Attributes::getLinetypeScale ( ) const
inline

Definition at line 169 of file dl_attributes.h.

Referenced by DL_Writer::entityAttributes().

◆ getWidth()

int DL_Attributes::getWidth ( ) const
inline

◆ isInPaperSpace()

bool DL_Attributes::isInPaperSpace ( ) const
inline

Definition at line 188 of file dl_attributes.h.

◆ setColor()

void DL_Attributes::setColor ( int  color)
inline

Sets the color.

See also
DL_Codes, dxfColors

Definition at line 123 of file dl_attributes.h.

References color.

Referenced by DL_Dxf::addLayer().

◆ setColor24()

void DL_Attributes::setColor24 ( int  color)
inline

Sets the 24bit color.

See also
DL_Codes, dxfColors

Definition at line 130 of file dl_attributes.h.

References color.

◆ setHandle()

void DL_Attributes::setHandle ( int  h)
inline

Definition at line 182 of file dl_attributes.h.

◆ setInPaperSpace()

void DL_Attributes::setInPaperSpace ( bool  on)
inline

Definition at line 186 of file dl_attributes.h.

Referenced by DL_Dxf::processDXFGroup().

◆ setLayer()

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.

Definition at line 111 of file dl_attributes.h.

◆ setLinetype()

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.

Definition at line 160 of file dl_attributes.h.

Referenced by DL_Dxf::addLayer().

◆ setLinetypeScale()

void DL_Attributes::setLinetypeScale ( double  linetypeScale)
inline

Sets the entity specific line type scale.

Definition at line 165 of file dl_attributes.h.

Referenced by DL_Dxf::processDXFGroup().

◆ setWidth()

void DL_Attributes::setWidth ( int  width)
inline

Sets the width.

Definition at line 149 of file dl_attributes.h.

References width.

Referenced by DL_Dxf::addLayer().


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