diff options
| author | Liam P. White <inkscapebronyat-signgmaildotcom> | 2014-03-02 15:29:06 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebronyat-signgmaildotcom> | 2014-03-02 15:29:06 +0000 |
| commit | 1d854ff519b9c0867bfa4ecaf2f6329ca256f06a (patch) | |
| tree | 437352a17301fbdd1787213b7dec3788b6e8eefa /src/live_effects/parameter/powerstrokepointarray.h | |
| parent | rename variable names to prevent hiding of names in outer scopes (diff) | |
| download | inkscape-1d854ff519b9c0867bfa4ecaf2f6329ca256f06a.tar.gz inkscape-1d854ff519b9c0867bfa4ecaf2f6329ca256f06a.zip | |
Experimental merge of Ponyscape features into trunk (will not compile)
(bzr r13090.1.1)
Diffstat (limited to 'src/live_effects/parameter/powerstrokepointarray.h')
| -rw-r--r-- | src/live_effects/parameter/powerstrokepointarray.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/live_effects/parameter/powerstrokepointarray.h b/src/live_effects/parameter/powerstrokepointarray.h index e1fa440f2..911bbc82d 100644 --- a/src/live_effects/parameter/powerstrokepointarray.h +++ b/src/live_effects/parameter/powerstrokepointarray.h @@ -20,8 +20,6 @@ namespace Inkscape { namespace LivePathEffect { -class PowerStrokePointArrayParamKnotHolderEntity; - class PowerStrokePointArrayParam : public ArrayParam<Geom::Point> { public: PowerStrokePointArrayParam( const Glib::ustring& label, @@ -37,6 +35,8 @@ public: void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); + float median_width(); + virtual bool providesKnotHolderEntities() const { return true; } virtual void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item); @@ -60,6 +60,25 @@ private: Geom::Piecewise<Geom::D2<Geom::SBasis> > last_pwd2_normal; }; +class PowerStrokePointArrayParamKnotHolderEntity : public KnotHolderEntity { +public: + PowerStrokePointArrayParamKnotHolderEntity(PowerStrokePointArrayParam *p, unsigned int index); + virtual ~PowerStrokePointArrayParamKnotHolderEntity() {} + + virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, guint state); + virtual Geom::Point knot_get() const; + virtual void knot_set_offset(Geom::Point offset); + virtual void knot_click(guint state); + + /** Checks whether the index falls within the size of the parameter's vector */ + bool valid_index(unsigned int index) const { + return (_pparam->_vector.size() > index); + }; + +private: + PowerStrokePointArrayParam *_pparam; + unsigned int _index; +}; } //namespace LivePathEffect |
