Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.6dev
      Class Index
      File List
   Version 1.0.6
   Version 1.0.5new_solver
   Version 1.0.5dev
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads
MyDXFArc Class Reference

DXF arc entity class. More...

#include <mydxfarc.hpp>

Inheritance diagram for MyDXFArc:
MyDXFPathEntity MyDXFEntity

Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from MyDXFPathEntity
 MyDXFPathEntity (const MyDXFEntity &ent)
 
- Protected Member Functions inherited from 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
 
- Static Protected Member Functions inherited from MyDXFEntity
static void bbox_ppoint (Vec3D &min, Vec3D &max, const Vec3D &p)
 Propose a point to bounding box. More...
 
- Protected Attributes inherited from MyDXFEntity
std::string _handle
 
std::string _layer
 

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() [1/2]

MyDXFArc::MyDXFArc ( )
inline

Default constructor.

◆ MyDXFArc() [2/2]

MyDXFArc::MyDXFArc ( class MyDXFFile dxf)

Construct arc entity by reading from DXF file.

#define DEBUG_INSIDE_LOOP 1

◆ ~MyDXFArc()

virtual MyDXFArc::~MyDXFArc ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ center()

Vec3D MyDXFArc::center ( void  ) const
inline

Get center point of arc.

◆ copy()

virtual MyDXFArc* MyDXFArc::copy ( void  ) const
inlinevirtual

Get a new copy of entity.

Implements MyDXFEntity.

◆ debug_print()

void MyDXFArc::debug_print ( std::ostream &  os) const
virtual

Print debugging information to stream os.

Implements MyDXFEntity.

◆ end()

virtual Vec3D MyDXFArc::end ( void  ) const
inlinevirtual

Get end point of path entity.

Implements MyDXFPathEntity.

◆ explode()

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.

◆ geom_same()

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.

◆ get_ang1()

double MyDXFArc::get_ang1 ( void  ) const
inline

Get start angle.

◆ get_ang2()

double MyDXFArc::get_ang2 ( void  ) const
inline

Get end angle.

◆ get_bbox()

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

Return bounding box of entity.

Implements MyDXFEntity.

◆ get_type()

virtual EntityType MyDXFArc::get_type ( void  ) const
inlinevirtual

Get entity type.

Implements MyDXFEntity.

◆ plot()

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.

◆ radius()

double MyDXFArc::radius ( void  ) const
inline

Get radius of arc.

◆ ray_cross()

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.

◆ rotate_z()

void MyDXFArc::rotate_z ( class MyDXFFile dxf,
double  a 
)
virtual

Rotate entity around origin.

Rotate for a radians.

Implements MyDXFEntity.

◆ scale()

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

Scale entity by factor s.

Implements MyDXFEntity.

◆ set_ang1()

void MyDXFArc::set_ang1 ( double  ang1)

Set start angle.

◆ set_ang2()

void MyDXFArc::set_ang2 ( double  ang2)

Set end angle.

◆ set_center_and_ends()

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.

◆ set_center_point()

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.

◆ set_end()

void MyDXFArc::set_end ( const Vec3D e)
virtual

Set end point of path entity.

Implements MyDXFPathEntity.

◆ set_pc()

void MyDXFArc::set_pc ( const Vec3D pc)
inline

Set center point.

◆ set_r()

void MyDXFArc::set_r ( double  r)
inline

Set radius.

◆ set_start()

void MyDXFArc::set_start ( const Vec3D s)
virtual

Set start point of path entity.

Implements MyDXFPathEntity.

◆ start()

virtual Vec3D MyDXFArc::start ( void  ) const
inlinevirtual

Get start point of path entity.

Implements MyDXFPathEntity.

◆ translate()

void MyDXFArc::translate ( class MyDXFFile dxf,
const Vec3D dx 
)
virtual

Translate entity by dx.

Implements MyDXFEntity.

◆ write()

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 files:


Reference manual for Ion Beam Simulator 1.0.6dev
Generated by Doxygen 1.9.1 on Thu Sep 11 2025 09:37:24.