Inkscape
Vector Graphics Editor
|
#include <lpe-simplify.h>
Public Member Functions | |
LPESimplify (LivePathEffectObject *lpeobject) | |
~LPESimplify () override | |
LPESimplify (const LPESimplify &)=delete | |
LPESimplify & | operator= (const LPESimplify &)=delete |
void | doEffect (Geom::PathVector &curve) override |
void | doBeforeEffect (SPLPEItem const *lpeitem) override |
Is performed each time before the effect is updated. | |
virtual void | generateHelperPathAndSmooth (Geom::PathVector &result) |
void | doOnApply (SPLPEItem const *lpeitem) override |
Is performed a single time when the effect is freshly applied to a path. | |
Gtk::Widget * | newWidget () override |
This creates a managed widget. | |
virtual void | drawNode (Geom::Point p) |
virtual void | drawHandle (Geom::Point p) |
virtual void | drawHandleLine (Geom::Point p, Geom::Point p2) |
![]() | |
virtual | ~Effect () |
Effect (const Effect &)=delete | |
Effect & | operator= (const Effect &)=delete |
EffectType | effectType () const |
void | doAfterEffect_impl (SPLPEItem const *lpeitem, Geom::PathVector *curve) |
void | doOnApply_impl (SPLPEItem const *lpeitem) |
void | doBeforeEffect_impl (SPLPEItem const *lpeitem) |
void | doOnOpen_impl () |
Is performed on document open allow things like fix legacy LPE in a undo insensitive way. | |
void | doOnRemove_impl (SPLPEItem const *lpeitem) |
void | transform_multiply_impl (Geom::Affine const &postmul, SPLPEItem *) |
void | doOnBeforeCommit () |
void | read_from_SVG () |
void | setCurrentZoom (double cZ) |
void | setSelectedNodePoints (std::vector< Geom::Point > sNP) |
bool | isNodePointSelected (Geom::Point const &nodePoint) const |
bool | isOnClipboard () |
The lpe is on clipboard. | |
std::vector< SPLPEItem * > | getCurrrentLPEItems () const |
void | update_satellites () |
virtual void | doOnException (SPLPEItem const *lpeitem) |
virtual void | doOnVisibilityToggled (SPLPEItem const *lpeitem) |
virtual void | adjustForNewPath () |
void | writeParamsToSVG () |
std::vector< SPObject * > | effect_get_satellites (bool force=true) |
virtual void | acceptParamPath (SPPath const *param_path) |
If the effect expects a path parameter (specified by a number of mouse clicks) before it is applied, this is the method that processes the resulting path. | |
int | acceptsNumClicks () const |
SPShape * | getCurrentShape () const |
void | setCurrentShape (SPShape *shape) |
virtual void | processObjects (LPEAction lpe_action) |
void | makeUndoDone (Glib::ustring message) |
bool | isReady () const |
void | setReady (bool ready=true) |
virtual void | resetDefaults (SPItem const *item) |
Sets all parameters to their default values and writes them to SVG. | |
bool | providesKnotholder () const |
virtual LPEPathFlashType | pathFlashType () const |
void | addHandles (KnotHolder *knotholder, SPItem *item) |
Add all registered LPE knotholder handles to the knotholder. | |
std::vector< Geom::PathVector > | getCanvasIndicators (SPLPEItem const *lpeitem) |
Return a vector of PathVectors which contain all canvas indicators for this effect. | |
void | update_helperpath () |
Call to a method on nodetool to update the helper path from the effect. | |
bool | providesOwnFlashPaths () const |
bool | showOrigPath () const |
Glib::ustring | getName () const |
Inkscape::XML::Node * | getRepr () |
SPDocument * | getSPDoc () |
LivePathEffectObject * | getLPEObj () |
LivePathEffectObject const * | getLPEObj () const |
Parameter * | getParameter (const char *key) |
void | readallParameters (Inkscape::XML::Node const *repr) |
void | setParameter (const gchar *key, const gchar *new_value) |
bool | isVisible () const |
void | editNextParamOncanvas (SPItem *item, SPDesktop *desktop) |
void | setLPEAction (LPEAction lpe_action) |
void | setDefaultParameters () |
Set this LPE defaults. | |
void | resetDefaultParameters () |
Reset this LPE defaults. | |
bool | hasDefaultParameters () |
Get LPE has defaults. | |
virtual bool | getHolderRemove () |
Public Attributes | |
ScalarParam | threshold |
![]() | |
bool | has_exception |
bool | apply_to_clippath_and_mask |
bool | keep_paths |
bool | is_load |
bool | is_applied |
bool | on_remove_all |
bool | refresh_widgets |
bool | finishiddle = false |
bool | satellitestoclipboard = false |
bool | helperLineSatellites = false |
gint | spinbutton_width_chars = 7 |
BoolParam | is_visible |
HiddenParam | lpeversion |
Geom::PathVector | pathvector_before_effect |
Geom::PathVector | pathvector_after_effect |
SPLPEItem * | sp_lpe_item = nullptr |
SPShape * | current_shape |
std::vector< Parameter * > | param_vector |
Protected Member Functions | |
void | addCanvasIndicators (SPLPEItem const *, std::vector< Geom::PathVector > &hp_vec) override |
Add possible canvas indicators (i.e., helperpaths other than the original path) to hp_vec This function should be overwritten by derived effects if they want to provide their own helperpaths. | |
![]() | |
Effect (LivePathEffectObject *lpeobject) | |
virtual Geom::PathVector | doEffect_path (Geom::PathVector const &path_in) |
virtual Geom::Piecewise< Geom::D2< Geom::SBasis > > | doEffect_pwd2 (Geom::Piecewise< Geom::D2< Geom::SBasis > > const &pwd2_in) |
void | registerParameter (Parameter *param) |
Parameter * | getNextOncanvasEditableParam () |
virtual void | addKnotHolderEntities (KnotHolder *, SPItem *) |
Private Member Functions | |
void | setVersioningData () |
![]() | |
Geom::OptRect | clip_mask_bbox (SPLPEItem *item, Geom::Affine transform) |
Updates the boundingbox_X and boundingbox_Y values from the geometric bounding box of lpeitem . | |
void | original_bbox (SPLPEItem const *lpeitem, bool absolute=false, bool clip_mask=false, Geom::Affine base_transform=Geom::identity()) |
Private Attributes | |
ScalarParam | steps |
ScalarParam | smooth_angles |
ScalarParam | helper_size |
BoolParam | simplify_individual_paths |
ToggleButtonParam | simplify_just_coalesce |
double | radius_helper_nodes |
Geom::PathVector | hp |
Geom::OptRect | bbox |
![]() | |
Geom::Interval | boundingbox_X |
Geom::Interval | boundingbox_Y |
Additional Inherited Members | |
![]() | |
static Effect * | New (EffectType lpenr, LivePathEffectObject *lpeobj) |
static void | createAndApply (const char *name, SPDocument *doc, SPItem *item) |
static void | createAndApply (EffectType type, SPDocument *doc, SPItem *item) |
static int | acceptsNumClicks (EffectType type) |
![]() | |
bool | _adjust_path = false |
bool | _provides_knotholder_entities |
bool | _provides_path_adjustment = false |
LPEAction | _lpe_action = LPE_NONE |
int | oncanvasedit_it |
bool | show_orig_path |
bool | concatenate_before_pwd2 |
double | current_zoom |
std::vector< Geom::Point > | selectedNodesPoints |
Inkscape::UI::Widget::Registry | wr |
Definition at line 18 of file lpe-simplify.h.
Inkscape::LivePathEffect::LPESimplify::LPESimplify | ( | LivePathEffectObject * | lpeobject | ) |
Definition at line 25 of file lpe-simplify.cpp.
References Inkscape::LivePathEffect::ScalarParam::addSlider(), Inkscape::LivePathEffect::Effect::apply_to_clippath_and_mask, helper_size, Inkscape::LivePathEffect::ScalarParam::param_set_digits(), Inkscape::LivePathEffect::ScalarParam::param_set_increments(), Inkscape::LivePathEffect::ScalarParam::param_set_range(), radius_helper_nodes, Inkscape::LivePathEffect::Effect::registerParameter(), setVersioningData(), simplify_individual_paths, simplify_just_coalesce, smooth_angles, Inkscape::LivePathEffect::Effect::spinbutton_width_chars, steps, and threshold.
|
overridedefault |
|
delete |
|
overrideprotectedvirtual |
Add possible canvas indicators (i.e., helperpaths other than the original path) to hp_vec This function should be overwritten by derived effects if they want to provide their own helperpaths.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 311 of file lpe-simplify.cpp.
References hp.
|
overridevirtual |
Is performed each time before the effect is updated.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 67 of file lpe-simplify.cpp.
References bbox, Geom::PathVector::clear(), Geom::PathVector::empty(), helper_size, hp, radius_helper_nodes, and SPItem::visualBounds().
|
overridevirtual |
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 144 of file lpe-simplify.cpp.
References bbox, Geom::bounds_fast(), Geom::Affine::descrim(), dimensions(), generateHelperPathAndSmooth(), SPItem::i2doc_affine(), Geom::L2(), Inkscape::LivePathEffect::Effect::lpeversion, Inkscape::LivePathEffect::HiddenParam::param_getSVGValue(), Path_for_pathvector(), pathv_to_linear_and_cubic_beziers(), result, simplify_individual_paths, simplify_just_coalesce, Inkscape::size, Inkscape::LivePathEffect::Effect::sp_lpe_item, steps, threshold, and Inkscape::LivePathEffect::Effect::update_helperpath().
|
overridevirtual |
Is performed a single time when the effect is freshly applied to a path.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 98 of file lpe-simplify.cpp.
References Inkscape::LivePathEffect::Effect::lpeversion, Inkscape::LivePathEffect::HiddenParam::param_setValue(), and setVersioningData().
|
virtual |
Definition at line 286 of file lpe-simplify.cpp.
References hp, Geom::PathVector::push_back(), radius_helper_nodes, and sp_svg_read_pathv().
Referenced by generateHelperPathAndSmooth().
|
virtual |
Definition at line 297 of file lpe-simplify.cpp.
References Geom::Ray::angle(), Geom::Path::appendNew(), Geom::distance(), helper_size, hp, Geom::PathVector::push_back(), radius_helper_nodes, and Geom::Path::start().
Referenced by generateHelperPathAndSmooth().
|
virtual |
Definition at line 274 of file lpe-simplify.cpp.
References hp, Geom::PathVector::push_back(), radius_helper_nodes, and sp_svg_read_pathv().
Referenced by generateHelperPathAndSmooth().
|
virtual |
Definition at line 174 of file lpe-simplify.cpp.
References Geom::Ray::angle(), Geom::are_near(), closepath_current(), Geom::distance(), drawHandle(), drawHandleLine(), drawNode(), Geom::Curve::finalPoint(), Geom::Angle::from_degrees(), helper_size, Geom::Curve::initialPoint(), Geom::PathVector::push_back(), result, smooth_angles, start, and steps.
Referenced by doEffect().
|
overridevirtual |
This creates a managed widget.
Deletion should be done by the eventual parent, or otherwise the caller.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 105 of file lpe-simplify.cpp.
References Inkscape::UI::Widget::Scalar::getSpinButton(), Inkscape::UI::pack_start(), and Inkscape::LivePathEffect::Effect::param_vector.
|
delete |
|
private |
Definition at line 77 of file lpe-simplify.cpp.
References helper_size, Geom::infinity(), Inkscape::LivePathEffect::Effect::lpeversion, Inkscape::LivePathEffect::HiddenParam::param_getSVGValue(), Inkscape::LivePathEffect::ScalarParam::param_set_digits(), Inkscape::LivePathEffect::ScalarParam::param_set_increments(), Inkscape::LivePathEffect::ScalarParam::param_set_no_leading_zeros(), Inkscape::LivePathEffect::ScalarParam::param_set_range(), smooth_angles, and threshold.
Referenced by doOnApply(), and LPESimplify().
|
private |
Definition at line 56 of file lpe-simplify.h.
Referenced by doBeforeEffect(), and doEffect().
|
private |
Definition at line 50 of file lpe-simplify.h.
Referenced by doBeforeEffect(), drawHandleLine(), generateHelperPathAndSmooth(), LPESimplify(), and setVersioningData().
|
private |
Definition at line 55 of file lpe-simplify.h.
Referenced by addCanvasIndicators(), doBeforeEffect(), drawHandle(), drawHandleLine(), and drawNode().
|
private |
Definition at line 54 of file lpe-simplify.h.
Referenced by doBeforeEffect(), drawHandle(), drawHandleLine(), drawNode(), and LPESimplify().
|
private |
Definition at line 51 of file lpe-simplify.h.
Referenced by doEffect(), and LPESimplify().
|
private |
Definition at line 52 of file lpe-simplify.h.
Referenced by doEffect(), and LPESimplify().
|
private |
Definition at line 49 of file lpe-simplify.h.
Referenced by generateHelperPathAndSmooth(), LPESimplify(), and setVersioningData().
|
private |
Definition at line 48 of file lpe-simplify.h.
Referenced by doEffect(), generateHelperPathAndSmooth(), and LPESimplify().
ScalarParam Inkscape::LivePathEffect::LPESimplify::threshold |
Definition at line 41 of file lpe-simplify.h.
Referenced by Inkscape::LivePathEffect::LPEPowerStroke::doAfterEffect(), doEffect(), LPESimplify(), and setVersioningData().