Inkscape
Vector Graphics Editor
|
#include <lpe-mirror_symmetry.h>
Public Member Functions | |
LPEMirrorSymmetry (LivePathEffectObject *lpeobject) | |
~LPEMirrorSymmetry () override | |
void | doOnApply (SPLPEItem const *lpeitem) override |
Is performed a single time when the effect is freshly applied to a path. | |
void | doBeforeEffect (SPLPEItem const *lpeitem) override |
Is performed each time before the effect is updated. | |
void | doAfterEffect (SPLPEItem const *lpeitem, 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. | |
bool | doOnOpen (SPLPEItem const *) override |
Is performed on load document or revert If the item is fixed legacy return true. | |
Geom::PathVector | doEffect_path (Geom::PathVector const &path_in) override |
void | doOnRemove (SPLPEItem const *) override |
void | doOnVisibilityToggled (SPLPEItem const *) override |
Gtk::Widget * | newWidget () override |
This creates a managed widget. | |
void | cloneStyle (SPObject *orig, SPObject *dest) |
void | toMirror (Geom::Affine transform) |
void | cloneD (SPObject *orig, SPObject *dest) |
Inkscape::XML::Node * | createPathBase (SPObject *elemref) |
void | centerVert () |
void | centerHoriz () |
![]() | |
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 | 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 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 | |
BoolParam | split_items |
![]() | |
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 *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. | |
![]() | |
Effect (LivePathEffectObject *lpeobject) | |
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 | |
LPEMirrorSymmetry (const LPEMirrorSymmetry &)=delete | |
LPEMirrorSymmetry & | operator= (const LPEMirrorSymmetry &)=delete |
![]() | |
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 | |
SatelliteArrayParam | lpesatellites |
EnumParam< ModeType > | mode |
BoolParam | discard_orig_path |
BoolParam | fuse_paths |
BoolParam | oposite_fuse |
BoolParam | split_open |
BoolParam | link_styles |
PointParam | start_point |
PointParam | end_point |
PointParam | center_point |
Geom::Point | previous_center |
SPObject * | container |
bool | reset |
bool | prev_split = false |
bool | prev_discard_orig_path = false |
bool | center_vert |
bool | center_horiz |
![]() | |
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 42 of file lpe-mirror_symmetry.h.
Inkscape::LivePathEffect::LPEMirrorSymmetry::LPEMirrorSymmetry | ( | LivePathEffectObject * | lpeobject | ) |
Definition at line 56 of file lpe-mirror_symmetry.cpp.
References Inkscape::LivePathEffect::Effect::apply_to_clippath_and_mask, center_horiz, center_point, center_vert, discard_orig_path, end_point, fuse_paths, link_styles, lpesatellites, mode, oposite_fuse, Inkscape::LivePathEffect::Parameter::param_widget_is_visible(), previous_center, Inkscape::LivePathEffect::Effect::registerParameter(), reset, Inkscape::LivePathEffect::Effect::satellitestoclipboard, Inkscape::LivePathEffect::Effect::show_orig_path, split_items, split_open, and start_point.
|
overridedefault |
|
privatedelete |
|
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 680 of file lpe-mirror_symmetry.cpp.
References Geom::Path::appendNew(), end_point, Geom::PathVector::push_back(), Geom::Path::start(), and start_point.
void Inkscape::LivePathEffect::LPEMirrorSymmetry::centerHoriz | ( | ) |
Definition at line 199 of file lpe-mirror_symmetry.cpp.
References center_horiz, Inkscape::LivePathEffect::Effect::makeUndoDone(), Inkscape::LivePathEffect::Effect::sp_lpe_item, and sp_lpe_item_update_patheffect().
Referenced by newWidget().
void Inkscape::LivePathEffect::LPEMirrorSymmetry::centerVert | ( | ) |
Definition at line 192 of file lpe-mirror_symmetry.cpp.
References center_vert, Inkscape::LivePathEffect::Effect::makeUndoDone(), Inkscape::LivePathEffect::Effect::sp_lpe_item, and sp_lpe_item_update_patheffect().
Referenced by newWidget().
Definition at line 344 of file lpe-mirror_symmetry.cpp.
References c, child, cloneD(), cloneStyle(), Inkscape::XML::Document::createElement(), SPObject::document, SPObject::getAttribute(), SPDocument::getReprDoc(), Inkscape::LivePathEffect::Effect::getSPDoc(), index, SPObject::nthChild(), orig, Inkscape::LivePathEffect::BoolParam::param_setValue(), reset, Inkscape::XML::Node::setAttribute(), sp_svg_write_path(), split_items, and SPObject::updateRepr().
Referenced by cloneD(), and toMirror().
Definition at line 324 of file lpe-mirror_symmetry.cpp.
References D, FONT, key, MARKER, orig, SPObject::setAttribute(), and UNSET.
Referenced by cloneD().
Inkscape::XML::Node * Inkscape::LivePathEffect::LPEMirrorSymmetry::createPathBase | ( | SPObject * | elemref | ) |
Definition at line 405 of file lpe-mirror_symmetry.cpp.
References SPObject::addChild(), Inkscape::XML::Node::attribute(), container, Inkscape::XML::Document::createElement(), createPathBase(), SPObject::getRepr(), SPDocument::getReprDoc(), Inkscape::LivePathEffect::Effect::getSPDoc(), SPObject::setAttribute(), and Inkscape::XML::Node::setAttribute().
Referenced by createPathBase(), and toMirror().
|
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 120 of file lpe-mirror_symmetry.cpp.
References Inkscape::LivePathEffect::SatelliteArrayParam::clear(), container, Inkscape::LivePathEffect::ArrayParam< StorageType >::data(), discard_orig_path, end_point, Inkscape::LivePathEffect::Effect::getSPDoc(), Inkscape::LivePathEffect::Effect::is_load, lpesatellites, SPObject::parent, prev_discard_orig_path, prev_split, Geom::reflection(), Inkscape::LivePathEffect::Effect::sp_lpe_item, split_items, start_point, toMirror(), SPItem::transform, and Geom::Line::vector().
|
overridevirtual |
Is performed each time before the effect is updated.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 206 of file lpe-mirror_symmetry.cpp.
References Geom::are_near(), Inkscape::LivePathEffect::GroupBBoxEffect::boundingbox_X, Inkscape::LivePathEffect::GroupBBoxEffect::boundingbox_Y, center_horiz, center_point, center_vert, Inkscape::LivePathEffect::ArrayParam< StorageType >::data(), discard_orig_path, end_point, SPDocument::getPageManager(), Inkscape::LivePathEffect::Effect::getSPDoc(), i2anc_affine(), Geom::Affine::inverse(), link_styles, Inkscape::LivePathEffect::LPE_ERASE, lpesatellites, Geom::GenericInterval< C >::max(), Geom::GenericInterval< C >::middle(), Geom::middle_point(), Geom::GenericInterval< C >::min(), mode, Inkscape::LivePathEffect::MT_FREE, Inkscape::LivePathEffect::MT_V, Inkscape::LivePathEffect::MT_X, Inkscape::LivePathEffect::MT_Y, Inkscape::LivePathEffect::GroupBBoxEffect::original_bbox(), page, Inkscape::LivePathEffect::PointParam::param_setValue(), SPDocument::preferredBounds(), previous_center, Inkscape::LivePathEffect::Effect::processObjects(), Inkscape::LivePathEffect::Parameter::read_from_SVG(), reset, Inkscape::LivePathEffect::Effect::sp_lpe_item, split_items, start_point, Inkscape::LivePathEffect::Parameter::update_satellites(), Geom::X, Geom::Point::x(), Geom::Y, and Geom::Point::y().
|
overridevirtual |
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 536 of file lpe-mirror_symmetry.cpp.
References Geom::Line::angle(), Geom::Path::appendNew(), Geom::are_near(), Geom::PathVector::begin(), Inkscape::LivePathEffect::GroupBBoxEffect::boundingbox_X, Inkscape::LivePathEffect::GroupBBoxEffect::boundingbox_Y, c, center_point, Geom::Bezier::clear(), Geom::PathVector::clear(), Geom::Path::close(), Geom::cross(), Geom::crossings(), discard_orig_path, Geom::distance(), Geom::PathVector::end(), end_point, Geom::EPSILON, fill_oddEven, Geom::Curve::finalPoint(), flatten(), fuse_paths, Geom::Curve::initialPoint(), Geom::PathVector::insert(), Inkscape::LivePathEffect::Effect::lpeversion, Geom::GenericInterval< C >::max(), Geom::GenericInterval< C >::min(), oposite_fuse, original, Inkscape::LivePathEffect::HiddenParam::param_getSVGValue(), pathv_to_linear_and_cubic_beziers(), Geom::Bezier::portion, Geom::portion(), Geom::PathVector::push_back(), Geom::reflection(), Geom::PathVector::reversed(), Geom::Path::setInitial(), Geom::sgn(), Geom::Bezier::size(), Geom::PathVector::size(), split_items, split_open, start_point, and Geom::Line::vector().
|
overridevirtual |
Is performed a single time when the effect is freshly applied to a path.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 515 of file lpe-mirror_symmetry.cpp.
References Inkscape::LivePathEffect::GroupBBoxEffect::boundingbox_X, Inkscape::LivePathEffect::GroupBBoxEffect::boundingbox_Y, center_point, end_point, lpesatellites, Inkscape::LivePathEffect::Effect::lpeversion, Geom::GenericInterval< C >::max(), Geom::GenericInterval< C >::middle(), Geom::GenericInterval< C >::min(), Inkscape::LivePathEffect::GroupBBoxEffect::original_bbox(), Inkscape::LivePathEffect::PointParam::param_setValue(), Inkscape::LivePathEffect::HiddenParam::param_setValue(), Inkscape::LivePathEffect::PointParam::param_update_default(), previous_center, start_point, and Inkscape::LivePathEffect::Parameter::update_satellites().
|
overridevirtual |
Is performed on load document or revert If the item is fixed legacy return true.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 94 of file lpe-mirror_symmetry.cpp.
References Inkscape::LivePathEffect::SatelliteArrayParam::clear(), Inkscape::LivePathEffect::Parameter::connect_selection_changed(), container, SPObject::getId(), Inkscape::LivePathEffect::Effect::getLPEObj(), SPDocument::getObjectById(), Inkscape::LivePathEffect::Effect::getSPDoc(), Inkscape::LivePathEffect::Effect::is_applied, Inkscape::LivePathEffect::Effect::is_load, Inkscape::LivePathEffect::SatelliteArrayParam::link(), lpesatellites, Inkscape::LivePathEffect::Effect::lpeversion, Inkscape::LivePathEffect::HiddenParam::param_getSVGValue(), Inkscape::LivePathEffect::HiddenParam::param_setValue(), SPObject::parent, split_items, Inkscape::LivePathEffect::SatelliteArrayParam::start_listening(), and Inkscape::LivePathEffect::Parameter::write_to_SVG().
|
overridevirtual |
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 505 of file lpe-mirror_symmetry.cpp.
References Inkscape::LivePathEffect::Effect::keep_paths, Inkscape::LivePathEffect::LPE_ERASE, Inkscape::LivePathEffect::LPE_TO_OBJECTS, and Inkscape::LivePathEffect::Effect::processObjects().
|
overridevirtual |
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 499 of file lpe-mirror_symmetry.cpp.
References Inkscape::LivePathEffect::LPE_VISIBILITY, and Inkscape::LivePathEffect::Effect::processObjects().
|
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 151 of file lpe-mirror_symmetry.cpp.
References centerHoriz(), centerVert(), Inkscape::UI::pack_start(), Inkscape::LivePathEffect::Parameter::param_getTooltip(), Inkscape::LivePathEffect::Parameter::param_key, Inkscape::LivePathEffect::Parameter::param_newWidget(), and Inkscape::LivePathEffect::Effect::param_vector.
|
privatedelete |
void Inkscape::LivePathEffect::LPEMirrorSymmetry::toMirror | ( | Geom::Affine | transform | ) |
Definition at line 437 of file lpe-mirror_symmetry.cpp.
References SPObject::appendChildRepr(), Inkscape::LivePathEffect::SatelliteArrayParam::clear(), cloneD(), container, createPathBase(), Inkscape::LivePathEffect::ArrayParam< StorageType >::data(), SPObject::getRepr(), Inkscape::LivePathEffect::Effect::getSPDoc(), Inkscape::LivePathEffect::SatelliteArrayParam::is_connected(), Inkscape::LivePathEffect::Effect::is_load, Inkscape::LivePathEffect::SatelliteArrayParam::link(), link_styles, lpesatellites, SPObject::parent, Inkscape::LivePathEffect::Parameter::read_from_SVG(), Inkscape::GC::release(), reset, Inkscape::XML::Node::setAttributeOrRemoveIfEmpty(), Inkscape::LivePathEffect::Effect::sp_lpe_item, sp_lpe_item_update_patheffect(), sp_svg_transform_write(), Inkscape::LivePathEffect::SatelliteArrayParam::start_listening(), Inkscape::LivePathEffect::Parameter::update_satellites(), and Inkscape::LivePathEffect::Parameter::write_to_SVG().
Referenced by doAfterEffect().
|
private |
Definition at line 82 of file lpe-mirror_symmetry.h.
Referenced by centerHoriz(), doBeforeEffect(), and LPEMirrorSymmetry().
|
private |
Definition at line 75 of file lpe-mirror_symmetry.h.
Referenced by doBeforeEffect(), doEffect_path(), doOnApply(), and LPEMirrorSymmetry().
|
private |
Definition at line 81 of file lpe-mirror_symmetry.h.
Referenced by centerVert(), doBeforeEffect(), and LPEMirrorSymmetry().
|
private |
Definition at line 77 of file lpe-mirror_symmetry.h.
Referenced by createPathBase(), doAfterEffect(), doOnOpen(), and toMirror().
|
private |
Definition at line 68 of file lpe-mirror_symmetry.h.
Referenced by doAfterEffect(), doBeforeEffect(), doEffect_path(), and LPEMirrorSymmetry().
|
private |
Definition at line 74 of file lpe-mirror_symmetry.h.
Referenced by addCanvasIndicators(), doAfterEffect(), doBeforeEffect(), doEffect_path(), doOnApply(), and LPEMirrorSymmetry().
|
private |
Definition at line 69 of file lpe-mirror_symmetry.h.
Referenced by doEffect_path(), and LPEMirrorSymmetry().
|
private |
Definition at line 72 of file lpe-mirror_symmetry.h.
Referenced by doBeforeEffect(), LPEMirrorSymmetry(), and toMirror().
|
private |
Definition at line 66 of file lpe-mirror_symmetry.h.
Referenced by doAfterEffect(), doBeforeEffect(), doOnApply(), doOnOpen(), LPEMirrorSymmetry(), and toMirror().
Definition at line 67 of file lpe-mirror_symmetry.h.
Referenced by doBeforeEffect(), and LPEMirrorSymmetry().
|
private |
Definition at line 70 of file lpe-mirror_symmetry.h.
Referenced by doEffect_path(), and LPEMirrorSymmetry().
|
private |
Definition at line 80 of file lpe-mirror_symmetry.h.
Referenced by doAfterEffect().
|
private |
Definition at line 79 of file lpe-mirror_symmetry.h.
Referenced by doAfterEffect().
|
private |
Definition at line 76 of file lpe-mirror_symmetry.h.
Referenced by doBeforeEffect(), doOnApply(), and LPEMirrorSymmetry().
|
private |
Definition at line 78 of file lpe-mirror_symmetry.h.
Referenced by cloneD(), doBeforeEffect(), LPEMirrorSymmetry(), and toMirror().
BoolParam Inkscape::LivePathEffect::LPEMirrorSymmetry::split_items |
Definition at line 60 of file lpe-mirror_symmetry.h.
Referenced by cloneD(), doAfterEffect(), doBeforeEffect(), doEffect_path(), doOnOpen(), and LPEMirrorSymmetry().
|
private |
Definition at line 71 of file lpe-mirror_symmetry.h.
Referenced by doEffect_path(), and LPEMirrorSymmetry().
|
private |
Definition at line 73 of file lpe-mirror_symmetry.h.
Referenced by addCanvasIndicators(), doAfterEffect(), doBeforeEffect(), doEffect_path(), doOnApply(), and LPEMirrorSymmetry().