object-snapper.cpp revision 6e3576be211b59b7d8a9e7afe3493d961c053b75
/**
* \file object-snapper.cpp
* \brief Snapping things to objects.
*
* Authors:
* Carl Hetherington <inkscape@carlh.net>
*
* Copyright (C) 2005 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "libnr/n-art-bpath.h"
#include "libnr/nr-rect-ops.h"
#include "document.h"
#include "sp-namedview.h"
#include "sp-path.h"
#include "sp-item-group.h"
#include "desktop.h"
#include "inkscape.h"
#include "splivarot.h"
{
}
/**
* \param p Point we are trying to snap (desktop coordinates)
*/
SPObject* r,
{
/* See if this item is on the ignore list */
i++;
}
/* See if the item is within range */
if (SP_IS_GROUP(o)) {
_findCandidates(c, o, it, p);
} else {
}
}
}
}
}
}
{
/* FIXME: this seems like a hack. Perhaps Snappers should be
** in SPDesktop rather than SPNamedView?
*/
if (SP_IS_SHAPE(*i)) {
int j = 0;
/* Get this node in desktop coordinates */
/* Try to snap to this node of the path */
s = SnappedPoint(n, dist);
}
j++;
}
}
}
}
}
{
/* FIXME: this seems like a hack. Perhaps Snappers should be
** in SPDesktop rather than SPNamedView?
*/
/* Transform the requested snap point to this item's coordinates */
if (!livarot_path)
continue;
/* Look for the nearest position on this SPItem to our snap point */
if (o && o->t >= 0 && o->t <= 1) {
/* Convert the nearest point back to desktop coordinates */
}
}
delete livarot_path;
}
}
{
if ( NULL == _named_view ) {
return SnappedPoint(p, NR_HUGE);
}
/* Get a list of all the SPItems that we will try to snap to */
SnappedPoint s(p, NR_HUGE);
if (_snap_to_nodes) {
_snapNodes(s, p, cand);
}
if (_snap_to_paths) {
_snapPaths(s, p, cand);
}
return s;
}
ConstraintLine const &c,
{
/* FIXME: this needs implementing properly; I think we have to do the
** intersection of c with the objects.
*/
return _doFreeSnap(p, it);
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :