lpe-skeleton.cpp revision 80d34fe4a953d704430b44c6201a4fcbf455dfc6
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm#define INKSCAPE_LPE_SKELETON_CPP
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm/** \file
4b9b63a91da8fd8538b1cf3ce3ec3ea78522176ejohanengelen * LPE <skeleton> implementation, used as an example for a base starting class
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * when implementing new LivePathEffects.
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm *
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * In vi, three global search-and-replaces will let you rename everything
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * in this and the .h file:
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm *
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * :%s/SKELETON/YOURNAME/g
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * :%s/Skeleton/Yourname/g
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * :%s/skeleton/yourname/g
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm */
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm/*
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * Authors:
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * Johan Engelen
02b211d5ad0015f24b09dee846a89cf19e95f98dcilix *
02b211d5ad0015f24b09dee846a89cf19e95f98dcilix * Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm *
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * Released under GNU GPL, read the file 'COPYING' for more information
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm */
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm#include "live_effects/lpe-skeleton.h"
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm// You might need to include other 2geom files. You can add them here:
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm#include <2geom/path.h>
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmnamespace Inkscape {
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmnamespace LivePathEffect {
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmLPESkeleton::LPESkeleton(LivePathEffectObject *lpeobject) :
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm Effect(lpeobject),
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm // initialise your parameters here:
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm number(_("Float parameter"), _("just a real number like 1.4!"), "svgname", &wr, this, 1.2)
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm{
80d34fe4a953d704430b44c6201a4fcbf455dfc6cilix /* uncomment the following line to have the original path displayed while the item is selected */
80d34fe4a953d704430b44c6201a4fcbf455dfc6cilix //show_orig_path = true;
80d34fe4a953d704430b44c6201a4fcbf455dfc6cilix
80d34fe4a953d704430b44c6201a4fcbf455dfc6cilix /* register all your parameters here, so Inkscape knows which parameters this effect has: */
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm registerParameter( dynamic_cast<Parameter *>(&number) );
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm}
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmLPESkeleton::~LPESkeleton()
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm{
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm}
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm/* ########################
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * Choose to implement one of the doEffect functions. You can delete or comment out the others.
02b211d5ad0015f24b09dee846a89cf19e95f98dcilix */
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm/*
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmvoid
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmLPESkeleton::doEffect (SPCurve * curve)
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm{
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm // spice this up to make the effect actually *do* something!
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm}
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmstd::vector<Geom::Path>
fb95eb573982218bbb35250e42fe69d84c4fd64acilixLPESkeleton::doEffect_path (std::vector<Geom::Path> const & path_in)
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm{
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm std::vector<Geom::Path> path_out;
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm path_out = path_in; // spice this up to make the effect actually *do* something!
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm return path_out;
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm}
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm*/
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmGeom::Piecewise<Geom::D2<Geom::SBasis> >
ecda720053ff791e35dae3c5c1177bc225b6cdf1johanengelenLPESkeleton::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in)
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm{
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm Geom::Piecewise<Geom::D2<Geom::SBasis> > output;
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm output = pwd2_in; // spice this up to make the effect actually *do* something!
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm return output;
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm}
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm/* ######################## */
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm} //namespace LivePathEffect
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm} /* namespace Inkscape */
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm/*
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm Local Variables:
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm mode:c++
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm c-file-style:"stroustrup"
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm indent-tabs-mode:nil
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm fill-column:99
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm End:
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm*/
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :