# IpeSnapData Class Reference
[Ipe Management]

Performs snapping operations, and stores snapping state. More...

List of all members.

## Public Types

- enum TSnapModes {
  ESnapNone = 0, ESnapVtx = 1, ESnapBd = 2, ESnapInt = 4,
  ESnapGrid = 8, ESnapAngle = 0x10, ESnapAuto = 0x20
  }

## Public Member Functions

- bool IntersectionSnap (IpeVector &pos, const IpePage *page, double snapDist) const
- bool SnapAngularIntersection (IpeVector &pos, const IpeLine &l, const IpePage *page, double snapDist) const
- bool SimpleSnap (IpeVector &pos, const IpePage *page, double snapDist) const
- bool Snap (IpeVector &pos, const IpePage *page, double snapDist, IpeVector *autoOrg=0) const
- IpeLine GetLine (const IpeVector &mouse, const IpeVector &base) const
- bool SetEdge (const IpeVector &pos, const IpePage *page)

## Public Attributes

- int iSnap
- bool iGridVisible
- int iGridSize
- double iAngleSize
- int iSnapDistance
- int iSelectDistance
- bool iWithAxes
- IpeVector iOrigin
- IpeAngle iDir

## Detailed Description

Performs snapping operations, and stores snapping state.

## Member Enumeration Documentation

enum IpeSnapData::TSnapModes

| The different snap modes as bitmasks.

## Member Function Documentation

bool IpeSnapData::IntersectionSnap | ( | IpeVector & | pos,
|  | const IpePage * | page,
|  | double | snapDist
| ) | const

| Perform intersection snapping.

bool IpeSnapData::SnapAngularIntersection | ( | IpeVector & | pos,
|  | const IpeLine & | l,
|  | const IpePage * | page,
|  | double | snapDist
| ) | const

| Perform snapping to intersection of angular line and pos.

bool IpeSnapData::SimpleSnap | ( | IpeVector & | pos,
|  | const IpePage * | page,
|  | double | snapDist
| ) | const

| Tries vertex, intersection, boundary, and grid snapping. If snapping occurred, pos is set to the new user space position.

bool IpeSnapData::Snap | ( | IpeVector & | pos,
|  | const IpePage * | page,
|  | double | snapDist,
|  | IpeVector * | autoOrg = 0
| ) | const

| 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.

IpeLine IpeSnapData::GetLine | ( | const IpeVector & | mouse,
|  | const IpeVector & | base
| ) | const

| Find line through base with slope determined by angular snap size and direction.

bool IpeSnapData::SetEdge | ( | const IpeVector & | pos,
|  | const IpePage * | page
| ) |

| Set axis origin and direction from edge near mouse. Returns `true` if successful.

## Member Data Documentation

int IpeSnapData::iSnap

| Activated snapping modes (TSnapModes).

bool IpeSnapData::iGridVisible

| Is the grid visible?

int IpeSnapData::iGridSize

| Snap grid spacing.

double IpeSnapData::iAngleSize

| Angle for angular snapping.

int IpeSnapData::iSnapDistance

| Snap distance (in pixels).

int IpeSnapData::iSelectDistance

| Select distance (in pixels).

bool IpeSnapData::iWithAxes

| Show coordinate system?

IpeVector IpeSnapData::iOrigin

| Origin of coordinate system.

IpeAngle IpeSnapData::iDir

| Direction of x-axis.

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

- ipesnap.h
- ipesnap.cpp