Inkscape
Vector Graphics Editor
|
#include <lpe-bool.h>
Public Types | |
enum | bool_op_ex { bool_op_ex_union = bool_op_union , bool_op_ex_inters = bool_op_inters , bool_op_ex_diff = bool_op_diff , bool_op_ex_symdiff = bool_op_symdiff , bool_op_ex_cut = bool_op_cut , bool_op_ex_cut_both , bool_op_ex_count } |
Public Member Functions | |
LPEBool (LivePathEffectObject *lpeobject) | |
~LPEBool () override | |
void | doEffect (Geom::PathVector &curve) 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 | doBeforeEffect (SPLPEItem const *lpeitem) override |
Is performed each time before the effect is updated. | |
void | transform_multiply (Geom::Affine const &postmul, bool set) override |
Overridden function to apply transforms for example to powerstroke, jointtype or tapperstroke. | |
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. | |
void | doOnVisibilityToggled (SPLPEItem const *) override |
void | doOnRemove (SPLPEItem const *) override |
bool | doOnOpen (SPLPEItem const *lpeitem) override |
Is performed on load document or revert If the item is fixed legacy return true. | |
void | add_filter () |
void | fractureit (SPObject *operandit, Geom::PathVector unionpv) |
void | divisionit (SPObject *operand_a, SPObject *operand_b, Geom::PathVector unionpv) |
Geom::PathVector | get_union (SPObject *root, SPObject *object, bool prefear_original=false) |
Inkscape::XML::Node * | dupleNode (SPObject *origin, Glib::ustring element_type) |
void | remove_filter (SPObject *object) |
![]() | |
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 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 | |
LPEBool (const LPEBool &)=delete | |
LPEBool & | operator= (const LPEBool &)=delete |
Private Attributes | |
OriginalSatelliteParam | operand_item |
EnumParam< bool_op_ex > | bool_operation |
EnumParam< FillRule > | fill_type_this |
EnumParam< FillRule > | fill_type_operand |
BoolParam | swap_operands |
BoolParam | rmv_inner |
bool | onremove = false |
SPItem * | operand = nullptr |
SPGroup * | division = nullptr |
SPGroup * | division_both = nullptr |
SPGroup * | division_other = nullptr |
Glib::ustring | operand_id = "" |
Glib::ustring | division_id = "" |
Glib::ustring | division_other_id = "" |
HiddenParam | filter |
Geom::PathVector | _hp |
Geom::Affine | prev_affine |
bool | reverse = false |
Friends | |
BooleanOp | to_bool_op (bool_op_ex val) |
Definition at line 24 of file lpe-bool.h.
Enumerator | |
---|---|
bool_op_ex_union | |
bool_op_ex_inters | |
bool_op_ex_diff | |
bool_op_ex_symdiff | |
bool_op_ex_cut | |
bool_op_ex_cut_both | |
bool_op_ex_count |
Definition at line 43 of file lpe-bool.h.
Inkscape::LivePathEffect::LPEBool::LPEBool | ( | LivePathEffectObject * | lpeobject | ) |
Definition at line 77 of file lpe-bool.cpp.
References bool_operation, fill_type_operand, fill_type_this, filter, SPObject::getId(), Inkscape::LivePathEffect::SatelliteParam::getObject(), Geom::identity(), operand, operand_id, operand_item, prev_affine, Inkscape::LivePathEffect::Effect::registerParameter(), Inkscape::LivePathEffect::Effect::satellitestoclipboard, Inkscape::LivePathEffect::Effect::show_orig_path, and swap_operands.
|
overridedefault |
|
privatedelete |
void Inkscape::LivePathEffect::LPEBool::add_filter | ( | ) |
Definition at line 377 of file lpe-bool.cpp.
References css, filter, SPStyle::getFilter(), SPObject::getId(), Inkscape::LivePathEffect::SatelliteParam::getObject(), SPObject::getRepr(), operand, operand_item, Inkscape::LivePathEffect::HiddenParam::param_setValue(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_change(), sp_repr_css_set_property(), and SPObject::style.
Referenced by doBeforeEffect().
|
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 716 of file lpe-bool.cpp.
References _hp.
void Inkscape::LivePathEffect::LPEBool::divisionit | ( | SPObject * | operand_a, |
SPObject * | operand_b, | ||
Geom::PathVector | unionpv | ||
) |
Definition at line 818 of file lpe-bool.cpp.
References SPObject::appendChildRepr(), bool_op_inters, c, child, division, division_id, divisionit(), dupleNode(), fill_justDont, fill_type_operand, fill_type_this, Inkscape::LivePathEffect::EnumParam< E >::get_value(), Inkscape::LivePathEffect::GetFillTyp(), SPObject::getId(), i2anc_affine(), item, SPObject::parent, Inkscape::GC::release(), SPObject::reorder(), Inkscape::XML::Node::setAttribute(), Inkscape::LivePathEffect::Effect::sp_lpe_item, sp_pathvector_boolop(), and sp_svg_write_path().
Referenced by divisionit(), doOnRemove(), and fractureit().
|
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 435 of file lpe-bool.cpp.
References onremove.
|
overridevirtual |
Is performed each time before the effect is updated.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 442 of file lpe-bool.cpp.
References _hp, add_filter(), Inkscape::XML::Node::addChild(), Inkscape::LivePathEffect::BOOL_OP, bool_op_ex_cut_both, bool_operation, SPObject::childList(), Geom::PathVector::clear(), Inkscape::XML::Document::createElement(), desktop, Inkscape::LivePathEffect::EnumParam< E >::get_value(), SPDocument::getDefs(), SPObject::getId(), Inkscape::LivePathEffect::SatelliteParam::getObject(), SPDocument::getObjectById(), SPObject::getRepr(), SPDocument::getReprDoc(), SPDesktop::getSelection(), Inkscape::LivePathEffect::Effect::getSPDoc(), Inkscape::Selection::includes(), Inkscape::LivePathEffect::Effect::is_load, Inkscape::LivePathEffect::Effect::is_visible, Inkscape::LivePathEffect::SatelliteParam::isConnected(), Inkscape::LivePathEffect::Effect::isOnClipboard(), Inkscape::LivePathEffect::SatelliteParam::linksToItem(), Inkscape::LivePathEffect::SatelliteParam::lperef, onremove, operand, operand_id, operand_item, Inkscape::LivePathEffect::Parameter::read_from_SVG(), Inkscape::GC::release(), remove_filter(), Inkscape::XML::Node::setAttribute(), Inkscape::LivePathEffect::Effect::sp_lpe_item, sp_lpe_item_update_patheffect(), Inkscape::LivePathEffect::SatelliteParam::start_listening(), and Inkscape::LivePathEffect::SatelliteParam::unlink().
|
overridevirtual |
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 637 of file lpe-bool.cpp.
References _hp, Geom::PathVector::begin(), bool_op_diff, bool_op_ex_cut, bool_op_ex_cut_both, bool_op_ex_diff, bool_op_inters, bool_operation, Inkscape::LivePathEffect::Effect::current_shape, Geom::PathVector::empty(), Geom::PathVector::end(), fill_justDont, fill_type_operand, fill_type_this, get_union(), Inkscape::LivePathEffect::BoolParam::get_value(), Inkscape::LivePathEffect::EnumParam< E >::get_value(), Inkscape::LivePathEffect::GetFillTyp(), Inkscape::LivePathEffect::SatelliteParam::getObject(), Inkscape::LivePathEffect::Effect::getSPDoc(), Inkscape::LivePathEffect::Effect::helperLineSatellites, Geom::PathVector::insert(), Geom::Affine::inverse(), item, onremove, operand_id, operand_item, Inkscape::LivePathEffect::SatelliteParam::param_set_default(), rmv_inner, Inkscape::LivePathEffect::Effect::sp_lpe_item, sp_pathvector_boolop(), Inkscape::LivePathEffect::sp_pathvector_boolop_remove_inner(), swap_operands, to_bool_op, and SPItem::transform.
|
overridevirtual |
Is performed on load document or revert If the item is fixed legacy return true.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 110 of file lpe-bool.cpp.
References Inkscape::LivePathEffect::Parameter::connect_selection_changed(), Inkscape::LivePathEffect::SatelliteParam::getObject(), Inkscape::LivePathEffect::Effect::is_applied, Inkscape::LivePathEffect::Effect::is_load, Inkscape::LivePathEffect::Effect::lpeversion, operand_item, Inkscape::LivePathEffect::HiddenParam::param_getSVGValue(), Inkscape::LivePathEffect::HiddenParam::param_setValue(), and Inkscape::LivePathEffect::SatelliteParam::start_listening().
|
overridevirtual |
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 864 of file lpe-bool.cpp.
References bool_op_ex_cut, bool_op_ex_cut_both, bool_operation, division, division_both, division_id, division_other, division_other_id, divisionit(), fractureit(), get_union(), Inkscape::LivePathEffect::EnumParam< E >::get_value(), Inkscape::LivePathEffect::SatelliteParam::getObject(), Inkscape::LivePathEffect::Effect::getSPDoc(), Inkscape::LivePathEffect::Effect::is_visible, Inkscape::LivePathEffect::Effect::keep_paths, Inkscape::LivePathEffect::LPE_ERASE, onremove, operand, operand_id, operand_item, SPItem::pos_in_parent(), Inkscape::LivePathEffect::Effect::processObjects(), remove_filter(), reverse, Inkscape::LivePathEffect::Effect::sp_lpe_item, and sp_lpe_item_update_patheffect().
|
overridevirtual |
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 909 of file lpe-bool.cpp.
References Inkscape::LivePathEffect::SatelliteParam::getObject(), Inkscape::LivePathEffect::Effect::is_visible, operand, operand_item, and remove_filter().
Inkscape::XML::Node * Inkscape::LivePathEffect::LPEBool::dupleNode | ( | SPObject * | origin, |
Glib::ustring | element_type | ||
) |
Definition at line 722 of file lpe-bool.cpp.
References Inkscape::XML::Document::createElement(), D, FONT, SPDocument::getReprDoc(), Inkscape::LivePathEffect::Effect::getSPDoc(), key, MARKER, origin, Inkscape::XML::Node::setAttribute(), and UNSET.
Referenced by divisionit(), and fractureit().
void Inkscape::LivePathEffect::LPEBool::fractureit | ( | SPObject * | operandit, |
Geom::PathVector | unionpv | ||
) |
Definition at line 747 of file lpe-bool.cpp.
References SPObject::appendChildRepr(), Inkscape::XML::Node::attribute(), bool_op_diff, bool_op_inters, c, child, division_both, division_id, division_other, division_other_id, divisionit(), dupleNode(), fill_justDont, fill_type_operand, fill_type_this, fractureit(), Inkscape::LivePathEffect::EnumParam< E >::get_value(), Inkscape::LivePathEffect::GetFillTyp(), SPObject::getId(), Inkscape::LivePathEffect::Effect::getSPDoc(), i2anc_affine(), item, SPObject::parent, Inkscape::GC::release(), SPObject::reorder(), Inkscape::XML::Node::setAttribute(), Inkscape::LivePathEffect::Effect::sp_lpe_item, sp_pathvector_boolop(), and sp_svg_write_path().
Referenced by doOnRemove(), and fractureit().
Geom::PathVector Inkscape::LivePathEffect::LPEBool::get_union | ( | SPObject * | root, |
SPObject * | object, | ||
bool | prefear_original = false |
||
) |
Definition at line 574 of file lpe-bool.cpp.
References bool_op_ex_diff, bool_op_ex_union, SPObject::childList(), Geom::clip(), Geom::PathVector::empty(), fill_oddEven, get_union(), Inkscape::LivePathEffect::GetFillTyp(), i2anc_affine(), root, sp_pathvector_boolop(), and to_bool_op.
Referenced by doEffect(), doOnRemove(), and get_union().
void Inkscape::LivePathEffect::LPEBool::remove_filter | ( | SPObject * | object | ) |
Definition at line 398 of file lpe-bool.cpp.
References css, filter, SPStyle::getFilter(), SPObject::getId(), SPObject::getRepr(), operand, Inkscape::LivePathEffect::HiddenParam::param_getSVGValue(), Inkscape::LivePathEffect::HiddenParam::param_setValue(), sp_repr_css_attr_new(), sp_repr_css_attr_unref(), sp_repr_css_change(), sp_repr_css_set_property(), sp_repr_css_unset_property(), and SPObject::style.
Referenced by doBeforeEffect(), doOnRemove(), and doOnVisibilityToggled().
|
overridevirtual |
Overridden function to apply transforms for example to powerstroke, jointtype or tapperstroke.
Reimplemented from Inkscape::LivePathEffect::Effect.
Definition at line 562 of file lpe-bool.cpp.
References desktop, SPObject::document, SPItem::doWriteTransform(), SPDocument::getObjectById(), SPDesktop::getSelection(), Inkscape::Selection::includes(), Geom::Affine::inverse(), Inkscape::LivePathEffect::Effect::is_visible, Inkscape::LivePathEffect::Effect::isOnClipboard(), operand, operand_id, SPLPEItem::pathEffectsEnabled(), prev_affine, sp_item_transform_repr(), Inkscape::LivePathEffect::Effect::sp_lpe_item, and SPItem::transform.
|
friend |
Definition at line 57 of file lpe-bool.h.
Referenced by doEffect(), and get_union().
|
private |
Definition at line 83 of file lpe-bool.h.
Referenced by addCanvasIndicators(), doBeforeEffect(), and doEffect().
|
private |
Definition at line 69 of file lpe-bool.h.
Referenced by doBeforeEffect(), doEffect(), doOnRemove(), and LPEBool().
|
private |
Definition at line 76 of file lpe-bool.h.
Referenced by divisionit(), and doOnRemove().
|
private |
Definition at line 77 of file lpe-bool.h.
Referenced by doOnRemove(), and fractureit().
|
private |
Definition at line 80 of file lpe-bool.h.
Referenced by divisionit(), doOnRemove(), and fractureit().
|
private |
Definition at line 78 of file lpe-bool.h.
Referenced by doOnRemove(), and fractureit().
|
private |
Definition at line 81 of file lpe-bool.h.
Referenced by doOnRemove(), and fractureit().
Definition at line 71 of file lpe-bool.h.
Referenced by divisionit(), doEffect(), fractureit(), and LPEBool().
Definition at line 70 of file lpe-bool.h.
Referenced by divisionit(), doEffect(), fractureit(), and LPEBool().
|
private |
Definition at line 82 of file lpe-bool.h.
Referenced by add_filter(), LPEBool(), and remove_filter().
|
private |
Definition at line 74 of file lpe-bool.h.
Referenced by doAfterEffect(), doBeforeEffect(), doEffect(), and doOnRemove().
|
private |
Definition at line 75 of file lpe-bool.h.
Referenced by add_filter(), doBeforeEffect(), doOnRemove(), doOnVisibilityToggled(), LPEBool(), remove_filter(), and transform_multiply().
|
private |
Definition at line 79 of file lpe-bool.h.
Referenced by doBeforeEffect(), doEffect(), doOnRemove(), LPEBool(), and transform_multiply().
|
private |
Definition at line 68 of file lpe-bool.h.
Referenced by add_filter(), doBeforeEffect(), doEffect(), doOnOpen(), doOnRemove(), doOnVisibilityToggled(), and LPEBool().
|
private |
Definition at line 84 of file lpe-bool.h.
Referenced by LPEBool(), and transform_multiply().
|
private |
Definition at line 85 of file lpe-bool.h.
Referenced by doOnRemove().
|
private |
Definition at line 73 of file lpe-bool.h.
Referenced by doEffect().
|
private |
Definition at line 72 of file lpe-bool.h.
Referenced by doEffect(), and LPEBool().