aboutsummaryrefslogtreecommitdiff
path: root/svg-flatten/include/gerbolyze.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'svg-flatten/include/gerbolyze.hpp')
-rw-r--r--svg-flatten/include/gerbolyze.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/svg-flatten/include/gerbolyze.hpp b/svg-flatten/include/gerbolyze.hpp
index 9b05bdb..7b70501 100644
--- a/svg-flatten/include/gerbolyze.hpp
+++ b/svg-flatten/include/gerbolyze.hpp
@@ -110,6 +110,20 @@ namespace gerbolyze {
GerberPolarityToken m_current_polarity = GRB_POL_DARK;
};
+ class Scaler : public PolygonSink {
+ public:
+ Scaler(PolygonSink &sink, double scale=1.0) : m_sink(sink), m_scale(scale) {}
+ virtual void header(d2p origin, d2p size);
+ virtual Scaler &operator<<(const Polygon &poly);
+ virtual Scaler &operator<<(const LayerNameToken &layer_name);
+ virtual Scaler &operator<<(GerberPolarityToken pol);
+ virtual void footer();
+
+ private:
+ PolygonSink &m_sink;
+ double m_scale;
+ };
+
class StreamPolygonSink : public PolygonSink {
public:
StreamPolygonSink(std::ostream &out, bool only_polys=false) : m_only_polys(only_polys), m_out(out) {}