From 97bd182d6a2113eab1dd5faf51402ebd5382791c Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 8 May 2016 22:57:37 +0200 Subject: First attempt to make fixed tweenk review (bzr r13645.1.128) --- src/live_effects/parameter/satellitesarray.h | 115 +++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 src/live_effects/parameter/satellitesarray.h (limited to 'src/live_effects/parameter/satellitesarray.h') diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h new file mode 100644 index 000000000..db3776ba3 --- /dev/null +++ b/src/live_effects/parameter/satellitesarray.h @@ -0,0 +1,115 @@ +#ifndef INKSCAPE_LIVEPATHEFFECT_SATELLITES_ARRAY_H +#define INKSCAPE_LIVEPATHEFFECT_SATELLITES_ARRAY_H + +/* + * Inkscape::LivePathEffectParameters + * Copyright (C) Jabiertxo Arraiza Cenoz + * Special thanks to Johan Engelen for the base of the effect -powerstroke- + * Also to ScislaC for point me to the idea + * Also su_v for his construvtive feedback and time + * To Nathan Hurst for his review and help on refactor + * and finaly to Liam P. White for his big help on coding, that save me a lot of + * hours + * + * + * This parameter act as bridge from pointwise class to serialize it as a LPE + * parameter + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#include "live_effects/parameter/array.h" +#include "live_effects/effect-enum.h" +#include "helper/geom-pointwise.h" +#include "knot-holder-entity.h" +#include + +namespace Inkscape { + +namespace LivePathEffect { + +class FilletChamferKnotHolderEntity; + +class SatellitesArrayParam : public ArrayArrayParam { +public: + SatellitesArrayParam(const Glib::ustring &label, const Glib::ustring &tip, + const Glib::ustring &key, + Inkscape::UI::Widget::Registry *wr, Effect *effect); + + virtual Gtk::Widget *param_newWidget() + { + return NULL; + } + virtual void setHelperSize(int hs); + virtual void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, + SPItem *item); + virtual void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, + SPItem *item, bool mirror); + virtual void addCanvasIndicators(SPLPEItem const *lpeitem, + std::vector &hp_vec); + virtual void updateCanvasIndicators(); + virtual void updateCanvasIndicators(bool mirror); + virtual bool providesKnotHolderEntities() const + { + return true; + } + void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/); + void setUseDistance(bool use_knot_distance); + void setEffectType(EffectType et); + void setPointwise(Pointwise *pointwise); + void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, + guint32 color); + + friend class FilletChamferKnotHolderEntity; + friend class LPEFilletChamfer; + +protected: + KnotHolder *knoth; + +private: + SatellitesArrayParam(const SatellitesArrayParam &); + SatellitesArrayParam &operator=(const SatellitesArrayParam &); + + SPKnotShapeType _knot_shape; + SPKnotModeType _knot_mode; + guint32 _knot_color; + Geom::PathVector _hp; + int _helper_size; + bool _use_distance; + EffectType _effectType; + Pointwise *_last_pointwise; + +}; + +class FilletChamferKnotHolderEntity : public KnotHolderEntity { +public: + FilletChamferKnotHolderEntity(SatellitesArrayParam *p, size_t index, size_t subindex); + virtual ~FilletChamferKnotHolderEntity() + { + _pparam->knoth = NULL; + } + + virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, + guint state); + virtual Geom::Point knot_get() const; + virtual void knot_click(guint state); + void knot_set_offset(Satellite); + /** Checks whether the index falls within the size of the parameter's vector + */ + bool valid_index(size_t index) const + { + return (_pparam->_vector.size() > index); + } + ; + +private: + SatellitesArrayParam *_pparam; + size_t _index; + size_t _subindex; +}; + +} //namespace LivePathEffect + +} //namespace Inkscape + +#endif -- cgit v1.2.3 From 07717a370b8efe6ddbb0c69d115bb063a2e7686a Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Tue, 10 May 2016 23:16:49 +0200 Subject: Working with path updates (bzr r13645.1.130) --- src/live_effects/parameter/satellitesarray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/live_effects/parameter/satellitesarray.h') diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h index db3776ba3..9a9ec4a88 100644 --- a/src/live_effects/parameter/satellitesarray.h +++ b/src/live_effects/parameter/satellitesarray.h @@ -30,7 +30,7 @@ namespace LivePathEffect { class FilletChamferKnotHolderEntity; -class SatellitesArrayParam : public ArrayArrayParam { +class SatellitesArrayParam : public ArrayParam > { public: SatellitesArrayParam(const Glib::ustring &label, const Glib::ustring &tip, const Glib::ustring &key, -- cgit v1.2.3 From 4c145e43f8ab8d8040fb2fa42309f7bd400f6349 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 14 May 2016 23:52:45 +0200 Subject: Fixing pointwise (bzr r13645.1.135) --- src/live_effects/parameter/satellitesarray.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/live_effects/parameter/satellitesarray.h') diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h index 9a9ec4a88..dcd82ada5 100644 --- a/src/live_effects/parameter/satellitesarray.h +++ b/src/live_effects/parameter/satellitesarray.h @@ -56,9 +56,9 @@ public: void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/); void setUseDistance(bool use_knot_distance); void setEffectType(EffectType et); - void setPointwise(Pointwise *pointwise); - void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, - guint32 color); + void setPointwise(Pointwise pointwise); + bool validData(); + void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); friend class FilletChamferKnotHolderEntity; friend class LPEFilletChamfer; @@ -77,7 +77,7 @@ private: int _helper_size; bool _use_distance; EffectType _effectType; - Pointwise *_last_pointwise; + Pointwise _last_pointwise; }; -- cgit v1.2.3 From 159439c26042b7c69aa9c33ce9484e4dfd00372a Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 15 May 2016 11:48:51 +0200 Subject: Fixing pointwise (bzr r13645.1.137) --- src/live_effects/parameter/satellitesarray.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/live_effects/parameter/satellitesarray.h') diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h index dcd82ada5..0cebb9cb4 100644 --- a/src/live_effects/parameter/satellitesarray.h +++ b/src/live_effects/parameter/satellitesarray.h @@ -55,6 +55,7 @@ public: } void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/); void setUseDistance(bool use_knot_distance); + void setPathUpdate(bool path_update); void setEffectType(EffectType et); void setPointwise(Pointwise pointwise); bool validData(); @@ -76,6 +77,7 @@ private: Geom::PathVector _hp; int _helper_size; bool _use_distance; + bool _path_update; EffectType _effectType; Pointwise _last_pointwise; @@ -99,8 +101,7 @@ public: bool valid_index(size_t index) const { return (_pparam->_vector.size() > index); - } - ; + }; private: SatellitesArrayParam *_pparam; -- cgit v1.2.3 From 8d35486a82d04a28dc9f297147ad4666b34cde4a Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Thu, 26 May 2016 19:37:15 +0200 Subject: Fixing pointwise (bzr r13645.1.143) --- src/live_effects/parameter/satellitesarray.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/live_effects/parameter/satellitesarray.h') diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h index 0cebb9cb4..c6893f595 100644 --- a/src/live_effects/parameter/satellitesarray.h +++ b/src/live_effects/parameter/satellitesarray.h @@ -55,10 +55,9 @@ public: } void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/); void setUseDistance(bool use_knot_distance); - void setPathUpdate(bool path_update); void setEffectType(EffectType et); void setPointwise(Pointwise pointwise); - bool validData(); + bool validData(size_t index, size_t subindex); void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); friend class FilletChamferKnotHolderEntity; @@ -77,7 +76,6 @@ private: Geom::PathVector _hp; int _helper_size; bool _use_distance; - bool _path_update; EffectType _effectType; Pointwise _last_pointwise; -- cgit v1.2.3 From 634be67d2fa8aa07d25d96e10a3ad24fdfdcc80e Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Thu, 26 May 2016 20:44:19 +0200 Subject: Rename branch (bzr r13645.1.145) --- src/live_effects/parameter/satellitesarray.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/live_effects/parameter/satellitesarray.h') diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h index c6893f595..27e9dea6f 100644 --- a/src/live_effects/parameter/satellitesarray.h +++ b/src/live_effects/parameter/satellitesarray.h @@ -12,7 +12,7 @@ * hours * * - * This parameter act as bridge from pointwise class to serialize it as a LPE + * This parameter act as bridge from pathVectorSatellites class to serialize it as a LPE * parameter * * Released under GNU GPL, read the file 'COPYING' for more information @@ -20,7 +20,7 @@ #include "live_effects/parameter/array.h" #include "live_effects/effect-enum.h" -#include "helper/geom-pointwise.h" +#include "helper/geom-pathvectorsatellites.h" #include "knot-holder-entity.h" #include @@ -56,7 +56,7 @@ public: void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/); void setUseDistance(bool use_knot_distance); void setEffectType(EffectType et); - void setPointwise(Pointwise pointwise); + void setPathVectorSatellites(PathVectorSatellites pathVectorSatellites); bool validData(size_t index, size_t subindex); void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); @@ -77,7 +77,7 @@ private: int _helper_size; bool _use_distance; EffectType _effectType; - Pointwise _last_pointwise; + PathVectorSatellites _last_pathVectorSatellites; }; -- cgit v1.2.3 From 5ad260d5810f6f8bb2cdea7186d0766091ad9b54 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 11 Jun 2016 17:32:56 +0200 Subject: Fixing satellites bug on erase (bzr r13645.1.146) --- src/live_effects/parameter/satellitesarray.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/live_effects/parameter/satellitesarray.h') diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h index 27e9dea6f..c52d28541 100644 --- a/src/live_effects/parameter/satellitesarray.h +++ b/src/live_effects/parameter/satellitesarray.h @@ -45,6 +45,7 @@ public: SPItem *item); virtual void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item, bool mirror); + virtual void clearKnotHolder(KnotHolder *knotholder); virtual void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector &hp_vec); virtual void updateCanvasIndicators(); @@ -56,7 +57,7 @@ public: void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/); void setUseDistance(bool use_knot_distance); void setEffectType(EffectType et); - void setPathVectorSatellites(PathVectorSatellites pathVectorSatellites); + void setPathVectorSatellites(PathVectorSatellites pathVectorSatellites, bool refresh_knots = false); bool validData(size_t index, size_t subindex); void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); -- cgit v1.2.3 From d84bbca17771ed1a2f680328adf14b30a4c66b77 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 12 Jun 2016 01:05:25 +0200 Subject: Fix the bug deleting satellites (bzr r13645.1.148) --- src/live_effects/parameter/satellitesarray.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/live_effects/parameter/satellitesarray.h') diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h index c52d28541..a52bcef53 100644 --- a/src/live_effects/parameter/satellitesarray.h +++ b/src/live_effects/parameter/satellitesarray.h @@ -45,7 +45,6 @@ public: SPItem *item); virtual void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item, bool mirror); - virtual void clearKnotHolder(KnotHolder *knotholder); virtual void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector &hp_vec); virtual void updateCanvasIndicators(); @@ -57,8 +56,7 @@ public: void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/); void setUseDistance(bool use_knot_distance); void setEffectType(EffectType et); - void setPathVectorSatellites(PathVectorSatellites pathVectorSatellites, bool refresh_knots = false); - bool validData(size_t index, size_t subindex); + void setPathVectorSatellites(PathVectorSatellites *pathVectorSatellites); void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); friend class FilletChamferKnotHolderEntity; @@ -78,13 +76,13 @@ private: int _helper_size; bool _use_distance; EffectType _effectType; - PathVectorSatellites _last_pathVectorSatellites; + PathVectorSatellites *_last_pathvector_satellites; }; class FilletChamferKnotHolderEntity : public KnotHolderEntity { public: - FilletChamferKnotHolderEntity(SatellitesArrayParam *p, size_t index, size_t subindex); + FilletChamferKnotHolderEntity(SatellitesArrayParam *p, size_t index); virtual ~FilletChamferKnotHolderEntity() { _pparam->knoth = NULL; @@ -97,15 +95,14 @@ public: void knot_set_offset(Satellite); /** Checks whether the index falls within the size of the parameter's vector */ - bool valid_index(size_t index) const + bool valid_index(size_t index,size_t subindex) const { - return (_pparam->_vector.size() > index); + return (_pparam->_vector.size() > index && _pparam->_vector[index].size() > subindex); }; private: SatellitesArrayParam *_pparam; size_t _index; - size_t _subindex; }; } //namespace LivePathEffect -- cgit v1.2.3 From 7e1183de6ed51ff730915fe936e2bb607dd72f33 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 12 Jun 2016 16:33:27 +0200 Subject: Fix bug consecutive nodes at same position (bzr r13645.1.152) --- src/live_effects/parameter/satellitesarray.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/live_effects/parameter/satellitesarray.h') diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h index a52bcef53..30b1db6c1 100644 --- a/src/live_effects/parameter/satellitesarray.h +++ b/src/live_effects/parameter/satellitesarray.h @@ -55,6 +55,7 @@ public: } void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/); void setUseDistance(bool use_knot_distance); + void setGlobalKnotHide(bool global_knot_hide); void setEffectType(EffectType et); void setPathVectorSatellites(PathVectorSatellites *pathVectorSatellites); void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); @@ -75,6 +76,7 @@ private: Geom::PathVector _hp; int _helper_size; bool _use_distance; + bool _global_knot_hide; EffectType _effectType; PathVectorSatellites *_last_pathvector_satellites; -- cgit v1.2.3 From 73f078b27b669c941651ecf14a3119ae491ccabf Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Mon, 13 Jun 2016 00:58:55 +0200 Subject: Fix 90% of tweenk review (bzr r13645.1.155) --- src/live_effects/parameter/satellitesarray.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/live_effects/parameter/satellitesarray.h') diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h index 30b1db6c1..64bc934c8 100644 --- a/src/live_effects/parameter/satellitesarray.h +++ b/src/live_effects/parameter/satellitesarray.h @@ -64,7 +64,7 @@ public: friend class LPEFilletChamfer; protected: - KnotHolder *knoth; + KnotHolder *_knoth; private: SatellitesArrayParam(const SatellitesArrayParam &); @@ -74,6 +74,7 @@ private: SPKnotModeType _knot_mode; guint32 _knot_color; Geom::PathVector _hp; + Geom::PathVector _knot_reset_helper; int _helper_size; bool _use_distance; bool _global_knot_hide; @@ -87,7 +88,7 @@ public: FilletChamferKnotHolderEntity(SatellitesArrayParam *p, size_t index); virtual ~FilletChamferKnotHolderEntity() { - _pparam->knoth = NULL; + _pparam->_knoth = NULL; } virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, -- cgit v1.2.3 From 2c544b51a588c8874b5b5f9a5e1e33d591972b15 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Tue, 14 Jun 2016 23:44:32 +0200 Subject: Add snap to origin in double direction knots (bzr r13645.1.157) --- src/live_effects/parameter/satellitesarray.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/live_effects/parameter/satellitesarray.h') diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h index 64bc934c8..5b2d8a799 100644 --- a/src/live_effects/parameter/satellitesarray.h +++ b/src/live_effects/parameter/satellitesarray.h @@ -55,6 +55,7 @@ public: } void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/); void setUseDistance(bool use_knot_distance); + void setCurrentZoom(double current_zoom); void setGlobalKnotHide(bool global_knot_hide); void setEffectType(EffectType et); void setPathVectorSatellites(PathVectorSatellites *pathVectorSatellites); @@ -78,6 +79,7 @@ private: int _helper_size; bool _use_distance; bool _global_knot_hide; + double _current_zoom; EffectType _effectType; PathVectorSatellites *_last_pathvector_satellites; -- cgit v1.2.3 From d431044fc72f9b668dcfa5771f361f4d6088bdd7 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Sun, 22 Jan 2017 18:53:31 +0100 Subject: Update to new code in trunk (bzr r13645.1.166) --- src/live_effects/parameter/satellitesarray.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/live_effects/parameter/satellitesarray.h') diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h index 5b2d8a799..edaf2f08d 100644 --- a/src/live_effects/parameter/satellitesarray.h +++ b/src/live_effects/parameter/satellitesarray.h @@ -41,12 +41,9 @@ public: return NULL; } virtual void setHelperSize(int hs); - virtual void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, - SPItem *item); - virtual void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, - SPItem *item, bool mirror); - virtual void addCanvasIndicators(SPLPEItem const *lpeitem, - std::vector &hp_vec); + virtual void addKnotHolderEntities(KnotHolder *knotholder, SPItem *item); + virtual void addKnotHolderEntities(KnotHolder *knotholder, SPItem *item, bool mirror); + virtual void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector &hp_vec); virtual void updateCanvasIndicators(); virtual void updateCanvasIndicators(bool mirror); virtual bool providesKnotHolderEntities() const -- cgit v1.2.3 From 5004996c798cdbad5ff7abbaf2e7272411631cee Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Sat, 6 May 2017 19:45:16 +0200 Subject: Pre merge fixing (bzr r13645.1.177) --- src/live_effects/parameter/satellitesarray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/live_effects/parameter/satellitesarray.h') diff --git a/src/live_effects/parameter/satellitesarray.h b/src/live_effects/parameter/satellitesarray.h index edaf2f08d..5ae372ac2 100644 --- a/src/live_effects/parameter/satellitesarray.h +++ b/src/live_effects/parameter/satellitesarray.h @@ -55,7 +55,7 @@ public: void setCurrentZoom(double current_zoom); void setGlobalKnotHide(bool global_knot_hide); void setEffectType(EffectType et); - void setPathVectorSatellites(PathVectorSatellites *pathVectorSatellites); + void setPathVectorSatellites(PathVectorSatellites *pathVectorSatellites, bool write = true); void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); friend class FilletChamferKnotHolderEntity; -- cgit v1.2.3