Inkscape
Vector Graphics Editor
|
#include <lpe-offset.h>
Public Member Functions | |
LPEOffset (LivePathEffectObject *lpeobject) | |
~LPEOffset () override | |
void | doBeforeEffect (SPLPEItem const *lpeitem) override |
Is performed each time before the effect is updated. | |
void | doAfterEffect (SPLPEItem const *, Geom::PathVector *curve) override |
Is performed at the end of the LPE only one time per "lpeitem" in paths/shapes is called in middle of the effect so we add the "curve" param to allow updates in the LPE results at this stage for groups dont need to send "curve" parameter because is applied when the LPE process finish, we can update LPE results without "curve" parameter. | |
Geom::PathVector | doEffect_path (Geom::PathVector const &path_in) override |
bool | doOnOpen (SPLPEItem const *lpeitem) override |
Is performed on load document or revert If the item is fixed legacy return true. | |
void | doOnApply (SPLPEItem const *lpeitem) override |
Is performed a single time when the effect is freshly applied to a path. | |
void | transform_multiply (Geom::Affine const &postmul, bool set) override |
Overridden function to apply transforms for example to powerstroke, jointtype or tapperstroke. | |
void | addKnotHolderEntities (KnotHolder *knotholder, SPItem *item) override |
void | addCanvasIndicators (SPLPEItem const *lpeitem, 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. | |
void | calculateOffset (Geom::PathVector const &path_in) |
Geom::Path | cleanupPathSelfIntersects (Geom::Path path, size_t originpos, double tolerance) |
Geom::Point | get_default_point (Geom::PathVector pathv) |
double | sp_get_offset () |
![]() | |
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 | doEffect (Geom::PathVector &curve) |
virtual Gtk::Widget * | newWidget () |
This creates a managed widget. | |
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 () |
Private Member Functions | |
void | modified (SPObject *, guint flags) |
LPEOffset (const LPEOffset &) | |
LPEOffset & | operator= (const LPEOffset &) |
![]() | |
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 | |
UnitParam | unit |
ScalarParam | offset |
EnumParam< unsigned > | linejoin_type |
ScalarParam | miter_limit |
BoolParam | attempt_force_join |
BoolParam | update_on_knot_move |
Geom::Point | offset_pt |
bool | sign = true |
Glib::ustring | prev_unit |
double | scale = 1 |
KnotHolder * | _knotholder |
Geom::PathVector | mix_pathv_all |
Geom::PathVector | helper_path |
Inkscape::UI::Widget::Scalar * | offset_widget |
FillRule | fillrule |
bool | liveknot |
sigc::connection | modified_connection |
![]() | |
Geom::Interval | boundingbox_X |
Geom::Interval | boundingbox_Y |
Friends | |
class | OfS::KnotHolderEntityOffsetPoint |
Definition at line 36 of file lpe-offset.h.
Inkscape::LivePathEffect::LPEOffset::LPEOffset | ( | LivePathEffectObject * | lpeobject | ) |
Definition at line 71 of file lpe-offset.cpp.
References _knotholder, Inkscape::LivePathEffect::Effect::_provides_knotholder_entities, Inkscape::LivePathEffect::Effect::apply_to_clippath_and_mask, attempt_force_join, fill_nonZero, fillrule, Inkscape::LivePathEffect::UnitParam::get_abbreviation(), Geom::infinity(), linejoin_type, liveknot, miter_limit, offset, offset_pt, Inkscape::LivePathEffect::ScalarParam::param_set_digits(), Inkscape::LivePathEffect::ScalarParam::param_set_increments(), prev_unit, Inkscape::LivePathEffect::Effect::registerParameter(), Inkscape::LivePathEffect::Effect::show_orig_path, unit, and update_on_knot_move.
|
override |
Definition at line 98 of file lpe-offset.cpp.
References _knotholder, KnotHolder::clear(), and modified_connection.
|
private |
|
overridevirtual |
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 214 of file lpe-offset.cpp.
References helper_path.
|
overridevirtual |
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 320 of file lpe-offset.cpp.
References _knotholder, KnotHolder::add(), Inkscape::CANVAS_ITEM_CTRL_TYPE_LPE, KnotHolderEntity::create(), Geom::infinity(), item, KnotHolderEntity::knot, offset_pt, OfS::KnotHolderEntityOffsetPoint, and SPKnot::updateCtrl().
void Inkscape::LivePathEffect::LPEOffset::calculateOffset | ( | Geom::PathVector const & | path_in | ) |
Geom::Path Inkscape::LivePathEffect::LPEOffset::cleanupPathSelfIntersects | ( | Geom::Path | path, |
size_t | originpos, | ||
double | tolerance | ||
) |
|
overridevirtual |
Is performed at the end of the LPE only one time per "lpeitem" in paths/shapes is called in middle of the effect so we add the "curve" param to allow updates in the LPE results at this stage for groups dont need to send "curve" parameter because is applied when the LPE process finish, we can update LPE results without "curve" parameter.
lpeitem | the element that has this LPE |
curve | the curve to pass when in mode path or shape |
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 241 of file lpe-offset.cpp.
References _knotholder, KnotHolder::entity, Inkscape::LivePathEffect::get_nearest_point(), Geom::infinity(), Inkscape::LivePathEffect::Effect::is_load, liveknot, offset_pt, and Inkscape::LivePathEffect::Effect::sp_lpe_item.
|
overridevirtual |
Is performed each time before the effect is updated.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 220 of file lpe-offset.cpp.
References Geom::PathVector::clear(), SPObject::connectModified(), Inkscape::Util::Quantity::convert(), Geom::Affine::descrim(), Inkscape::LivePathEffect::UnitParam::get_abbreviation(), SPItem::i2doc_affine(), Inkscape::LivePathEffect::Effect::is_load, mix_pathv_all, modified(), modified_connection, offset, Inkscape::LivePathEffect::GroupBBoxEffect::original_bbox(), Inkscape::LivePathEffect::ScalarParam::param_set_undo(), Inkscape::LivePathEffect::ScalarParam::param_set_value(), prev_unit, scale, Inkscape::LivePathEffect::Effect::sp_lpe_item, and unit.
|
overridevirtual |
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 264 of file lpe-offset.cpp.
References _knotholder, Geom::are_near(), attempt_force_join, Geom::PathVector::begin(), Geom::PathVector::clear(), Inkscape::Util::Quantity::convert(), Inkscape::LivePathEffect::Effect::current_shape, Inkscape::do_offset(), Geom::PathVector::empty(), Geom::PathVector::end(), KnotHolder::entity, fill_nonZero, fill_oddEven, fillrule, Inkscape::LivePathEffect::UnitParam::get_abbreviation(), get_default_point(), Inkscape::LivePathEffect::EnumParam< E >::get_value(), Inkscape::LivePathEffect::Effect::getSPDoc(), helper_path, Geom::infinity(), Geom::PathVector::insert(), Inkscape::LivePathEffect::Effect::is_load, item, Inkscape::join(), linejoin_type, liveknot, miter_limit, mix_pathv_all, offset, offset_pt, scale, Inkscape::LivePathEffect::sp_get_fill_rule(), Inkscape::LivePathEffect::Effect::sp_lpe_item, and unit.
|
overridevirtual |
Is performed a single time when the effect is freshly applied to a path.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 119 of file lpe-offset.cpp.
References Inkscape::LivePathEffect::Effect::lpeversion, and Inkscape::LivePathEffect::HiddenParam::param_setValue().
|
overridevirtual |
Is performed on load document or revert If the item is fixed legacy return true.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 106 of file lpe-offset.cpp.
References Inkscape::LivePathEffect::Effect::is_applied, Inkscape::LivePathEffect::Effect::is_load, Inkscape::LivePathEffect::Effect::lpeversion, Inkscape::LivePathEffect::HiddenParam::param_getSVGValue(), and Inkscape::LivePathEffect::HiddenParam::param_setValue().
Geom::Point Inkscape::LivePathEffect::LPEOffset::get_default_point | ( | Geom::PathVector | pathv | ) |
Definition at line 171 of file lpe-offset.cpp.
References Geom::PathVector::boundsFast(), Inkscape::LivePathEffect::get_nearest_point(), Geom::infinity(), origin, and Geom::X.
Referenced by doEffect_path().
|
private |
Definition at line 134 of file lpe-offset.cpp.
References fill_nonZero, fill_oddEven, fillrule, Inkscape::LivePathEffect::sp_get_fill_rule(), Inkscape::LivePathEffect::Effect::sp_lpe_item, and sp_lpe_item_update_patheffect().
Referenced by doBeforeEffect().
double Inkscape::LivePathEffect::LPEOffset::sp_get_offset | ( | ) |
Definition at line 183 of file lpe-offset.cpp.
References Geom::Path::closed(), Inkscape::Util::Quantity::convert(), Geom::PathTime::curve_index, Geom::distance(), Inkscape::LivePathEffect::UnitParam::get_abbreviation(), Geom::infinity(), mix_pathv_all, Geom::PathVector::nearestTime(), offset_pt, Geom::Path::pointAt(), scale, sign, Geom::PathTime::t, unit, and Geom::PathVector::winding().
|
overridevirtual |
Overridden function to apply transforms for example to powerstroke, jointtype or tapperstroke.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 161 of file lpe-offset.cpp.
References Geom::Affine::inverse(), Geom::Affine::isTranslation(), offset, offset_pt, Inkscape::LivePathEffect::ScalarParam::param_transform_multiply(), Inkscape::LivePathEffect::Effect::refresh_widgets, sp_item_transform_repr(), and Inkscape::LivePathEffect::Effect::sp_lpe_item.
|
friend |
Definition at line 52 of file lpe-offset.h.
Referenced by addKnotHolderEntities().
|
private |
Definition at line 66 of file lpe-offset.h.
Referenced by addKnotHolderEntities(), doAfterEffect(), doEffect_path(), LPEOffset(), and ~LPEOffset().
|
private |
Definition at line 59 of file lpe-offset.h.
Referenced by doEffect_path(), and LPEOffset().
|
private |
Definition at line 70 of file lpe-offset.h.
Referenced by doEffect_path(), LPEOffset(), and modified().
|
private |
Definition at line 68 of file lpe-offset.h.
Referenced by addCanvasIndicators(), and doEffect_path().
|
private |
Definition at line 57 of file lpe-offset.h.
Referenced by doEffect_path(), and LPEOffset().
|
private |
Definition at line 71 of file lpe-offset.h.
Referenced by doAfterEffect(), doEffect_path(), and LPEOffset().
|
private |
Definition at line 58 of file lpe-offset.h.
Referenced by doEffect_path(), and LPEOffset().
|
private |
Definition at line 67 of file lpe-offset.h.
Referenced by doBeforeEffect(), doEffect_path(), and sp_get_offset().
|
private |
Definition at line 73 of file lpe-offset.h.
Referenced by doBeforeEffect(), and ~LPEOffset().
|
private |
Definition at line 56 of file lpe-offset.h.
Referenced by doBeforeEffect(), doEffect_path(), LPEOffset(), and transform_multiply().
|
private |
Definition at line 62 of file lpe-offset.h.
Referenced by addKnotHolderEntities(), doAfterEffect(), doEffect_path(), LPEOffset(), sp_get_offset(), and transform_multiply().
|
private |
Definition at line 69 of file lpe-offset.h.
|
private |
Definition at line 64 of file lpe-offset.h.
Referenced by doBeforeEffect(), and LPEOffset().
|
private |
Definition at line 65 of file lpe-offset.h.
Referenced by doBeforeEffect(), doEffect_path(), and sp_get_offset().
|
private |
Definition at line 63 of file lpe-offset.h.
Referenced by sp_get_offset().
|
private |
Definition at line 55 of file lpe-offset.h.
Referenced by doBeforeEffect(), doEffect_path(), LPEOffset(), and sp_get_offset().
|
private |
Definition at line 61 of file lpe-offset.h.
Referenced by LPEOffset().