/*
7 * Created by fred on Fri Dec 05 2003.
8 * tweaked endlessly by bulia byak <buliabyak@users.sf.net>
10 * Copyright (C) 2018 Authors
11 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
37 auto group = cast<SPGroup>(
item);
39 int pathsSimplified = 0;
40 std::vector<SPItem*>
items = group->item_list();
44 return pathsSimplified;
47 auto path = cast<SPPath>(
item);
52 std::string orig_path_str;
53 if (path->getRepr()->attribute(
"d")) {
54 orig_path_str = path->getRepr()->attribute(
"d");
57 int nodes_before_simplify = path->nodesInPath();
61 bool simplifyIndividualPaths = prefs->
getBool(
"/options/simplifyindividualpaths/value");
62 if (simplifyIndividualPaths) {
65 size = L2(itemBbox->dimensions());
95 orig->ConvertEvenLines(threshold *
size);
100 auto simplified_path_str =
orig->svg_dump_path();
117 int nodes_after_simplify = path->nodesInPath();
119 if (nodes_before_simplify < nodes_after_simplify) {
TODO: insert short description here.
3x3 matrix representing an affine transformation.
Coord descrim() const
Calculate the descriminant.
Axis-aligned rectangle that can be empty.
Preference storage class.
bool getBool(Glib::ustring const &pref_path, bool def=false)
Retrieve a Boolean value.
static Preferences * get()
Access the singleton Preferences object.
virtual char const * attribute(char const *key) const =0
Get the string representation of a node's attribute.
Base class for visual SVG elements.
Geom::OptRect documentVisualBounds() const
Get item's visual bbox in document coordinate system.
Geom::Affine i2doc_affine() const
Returns the accumulated transformation of the item and all its ancestors, including root's viewport.
void doWriteTransform(Geom::Affine const &transform, Geom::Affine const *adv=nullptr, bool compensate=true)
Set a new transform on an object.
void setAttribute(Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value)
void removeAttribute(char const *key)
Inkscape::XML::Node * getRepr()
Returns the XML representation of tree.
TODO: insert short description here.
Affine identity()
Create an identity matrix.
int path_simplify(SPItem *item, float threshold, bool justCoalesce, double size)
Simplify paths (reduce node count).
std::unique_ptr< Path > Path_for_item_before_LPE(SPItem *item, bool doTransformation, bool transformFull)
Creates a Livarot Path object from the SPItem.
Singleton class to access the preferences file in a convenient way.