effect.cpp revision 19715d9462f14c8543082f8df232e3c99a8453ca
0N/A#ifdef HAVE_CONFIG_H
0N/A#include "live_effects/lpe-patternalongpath.h"
0N/A#include "live_effects/effect.h"
0N/A#include "live_effects/lpe-bendpath.h"
0N/A#include "live_effects/lpe-sketch.h"
0N/A#include "live_effects/lpe-vonkoch.h"
0N/A#include "live_effects/lpe-knot.h"
0N/A#include "live_effects/lpe-rough-hatches.h"
0N/A#include "live_effects/lpe-dynastroke.h"
0N/A#include "live_effects/lpe-test-doEffect-stack.h"
0N/A#include "live_effects/lpe-bspline.h"
0N/A#include "live_effects/lpe-gears.h"
0N/A#include "live_effects/lpe-curvestitch.h"
0N/A#include "live_effects/lpe-circle_with_radius.h"
0N/A#include "live_effects/lpe-perspective_path.h"
0N/A#include "live_effects/lpe-spiro.h"
0N/A#include "live_effects/lpe-lattice.h"
0N/A#include "live_effects/lpe-lattice2.h"
0N/A#include "live_effects/lpe-simplify.h"
0N/A#include "live_effects/lpe-envelope.h"
0N/A#include "live_effects/lpe-constructgrid.h"
0N/A#include "live_effects/lpe-perp_bisector.h"
0N/A#include "live_effects/lpe-tangent_to_curve.h"
0N/A#include "live_effects/lpe-mirror_symmetry.h"
0N/A#include "live_effects/lpe-circle_3pts.h"
0N/A#include "live_effects/lpe-angle_bisector.h"
0N/A#include "live_effects/lpe-parallel.h"
0N/A#include "live_effects/lpe-copy_rotate.h"
0N/A#include "live_effects/lpe-offset.h"
0N/A#include "live_effects/lpe-ruler.h"
0N/A#include "live_effects/lpe-boolops.h"
0N/A#include "live_effects/lpe-interpolate.h"
0N/A#include "live_effects/lpe-text_label.h"
0N/A#include "live_effects/lpe-path_length.h"
0N/A#include "live_effects/lpe-line_segment.h"
0N/A#include "live_effects/lpe-recursiveskeleton.h"
0N/A#include "live_effects/lpe-extrude.h"
0N/A#include "live_effects/lpe-powerstroke.h"
0N/A#include "live_effects/lpe-clone-original.h"
0N/A#include "live_effects/lpe-envelope-perspective.h"
0N/A#include "xml/node-event-vector.h"
0N/A#include "sp-object.h"
0N/A#include "attributes.h"
0N/A#include "message-stack.h"
0N/A#include "inkscape.h"
0N/A#include "document.h"
0N/A#include "document-private.h"
0N/A#include "xml/document.h"
0N/A#include "ui/tools/pen-tool.h"
0N/A#include "tools-switch.h"
0N/A#include "message-stack.h"
0N/A#include "knotholder.h"
0N/A#include "sp-lpe-item.h"
0N/A#include "live_effects/lpeobject.h"
0N/A#include "live_effects/parameter/parameter.h"
0N/Anamespace LivePathEffect {
0N/A // {constant defined in effect-enum.h, N_("name of your effect"), "name of your effect in SVG"}
0N/A#ifdef LPE_ENABLE_TEST_EFFECTS
0N/A {PATTERN_ALONG_PATH, N_("Pattern Along Path"), "skeletal"}, // for historic reasons, this effect is called skeletal(strokes) in Inkscape:SVG
0N/Aconst Util::EnumDataConverter<EffectType> LPETypeConverter(LPETypeData, sizeof(LPETypeData)/sizeof(*LPETypeData));
0N/A case INVALID_LPE: return -1; // in case we want to distinguish between invalid LPE and valid ones that expect zero clicks
0N/A case PATTERN_ALONG_PATH:
0N/A case ROUGH_HATCHES:
0N/A case CURVE_STITCH:
0N/A case CIRCLE_WITH_RADIUS:
0N/A case PERSPECTIVE_PATH:
0N/A case CONSTRUCT_GRID:
0N/A case PERP_BISECTOR:
case TANGENT_TO_CURVE:
case MIRROR_SYMMETRY:
case CIRCLE_3PTS:
case ANGLE_BISECTOR:
case PARALLEL:
case COPY_ROTATE:
case OFFSET:
case RULER:
case BOOLOPS:
case INTERPOLATE:
case TEXT_LABEL:
case PATH_LENGTH:
case LINE_SEGMENT:
case DOEFFECTSTACK_TEST:
case BSPLINE:
case DYNASTROKE:
case RECURSIVE_SKELETON:
case EXTRUDE:
case POWERSTROKE:
case CLONE_ORIGINAL:
case SIMPLIFY:
case LATTICE2:
case ENVELOPE_PERSPECTIVE:
case FILLET_CHAMFER:
if (neweffect) {
return neweffect;
: _provides_knotholder_entities(false),
oncanvasedit_it(0),
is_visible(_("Is visible?"), _("If unchecked, the effect remains applied to the object but is temporarily disabled on canvas"), "is_visible", &wr, this, true),
show_orig_path(false),
concatenate_before_pwd2(false),
provides_own_flash_paths(true), // is automatically set to false if providesOwnFlashPaths() is not overridden
SPDesktop *desktop = inkscape_active_desktop(); // TODO: Is there a better method to find the item's desktop?
(*p)->write_to_SVG();
setReady();
if ( !concatenate_before_pwd2 ) {
return path_out;
return pwd2_in;
if (value) {
if (!accepted) {
++it;
if (param) {
if (new_value) {
if (!accepted) {
* This is the function called by external code to get all canvas indicators (effect and its parameters)
* @todo change return type to one pathvector, add all paths to one pathvector instead of maintaining a vector of pathvectors
return hp_vec;
* This function should be overwritten by derived effects if they want to provide their own helperpaths.
// use manage here, because after deletion of Effect object, others might still be pointing to this widget.
if (widg) {
if (tip) {
++it;
return param;
++it;
return NULL;
return NULL;
oncanvasedit_it = 0;
return param;
oncanvasedit_it = 0;
return NULL;
if (!desktop) return;
if (param) {
/* This function should reset the defaults and is used for example to initialize an effect right after it has been applied to a path
* The nice thing about this is that this function can use knowledge of the original path and set things accordingly for example to the size or origin of the original path!
(*p)->param_set_default();
(*p)->write_to_SVG();
// cycle through all parameters. Most parameters will not need transformation, but path and point params do.
for (std::vector<Parameter *>::iterator it = param_vector.begin(); it != param_vector.end(); ++it) {
for (std::vector<Parameter *>::const_iterator p = param_vector.begin(); p != param_vector.end(); ++p) {
if ((*p)->providesKnotHolderEntities()) {