snap.h revision 70d31ae8a7a27e57cfcdc921ea0d2f47c92442a4
919N/A#ifndef SEEN_SNAP_H
919N/A#define SEEN_SNAP_H
919N/A#include "guide-snapper.h"
919N/A#include "object-snapper.h"
919N/A#include "snap-preferences.h"
425N/A * The SnapManager class handles most (if not all) of the interfacing of the snapping mechanisms
1068N/A * with the other parts of the code base. It stores the references to the various types of snappers
911N/A * it provides methods to setup the snapping environment (e.g. keeps a list of the items to ignore
1068N/A * when looking for snap target candidates, and toggling of the snap indicator), and it provides
970N/A * The second is in event-context.cpp and implements the snapping timeout. Whenever a motion
enum Transformation {
bool someSnapperMightSnap() const;
bool gridSnapperMightSnap() const;
bool snapindicator = true,
bool snapindicator,
bool snapindicator = true,
bool first_point = true,
bool first_point = true,
bool first_point = true,
bool first_point = true,
void guideFreeSnap(Geom::Point &p, Geom::Point const &guide_normal, SPGuideDragType drag_type) const;
bool uniform) const;
std::vector<SPItem const *> _items_to_ignore; ///< Items that should not be snapped to, for example the items that are currently being dragged. Set using the setup() method
SPGuide *_guide_to_ignore; ///< A guide that should not be snapped to, e.g. the guide that is currently being dragged
bool _snapindicator; ///< When true, an indicator will be drawn at the position that was being snapped to
std::vector<std::pair<Geom::Point, int> > *_unselected_nodes; ///< Nodes of the path that is currently being edited and which have not been selected and which will therefore be stationary. Only these nodes will be considered for snapping to. Of each unselected node both the position (Geom::Point) and the type (Inkscape::SnapTargetType) will be stored
//TODO: Make _unselected_nodes type safe; in the line above int is used for Inkscape::SnapTargetType, but if I remember
//correctly then in other cases the int is being used for Inkscape::SnapSourceType, or for both. How to make
bool constrained,
bool uniform) const;
bool const uniform) const;
void _displaySnapsource(Inkscape::SnapPreferences::PointType point_type, std::pair<Geom::Point, int> const &p) const;
Inkscape::SnappedPoint findBestSnap(Geom::Point const &p, Inkscape::SnapSourceType const source_type, SnappedConstraints &sc, bool constrained, bool noCurves = false) const;