QCAD
Open Source 2D CAD
RPolylineProxy.h
Go to the documentation of this file.
1 
20 #ifndef RPOLYLINEPROXY_H
21 #define RPOLYLINEPROXY_H
22 
23 #include "../core_global.h"
24 
25 #include <RS.h>
26 #include <RMath.h>
27 
28 class RArc;
29 class RExporter;
30 class RLine;
31 class RPainterPath;
32 class RPolyline;
33 class RVector;
34 
35 
43 public:
44  virtual ~RPolylineProxy() {}
45  virtual RS::Ending getTrimEnd(RPolyline& polyline, const RVector& trimPoint, const RVector& clickPoint) = 0;
46  virtual bool trimStartPoint(RPolyline& polyline, const RVector& trimPoint, const RVector& clickPoint, bool extend = false) = 0;
47  virtual bool trimEndPoint(RPolyline& polyline, const RVector& trimPoint, const RVector& clickPoint, bool extend = false) = 0;
48  virtual bool trimStartPoint(RPolyline& polyline, double trimDist) = 0;
49  virtual bool trimEndPoint(RPolyline& polyline, double trimDist) = 0;
50  virtual bool relocateStartPoint(RPolyline& polyline, const RVector& p) = 0;
51  virtual bool relocateStartPoint(RPolyline& polyline, double dist) = 0;
52  virtual int getSegmentAtDist(const RPolyline& polyline, double dist) = 0;
53 
54  virtual QList<RPolyline> renderThickPolyline(const RPolyline& polyline) = 0;
55  virtual QList<RVector> verifyTangency(const RPolyline& polyline, double toleranceMin = RS::AngleTolerance, double toleranceMax = M_PI_4) = 0;
56  virtual double getArea(const RPolyline& polyline, double segmentLength) = 0;
57  virtual RVector getPointInside(const RPolyline& polyline) = 0;
58 
59  virtual QList<RPolyline> splitAtDiscontinuities(const RPolyline& polyline, double tolerance) = 0;
60 
61  virtual double getBaseAngle(const RPolyline& polyline) = 0;
62  virtual double getWidth(const RPolyline& polyline) = 0;
63  virtual bool setWidth(RPolyline& polyline, double v) = 0;
64  virtual double getHeight(const RPolyline& polyline) = 0;
65  virtual bool setHeight(RPolyline& polyline, double v) = 0;
66 
67  virtual QList<RPolyline> morph(const RPolyline& polyline, const RPolyline& target, int steps, RS::Easing easing = RS::Linear, bool zLinear = true, double customFactor = RNANDOUBLE) = 0;
68  virtual RPolyline roundAllCorners(const RPolyline& polyline, double radius) = 0;
69  virtual RPolyline getPolygonHull(const RPolyline& polyline, double angle, double tolerance, bool inner = false) = 0;
70  virtual RVector insertVertexAtDistance(RPolyline& polyline, double dist) = 0;
71 
72  virtual bool simplify(RPolyline& polyline, double tolerance) = 0;
73  virtual QList<RPolyline> splitAtSegmentTypeChange(const RPolyline& polyline) = 0;
74 };
75 
76 #endif
RPolylineProxy::splitAtSegmentTypeChange
virtual QList< RPolyline > splitAtSegmentTypeChange(const RPolyline &polyline)=0
M_PI_4
#define M_PI_4
Definition: RMath.h:43
RPolylineProxy::insertVertexAtDistance
virtual RVector insertVertexAtDistance(RPolyline &polyline, double dist)=0
RS::AngleTolerance
static const double AngleTolerance
Definition: RS.h:697
RMath.h
RPolylineProxy::trimEndPoint
virtual bool trimEndPoint(RPolyline &polyline, const RVector &trimPoint, const RVector &clickPoint, bool extend=false)=0
RVector
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
RPolylineProxy::~RPolylineProxy
virtual ~RPolylineProxy()
Definition: RPolylineProxy.h:44
RS::Ending
Ending
Entity ending.
Definition: RS.h:214
RPolylineProxy
Proxy for advanced polyline functionality.
Definition: RPolylineProxy.h:42
RS.h
RPolylineProxy::getPolygonHull
virtual RPolyline getPolygonHull(const RPolyline &polyline, double angle, double tolerance, bool inner=false)=0
RPolylineProxy::relocateStartPoint
virtual bool relocateStartPoint(RPolyline &polyline, double dist)=0
RPolylineProxy::trimEndPoint
virtual bool trimEndPoint(RPolyline &polyline, double trimDist)=0
RArc
Low-level mathematical representation of an arc.
Definition: RArc.h:40
RPolylineProxy::renderThickPolyline
virtual QList< RPolyline > renderThickPolyline(const RPolyline &polyline)=0
RPolylineProxy::getTrimEnd
virtual RS::Ending getTrimEnd(RPolyline &polyline, const RVector &trimPoint, const RVector &clickPoint)=0
RPolylineProxy::verifyTangency
virtual QList< RVector > verifyTangency(const RPolyline &polyline, double toleranceMin=RS::AngleTolerance, double toleranceMax=M_PI_4)=0
RPolylineProxy::setWidth
virtual bool setWidth(RPolyline &polyline, double v)=0
RS::Linear
@ Linear
Definition: RS.h:604
RLine
Low-level mathematical representation of a line.
Definition: RLine.h:41
RPolylineProxy::getHeight
virtual double getHeight(const RPolyline &polyline)=0
RPolylineProxy::morph
virtual QList< RPolyline > morph(const RPolyline &polyline, const RPolyline &target, int steps, RS::Easing easing=RS::Linear, bool zLinear=true, double customFactor=RNANDOUBLE)=0
RPolylineProxy::trimStartPoint
virtual bool trimStartPoint(RPolyline &polyline, double trimDist)=0
RNANDOUBLE
#define RNANDOUBLE
Definition: RMath.h:71
RPolylineProxy::getSegmentAtDist
virtual int getSegmentAtDist(const RPolyline &polyline, double dist)=0
RPolylineProxy::getPointInside
virtual RVector getPointInside(const RPolyline &polyline)=0
RPolylineProxy::setHeight
virtual bool setHeight(RPolyline &polyline, double v)=0
RExporter
Abstract base class for exporters.
Definition: RExporter.h:72
RPainterPath
Extended painter path with a z-level and a pen.
Definition: RPainterPath.h:46
RS::Easing
Easing
Definition: RS.h:603
RPolylineProxy::getBaseAngle
virtual double getBaseAngle(const RPolyline &polyline)=0
RPolylineProxy::roundAllCorners
virtual RPolyline roundAllCorners(const RPolyline &polyline, double radius)=0
RPolylineProxy::getWidth
virtual double getWidth(const RPolyline &polyline)=0
RPolylineProxy::simplify
virtual bool simplify(RPolyline &polyline, double tolerance)=0
RPolylineProxy::trimStartPoint
virtual bool trimStartPoint(RPolyline &polyline, const RVector &trimPoint, const RVector &clickPoint, bool extend=false)=0
RPolylineProxy::splitAtDiscontinuities
virtual QList< RPolyline > splitAtDiscontinuities(const RPolyline &polyline, double tolerance)=0
RPolyline
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition: RPolyline.h:49
RPolylineProxy::relocateStartPoint
virtual bool relocateStartPoint(RPolyline &polyline, const RVector &p)=0
QCADCORE_EXPORT
#define QCADCORE_EXPORT
Definition: core_global.h:10
RPolylineProxy::getArea
virtual double getArea(const RPolyline &polyline, double segmentLength)=0