From 05056226ae6308ef88dc7477a90f969bb396a954 Mon Sep 17 00:00:00 2001 From: micio Date: Sat, 2 Feb 2013 15:55:39 +0000 Subject: [PATCH] Bazaar/DXF : added Arc with point and bulge to polyline git-svn-id: svn://ultimatepp.org/upp/trunk@5752 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- bazaar/DXF/LwPolyline.cpp | 11 +++++++++++ bazaar/DXF/LwPolyline.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/bazaar/DXF/LwPolyline.cpp b/bazaar/DXF/LwPolyline.cpp index 242287456..9bfa4486b 100644 --- a/bazaar/DXF/LwPolyline.cpp +++ b/bazaar/DXF/LwPolyline.cpp @@ -301,6 +301,17 @@ DXFLwPolyline &DXFLwPolyline::AddArcCenter(Pointf const ¢er, Pointf const &p return *this; } +// adds an arc with point and bulge; if bulge is null, just add a line segment +DXFLwPolyline &DXFLwPolyline::AddArc(Pointf const &p, double bulge) +{ + if(!vertices.GetCount()) + return AddPoints(p); + bulges.Top() = bulge; + vertices.Add(T(p)); + bulges.Add(0); + return *this; +} + // close/open polyline DXFLwPolyline &DXFLwPolyline::Close(void) { diff --git a/bazaar/DXF/LwPolyline.h b/bazaar/DXF/LwPolyline.h index c600ac390..bda556e47 100644 --- a/bazaar/DXF/LwPolyline.h +++ b/bazaar/DXF/LwPolyline.h @@ -64,6 +64,9 @@ class DXFLwPolyline : public DXFEntity // if no previous point, simply add a point DXFLwPolyline &AddArcCenter(Pointf const ¢er, Pointf const &p, bool big = false); + // adds an arc with point and bulge; if bulge is null, just add a line segment + DXFLwPolyline &AddArc(Pointf const &p, double bulge); + // close/open polyline DXFLwPolyline &Close(void); DXFLwPolyline &Open(void);