aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-01-27 00:49:31 +0100
committerjaseg <git@jaseg.de>2021-01-27 00:49:31 +0100
commit5285b6dce8f0df37282b744ce625d4976b0f2541 (patch)
tree3e73522b83c9b83c8e3aeb49bb17bb7a61293796 /include
parent70d0021df14faa412d9a94d0e59bfcd4c7082a9d (diff)
downloadgerbolyze-5285b6dce8f0df37282b744ce625d4976b0f2541.tar.gz
gerbolyze-5285b6dce8f0df37282b744ce625d4976b0f2541.tar.bz2
gerbolyze-5285b6dce8f0df37282b744ce625d4976b0f2541.zip
Add group id include/exclude matching
Diffstat (limited to 'include')
-rw-r--r--include/gerbolyze.hpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/gerbolyze.hpp b/include/gerbolyze.hpp
index 6895f09..b2634f0 100644
--- a/include/gerbolyze.hpp
+++ b/include/gerbolyze.hpp
@@ -76,6 +76,14 @@ namespace gerbolyze {
bool m_only_polys = false;
std::ostream &m_out;
};
+
+ class ElementSelector {
+ public:
+ bool match(const pugi::xml_node &node, bool included) const;
+
+ std::vector<std::string> include;
+ std::vector<std::string> exclude;
+ };
class SVGDocument {
public:
@@ -95,8 +103,8 @@ namespace gerbolyze {
double width() const { return page_w_mm; }
double height() const { return page_h_mm; }
- void render(PolygonSink &sink);
- void render_to_list(std::vector<std::pair<Polygon, GerberPolarityToken>> &out);
+ void render(PolygonSink &sink, const ElementSelector *sel=nullptr);
+ void render_to_list(std::vector<std::pair<Polygon, GerberPolarityToken>> &out, const ElementSelector *sel=nullptr);
private:
friend class Pattern;
@@ -105,7 +113,7 @@ namespace gerbolyze {
const ClipperLib::Paths *lookup_clip_path(const pugi::xml_node &node);
Pattern *lookup_pattern(const std::string id);
- void export_svg_group(const pugi::xml_node &group, ClipperLib::Paths &parent_clip_path);
+ void export_svg_group(const pugi::xml_node &group, ClipperLib::Paths &parent_clip_path, const ElementSelector *sel=nullptr, bool included=true);
void export_svg_path(const pugi::xml_node &node, ClipperLib::Paths &clip_path);
void setup_debug_output(std::string filename="");
void setup_viewport_clip();