Swiftray  1.0
toolpath-exporter.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <QList>
4 #include <QPainter>
5 #include <layer.h>
6 #include <shape/bitmap-shape.h>
7 #include <shape/path-shape.h>
8 #include <shape/group-shape.h>
10 
12 public:
13  ToolpathExporter(BaseGenerator *generator) noexcept;
14 
15  void convertStack(const QList<LayerPtr> &layers);
16 
17 private:
18  void convertLayer(const LayerPtr &layer);
19 
20  void convertShape(const ShapePtr &shape);
21 
22  void convertGroup(const GroupShape *group);
23 
24  void convertBitmap(const BitmapShape *bmp);
25 
26  void convertPath(const PathShape *path);
27 
28  void sortPolygons();
29 
30  void outputLayerGcode();
31 
32  void outputLayerPathGcode();
33 
34  void outputLayerBitmapGcode();
35 
36  bool rasterBitmapRowHighSpeed(unsigned char *data, float global_coord_y, bool reverse, QPointF offset);
37 
38  bool rasterBitmapRow(unsigned char *data, float global_coord_y, bool reverse, QPointF offset);
39 
40  QTransform global_transform_;
41  QList<ShapePtr> layer_elements_;
42  QList<QPolygonF> layer_polygons_;
43  QPixmap layer_bitmap_;
44  LayerPtr current_layer_;
45  unique_ptr<QPainter> layer_painter_;
46  BaseGenerator *gen_;
47  float dpmm_;
48  float travel_speed_;
49  QRectF bitmap_dirty_area_;
50 };
Definition: base-generator.h:8
Definition: bitmap-shape.h:7
Definition: group-shape.h:8
Definition: path-shape.h:7
Definition: toolpath-exporter.h:11
ToolpathExporter(BaseGenerator *generator) noexcept
Definition: toolpath-exporter.cpp:8
void convertStack(const QList< LayerPtr > &layers)
Definition: toolpath-exporter.cpp:15
shared_ptr< Layer > LayerPtr
Definition: layer.h:127
shared_ptr< Shape > ShapePtr
Definition: shape.h:137