10 #ifndef SVGWRAP_H_UOFARIZONAVISION
11 #define SVGWRAP_H_UOFARIZONAVISION 1
207 return "<?xml version=\"1.0\" ?>\n"
208 "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n"
209 "\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n";
216 std::string svg_open_tag()
const
218 std::ostringstream tag;
219 tag <<
"<svg xmlns=\"http://www.w3.org/2000/svg\" "
220 "xmlns:xlink=\"http://www.w3.org/1999/xlink\" "
227 std::string generate_fill_attr()
const;
228 std::string generate_stroke_attr()
const;
SvgWrap & set_path_extra(const std::string &)
set an extra attribute to add to each path node in SVG
Definition: svgwrap.cpp:192
bool m_fill_path
should the path be filled?
Definition: svgwrap.h:50
bool m_gen_xml_header
print the special XML header tag?
Definition: svgwrap.h:50
const std::string & get_id() const
retrieve the identifier for this rendering
Definition: svgwrap.h:190
SvgWrap & set_fill(bool fill=false)
can opt in/out of making this a filled polygon
Definition: svgwrap.h:145
bool m_open_svg
print an opening SVG tag?
Definition: svgwrap.h:50
SvgWrap & set_id(const std::string &)
try to set the id string for the path
Definition: svgwrap.cpp:159
SvgWrap & set_text(bool txt=true)
can opt in/out of showing point sequence index
Definition: svgwrap.h:114
std::string m_color
color, as text string, of objects
Definition: svgwrap.h:59
bool m_show_segments
show line segments between points?
Definition: svgwrap.h:50
SvgWrap & set_xml(bool xml=true)
can opt in/out of emitting XML tag at start of output
Definition: svgwrap.h:92
bool m_totally_omit_fill_attribute
no mention of fill at all
Definition: svgwrap.h:63
unsigned m_height
height in world units of SVG image
Definition: svgwrap.h:56
static PixPath reserve(size_t potential_size=0)
named ctor creates an empty path but reserves some memory for it
Definition: pixpath.h:244
SvgWrap(const PixPath &pp=PixPath::reserve())
ctor take a path and sets fields to sensible default values
Definition: svgwrap.h:67
SvgWrap & set_svg(bool svg_open, bool svg_close)
can opt in/out of emitting SVG open, close tags (you pick which)
Definition: svgwrap.h:106
unsigned m_magnify
magnification from world to image
Definition: svgwrap.h:56
SvgWrap & set_color(const std::string &color)
set the color of the path and text
Definition: svgwrap.h:132
std::string operator()() const
render the path in a rectangular box using SVG 1.1
Definition: svgwrap.cpp:81
const std::string & get_path_extra() const
retrieve the optional extra-path-attribute string.
Definition: svgwrap.h:199
Representation of a sequence of pixel coordinates.
Definition: pixpath.h:117
bool m_totally_omit_stroke_attribute
no mention of stroke at all
Definition: svgwrap.h:63
SvgWrap & set_color(const kjb_c::Pixel &color)
see overload of same name, but this takes a struct kjb_c::Pixel.
Definition: svgwrap.h:139
Code for a wrapper class around the C struct Pixel.
SvgWrap & set_fill_color(const kjb_c::Pixel &color)
see overload of same name, but this takes a struct kjb_c::Pixel.
Definition: svgwrap.h:181
bool m_show_text
show numbered sequence of points?
Definition: svgwrap.h:50
bool m_close_svg
print the close tag of the SVG node?
Definition: svgwrap.h:50
std::string pixel_as_hex_triplet_string(const kjb_c::Pixel *)
express color as HTML-style hex triplet, e.g., "#FFCC00," of pointer
Definition: i_pixel.h:366
static std::string xml_header()
string for top of a standalone XML file
Definition: svgwrap.h:205
SvgWrap & set_fill_color(const std::string &color)
set the color used for filling the polygon interior (if any).
Definition: svgwrap.h:174
std::string m_fill_color
color of fill, can override default
Definition: svgwrap.h:59
class used to render a PixPath as an SVG polygonal path picture
Definition: svgwrap.h:41
SvgWrap & set_svg(bool svg=true)
can opt in/out of emitting opening SVG tag at start of output
Definition: svgwrap.h:99
Contains definition for class PixPath.
unsigned m_width
width in world units of the SVG image
Definition: svgwrap.h:56
SvgWrap & set_segs(bool seg=true)
can opt in/out of showing line segments between points of path
Definition: svgwrap.h:85