QCAD
Open Source 2D CAD
RShapesExporter.h
Go to the documentation of this file.
1 
19 #ifndef RSHAPESEXPORTER_H
20 #define RSHAPESEXPORTER_H
21 
22 #include "core_global.h"
23 
24 #include "RShape.h"
25 #include "RExporter.h"
26 
31 public:
32  RShapesExporter(RExporter& exporter, const QList<QSharedPointer<RShape> >& shapes, double offset);
33  virtual void exportLineSegment(const RLine& line, double angle = RNANDOUBLE);
34 
36  return exporter.getLinetypePattern();
37  }
38  double getLineTypePatternScale(const RLinetypePattern& p) const {
39  return exporter.getLineTypePatternScale(p);
40  }
41 
42  virtual void exportPainterPaths(const QList<RPainterPath>& paths) {
43  exporter.exportPainterPaths(paths);
44  }
45 
46  virtual void exportPainterPaths(const QList<RPainterPath>& paths, double angle, const RVector& pos);
47 
48  virtual void exportXLine(const RXLine& ) {}
49  virtual void exportRay(const RRay& ) { }
50  virtual void exportPoint(const RPoint& ) { }
51  virtual void exportTriangle(const RTriangle& ) { }
52 
53  RVector getPointAt(double d, int* index = NULL);
54  double getAngleAt(double d);
55  int getShapeAt(double d);
56  void exportShapesBetween(int i1, const RVector& p1, int i2, const RVector& p2, double angle);
57 
58 private:
60  QList<QSharedPointer<RShape> > shapes;
61  std::vector<double> lengthAt;
62 };
63 
64 #endif
virtual void exportPainterPaths(const QList< RPainterPath > &paths)
Definition: RExporter.cpp:1558
virtual RLinetypePattern getLinetypePattern()
Definition: RShapesExporter.h:35
virtual void exportPoint(const RPoint &)
Exports a point with the current attributes.
Definition: RShapesExporter.h:50
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
QList< QSharedPointer< RShape > > shapes
Definition: RShapesExporter.h:60
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RShapesExporter.h:30
virtual void exportLineSegment(const RLine &line, double angle=RNANDOUBLE)=0
Exports a line segment (a line without pattern).
Low-level mathematical representation of a triangle.
Definition: RTriangle.h:46
#define QCADCORE_EXPORT
Definition: core_global.h:10
std::vector< double > lengthAt
Definition: RShapesExporter.h:61
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RLinetypePattern.h:45
virtual void exportTriangle(const RTriangle &)
Exports a triangle with the current attributes.
Definition: RShapesExporter.h:51
#define RNANDOUBLE
Definition: RMath.h:71
virtual void exportPainterPaths(const QList< RPainterPath > &paths)
Definition: RShapesExporter.h:42
virtual double getLineTypePatternScale(const RLinetypePattern &p) const
Definition: RExporter.cpp:1592
virtual void exportRay(const RRay &)
Exports an infinite ray.
Definition: RShapesExporter.h:49
Low-level mathematical representation of an infinite line.
Definition: RXLine.h:42
Low-level mathematical representation of a line.
Definition: RLine.h:41
virtual void exportXLine(const RXLine &)
Exports an infinite line.
Definition: RShapesExporter.h:48
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RPoint.h:38
virtual RLinetypePattern getLinetypePattern()
Definition: RExporter.cpp:893
Abstract base class for exporters.
Definition: RExporter.h:71
RExporter & exporter
Definition: RShapesExporter.h:59
Low-level mathematical representation of a ray.
Definition: RRay.h:42
double getLineTypePatternScale(const RLinetypePattern &p) const
Definition: RShapesExporter.h:38