Code

remove many needless references to n-art-bpath.h
[inkscape.git] / src / live_effects / effect.h
index b78e931f92f2e4e2d04b58a1a330d3c67ed39224..51ca6a558422bcb6727417804022efafbcf39a3d 100644 (file)
@@ -14,6 +14,7 @@
 #include <map>
 #include <glibmm/ustring.h>
 #include <2geom/path.h>
+#include <2geom/forward.h>
 #include "ui/widget/registry.h"
 #include "util/enums.h"
 #include "sp-lpe-item.h"
@@ -27,7 +28,7 @@
 struct SPDocument;
 struct SPDesktop;
 struct SPItem;
-class NArtBpath;
+class SPNodeContext;
 struct LivePathEffectObject;
 
 namespace Gtk {
@@ -36,10 +37,6 @@ namespace Gtk {
     class Tooltips;
 }
 
-namespace Geom {
-    class Matrix;
-}
-
 namespace Inkscape {
 
 namespace XML {
@@ -55,6 +52,7 @@ namespace LivePathEffect {
 enum EffectType {
     BEND_PATH = 0,
     PATTERN_ALONG_PATH,
+    FREEHAND_SHAPE,
     SKETCH,
     VONKOCH,
     KNOT,
@@ -71,15 +69,26 @@ enum EffectType {
     CONSTRUCT_GRID,
     PERP_BISECTOR,
     TANGENT_TO_CURVE,
+    MIRROR_SYMMETRY,
+    CIRCLE_3PTS,
+    ANGLE_BISECTOR,
+    PARALLEL,
+    COPY_ROTATE,
+    OFFSET,
+    RULER,
+    BOOLOPS,
+    INTERPOLATE,
+    TEXT_LABEL,
+    PATH_LENGTH,
     INVALID_LPE // This must be last
 };
 
-extern const Util::EnumData<EffectType> LPETypeData[INVALID_LPE];
+extern const Util::EnumData<EffectType> LPETypeData[];
 extern const Util::EnumDataConverter<EffectType> LPETypeConverter;
 
 enum LPEPathFlashType {
     SUPPRESS_FLASH,
-    PERMANENT_FLASH,
+//    PERMANENT_FLASH,
     DEFAULT
 };
 
@@ -94,10 +103,16 @@ public:
     EffectType effectType ();
 
     virtual void doOnApply (SPLPEItem *lpeitem);
-
     virtual void doBeforeEffect (SPLPEItem *lpeitem);
+
     void writeParamsToSVG();
 
+    virtual void acceptParamPath (SPPath *param_path);
+    virtual int acceptsNumParams() { return 0; }
+    void doAcceptPathPreparations(SPLPEItem *lpeitem);
+
+    inline bool pathParamAccepted() { return done_pathparam_set; }
+
     virtual void doEffect (SPCurve * curve);
 
     virtual Gtk::Widget * newWidget(Gtk::Tooltips * tooltips);
@@ -108,9 +123,19 @@ public:
 
     virtual void transform_multiply(Geom::Matrix const& postmul, bool set);
 
-    bool providesKnotholder() { return (kh_entity_vector.size() > 0); }
+    // TODO: providesKnotholder() is currently used as an indicator of whether a nodepath is
+    // created for an item or not. When we allow both at the same time, this needs rethinking!
+    bool providesKnotholder();
+    // TODO: in view of providesOwnFlashPaths() below, this is somewhat redundant
+    //       (but spiro lpe still needs it!)
     virtual LPEPathFlashType pathFlashType() { return DEFAULT; }
     void addHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item);
+    std::vector<Geom::PathVector> getHelperPaths(SPLPEItem *lpeitem);
+
+    inline bool providesOwnFlashPaths() {
+        return provides_own_flash_paths || show_orig_path;
+    }
+    inline bool showOrigPath() { return show_orig_path; }
 
     Glib::ustring          getName();
     Inkscape::XML::Node *  getRepr();
@@ -140,13 +165,22 @@ protected:
 
     void registerParameter(Parameter * param);
     void registerKnotHolderHandle(KnotHolderEntity* entity, const char* descr);
-    void addPointParamHandles(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item);
     Parameter * getNextOncanvasEditableParam();
 
+    void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item);
+
+    //virtual std::vector<Geom::PathVector> getCanvasIndicators(SPLPEItem *lpeitem);
+    virtual void addCanvasIndicators(SPLPEItem *lpeitem, std::vector<Geom::PathVector> &hp_vec);
+
+
     std::vector<Parameter *> param_vector;
     std::vector<std::pair<KnotHolderEntity*, const char*> > kh_entity_vector;
     int oncanvasedit_it;
     BoolParam is_visible;
+    bool done_pathparam_set;
+
+    bool show_orig_path; // set this to true in derived effects to automatically have the original
+                         // path displayed as helperpath
 
     Inkscape::UI::Widget::Registry wr;
 
@@ -157,11 +191,12 @@ protected:
     bool concatenate_before_pwd2;
 
 private:
+    bool provides_own_flash_paths; // if true, the standard flash path is suppressed
+
     Effect(const Effect&);
     Effect& operator=(const Effect&);
 };
 
-
 } //namespace LivePathEffect
 } //namespace Inkscape