1 #ifndef __SP_LIVAROT_H__
2 #define __SP_LIVAROT_H__
4 /*
5 * boolops and outlines
6 *
7 * public domain
8 */
10 #include "livarot/Path.h"
11 #include <2geom/forward.h>
12 #include <2geom/path.h>
13 class SPCurve;
14 struct SPItem;
16 // boolean operations
17 // work on the current selection
18 // selection has 2 contain exactly 2 items
19 void sp_selected_path_union (SPDesktop *desktop);
20 void sp_selected_path_union_skip_undo (SPDesktop *desktop);
21 void sp_selected_path_intersect (SPDesktop *desktop);
22 void sp_selected_path_diff (SPDesktop *desktop);
23 void sp_selected_path_diff_skip_undo (SPDesktop *desktop);
24 void sp_selected_path_symdiff (SPDesktop *desktop);
25 void sp_selected_path_cut (SPDesktop *desktop);
26 void sp_selected_path_slice (SPDesktop *desktop);
28 // offset/inset of a curve
29 // takes the fill-rule in consideration
30 // offset amount is the stroke-width of the curve
31 void sp_selected_path_offset (SPDesktop *desktop);
32 void sp_selected_path_offset_screen (SPDesktop *desktop, double pixels);
33 void sp_selected_path_inset (SPDesktop *desktop);
34 void sp_selected_path_inset_screen (SPDesktop *desktop, double pixels);
35 void sp_selected_path_create_offset (SPDesktop *desktop);
36 void sp_selected_path_create_inset (SPDesktop *desktop);
37 void sp_selected_path_create_updating_offset (SPDesktop *desktop);
38 void sp_selected_path_create_updating_inset (SPDesktop *desktop);
40 void sp_selected_path_create_offset_object_zero (SPDesktop *desktop);
41 void sp_selected_path_create_updating_offset_object_zero (SPDesktop *desktop);
43 // outline of a curve
44 // uses the stroke-width
45 void sp_selected_path_outline (SPDesktop *desktop);
47 // simplifies a path (removes small segments and the like)
48 void sp_selected_path_simplify (SPDesktop *desktop);
50 Path *Path_for_item(SPItem *item, bool doTransformation, bool transformFull = true);
51 Geom::PathVector* pathvector_for_curve(SPItem *item, SPCurve *curve, bool doTransformation, bool transformFull, Geom::Matrix extraPreAffine, Geom::Matrix extraPostAffine);
52 SPCurve *curve_for_item(SPItem *item);
53 boost::optional<Path::cut_position> get_nearest_position_on_Path(Path *path, Geom::Point p, unsigned seg = 0);
54 Geom::Point get_point_on_Path(Path *path, int piece, double t);
56 #endif
58 /*
59 Local Variables:
60 mode:c++
61 c-file-style:"stroustrup"
62 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
63 indent-tabs-mode:nil
64 fill-column:99
65 End:
66 */
67 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :