1 /**
2  * \file lpe-framework.h
3  * \brief A framework for writing an Inkscape Live Path Effect toy.
4  *
5  * Instead of using the standard toy framework, one can use this LPE
6  * framework when creating an LPE for Inkscape. When new 2geom functions
7  * are required for the LPE, adding this functionality directly in Inkscape
8  * greatly increases compile times. Using this framework, one only has to
9  * rebuild 2geom, which speeds up development considerably. (Think about
10  * how much of Inkscape will have to be rebuild if you change/add something
11  * in point.h ...)
12  * An example of how to use this framework is lpe.test.cpp.
13  *//*
14  * Copyright 2009  Johan Engelen <goejendaagh@zonnet.nl>
15  *
16  * This library is free software; you can redistribute it and/or
17  * modify it either under the terms of the GNU Lesser General Public
18  * License version 2.1 as published by the Free Software Foundation
19  * (the "LGPL") or, at your option, under the terms of the Mozilla
20  * Public License Version 1.1 (the "MPL"). If you do not alter this
21  * notice, a recipient may use your version of this file under either
22  * the MPL or the LGPL.
23  *
24  * You should have received a copy of the LGPL along with this library
25  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27  * You should have received a copy of the MPL along with this library
28  * in the file COPYING-MPL-1.1
29  *
30  * The contents of this file are subject to the Mozilla Public License
31  * Version 1.1 (the "License"); you may not use this file except in
32  * compliance with the License. You may obtain a copy of the License at
33  * http://www.mozilla.org/MPL/
34  *
35  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
36  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
37  * the specific language governing rights and limitations.
38  *
39  */
40 
41 #ifndef _2GEOM_LPE_TOY_FRAMEWORK_H_
42 #define _2GEOM_LPE_TOY_FRAMEWORK_H_
43 
44 /**
45  *  This should greatly simplify creating toy code for a Live Path Effect (LPE) for Inkscape
46  */
47 
48 
49 #include <toys/toy-framework-2.h>
50 #include <2geom/pathvector.h>
51 
52 class LPEToy: public Toy {
53 public:
54     LPEToy();
55     void draw(cairo_t *cr, std::ostringstream *notify, int width, int height, bool save, std::ostringstream *timer_stream);
56     virtual Geom::PathVector
57             doEffect_path (Geom::PathVector const & path_in);
58     virtual Geom::Piecewise<Geom::D2<Geom::SBasis> >
59             doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in);
60 
61     /** this boolean defaults to false, it concatenates the input path to one pwd2,
62      * instead of normally 'splitting' the path into continuous pwd2 paths. */
63     bool concatenate_before_pwd2;
64     PointSetHandle curve_handle;
65 };
66 
67 #endif // _2GEOM_LPE_TOY_FRAMEWORK_H_
68 /*
69 	Local Variables:
70 	mode:c++
71 	c-file-style:"stroustrup"
72 	c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
73 	indent-tabs-mode:nil
74 	fill-column:99
75 	End:
76       */
77 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4:fileencoding=utf-8:textwidth=99 :
78