diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2008-07-15 12:41:43 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2008-07-15 12:41:43 +0000 |
| commit | bfa81f113e1a7b19804c4543c1e05cc6c5cf0fda (patch) | |
| tree | ac5a346a9ba67d0ebde14f648d7f266c6aa9e5c3 /src/live_effects | |
| parent | Print distance info in console for LPERuler until new CanvasText item works (diff) | |
| download | inkscape-bfa81f113e1a7b19804c4543c1e05cc6c5cf0fda.tar.gz inkscape-bfa81f113e1a7b19804c4543c1e05cc6c5cf0fda.zip | |
New LPE FreehandShape derived from PatternAlongPath (for the shapes in pen/pencil context); don't apply shapes each time the selection changes; new functions to test for specific LPE type and if a path can accept a new shape
(bzr r6322)
Diffstat (limited to 'src/live_effects')
| -rw-r--r-- | src/live_effects/effect.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/effect.h | 1 | ||||
| -rw-r--r-- | src/live_effects/lpe-patternalongpath.cpp | 4 | ||||
| -rw-r--r-- | src/live_effects/lpe-patternalongpath.h | 17 |
4 files changed, 26 insertions, 0 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index d5ac6dc74..4c74d56a6 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -72,6 +72,7 @@ const Util::EnumData<EffectType> LPETypeData[INVALID_LPE] = { // {constant defined in effect.h, N_("name of your effect"), "name of your effect in SVG"} {BEND_PATH, N_("Bend"), "bend_path"}, {PATTERN_ALONG_PATH, N_("Pattern Along Path"), "skeletal"}, // for historic reasons, this effect is called skeletal(strokes) in Inkscape:SVG + {FREEHAND_SHAPE, N_("Freehand Shape"), "freehand_shape"}, // this is actually a special type of PatternAlongPath, used to paste shapes in pen/pencil tool {SKETCH, N_("Sketch"), "sketch"}, {VONKOCH, N_("VonKoch"), "vonkoch"}, {KNOT, N_("Knot"), "knot"}, @@ -106,6 +107,9 @@ Effect::New(EffectType lpenr, LivePathEffectObject *lpeobj) case PATTERN_ALONG_PATH: neweffect = static_cast<Effect*> ( new LPEPatternAlongPath(lpeobj) ); break; + case FREEHAND_SHAPE: + neweffect = static_cast<Effect*> ( new LPEFreehandShape(lpeobj) ); + break; case BEND_PATH: neweffect = static_cast<Effect*> ( new LPEBendPath(lpeobj) ); break; diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index eced0a194..fbaf8f867 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -53,6 +53,7 @@ namespace LivePathEffect { enum EffectType { BEND_PATH = 0, PATTERN_ALONG_PATH, + FREEHAND_SHAPE, SKETCH, VONKOCH, KNOT, diff --git a/src/live_effects/lpe-patternalongpath.cpp b/src/live_effects/lpe-patternalongpath.cpp index 2e10efe7a..30ec589af 100644 --- a/src/live_effects/lpe-patternalongpath.cpp +++ b/src/live_effects/lpe-patternalongpath.cpp @@ -7,6 +7,7 @@ */ #include "live_effects/lpe-patternalongpath.h" +#include "live_effects/lpeobject.h" #include "sp-shape.h" #include "display/curve.h" #include <libnr/n-art-bpath.h> @@ -203,6 +204,9 @@ LPEPatternAlongPath::transform_multiply(Geom::Matrix const& postmul, bool set) Effect::transform_multiply(postmul, set); } +LPEFreehandShape::LPEFreehandShape(LivePathEffectObject *lpeobject) : LPEPatternAlongPath(lpeobject) +{ +} } // namespace LivePathEffect } /* namespace Inkscape */ diff --git a/src/live_effects/lpe-patternalongpath.h b/src/live_effects/lpe-patternalongpath.h index 341f99454..10b9e8bc2 100644 --- a/src/live_effects/lpe-patternalongpath.h +++ b/src/live_effects/lpe-patternalongpath.h @@ -51,7 +51,24 @@ private: LPEPatternAlongPath& operator=(const LPEPatternAlongPath&); }; +class LPEFreehandShape : public LPEPatternAlongPath { +public: + LPEFreehandShape(LivePathEffectObject *lpeobject); + virtual ~LPEFreehandShape() {} +}; + }; //namespace LivePathEffect }; //namespace Inkscape #endif + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : |
