IBSimu  1.0.4
Public Member Functions
MyDXFArc Class Reference

DXF arc entity class. More...

#include <mydxfentities.hpp>

Inheritance diagram for MyDXFArc:
MyDXFPathEntity MyDXFEntity

List of all members.

Public Member Functions

 MyDXFArc ()
 Default constructor.
 MyDXFArc (class MyDXFFile *dxf)
 Construct arc entity by reading from DXF file.
virtual ~MyDXFArc ()
 Virtual destructor.
virtual MyDXFArccopy (void) const
 Get a new copy of entity.
virtual void explode (class MyDXFEntities *ent, MyDXFFile *dxf, const Transformation *t) const
 Explode into entities.
virtual void write (class MyDXFFile *dxf, std::ofstream &ostr)
 Write dxf file to stream.
virtual EntityType get_type (void) const
 Get entity type.
Vec3D center (void) const
 Get center point of arc.
double radius (void) const
 Get radius of arc.
virtual Vec3D start (void) const
 Get start point of path entity.
virtual Vec3D end (void) const
 Get end point of path entity.
void set_pc (const Vec3D &pc)
 Set center point.
void set_r (double r)
 Set radius.
void set_ang1 (double ang1)
 Set start angle.
void set_ang2 (double ang2)
 Set end angle.
double get_ang1 (void) const
 Get start angle.
double get_ang2 (void) const
 Get end angle.
void set_center_and_ends (const Vec3D &c, const Vec3D &s, const Vec3D &e)
 Set arc according to center and end points.
void set_center_point (const Vec3D &s, const Vec3D &e)
 Set arc according to end points.
virtual void set_start (const Vec3D &s)
 Set start point of path entity.
virtual void set_end (const Vec3D &e)
 Set end point of path entity.
virtual int ray_cross (double x, double y) const
 Check for ray crossing.
bool geom_same (const MyDXFArc &arc, double eps=1.0e-6) const
 Check if two entities are geometrically same.
virtual void plot (const class MyDXFFile *dxf, cairo_t *cairo, const Transformation *t, const double range[4]) const
 Plot entity with cairo.
virtual void get_bbox (Vec3D &min, Vec3D &max, const class MyDXFFile *dxf, const Transformation *t) const
 Return bounding box of entity.
virtual void scale (class MyDXFFile *dxf, double s)
 Scale entity by factor s.

Detailed Description

DXF arc entity class.

An arc entity is defined with a center point of the arc, radius, starting angle and ending angle.


Constructor & Destructor Documentation

MyDXFArc::MyDXFArc ( ) [inline]

Default constructor.

MyDXFArc::MyDXFArc ( class MyDXFFile dxf)

Construct arc entity by reading from DXF file.

virtual MyDXFArc::~MyDXFArc ( ) [inline, virtual]

Virtual destructor.


Member Function Documentation

Vec3D MyDXFArc::center ( void  ) const [inline]

Get center point of arc.

virtual MyDXFArc* MyDXFArc::copy ( void  ) const [inline, virtual]

Get a new copy of entity.

Implements MyDXFEntity.

virtual Vec3D MyDXFArc::end ( void  ) const [inline, virtual]

Get end point of path entity.

Implements MyDXFPathEntity.

virtual void MyDXFArc::explode ( class MyDXFEntities ent,
MyDXFFile dxf,
const Transformation t 
) const [virtual]

Explode into entities.

Break entity into atomic entities and tranform entities them with tranformation t. Add the tranformed entities to the database ent.

Implements MyDXFEntity.

bool MyDXFArc::geom_same ( const MyDXFArc arc,
double  eps = 1.0e-6 
) const

Check if two entities are geometrically same.

Checks if entity a is the geometrically same as entity b within error limit eps.

double MyDXFArc::get_ang1 ( void  ) const [inline]

Get start angle.

double MyDXFArc::get_ang2 ( void  ) const [inline]

Get end angle.

virtual void MyDXFArc::get_bbox ( Vec3D min,
Vec3D max,
const class MyDXFFile dxf,
const Transformation t 
) const [virtual]

Return bounding box of entity.

Implements MyDXFEntity.

virtual EntityType MyDXFArc::get_type ( void  ) const [inline, virtual]

Get entity type.

Implements MyDXFEntity.

virtual void MyDXFArc::plot ( const class MyDXFFile dxf,
cairo_t *  cairo,
const Transformation t,
const double  range[4] 
) const [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.

Implements MyDXFEntity.

double MyDXFArc::radius ( void  ) const [inline]

Get radius of arc.

virtual int MyDXFArc::ray_cross ( double  x,
double  y 
) const [virtual]

Check for ray crossing.

Check if ray going from point (x,y) downwards (negative y direction) crosses the entity. Return 1 if crosses odd number of times and 0 if even number of times. Return 2 in case of exact crossing at boundaries. This function is used as a subroutine to inside_loop().

Implements MyDXFPathEntity.

virtual void MyDXFArc::scale ( class MyDXFFile dxf,
double  s 
) [virtual]

Scale entity by factor s.

Implements MyDXFEntity.

void MyDXFArc::set_ang1 ( double  ang1)

Set start angle.

void MyDXFArc::set_ang2 ( double  ang2)

Set end angle.

void MyDXFArc::set_center_and_ends ( const Vec3D c,
const Vec3D s,
const Vec3D e 
)

Set arc according to center and end points.

End point is only used for the angle.

void MyDXFArc::set_center_point ( const Vec3D s,
const Vec3D e 
)

Set arc according to end points.

Resets the center point and angles according to starting point s and ending point e. Arc is assumed to go in counter-clockwise direction from start to end. Radius of arc is kept constant if distance from s to e is less than double the radius. Otherwise the center point is set to the middle of start and end and the radius is set to half of the distance of start to end.

virtual void MyDXFArc::set_end ( const Vec3D e) [virtual]

Set end point of path entity.

Implements MyDXFPathEntity.

void MyDXFArc::set_pc ( const Vec3D pc) [inline]

Set center point.

void MyDXFArc::set_r ( double  r) [inline]

Set radius.

virtual void MyDXFArc::set_start ( const Vec3D s) [virtual]

Set start point of path entity.

Implements MyDXFPathEntity.

virtual Vec3D MyDXFArc::start ( void  ) const [inline, virtual]

Get start point of path entity.

Implements MyDXFPathEntity.

virtual void MyDXFArc::write ( class MyDXFFile dxf,
std::ofstream &  ostr 
) [virtual]

Write dxf file to stream.

Implements MyDXFEntity.


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