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 RVector insertVertexAtDistance(RPolyline& polyline, double dist) = 0;
69 
70  virtual bool simplify(RPolyline& polyline, double tolerance) = 0;
71  virtual QList<RPolyline> splitAtSegmentTypeChange(const RPolyline& polyline) = 0;
72 };
73 
74 #endif
static const double AngleTolerance
Definition: RS.h:685
Ending
Entity ending.
Definition: RS.h:204
#define M_PI_4
Definition: RMath.h:43
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
virtual ~RPolylineProxy()
Definition: RPolylineProxy.h:44
Low-level mathematical representation of an arc.
Definition: RArc.h:40
#define QCADCORE_EXPORT
Definition: core_global.h:10
Definition: RS.h:593
#define RNANDOUBLE
Definition: RMath.h:71
Extended painter path with a z-level and a pen.
Definition: RPainterPath.h:46
void trimEndPoint(void shape, void trimPoint, void clickPoint)
Definition: library.js:596
Low-level mathematical representation of a line.
Definition: RLine.h:41
void trimStartPoint(void shape, void trimPoint, void clickPoint)
Definition: library.js:864
Abstract base class for exporters.
Definition: RExporter.h:71
Proxy for advanced polyline functionality.
Definition: RPolylineProxy.h:42
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition: RPolyline.h:49
Easing
Definition: RS.h:592