15#ifndef SP_LPE_ITEM_H_SEEN
16#define SP_LPE_ITEM_H_SEEN
24#include <sigc++/scoped_connection.h>
37namespace LivePathEffect{
38class LPEObjectReference;
55 int tag()
const override {
return tag_of<
decltype(*this)>; }
66 std::vector<LivePathEffectObject const *>
const &new_lpeobjs );
74 void update(
SPCtx* ctx,
unsigned int flags)
override;
75 void modified(
unsigned int flags)
override;
95 std::size_t
countLPEOfType(
int const type,
bool inc_hidden =
true,
bool is_ready =
true)
const;
102 std::vector<Inkscape::LivePathEffect::Effect const *>
getPathEffects()
const;
103 std::vector<SPObject *>
get_satellites(
bool force =
true,
bool recursive =
false,
bool onchilds =
false);
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
3x3 matrix representing an affine transformation.
Interface for refcounted XML nodes.
To do: update description of desktop.
Typed SVG document implementation.
Base class for visual SVG elements.
bool isOnClipboard()
The lpeitem is on clipboard.
void remove_child(Inkscape::XML::Node *child) override
std::vector< Inkscape::LivePathEffect::Effect * > getPathEffectsOfType(int type)
void notifyTransform(Geom::Affine const &postmul)
notify tranbsform applied to a LPE
void duplicateCurrentPathEffect()
void downCurrentPathEffect()
Inkscape::LivePathEffect::Effect * getCurrentLPE()
void resetClipPathAndMaskLPE(bool fromrecurse=false)
PathEffectSharedPtr getNextLPEReference(PathEffectSharedPtr const &lperef)
std::vector< Inkscape::LivePathEffect::Effect * > getPathEffects()
void applyToMask(SPItem *to, Inkscape::LivePathEffect::Effect *lpe=nullptr)
void upCurrentPathEffect()
bool hasBrokenPathEffect() const
used for shapes so they can see if they should also disable shape calculation and read from d=
Inkscape::LivePathEffect::Effect * getFirstPathEffectOfType(int type)
bool hasPathEffect() const
void applyToClipPath(SPItem *to, Inkscape::LivePathEffect::Effect *lpe=nullptr)
SPLPEItem const * getTopPathEffect() const
returns top most LPE item with LPE
PathEffectSharedPtr current_path_effect
void movePathEffect(gint origin, gint dest, bool select_moved=false)
PathEffectSharedPtr getLastLPEReference()
std::list< sigc::scoped_connection > lpe_modified_connection_list
std::vector< SPObject * > get_satellites(bool force=true, bool recursive=false, bool onchilds=false)
void replacePathEffects(std::vector< LivePathEffectObject const * > const &old_lpeobjs, std::vector< LivePathEffectObject const * > const &new_lpeobjs)
Writes a new "inkscape:path-effect" string to xml, where the old_lpeobjects are substituted by the ne...
SPLPEItem * removeCurrentPathEffect(bool keep_paths)
If keep_path is true, the item should not be updated, effectively 'flattening' the LPE.
bool performOnePathEffect(Geom::PathVector &curve, SPShape *current, Inkscape::LivePathEffect::Effect *lpe, bool is_clip_or_mask=false)
returns true when LPE was successful.
void update_satellites(bool recursive=true)
bool hasPathEffectOnClipOrMaskRecursive(SPLPEItem *shape) const
returns true when any LPE apply to clip or mask.
std::size_t getLPEReferenceIndex(PathEffectSharedPtr const &lperef) const
std::size_t getLPEIndex(Inkscape::LivePathEffect::Effect *lpe) const
bool hasPathEffectOfTypeRecursive(int const type, bool is_ready=true) const
bool performPathEffect(Geom::PathVector &curve, SPShape *current, bool is_clip_or_mask=false)
returns true when LPE was successful.
std::size_t countLPEOfType(int const type, bool inc_hidden=true, bool is_ready=true) const
PathEffectList getEffectList()
void child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) override
bool hasPathEffectOfType(int const type, bool is_ready=true) const
SPLPEItem * removeAllPathEffects(bool keep_paths, bool recursive=false)
If keep_path is true, the item should not be updated, effectively 'flattening' the LPE.
SPLPEItem * flattenCurrentPathEffect()
void removePathEffect(Inkscape::LivePathEffect::Effect *lpe, bool keep_paths)
bool hasPathEffectRecursive() const
void addPathEffect(std::string value, bool reset)
void applyToClipPathOrMask(SPItem *clip_mask, SPItem *to, Inkscape::LivePathEffect::Effect *lpe=nullptr)
Inkscape::LivePathEffect::Effect * getLastLPE()
bool pathEffectsEnabled() const
virtual void update_patheffect(bool write)
PathEffectList * path_effect_list
void update(SPCtx *ctx, unsigned int flags) override
bool forkPathEffectsIfNecessary(unsigned int nr_of_allowed_users=1, bool recursive=true, bool force=false)
Check all effects in the stack if they are used by other items, and fork them if so.
void build(SPDocument *doc, Inkscape::XML::Node *repr) override
void modified(unsigned int flags) override
bool hasPathEffectOnClipOrMask(SPLPEItem *shape) const
returns true when any LPE apply to clip or mask.
PathEffectSharedPtr getCurrentLPEReference()
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override
PathEffectSharedPtr getPrevLPEReference(PathEffectSharedPtr const &lperef)
std::vector< Inkscape::Display::TemporaryItem * > lpe_helperpaths
Inkscape::LivePathEffect::Effect * getPrevLPE(Inkscape::LivePathEffect::Effect *lpe)
bool optimizeTransforms()
returns false when LPE write unoptimiced
void editNextParamOncanvas(SPDesktop *dt)
Inkscape::LivePathEffect::Effect * getNextLPE(Inkscape::LivePathEffect::Effect *lpe)
bool setCurrentPathEffect(PathEffectSharedPtr const &lperef)
Inkscape::XML::Node * repr
Base class for shapes, including <path> element.
static char const *const current
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key
Some things pertinent to all visible shapes: SPItem, SPItemView, SPItemCtx.
std::list< PathEffectSharedPtr > PathEffectList
void sp_lpe_item_enable_path_effects(SPLPEItem *lpeitem, bool enable)
void sp_lpe_item_update_patheffect(SPLPEItem *lpeitem, bool wholetree, bool write, bool with_satellites=false)
Calls any registered handlers for the update_patheffect action.
std::shared_ptr< Inkscape::LivePathEffect::LPEObjectReference > PathEffectSharedPtr
Interface for XML documents.