Logo Search packages:      
Sourcecode: inkscape version File versions

SnapManager Class Reference

#include <snap.h>

List of all members.


Detailed Description

Class to coordinate snapping operations.

Each SPNamedView has one of these. It offers methods to snap points to whatever snappers are defined (e.g. grid, guides etc.). It also allows callers to snap points which have undergone some transformation (e.g. translation, scaling etc.)

Definition at line 38 of file snap.h.


Public Types

typedef std::list< const
Inkscape::Snapper * > 
SnapperList
enum  Transformation { TRANSLATION, SCALE, STRETCH, SKEW }

Public Member Functions

Inkscape::SnappedPoint constrainedSnap (Inkscape::SnapPreferences::PointType point_type, Geom::Point const &p, Inkscape::SnapSourceType const &source_type, Inkscape::Snapper::ConstraintLine const &constraint, bool const snap_projection, bool first_point=true, Geom::OptRect const &bbox_to_snap=Geom::OptRect()) const
void constrainedSnapReturnByRef (Inkscape::SnapPreferences::PointType point_type, Geom::Point &p, Inkscape::SnapSourceType const source_type, Inkscape::Snapper::ConstraintLine const &constraint, bool snap_projection, bool first_point=true, Geom::OptRect const &bbox_to_snap=Geom::OptRect()) const
Inkscape::SnappedPoint constrainedSnapScale (Inkscape::SnapPreferences::PointType point_type, std::vector< std::pair< Geom::Point, int > > const &p, Geom::Point const &pointer, Geom::Scale const &s, Geom::Point const &o) const
Inkscape::SnappedPoint constrainedSnapSkew (Inkscape::SnapPreferences::PointType point_type, std::vector< std::pair< Geom::Point, int > > const &p, Geom::Point const &pointer, Inkscape::Snapper::ConstraintLine const &constraint, Geom::Point const &s, Geom::Point const &o, Geom::Dim2 d) const
Inkscape::SnappedPoint constrainedSnapStretch (Inkscape::SnapPreferences::PointType point_type, std::vector< std::pair< Geom::Point, int > > const &p, Geom::Point const &pointer, Geom::Coord const &s, Geom::Point const &o, Geom::Dim2 d, bool uniform) const
Inkscape::SnappedPoint constrainedSnapTranslation (Inkscape::SnapPreferences::PointType point_type, std::vector< std::pair< Geom::Point, int > > const &p, Geom::Point const &pointer, Inkscape::Snapper::ConstraintLine const &constraint, Geom::Point const &tr) const
Inkscape::SnappedPoint freeSnap (Inkscape::SnapPreferences::PointType point_type, Geom::Point const &p, Inkscape::SnapSourceType const &source_type, bool first_point=true, Geom::OptRect const &bbox_to_snap=Geom::OptRect()) const
void freeSnapReturnByRef (Inkscape::SnapPreferences::PointType point_type, Geom::Point &p, Inkscape::SnapSourceType const source_type, bool first_point=true, Geom::OptRect const &bbox_to_snap=Geom::OptRect()) const
Inkscape::SnappedPoint freeSnapScale (Inkscape::SnapPreferences::PointType point_type, std::vector< std::pair< Geom::Point, int > > const &p, Geom::Point const &pointer, Geom::Scale const &s, Geom::Point const &o) const
Inkscape::SnappedPoint freeSnapTranslation (Inkscape::SnapPreferences::PointType point_type, std::vector< std::pair< Geom::Point, int > > const &p, Geom::Point const &pointer, Geom::Point const &tr) const
SPDesktop const * getDesktop () const
SPDocumentgetDocument () const
SnapperList getGridSnappers () const
SPGuide const * getGuideToIgnore () const
SPNamedView const * getNamedView () const
bool getSnapIndicator () const
SnapperList getSnappers () const
bool gridSnapperMightSnap () const
void guideConstrainedSnap (Geom::Point &p, SPGuide const &guideline) const
void guideFreeSnap (Geom::Point &p, Geom::Point const &guide_normal) const
Geom::Point multipleOfGridPitch (Geom::Point const &t) const
void setup (SPDesktop const *desktop, bool snapindicator, std::vector< SPItem const * > &items_to_ignore, std::vector< std::pair< Geom::Point, int > > *unselected_nodes=NULL, SPGuide *guide_to_ignore=NULL)
void setup (SPDesktop const *desktop, bool snapindicator=true, SPItem const *item_to_ignore=NULL, std::vector< std::pair< Geom::Point, int > > *unselected_nodes=NULL, SPGuide *guide_to_ignore=NULL)
 SnapManager (SPNamedView const *v)
bool someSnapperMightSnap () const

Public Attributes

Inkscape::GuideSnapper guide
 guide snapper
Inkscape::ObjectSnapper object
 snapper to other objects
Inkscape::SnapPreferences snapprefs

Protected Attributes

SPNamedView const * _named_view

Private Member Functions

void _displaySnapsource (Inkscape::SnapPreferences::PointType point_type, std::pair< Geom::Point, int > const &p) const
Inkscape::SnappedPoint _snapTransformed (Inkscape::SnapPreferences::PointType type, std::vector< std::pair< Geom::Point, int > > const &points, Geom::Point const &pointer, bool constrained, Inkscape::Snapper::ConstraintLine const &constraint, Transformation transformation_type, Geom::Point const &transformation, Geom::Point const &origin, Geom::Dim2 dim, bool uniform) const
Geom::Point _transformPoint (std::pair< Geom::Point, int > const &p, Transformation const transformation_type, Geom::Point const &transformation, Geom::Point const &origin, Geom::Dim2 const dim, bool const uniform) const
Inkscape::SnappedPoint findBestSnap (Geom::Point const &p, Inkscape::SnapSourceType const source_type, SnappedConstraints &sc, bool constrained) const

Private Attributes

SPDesktop const * _desktop
SPGuide * _guide_to_ignore
SPItem const * _item_to_ignore
std::vector< SPItem const * > * _items_to_ignore
bool _snapindicator
std::vector< std::pair
< Geom::Point, int > > * 
_unselected_nodes

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index