Basic Interface to Alias snapping functions
#include <AlSnap.h>
class AlSnap
static statusCode toGrid( Screencoord x, Screencoord y, double worldPos[3], AlWindow* window = NULL );
static statusCode toCV( Screencoord x, Screencoord y, AlObject* &obj, AlWindow *window = NULL );
static statusCode toCurve( Screencoord x, Screencoord y, AlObject* &obj, double &curveParam, AlWindow *window = NULL );
static int snappingTo( void );
This class contains various utility functions for doing snapping. You can snap to grids, CVs and curves. When using the toGrid function, the world position returned would be used to translate the object to the correct location. For the CV and curve functions, the world position of the AlObject returned would be used to translate the object to the correct location. The function snappingTo returns either kSnapGrid, kSnapCurve or kSnapCV based on what buttons have been set in the application.
statusCode AlSnap::toGrid( Screencoord x, Screencoord y, double worldPos[3], AlWindow* window )
Snaps a point on the screen to the closest grid intersection. Returns world space coordinates for the closest grid intersection to the specified cursor position.
The grid size is set using the meshSize method in AlWindow.
statusCode AlSnap::toCV( Screencoord x, Screencoord y, AlObject* &obj, AlWindow *window )
statusCode AlSnap::toCurve( Screencoord x, Screencoord y, AlObject* &obj, double &curveParam, AlWindow *window )