2013-10-13 13:59:38 +00:00
|
|
|
#ifndef slic3r_SVG_hpp_
|
|
|
|
#define slic3r_SVG_hpp_
|
|
|
|
|
2015-12-07 23:39:54 +00:00
|
|
|
#include "libslic3r.h"
|
2015-01-06 15:26:15 +00:00
|
|
|
#include "ExPolygon.hpp"
|
2013-10-13 13:59:38 +00:00
|
|
|
#include "Line.hpp"
|
2013-10-26 12:41:37 +00:00
|
|
|
#include "TriangleMesh.hpp"
|
2013-10-13 13:59:38 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
|
|
|
class SVG
|
|
|
|
{
|
|
|
|
public:
|
2013-10-26 12:41:37 +00:00
|
|
|
bool arrows;
|
2015-01-06 15:26:15 +00:00
|
|
|
std::string fill, stroke;
|
|
|
|
|
2013-10-13 13:59:38 +00:00
|
|
|
SVG(const char* filename);
|
2015-01-06 19:51:48 +00:00
|
|
|
void draw(const Line &line, std::string stroke = "black");
|
2015-01-28 12:00:38 +00:00
|
|
|
void draw(const Lines &lines, std::string stroke = "black");
|
|
|
|
void draw(const IntersectionLines &lines, std::string stroke = "black");
|
2015-01-06 19:51:48 +00:00
|
|
|
void draw(const ExPolygon &expolygon, std::string fill = "grey");
|
2015-01-28 12:00:38 +00:00
|
|
|
void draw(const ExPolygons &expolygons, std::string fill = "grey");
|
2015-01-06 19:51:48 +00:00
|
|
|
void draw(const Polygon &polygon, std::string fill = "grey");
|
2015-01-28 12:00:38 +00:00
|
|
|
void draw(const Polygons &polygons, std::string fill = "grey");
|
2015-01-06 19:51:48 +00:00
|
|
|
void draw(const Polyline &polyline, std::string stroke = "black");
|
2015-01-28 12:00:38 +00:00
|
|
|
void draw(const Polylines &polylines, std::string stroke = "black");
|
2016-03-19 14:33:58 +00:00
|
|
|
void draw(const ThickPolylines &polylines, std::string stroke = "black");
|
2015-01-06 19:51:48 +00:00
|
|
|
void draw(const Point &point, std::string fill = "black", unsigned int radius = 3);
|
2015-01-28 12:00:38 +00:00
|
|
|
void draw(const Points &points, std::string fill = "black", unsigned int radius = 3);
|
2013-10-13 13:59:38 +00:00
|
|
|
void Close();
|
2015-01-06 15:26:15 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::string filename;
|
|
|
|
FILE* f;
|
|
|
|
|
|
|
|
void path(const std::string &d, bool fill);
|
2015-01-06 19:51:48 +00:00
|
|
|
std::string get_path_d(const MultiPoint &mp, bool closed = false) const;
|
2013-10-13 13:59:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|