Ipelib
|
#include <ipesnap.h>
Public Types | |
enum | TSnapModes { ESnapNone = 0, ESnapVtx = 1, ESnapBd = 2, ESnapInt = 4, ESnapGrid = 8, ESnapAngle = 0x10, ESnapAuto = 0x20 } |
Public Member Functions | |
bool | intersectionSnap (Vector &pos, const Page *page, double snapDist) const |
bool | snapAngularIntersection (Vector &pos, const Line &l, const Page *page, double snapDist) const |
bool | simpleSnap (Vector &pos, const Page *page, double snapDist) const |
bool | snap (Vector &pos, const Page *page, double snapDist, Vector *autoOrg=0) const |
Line | getLine (const Vector &mouse, const Vector &base) const |
bool | setEdge (const Vector &pos, const Page *page) |
Public Attributes | |
int | iSnap |
bool | iGridVisible |
int | iGridSize |
double | iAngleSize |
int | iSnapDistance |
bool | iWithAxes |
Vector | iOrigin |
Angle | iDir |
Performs snapping operations, and stores snapping state.
Perform intersection snapping.
bool Snap::snapAngularIntersection | ( | Vector & | pos, |
const Line & | l, | ||
const Page * | page, | ||
double | snapDist | ||
) | const |
Perform snapping to intersection of angular line and pos.
Tries vertex, intersection, boundary, and grid snapping.
If snapping occurred, pos is set to the new user space position.
Performs snapping of position pos.
Returns true
if snapping occurred. In that case pos is set to the new user space position.
Automatic angular snapping occurs if autoOrg is not null — the value is then used as the origin for automatic angular snapping.
Find line through base with slope determined by angular snap size and direction.
Set axis origin and direction from edge near mouse.
Returns true
if successful.
int ipe::Snap::iSnap |
Activated snapping modes (TSnapModes)
bool ipe::Snap::iGridVisible |
Is the grid visible?
int ipe::Snap::iGridSize |
Snap grid spacing.
double ipe::Snap::iAngleSize |
Angle for angular snapping.
int ipe::Snap::iSnapDistance |
Snap distance (in pixels).
bool ipe::Snap::iWithAxes |
Show coordinate system?
Vector ipe::Snap::iOrigin |
Origin of coordinate system.
Angle ipe::Snap::iDir |
Direction of x-axis.