IBSimu 1.0.4
|
DXF entity base class. More...
#include <mydxfentities.hpp>
Public Member Functions | |
virtual | ~MyDXFEntity () |
Virtual destructor. | |
virtual MyDXFEntity * | copy (void) const =0 |
Get a new copy of entity. | |
virtual void | explode (class MyDXFEntities *ent, MyDXFFile *dxf, const Transformation *t) const =0 |
Explode into entities. | |
virtual void | write (class MyDXFFile *dxf, std::ofstream &ostr)=0 |
Write dxf file to stream. | |
virtual void | scale (class MyDXFFile *dxf, double s)=0 |
Scale entity by factor s. | |
void | set_layer (const std::string &layer) |
Set layer. | |
std::string | get_layer (void) const |
Get layer. | |
virtual EntityType | get_type (void) const =0 |
Get entity type. | |
void | set_handle (const std::string &handle) |
Set entity handle. | |
std::string | get_handle (void) const |
Get entity handle. | |
virtual void | plot (const class MyDXFFile *dxf, cairo_t *cairo, const Transformation *t, const double range[4]) const =0 |
Plot entity with cairo. | |
virtual void | get_bbox (Vec3D &min, Vec3D &max, const class MyDXFFile *dxf, const Transformation *t) const =0 |
Return bounding box of entity. | |
Protected Member Functions | |
MyDXFEntity () | |
void | write_common (class MyDXFFile *dxf, std::ofstream &ostr) |
void | process_group (class MyDXFFile *dxf) |
void | constructor_debug_print (void) const |
void | debug_print_base (std::ostream &os) const |
virtual void | debug_print (std::ostream &os) const =0 |
Static Protected Member Functions | |
static void | bbox_ppoint (Vec3D &min, Vec3D &max, const Vec3D &p) |
Propose a point to bounding box. | |
Protected Attributes | |
std::string | _handle |
std::string | _layer |
Friends | |
std::ostream & | operator<< (std::ostream &os, const MyDXFEntity &ent) |
DXF entity base class.
A general base class for all DXF entities. Contains data fields common to all entities.
MyDXFEntity::MyDXFEntity | ( | ) | [protected] |
virtual MyDXFEntity::~MyDXFEntity | ( | ) | [inline, virtual] |
Virtual destructor.
static void MyDXFEntity::bbox_ppoint | ( | Vec3D & | min, |
Vec3D & | max, | ||
const Vec3D & | p | ||
) | [static, protected] |
Propose a point to bounding box.
Updates bounding box value at min and max by including point p in the bounding box.
void MyDXFEntity::constructor_debug_print | ( | void | ) | const [protected] |
virtual MyDXFEntity* MyDXFEntity::copy | ( | void | ) | const [pure virtual] |
Get a new copy of entity.
Implemented in MyDXFLine, MyDXFLWPolyline, MyDXFArc, MyDXFCircle, MyDXFMText, and MyDXFInsert.
virtual void MyDXFEntity::debug_print | ( | std::ostream & | os | ) | const [protected, pure virtual] |
void MyDXFEntity::debug_print_base | ( | std::ostream & | os | ) | const [protected] |
virtual void MyDXFEntity::explode | ( | class MyDXFEntities * | ent, |
MyDXFFile * | dxf, | ||
const Transformation * | t | ||
) | const [pure virtual] |
Explode into entities.
Break entity into atomic entities and tranform entities them with tranformation t. Add the tranformed entities to the database ent.
Implemented in MyDXFLine, MyDXFLWPolyline, MyDXFArc, MyDXFCircle, MyDXFMText, and MyDXFInsert.
virtual void MyDXFEntity::get_bbox | ( | Vec3D & | min, |
Vec3D & | max, | ||
const class MyDXFFile * | dxf, | ||
const Transformation * | t | ||
) | const [pure virtual] |
Return bounding box of entity.
Implemented in MyDXFLine, MyDXFLWPolyline, MyDXFArc, MyDXFCircle, MyDXFMText, and MyDXFInsert.
std::string MyDXFEntity::get_handle | ( | void | ) | const [inline] |
Get entity handle.
std::string MyDXFEntity::get_layer | ( | void | ) | const [inline] |
Get layer.
virtual EntityType MyDXFEntity::get_type | ( | void | ) | const [pure virtual] |
Get entity type.
Implemented in MyDXFLine, MyDXFLWPolyline, MyDXFArc, MyDXFCircle, MyDXFMText, and MyDXFInsert.
virtual void MyDXFEntity::plot | ( | const class MyDXFFile * | dxf, |
cairo_t * | cairo, | ||
const Transformation * | t, | ||
const double | range[4] | ||
) | const [pure virtual] |
Plot entity with cairo.
Plot the entity using the transformation from from the object space to cairo coordinates. The visible range is specified by range (xmin,ymin,xmax,ymax) in cairo coordinates.
Implemented in MyDXFLine, MyDXFLWPolyline, MyDXFArc, MyDXFCircle, MyDXFMText, and MyDXFInsert.
void MyDXFEntity::process_group | ( | class MyDXFFile * | dxf | ) | [protected] |
virtual void MyDXFEntity::scale | ( | class MyDXFFile * | dxf, |
double | s | ||
) | [pure virtual] |
Scale entity by factor s.
Implemented in MyDXFLine, MyDXFLWPolyline, MyDXFArc, MyDXFCircle, MyDXFMText, and MyDXFInsert.
void MyDXFEntity::set_handle | ( | const std::string & | handle | ) | [inline] |
Set entity handle.
void MyDXFEntity::set_layer | ( | const std::string & | layer | ) | [inline] |
Set layer.
virtual void MyDXFEntity::write | ( | class MyDXFFile * | dxf, |
std::ofstream & | ostr | ||
) | [pure virtual] |
Write dxf file to stream.
Implemented in MyDXFLine, MyDXFLWPolyline, MyDXFArc, MyDXFCircle, MyDXFMText, and MyDXFInsert.
void MyDXFEntity::write_common | ( | class MyDXFFile * | dxf, |
std::ofstream & | ostr | ||
) | [protected] |
std::ostream& operator<< | ( | std::ostream & | os, |
const MyDXFEntity & | ent | ||
) | [friend] |
std::string MyDXFEntity::_handle [protected] |
std::string MyDXFEntity::_layer [protected] |