Inkscape
Vector Graphics Editor
|
Base class for shapes, including <path> element. More...
#include <sp-shape.h>
Public Member Functions | |
SPShape () | |
~SPShape () override | |
int | tag () const override |
SPCurve const * | curve () const |
Return a borrowed pointer to the curve (if any exists) or NULL if there is no curve. | |
SPCurve const * | curveBeforeLPE () const |
Return a borrowed pointer of the curve before LPE (if any exists) or NULL if there is no curve. | |
SPCurve const * | curveForEdit () const |
Return a borrowed pointer of the curve for edit. | |
void | setCurve (SPCurve const *) |
void | setCurve (SPCurve) |
Adds a curve to the shape. | |
void | setCurveInsync (SPCurve const *) |
void | setCurveInsync (SPCurve) |
Same as setCurve() but without updating the display. | |
void | setCurveBeforeLPE (SPCurve const *) |
void | setCurveBeforeLPE (SPCurve) |
Sets _curve_before_lpe to a copy of new_curve | |
bool | checkBrokenPathEffect () |
bool | prepareShapeForLPE (SPCurve const *c) |
int | hasMarkers () const |
int | numberOfMarkers (int type) const |
void | build (SPDocument *document, Inkscape::XML::Node *repr) override |
void | release () override |
Removes, releases and unrefs all children of object. | |
void | update (SPCtx *ctx, unsigned int flags) override |
void | modified (unsigned int flags) override |
void | set (SPAttr key, char const *value) override |
Inkscape::XML::Node * | write (Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override |
Geom::OptRect | bbox (Geom::Affine const &transform, SPItem::BBoxType bboxtype) const override |
Geom::OptRect | either_bbox (Geom::Affine const &transform, SPItem::BBoxType bboxtype, bool cache_is_valid, Geom::OptRect bbox_cache, Geom::Affine const &transform_cache) const |
void | print (SPPrintContext *ctx) override |
std::optional< Geom::PathVector > | documentExactBounds () const override |
Get an exact geometric shape representing the visual bounds of the item in the document coordinates. | |
Inkscape::DrawingItem * | show (Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) override |
void | hide (unsigned int key) override |
Sets style, path, and paintbox. | |
void | snappoints (std::vector< Inkscape::SnapCandidatePoint > &p, Inkscape::SnapPreferences const *snapprefs) const override |
virtual void | set_shape () |
void | update_patheffect (bool write) override |
void | set_marker (unsigned key, char const *value) |
Adds a new marker to shape object at the location indicated by key. | |
std::vector< std::tuple< SPMarkerLoc, SPMarker *, Geom::Affine > > | get_markers () const |
Lists every marker on this shape along with its transform and marker type. | |
![]() | |
SPLPEItem () | |
~SPLPEItem () override | |
void | replacePathEffects (std::vector< LivePathEffectObject const * > const &old_lpeobjs, std::vector< LivePathEffectObject const * > const &new_lpeobjs) |
Writes a new "inkscape:path-effect" string to xml, where the old_lpeobjects are substituted by the new ones. | |
void | child_added (Inkscape::XML::Node *child, Inkscape::XML::Node *ref) override |
void | remove_child (Inkscape::XML::Node *child) override |
bool | optimizeTransforms () |
returns false when LPE write unoptimiced | |
void | notifyTransform (Geom::Affine const &postmul) |
notify tranbsform applied to a LPE | |
bool | performPathEffect (SPCurve *curve, SPShape *current, bool is_clip_or_mask=false) |
returns true when LPE was successful. | |
bool | performOnePathEffect (SPCurve *curve, SPShape *current, Inkscape::LivePathEffect::Effect *lpe, bool is_clip_or_mask=false) |
returns true when LPE was successful. | |
bool | pathEffectsEnabled () const |
bool | hasPathEffect () const |
bool | hasPathEffectOfType (int const type, bool is_ready=true) const |
bool | hasPathEffectOfTypeRecursive (int const type, bool is_ready=true) const |
bool | hasPathEffectRecursive () const |
SPLPEItem const * | getTopPathEffect () const |
returns top most LPE item with LPE | |
bool | hasPathEffectOnClipOrMask (SPLPEItem *shape) const |
returns true when any LPE apply to clip or mask. | |
bool | hasPathEffectOnClipOrMaskRecursive (SPLPEItem *shape) const |
returns true when any LPE apply to clip or mask. | |
std::size_t | getLPEIndex (Inkscape::LivePathEffect::Effect *lpe) const |
std::size_t | countLPEOfType (int const type, bool inc_hidden=true, bool is_ready=true) const |
std::size_t | getLPEReferenceIndex (PathEffectSharedPtr const &lperef) const |
Inkscape::LivePathEffect::Effect * | getFirstPathEffectOfType (int type) |
Inkscape::LivePathEffect::Effect const * | getFirstPathEffectOfType (int type) const |
std::vector< Inkscape::LivePathEffect::Effect * > | getPathEffectsOfType (int type) |
std::vector< Inkscape::LivePathEffect::Effect const * > | getPathEffectsOfType (int type) const |
std::vector< Inkscape::LivePathEffect::Effect * > | getPathEffects () |
std::vector< Inkscape::LivePathEffect::Effect const * > | getPathEffects () const |
std::vector< SPObject * > | get_satellites (bool force=true, bool recursive=false, bool onchilds=false) |
bool | isOnClipboard () |
The lpeitem is on clipboard. | |
bool | isOnSymbol () const |
bool | hasBrokenPathEffect () const |
used for shapes so they can see if they should also disable shape calculation and read from d= | |
PathEffectList | getEffectList () |
PathEffectList const | getEffectList () const |
void | duplicateCurrentPathEffect () |
void | downCurrentPathEffect () |
void | upCurrentPathEffect () |
void | removePathEffect (Inkscape::LivePathEffect::Effect *lpe, bool keep_paths) |
void | movePathEffect (gint origin, gint dest, bool select_moved=false) |
SPLPEItem * | flattenCurrentPathEffect () |
PathEffectSharedPtr | getCurrentLPEReference () |
Inkscape::LivePathEffect::Effect * | getCurrentLPE () |
PathEffectSharedPtr | getPrevLPEReference (PathEffectSharedPtr const &lperef) |
Inkscape::LivePathEffect::Effect * | getPrevLPE (Inkscape::LivePathEffect::Effect *lpe) |
PathEffectSharedPtr | getNextLPEReference (PathEffectSharedPtr const &lperef) |
Inkscape::LivePathEffect::Effect * | getNextLPE (Inkscape::LivePathEffect::Effect *lpe) |
PathEffectSharedPtr | getLastLPEReference () |
Inkscape::LivePathEffect::Effect * | getLastLPE () |
bool | setCurrentPathEffect (PathEffectSharedPtr const &lperef) |
bool | setCurrentPathEffect (LivePathEffectObject const *lpeobj) |
SPLPEItem * | removeCurrentPathEffect (bool keep_paths) |
If keep_path is true, the item should not be updated, effectively 'flattening' the LPE. | |
SPLPEItem * | removeAllPathEffects (bool keep_paths, bool recursive=false) |
If keep_path is true, the item should not be updated, effectively 'flattening' the LPE. | |
void | addPathEffect (std::string value, bool reset) |
void | addPathEffect (LivePathEffectObject *new_lpeobj) |
void | resetClipPathAndMaskLPE (bool fromrecurse=false) |
void | applyToMask (SPItem *to, Inkscape::LivePathEffect::Effect *lpe=nullptr) |
void | applyToClipPath (SPItem *to, Inkscape::LivePathEffect::Effect *lpe=nullptr) |
void | applyToClipPathOrMask (SPItem *clip_mask, SPItem *to, Inkscape::LivePathEffect::Effect *lpe=nullptr) |
bool | forkPathEffectsIfNecessary (unsigned int nr_of_allowed_users=1, bool recursive=true, bool force=false) |
Check all effects in the stack if they are used by other items, and fork them if so. | |
void | editNextParamOncanvas (SPDesktop *dt) |
void | update_satellites (bool recursive=true) |
![]() | |
SPItem () | |
~SPItem () override | |
SPClipPath * | getClipObject () const |
SPMask * | getMaskObject () const |
SPClipPathReference & | getClipRef () |
SPMaskReference & | getMaskRef () |
std::optional< Geom::PathVector > | getClipPathVector () const |
Return the path vector of the clipping region. | |
std::optional< Geom::PathVector > | getClipPathVector (SPItem const *root) const |
Return the path vector of the clipping region, combined with the clipping regions of all groups containing this object up to and including root. | |
SPText const * | getClipTextObject () const |
Return the text object, IF and only if this item is clipped by a single SPText object. | |
SPAvoidRef & | getAvoidRef () |
bool | isLocked () const |
void | setLocked (bool lock, bool recursive=false) |
bool | isHidden () const |
void | setHidden (bool hidden) |
bool | isSensitive () const |
void | setHighlight (Inkscape::Colors::Color color) |
bool | isHighlightSet () const |
virtual Inkscape::Colors::Color | highlight_color () const |
bool | isEvaluated () const |
void | setEvaluated (bool visible) |
void | resetEvaluated () |
bool | unoptimized () |
bool | isHidden (unsigned display_key) const |
bool | isExplicitlyHidden () const |
Returns something suitable for the ‘Hide’ checkbox in the Object Properties dialog box. | |
void | setExplicitlyHidden (bool val) |
Sets the display CSS property to ‘hidden’ if val is true, otherwise makes it unset. | |
void | setCenter (Geom::Point const &object_centre) |
Sets the transform_center_x and transform_center_y properties to retain the rotation center. | |
bool | updateCenterIfSet (Geom::Point const ¢er) |
void | unsetCenter () |
bool | isCenterSet () const |
Geom::Point | getCenter (bool ensure_uptodate=true) const |
void | scaleCenter (Geom::Scale const &sc) |
bool | isVisibleAndUnlocked () const |
bool | isVisibleAndUnlocked (unsigned display_key) const |
Geom::Affine | getRelativeTransform (SPObject const *obj) const |
bool | raiseOne () |
bool | lowerOne () |
void | raiseToTop () |
void | lowerToBottom () |
SPGroup * | getParentGroup () const |
Return the parent, only if it's a group object. | |
void | moveTo (SPItem *target, bool intoafter) |
Move this SPItem into or after another SPItem in the doc. | |
sigc::connection | connectTransformed (sigc::slot< void(Geom::Affine const *, SPItem *)> slot) |
Geom::OptRect | geometricBounds (Geom::Affine const &transform=Geom::identity()) const |
Get item's geometric bounding box in this item's coordinate system. | |
Geom::OptRect | visualBounds (Geom::Affine const &transform=Geom::identity(), bool wfilter=true, bool wclip=true, bool wmask=true) const |
Get item's visual bounding box in this item's coordinate system. | |
Geom::OptRect | bounds (BBoxType type, Geom::Affine const &transform=Geom::identity()) const |
Geom::OptRect | documentGeometricBounds () const |
Get item's geometric bbox in document coordinate system. | |
Geom::OptRect | documentVisualBounds () const |
Get item's visual bbox in document coordinate system. | |
Geom::OptRect | documentBounds (BBoxType type) const |
Geom::OptRect | documentPreferredBounds () const |
Geom::OptRect | desktopGeometricBounds () const |
Get item's geometric bbox in desktop coordinate system. | |
Geom::OptRect | desktopVisualBounds () const |
Get item's visual bbox in desktop coordinate system. | |
Geom::OptRect | desktopPreferredBounds () const |
Geom::OptRect | desktopBounds (BBoxType type) const |
unsigned int | pos_in_parent () const |
char * | detailedDescription () const |
Returns a string suitable for status bar, formatted in pango markup language. | |
bool | isFiltered () const |
Returns true if the item is filtered, false otherwise. | |
SPObject * | isInMask () const |
SPObject * | isInClipPath () const |
void | invoke_print (SPPrintContext *ctx) |
Inkscape::DrawingItem * | invoke_show (Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) |
void | invoke_hide (unsigned int key) |
void | invoke_hide_except (unsigned key, const std::vector< SPItem const * > &to_keep) |
Invoke hide on all non-group items, except for the list of items to keep. | |
void | getSnappoints (std::vector< Inkscape::SnapCandidatePoint > &p, Inkscape::SnapPreferences const *snapprefs=nullptr) const |
void | adjust_pattern (Geom::Affine const &postmul, bool set=false, PaintServerTransform=TRANSFORM_BOTH) |
void | adjust_hatch (Geom::Affine const &postmul, bool set=false, PaintServerTransform=TRANSFORM_BOTH) |
void | adjust_gradient (Geom::Affine const &postmul, bool set=false) |
void | adjust_clip (Geom::Affine const &postmul, bool set=false) |
void | remove_clip_transforms () |
void | adjust_stroke (double ex) |
void | adjust_stroke_width_recursive (double ex) |
Recursively scale stroke width in item and its children by expansion. | |
void | freeze_stroke_width_recursive (bool freeze) |
void | adjust_paint_recursive (Geom::Affine advertized_transform, Geom::Affine t_ancestors, PaintServerType type=GRADIENT) |
Recursively compensate pattern or gradient transform. | |
bool | collidesWith (Geom::PathVector const &shape) const |
Checks for visual collision with another item. | |
bool | collidesWith (SPItem const &other) const |
void | doWriteTransform (Geom::Affine const &transform, Geom::Affine const *adv=nullptr, bool compensate=true) |
Set a new transform on an object. | |
void | set_item_transform (Geom::Affine const &transform_matrix) |
Sets item private transform (not propagated to repr), without compensating stroke widths, gradients, patterns as sp_item_write_transform does. | |
Inkscape::DrawingItem * | get_arenaitem (unsigned key) const |
Return the arenaitem corresponding to the given item in the display with the given key. | |
Geom::Affine | i2doc_affine () const |
Returns the accumulated transformation of the item and all its ancestors, including root's viewport. | |
Geom::Affine | i2dt_affine () const |
Returns the transformation from item to desktop coords. | |
void | set_i2d_affine (Geom::Affine const &transform) |
Geom::Affine | dt2i_affine () const |
Returns the transformation from desktop to item coords. | |
bool | isExpanded () const |
void | setExpanded (bool expand) |
void | rotate_rel (Geom::Rotate const &rotation) |
void | scale_rel (Geom::Scale const &scale) |
void | skew_rel (double skewX, double skewY) |
void | move_rel (Geom::Translate const &tr) |
virtual const char * | typeName () const |
The item's type name, not node tag name. | |
virtual const char * | displayName () const |
The item's type name as a translated human string. | |
virtual char * | description () const |
virtual Geom::Affine | set_transform (Geom::Affine const &transform) |
virtual void | removeTransformsRecursively (SPObject const *root) |
virtual void | convert_to_guides () const |
![]() | |
SPObject () | |
Constructor, sets all attributes to default values. | |
SPObject (SPObject const &)=delete | |
SPObject & | operator= (SPObject const &)=delete |
~SPObject () override | |
Destructor, frees the used memory and unreferences a potential successor of the object. | |
char const * | getId () const |
Returns the objects current ID string. | |
void | getIds (std::set< std::string > &ret) const |
Accumulate this id and all it's descendants ids. | |
std::string | getUrl () const |
Get the id in a URL format. | |
Inkscape::XML::Node * | getRepr () |
Returns the XML representation of tree. | |
Inkscape::XML::Node const * | getRepr () const |
Returns the XML representation of tree. | |
void | releaseReferences () |
Cleans up an SPObject, releasing its references and requesting that references to it be released. | |
sigc::connection | connectRelease (sigc::slot< void(SPObject *)> slot) |
Connects to the release request signal. | |
bool | isSiblingOf (SPObject const *object) const |
virtual void | getLinked (std::vector< SPObject * > &objects, LinkedObjectNature direction=LinkedObjectNature::ANY) const |
Get objects which are linked to this object as either a source or a target. | |
std::vector< SPObject * > | getLinked (LinkedObjectNature direction=LinkedObjectNature::ANY) const |
Get objects which are linked, like above. | |
bool | isAncestorOf (SPObject const *object) const |
True if object is non-NULL and this is some in/direct parent of object. | |
SPObject const * | nearestCommonAncestor (SPObject const *object) const |
Returns youngest object being parent to this and object. | |
SPObject const * | getTopAncestorNonLayer () const |
Returns ancestor non layer. | |
SPObject * | getNext () |
SPObject * | getPrev () |
Returns previous object in sibling list or NULL. | |
bool | hasChildren () const |
SPObject * | firstChild () |
SPObject const * | firstChild () const |
SPObject * | lastChild () |
SPObject const * | lastChild () const |
SPObject * | nthChild (unsigned index) |
SPObject const * | nthChild (unsigned index) const |
std::vector< SPObject * > | childList (bool add_ref, Action action=ActionGeneral) |
Retrieves the children as a std vector object, optionally ref'ing the children in the process, if add_ref is specified. | |
std::vector< SPObject * > | ancestorList (bool root_to_tip) |
Retrieves a list of ancestors of the object, as an easy to use vector. | |
SPObject * | appendChildRepr (Inkscape::XML::Node *repr) |
Append repr as child of this object. | |
char const * | label () const |
Gets the author-visible label property for the object or a default if no label is defined. | |
char const * | defaultLabel () const |
Returns a default label property for this object. | |
void | setLabel (char const *label) |
Sets the author-visible label for this object. | |
char * | title () const |
Returns the title of this object, or NULL if there is none. | |
bool | setTitle (char const *title, bool verbatim=false) |
Sets the title of this object. | |
char * | desc () const |
Returns the description of this object, or NULL if there is none. | |
bool | setDesc (char const *desc, bool verbatim=false) |
Sets the description of this object. | |
Glib::ustring | getExportFilename () const |
Get and set the exportable filename on this object. | |
void | setExportFilename (Glib::ustring filename) |
Geom::Point | getExportDpi () const |
Get and set the exported DPI for this objet, if available. | |
void | setExportDpi (Geom::Point dpi) |
CollectionPolicy | collectionPolicy () const |
Set the policy under which this object will be orphan-collected. | |
void | setCollectionPolicy (CollectionPolicy policy) |
Sets the orphan-collection policy in effect for this object. | |
void | requestOrphanCollection () |
Requests a later automatic call to collectOrphan(). | |
void | collectOrphan () |
Unconditionally delete the object if it is not referenced. | |
void | hrefObject (SPObject *owner=nullptr) |
Increase weak refcount. | |
void | unhrefObject (SPObject *owner=nullptr) |
Decrease weak refcount. | |
bool | isReferenced () |
Check if object is referenced by any other object. | |
void | deleteObject (bool propagate, bool propagate_descendants) |
Deletes an object, unparenting it from its parent. | |
void | deleteObject (bool propagate=true) |
Deletes on object. | |
void | cropToObject (SPObject *except) |
Removes all children except for the given object, it's children and it's ancesstors. | |
void | cropToObjects (std::vector< SPObject * > except_objects) |
Removes objects which are not related to given list of objects. | |
void | getObjectsExcept (std::vector< SPObject * > &objects, const std::vector< SPObject * > &except) |
Get all child objects except for any in the list. | |
void | getLinkedRecursive (std::vector< SPObject * > &objects, LinkedObjectNature direction=LinkedObjectNature::ANY) const |
Grows the input list with all linked items recursively in both child nodes and links of links. | |
sigc::connection | connectDelete (sigc::slot< void(SPObject *)> slot) |
Connects a slot to be called when an object is deleted. | |
sigc::connection | connectPositionChanged (sigc::slot< void(SPObject *)> slot) |
SPObject * | successor () |
Returns the object which supercedes this one (if any). | |
void | setSuccessor (SPObject *successor) |
Indicates that another object supercedes this one. | |
void | setTmpSuccessor (SPObject *tmpsuccessor) |
Indicates that another object supercedes temporaty this one. | |
void | unsetTmpSuccessor () |
Unset object supercedes. | |
void | fixTmpSuccessors () |
Fix temporary successors in duple stamp. | |
Inkscape::XML::Node * | updateRepr (unsigned int flags=SP_OBJECT_WRITE_EXT) |
Updates the object's repr based on the object's state. | |
Inkscape::XML::Node * | updateRepr (Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags) |
Updates the given repr based on the object's state. | |
void | requestDisplayUpdate (unsigned int flags) |
Queues an deferred update of this object's display. | |
void | updateDisplay (SPCtx *ctx, unsigned int flags) |
Updates the object's display immediately. | |
void | requestModified (unsigned int flags) |
Requests that a modification notification signal be emitted later (e.g. | |
void | emitModified (unsigned int flags) |
Emits the MODIFIED signal with the object's flags. | |
sigc::connection | connectModified (sigc::slot< void(SPObject *, unsigned int)> slot) |
Connects to the modification notification signal. | |
void | _sendDeleteSignalRecursive () |
Sends the delete signal to all children of this object recursively. | |
void | _updateTotalHRefCount (int increment) |
Adds increment to _total_hrefcount of object and its parents. | |
void | _requireSVGVersion (unsigned major, unsigned minor) |
void | _requireSVGVersion (Inkscape::Version version) |
Lifts SVG version of all root objects to version. | |
void | attach (SPObject *object, SPObject *prev) |
Put object into object tree, under parent, and behind prev; also update object's XML space. | |
void | reorder (SPObject *obj, SPObject *prev) |
In list of object's children, move object behind prev. | |
void | detach (SPObject *object) |
Remove object from parent's children, release and unref it. | |
SPObject * | get_child_by_repr (Inkscape::XML::Node *repr) |
Return object's child whose node pointer equals repr. | |
void | invoke_build (SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned) |
int | getIntAttribute (char const *key, int def) |
unsigned | getPosition () |
char const * | getAttribute (char const *name) const |
void | appendChild (Inkscape::XML::Node *child) |
void | addChild (Inkscape::XML::Node *child, Inkscape::XML::Node *prev=nullptr) |
void | setKeyValue (SPAttr key, char const *value) |
Call virtual set() function of object. | |
void | setAttribute (Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value) |
void | setAttributeDouble (Inkscape::Util::const_char_ptr key, double value) |
void | setAttributeOrRemoveIfEmpty (Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value) |
void | readAttr (char const *key) |
Read value of key attribute from XML node into object. | |
void | readAttr (SPAttr keyid) |
char const * | getTagName () const |
void | removeAttribute (char const *key) |
void | setCSS (SPCSSAttr *css, char const *attr) |
void | changeCSS (SPCSSAttr *css, char const *attr) |
bool | storeAsDouble (char const *key, double *val) const |
virtual void | read_content () |
void | recursivePrintTree (unsigned level=0) |
void | objectTrace (std::string const &, bool in=true, unsigned flags=0) |
std::string | generate_unique_id (char const *default_id=nullptr) const |
Generate a document-wide unique id for this object. | |
Protected Attributes | |
std::optional< SPCurve > | _curve_before_lpe |
std::shared_ptr< SPCurve const > | _curve |
![]() | |
ListHook | _child_hook |
Additional Inherited Members | |
![]() | |
enum | BBoxType { APPROXIMATE_BBOX , GEOMETRIC_BBOX , VISUAL_BBOX } |
enum | PaintServerType { PATTERN , HATCH , GRADIENT } |
![]() | |
enum | CollectionPolicy { COLLECT_WITH_PARENT , ALWAYS_COLLECT } |
enum class | LinkedObjectNature { DEPENDENT = -1 , ANY = 0 , DEPENDENCY = 1 } |
enum | Action { ActionGeneral , ActionBBox , ActionUpdate , ActionShow } |
typedef Inkscape::Util::ForwardPointerIterator< SPObject, ParentIteratorStrategy > | ParentIterator |
typedef Inkscape::Util::ForwardPointerIterator< SPObject const, ParentIteratorStrategy > | ConstParentIterator |
using | ChildrenList = boost::intrusive::list< SPObject, boost::intrusive::member_hook< SPObject, ListHook, &SPObject::_child_hook > > |
![]() | |
static unsigned int | display_key_new (unsigned numkeys) |
Allocates unique integer keys. | |
static unsigned | ensure_key (Inkscape::DrawingItem *di) |
Ensures that a drawing item's key is the first of a block of ITEM_KEY_SIZE keys, assigning it such a key if necessary. | |
![]() | |
typedef boost::intrusive::list_member_hook | ListHook |
![]() | |
virtual void | order_changed (Inkscape::XML::Node *child, Inkscape::XML::Node *old_repr, Inkscape::XML::Node *new_repr) |
virtual void | tag_name_changed (gchar const *oldname, gchar const *newname) |
Base class for shapes, including <path> element.
Definition at line 38 of file sp-shape.h.
SPShape::SPShape | ( | ) |
Definition at line 50 of file sp-shape.cpp.
References _marker.
|
override |
Definition at line 56 of file sp-shape.cpp.
References _modified_connect, _release_connect, and SP_MARKER_LOC_QTY.
|
overridevirtual |
Reimplemented from SPItem.
Definition at line 499 of file sp-shape.cpp.
References bbox_geom_cache, bbox_geom_cache_is_valid, bbox_geom_cache_transform, bbox_vis_cache, bbox_vis_cache_is_valid, bbox_vis_cache_transform, either_bbox(), SPItem::transform, and SPItem::VISUAL_BBOX.
Referenced by either_bbox(), print(), SPOffset::set_shape(), and snappoints().
|
overridevirtual |
Reimplemented from SPLPEItem.
Reimplemented in SPSpiral, and SPStar.
Definition at line 63 of file sp-shape.cpp.
References SPLPEItem::build(), SPObject::document, SPObject::getAttribute(), SPLPEItem::hasPathEffectOnClipOrMaskRecursive(), SPLPEItem::isOnClipboard(), SPStyle::marker_ptrs, SPObject::repr, set_marker(), SPObject::setAttribute(), SP_MARKER_LOC_QTY, SPObject::style, and SPIString::value().
Referenced by SPPolyLine::build(), SPRect::build(), SPSpiral::build(), SPGenericEllipse::build(), SPLine::build(), SPOffset::build(), SPPath::build(), SPPolygon::build(), and SPStar::build().
bool SPShape::checkBrokenPathEffect | ( | ) |
Definition at line 459 of file sp-shape.cpp.
References curve(), SPObject::getAttribute(), SPObject::getRepr(), SPLPEItem::hasBrokenPathEffect(), setCurveBeforeLPE(), setCurveInsync(), and sp_svg_read_pathv().
Referenced by SPGenericEllipse::set_shape(), SPRect::set_shape(), SPSpiral::set_shape(), and SPStar::set_shape().
SPCurve const * SPShape::curve | ( | ) | const |
Return a borrowed pointer to the curve (if any exists) or NULL if there is no curve.
Definition at line 970 of file sp-shape.cpp.
References _curve.
Referenced by change_endpts(), checkBrokenPathEffect(), curveForEdit(), documentExactBounds(), Inkscape::LivePathEffect::LPECloneOriginal::doEffect(), Inkscape::UI::Tools::MarkerTool::get_marker_transform(), get_markers(), SPText::getInclusionShape(), Inkscape::LivePathEffect::getNodes(), SPLine::set_shape(), SPOffset::set_shape(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::set_shape(), sp_conn_get_route_and_redraw(), Inkscape::Extension::Internal::sp_shape_render(), sp_shape_update_marker_view(), try_get_intersect_point_with_item(), and Inkscape::UI::Tools::LpeTool::update_measuring_items().
SPCurve const * SPShape::curveBeforeLPE | ( | ) | const |
Return a borrowed pointer of the curve before LPE (if any exists) or NULL if there is no curve.
Definition at line 978 of file sp-shape.cpp.
References _curve_before_lpe.
Referenced by Inkscape::LivePathEffect::LPECloneOriginal::doEffect(), Inkscape::LivePathEffect::LPESlice::originalDtoD(), prepareShapeForLPE(), and Box3DSide::set_shape().
SPCurve const * SPShape::curveForEdit | ( | ) | const |
Return a borrowed pointer of the curve for edit.
Definition at line 986 of file sp-shape.cpp.
References _curve_before_lpe, and curve().
Referenced by Inkscape::LivePathEffect::LPEShowHandles::doEffect_path(), SPConnEndPair::getEndpoints(), and update_patheffect().
|
overridevirtual |
Get an exact geometric shape representing the visual bounds of the item in the document coordinates.
This is different than a simple bounding rectangle aligned to the coordinate axes: the returned pathvector may effectively describe any shape and coincides with an appropriately transformed path-vector for paths. Even for rectangular items such as SPImage, the bounds may be a parallelogram resulting from transforming the bounding rectangle by an affine transformation.
Reimplemented from SPItem.
Definition at line 641 of file sp-shape.cpp.
References c, curve(), SPItem::i2doc_affine(), and result.
Geom::OptRect SPShape::either_bbox | ( | Geom::Affine const & | transform, |
SPItem::BBoxType | bboxtype, | ||
bool | cache_is_valid, | ||
Geom::OptRect | bbox_cache, | ||
Geom::Affine const & | transform_cache | ||
) | const |
Definition at line 523 of file sp-shape.cpp.
References _curve, bbox(), bounds_exact_transformed(), delta, get_markers(), hasMarkers(), Geom::Affine::inverse(), item_to_outline(), sp_item_first_item_child(), SPStyle::stroke, SPObject::style, SPItem::transform, and SPItem::VISUAL_BBOX.
Referenced by bbox().
std::vector< std::tuple< SPMarkerLoc, SPMarker *, Geom::Affine > > SPShape::get_markers | ( | ) | const |
Lists every marker on this shape along with its transform and marker type.
marker->c2p
. The caller should ensure to apply any required premultiplication(s). Definition at line 247 of file sp-shape.cpp.
References _marker, Geom::PathVector::back(), Geom::PathVector::begin(), curve(), Geom::PathVector::empty(), Geom::PathVector::end(), Geom::PathVector::front(), Geom::Path::front(), SPCurve::get_pathvector(), index, Geom::Path::size_default(), SP_MARKER_LOC, SP_MARKER_LOC_END, SP_MARKER_LOC_MID, SP_MARKER_LOC_START, sp_shape_marker_get_transform(), sp_shape_marker_get_transform_at_end(), sp_shape_marker_get_transform_at_start(), start, SPStyle::stroke_width, SPObject::style, and width.
Referenced by either_bbox(), Inkscape::Extension::Internal::PdfBuilder::DrawContext::paint_shape(), print(), Inkscape::Extension::Internal::sp_shape_render(), and sp_shape_update_marker_view().
int SPShape::hasMarkers | ( | ) | const |
shape | Shape. |
Definition at line 753 of file sp-shape.cpp.
References _curve, _marker, SPObject::parent, SP_MARKER_LOC, SP_MARKER_LOC_END, SP_MARKER_LOC_MID, and SP_MARKER_LOC_START.
Referenced by either_bbox(), modified(), show(), Inkscape::Extension::Internal::sp_shape_render(), and update().
|
overridevirtual |
Sets style, path, and paintbox.
Updates marker views, including dimensions.
Reimplemented from SPItem.
Definition at line 734 of file sp-shape.cpp.
References _marker, ITEM_KEY_MARKERS, key, sp_marker_hide(), SP_MARKER_LOC_QTY, and SPItem::views.
|
overridevirtual |
Reimplemented from SPLPEItem.
Definition at line 427 of file sp-shape.cpp.
References _curve, SPObject::context_style, SPStyle::filter, SPStyle::getFilter(), hasMarkers(), SPLPEItem::modified(), SPObject::parent, sp_lpe_item_update_patheffect(), SPObject::style, and SPItem::views.
Referenced by SPGenericEllipse::modified(), and SPRect::modified().
int SPShape::numberOfMarkers | ( | int | type | ) | const |
shape | Shape. |
type | Marker type (e.g. SP_MARKER_LOC_START) |
Definition at line 781 of file sp-shape.cpp.
References _curve, _marker, Geom::PathVector::size(), SP_MARKER_LOC, SP_MARKER_LOC_END, SP_MARKER_LOC_MID, and SP_MARKER_LOC_START.
bool SPShape::prepareShapeForLPE | ( | SPCurve const * | c | ) |
Definition at line 479 of file sp-shape.cpp.
References c, curveBeforeLPE(), SPObject::getAttribute(), SPObject::getRepr(), SPLPEItem::hasPathEffectOnClipOrMaskRecursive(), setCurveBeforeLPE(), setCurveInsync(), sp_lpe_item_update_patheffect(), and sp_svg_read_pathv().
Referenced by SPGenericEllipse::set_shape(), SPRect::set_shape(), SPSpiral::set_shape(), and SPStar::set_shape().
|
overridevirtual |
Reimplemented from SPItem.
Definition at line 575 of file sp-shape.cpp.
References _curve, bbox(), SPPrintContext::context_item, SPItem::desktopVisualBounds(), SPObject::document, Geom::PathVector::empty(), Inkscape::Extension::Print::fill(), SPPrintContext::fill(), SPStyle::fill, Geom::GenericRect< Coord >::from_xywh(), SPItem::geometricBounds(), get_markers(), SPDocument::getDimensions(), SPItem::i2dt_affine(), SPStyle::merge(), SP_CSS_PAINT_ORIGIN_CONTEXT_FILL, SP_CSS_PAINT_ORIGIN_CONTEXT_STROKE, sp_item_first_item_child(), SPPrintContext::stroke(), Inkscape::Extension::Print::stroke(), SPStyle::stroke, SPStyle::stroke_width, and SPObject::style.
|
overridevirtual |
Removes, releases and unrefs all children of object.
This is the inverse of sp_shape_build(). It must be invoked as soon as the shape is removed from the tree, even if it is still referenced by other objects. This routine also disconnects/unrefs markers and curves attached to it.
Reimplemented from SPLPEItem.
Definition at line 92 of file sp-shape.cpp.
References _curve, _curve_before_lpe, _marker, _modified_connect, _release_connect, ITEM_KEY_MARKERS, SPLPEItem::release(), sp_marker_hide(), SP_MARKER_LOC_QTY, SPObject::unhrefObject(), and SPItem::views.
Referenced by SPOffset::release(), and SPPath::release().
|
overridevirtual |
Reimplemented from SPLPEItem.
Reimplemented in SPSpiral, and SPStar.
Definition at line 115 of file sp-shape.cpp.
References key, and SPLPEItem::set().
Referenced by SPGenericEllipse::set(), SPLine::set(), SPOffset::set(), SPPath::set(), SPPolygon::set(), SPPolyLine::set(), SPRect::set(), SPSpiral::set(), and SPStar::set().
void SPShape::set_marker | ( | unsigned | key, |
char const * | value | ||
) |
Adds a new marker to shape object at the location indicated by key.
value must be a valid URI reference resolvable from the shape object (i.e., present in the document <defs>). If the shape object already has a marker registered at the given position, it is removed first. Then the new marker is hrefed and its signals connected.
Definition at line 874 of file sp-shape.cpp.
References _marker, _modified_connect, _release_connect, SPObject::document, SPObject::hrefObject(), ITEM_KEY_MARKERS, key, sp_css_uri_reference_resolve(), sp_marker_hide(), SP_MARKER_LOC_END, sp_shape_marker_modified(), sp_shape_marker_release(), SPObject::unhrefObject(), and SPItem::views.
Referenced by build(), SPPath::set(), show(), and update().
|
virtual |
Reimplemented in Box3DSide, SPGenericEllipse, SPLine, SPOffset, SPRect, SPSpiral, and SPStar.
Definition at line 908 of file sp-shape.cpp.
Referenced by SPText::getInclusionShape(), update_patheffect(), and SPPolygon::write().
void SPShape::setCurve | ( | SPCurve const * | new_curve | ) |
Definition at line 926 of file sp-shape.cpp.
References _curve, new_curve(), and setCurve().
Referenced by change_endpts(), SPPath::removeTransformsRecursively(), SPConnEndPair::reroutePathFromLibavoid(), SPPath::set(), SPPolygon::set(), SPPolyLine::set(), SPPath::set_transform(), and setCurve().
void SPShape::setCurve | ( | SPCurve | new_curve | ) |
Adds a curve to the shape.
Any existing curve in the shape will be unreferenced first. This routine also triggers a request to update the display.
Definition at line 919 of file sp-shape.cpp.
References _curve, SPObject::document, new_curve(), and SPObject::requestDisplayUpdate().
void SPShape::setCurveBeforeLPE | ( | SPCurve const * | new_curve | ) |
Definition at line 942 of file sp-shape.cpp.
References _curve_before_lpe, new_curve(), and setCurveBeforeLPE().
Referenced by checkBrokenPathEffect(), prepareShapeForLPE(), SPPath::set(), Box3DSide::set_shape(), SPLine::set_shape(), SPOffset::set_shape(), SPRect::set_shape(), SPPath::set_transform(), and setCurveBeforeLPE().
void SPShape::setCurveBeforeLPE | ( | SPCurve | new_curve | ) |
Sets _curve_before_lpe to a copy of new_curve
Definition at line 938 of file sp-shape.cpp.
References _curve_before_lpe, and new_curve().
void SPShape::setCurveInsync | ( | SPCurve const * | new_curve | ) |
Definition at line 958 of file sp-shape.cpp.
References _curve, new_curve(), and setCurveInsync().
Referenced by SPPath::build(), checkBrokenPathEffect(), prepareShapeForLPE(), Box3DSide::set_shape(), SPGenericEllipse::set_shape(), SPLine::set_shape(), SPOffset::set_shape(), SPRect::set_shape(), setCurveInsync(), and update_patheffect().
void SPShape::setCurveInsync | ( | SPCurve | new_curve | ) |
Same as setCurve() but without updating the display.
Definition at line 954 of file sp-shape.cpp.
References _curve, and new_curve().
|
overridevirtual |
Reimplemented from SPItem.
Definition at line 688 of file sp-shape.cpp.
References _curve, _marker, SPObject::context_style, SPItem::ensure_key(), hasMarkers(), ITEM_KEY_MARKERS, Inkscape::DrawingItem::key(), SPStyle::marker_ptrs, numberOfMarkers(), SPObject::parent, Inkscape::propagate_antialias(), set_marker(), Inkscape::DrawingShape::setChildrenStyle(), Inkscape::DrawingShape::setPath(), Inkscape::DrawingShape::setStyle(), SPStyle::shape_rendering, SP_MARKER_LOC_QTY, sp_marker_show_dimension(), sp_shape_update_marker_view(), SPObject::style, and SPIString::value().
|
overridevirtual |
Reimplemented from SPItem.
Reimplemented in SPSpiral, and SPStar.
Definition at line 991 of file sp-shape.cpp.
References _curve, bbox(), c, SPItem::desktopVisualBounds(), Geom::PathVector::empty(), Geom::get_nodetype(), SPItem::i2dt_affine(), Inkscape::SnapPreferences::isSourceSnappable(), Inkscape::SnapPreferences::isTargetSnappable(), Geom::middle_point(), Geom::NODE_CUSP, Geom::NODE_NONE, Geom::NODE_SMOOTH, Geom::NODE_SYMM, Inkscape::SNAPSOURCE_LINE_MIDPOINT, Inkscape::SNAPSOURCE_NODE_CUSP, Inkscape::SNAPSOURCE_NODE_SMOOTH, Inkscape::SNAPSOURCE_OBJECT_MIDPOINT, Inkscape::SNAPSOURCE_PATH_INTERSECTION, Inkscape::SNAPSOURCE_UNDEFINED, Inkscape::SNAPTARGET_LINE_MIDPOINT, Inkscape::SNAPTARGET_NODE_CUSP, Inkscape::SNAPTARGET_NODE_SMOOTH, Inkscape::SNAPTARGET_OBJECT_MIDPOINT, Inkscape::SNAPTARGET_PATH_INTERSECTION, and Inkscape::SNAPTARGET_UNDEFINED.
Referenced by SPOffset::snappoints(), SPSpiral::snappoints(), and SPStar::snappoints().
|
inlineoverridevirtual |
|
overridevirtual |
Reimplemented from SPLPEItem.
Reimplemented in SPSpiral, and SPStar.
Definition at line 125 of file sp-shape.cpp.
References _curve, _marker, bbox_geom_cache_is_valid, bbox_vis_cache_is_valid, SPObject::context_style, Geom::Affine::descrim(), SPItem::ensure_key(), SPStyle::font_size, hasMarkers(), Geom::GenericRect< C >::height(), SPItemCtx::i2vp, ITEM_KEY_MARKERS, SPStyle::marker_ptrs, numberOfMarkers(), SPObject::parent, set_marker(), Inkscape::DrawingShape::setChildrenStyle(), Inkscape::DrawingShape::setPath(), SP_CSS_UNIT_EM, SP_CSS_UNIT_EX, SP_CSS_UNIT_PERCENT, SP_MARKER_LOC_QTY, sp_marker_show_dimension(), sp_shape_update_marker_view(), SPStyle::stroke_dasharray, SPStyle::stroke_dashoffset, SPStyle::stroke_width, SPObject::style, SPLPEItem::update(), SPIString::value(), SPItemCtx::viewport, SPItem::views, w, and Geom::GenericRect< C >::width().
Referenced by SPGenericEllipse::update(), SPLine::update(), SPOffset::update(), SPPath::update(), SPRect::update(), SPSpiral::update(), and SPStar::update().
|
overridevirtual |
Reimplemented from SPLPEItem.
Reimplemented in SPSpiral, and SPStar.
Definition at line 650 of file sp-shape.cpp.
References SPLPEItem::applyToClipPath(), SPLPEItem::applyToMask(), curveForEdit(), SPObject::document, SPObject::getRepr(), SPDocument::getRoot(), SPLPEItem::hasPathEffect(), SPRoot::inkscape, SPLPEItem::lpe_initialized, SPLPEItem::pathEffectsEnabled(), SPLPEItem::performPathEffect(), SPObject::repr, SPObject::requestDisplayUpdate(), SPLPEItem::resetClipPathAndMaskLPE(), set_shape(), Inkscape::XML::Node::setAttribute(), setCurveInsync(), sp_svg_write_path(), and write().
Referenced by SPGenericEllipse::update_patheffect(), SPPath::update_patheffect(), SPRect::update_patheffect(), SPSpiral::update_patheffect(), and SPStar::update_patheffect().
|
overridevirtual |
Reimplemented from SPLPEItem.
Reimplemented in SPSpiral, and SPStar.
Definition at line 120 of file sp-shape.cpp.
References SPObject::repr, and SPLPEItem::write().
Referenced by update_patheffect(), SPOffset::write(), SPGenericEllipse::write(), SPLine::write(), SPPath::write(), SPPolygon::write(), SPPolyLine::write(), SPRect::write(), SPSpiral::write(), and SPStar::write().
|
protected |
Definition at line 70 of file sp-shape.h.
Referenced by SPPath::convert_to_guides(), curve(), either_bbox(), hasMarkers(), modified(), SPPath::nodesInPath(), numberOfMarkers(), print(), release(), SPPath::removeTransformsRecursively(), SPGenericEllipse::set_elliptical_path_attribute(), SPRect::set_rect_path_attribute(), SPPath::set_transform(), setCurve(), setCurve(), setCurveInsync(), setCurveInsync(), show(), snappoints(), update(), SPOffset::write(), Box3DSide::write(), SPPath::write(), SPPolygon::write(), SPSpiral::write(), and SPStar::write().
|
protected |
Definition at line 69 of file sp-shape.h.
Referenced by curveBeforeLPE(), curveForEdit(), release(), SPPath::removeTransformsRecursively(), SPPath::set_transform(), setCurveBeforeLPE(), setCurveBeforeLPE(), and SPPath::write().
SPMarker* SPShape::_marker[SP_MARKER_LOC_QTY] |
Definition at line 73 of file sp-shape.h.
Referenced by get_markers(), hasMarkers(), hide(), numberOfMarkers(), release(), set_marker(), show(), sp_shape_marker_release(), SPShape(), and update().
sigc::connection SPShape::_modified_connect[SP_MARKER_LOC_QTY] |
Definition at line 75 of file sp-shape.h.
Referenced by release(), set_marker(), sp_shape_marker_release(), and ~SPShape().
sigc::connection SPShape::_release_connect[SP_MARKER_LOC_QTY] |
Definition at line 74 of file sp-shape.h.
Referenced by release(), set_marker(), sp_shape_marker_release(), and ~SPShape().
|
mutable |
Definition at line 65 of file sp-shape.h.
Referenced by bbox().
|
mutable |
Definition at line 61 of file sp-shape.h.
|
mutable |
Definition at line 63 of file sp-shape.h.
Referenced by bbox().
|
mutable |
Definition at line 66 of file sp-shape.h.
Referenced by bbox().
|
mutable |
Definition at line 62 of file sp-shape.h.
|
mutable |
Definition at line 64 of file sp-shape.h.
Referenced by bbox().