LibreCAD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lc::entity::LWVertex2D Class Reference

#include <lwpolyline.h>

Collaboration diagram for lc::entity::LWVertex2D:

Public Member Functions

 LWVertex2D (geo::Coordinate const location, double const bulge=0., double const startWidth=0., double const endWidth=0.)
 
 LWVertex2D (LWVertex2D const &other)
 
geo::Coordinate const location () const
 
LWVertex2D const move (geo::Coordinate const &offset)
 
LWVertex2D const rotate (const geo::Coordinate &rotation_center, double rotation_angle)
 
LWVertex2D const scale (const geo::Coordinate &scale_center, const geo::Coordinate &scale_factor)
 
double startWidth () const
 
double endWidth () const
 
double bulge () const
 

Public Attributes

geo::Coordinate _location
 
double _startWidth
 
double _endWidth
 
double _bulge
 

Friends

std::ostream & operator<< (std::ostream &os, const LWVertex2D &a)
 

Detailed Description

Vertex for a Light Weight polyline

Definition at line 19 of file lwpolyline.h.

Constructor & Destructor Documentation

lc::entity::LWVertex2D::LWVertex2D ( geo::Coordinate const  location,
double const  bulge = 0.,
double const  startWidth = 0.,
double const  endWidth = 0. 
)
inline

Definition at line 21 of file lwpolyline.h.

24  }
geo::Coordinate const location() const
Definition: lwpolyline.h:33
double startWidth() const
Definition: lwpolyline.h:57
double bulge() const
Definition: lwpolyline.h:65
double endWidth() const
Definition: lwpolyline.h:61
geo::Coordinate _location
Definition: lwpolyline.h:77
lc::entity::LWVertex2D::LWVertex2D ( LWVertex2D const &  other)
inline

Definition at line 26 of file lwpolyline.h.

27  : _location(other._location),
28  _startWidth(other._startWidth),
29  _endWidth(other._endWidth),
30  _bulge(other._bulge) {
31  }
geo::Coordinate _location
Definition: lwpolyline.h:77

Member Function Documentation

double lc::entity::LWVertex2D::bulge ( ) const
inline

Definition at line 65 of file lwpolyline.h.

65  {
66  return _bulge;
67  }
double lc::entity::LWVertex2D::endWidth ( ) const
inline

Definition at line 61 of file lwpolyline.h.

61  {
62  return _endWidth;
63  }
geo::Coordinate const lc::entity::LWVertex2D::location ( ) const
inline

Definition at line 33 of file lwpolyline.h.

33  {
34  return _location;
35  }
geo::Coordinate _location
Definition: lwpolyline.h:77
LWVertex2D const lc::entity::LWVertex2D::move ( geo::Coordinate const &  offset)
inline

Definition at line 37 of file lwpolyline.h.

37  {
38  return LWVertex2D(_location + offset);
39  }
LWVertex2D(geo::Coordinate const location, double const bulge=0., double const startWidth=0., double const endWidth=0.)
Definition: lwpolyline.h:21
geo::Coordinate _location
Definition: lwpolyline.h:77
LWVertex2D const lc::entity::LWVertex2D::rotate ( const geo::Coordinate rotation_center,
double  rotation_angle 
)
inline

Definition at line 41 of file lwpolyline.h.

41  {
42  return LWVertex2D(_location.rotate(rotation_center, rotation_angle));
43  }
Coordinate rotate(const Coordinate &angleVector) const
rotate around (0.,0.) with a given angle vector
LWVertex2D(geo::Coordinate const location, double const bulge=0., double const startWidth=0., double const endWidth=0.)
Definition: lwpolyline.h:21
geo::Coordinate _location
Definition: lwpolyline.h:77
LWVertex2D const lc::entity::LWVertex2D::scale ( const geo::Coordinate scale_center,
const geo::Coordinate scale_factor 
)
inline

Scale up/Down a polyline. Be aware that non-uniform scaling won't turn a arc into a ellipse.

Definition at line 48 of file lwpolyline.h.

48  {
49  if (scale_factor.x() == scale_factor.y()) {
50  return LWVertex2D(_location.scale(scale_center, scale_factor), _bulge * scale_factor.x(),
51  _startWidth * scale_factor.x(), _endWidth * scale_factor.x());
52  } else {
53  throw;
54  }
55  }
Coordinate scale(const double &scale_factor) const
LWVertex2D(geo::Coordinate const location, double const bulge=0., double const startWidth=0., double const endWidth=0.)
Definition: lwpolyline.h:21
geo::Coordinate _location
Definition: lwpolyline.h:77
double lc::entity::LWVertex2D::startWidth ( ) const
inline

Definition at line 57 of file lwpolyline.h.

57  {
58  return _startWidth;
59  }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const LWVertex2D a 
)
friend

Definition at line 70 of file lwpolyline.h.

70  {
71  os << "LWVertex2D(location=" << a._location << " startWidth=" << a._startWidth << " startHeight=" <<
72  a._endWidth << " bulge=" << a._bulge << ")";
73  return os;
74  }

Member Data Documentation

double lc::entity::LWVertex2D::_bulge

Definition at line 80 of file lwpolyline.h.

double lc::entity::LWVertex2D::_endWidth

Definition at line 79 of file lwpolyline.h.

geo::Coordinate lc::entity::LWVertex2D::_location

Definition at line 77 of file lwpolyline.h.

double lc::entity::LWVertex2D::_startWidth

Definition at line 78 of file lwpolyline.h.


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