#include <c4d_snapdata.h>
The Snap Interface, must be allocated either with AutoAlloc, or Alloc() and freed after use with Free(). 
 
◆ SnapCore()
◆ Alloc()
Allocates a snap core. Destroy the allocated snap core with Free(). Use AutoAlloc to automate the allocation and destruction based on scope. 
- Returns
 - The allocated snap core, or nullptr if the allocation failed. 
 
 
 
◆ Free()
Destructs snap cores allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope. 
- Parameters
 - 
  
    | [in] | p | The snap core to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.  | 
  
   
 
 
◆ Init()
Snap initialization routine. 
- Parameters
 - 
  
    | [in] | doc | The current document. The caller owns the pointed document.  | 
    | [in] | bd | The BaseDraw to initialize. The caller owns the pointed BaseDraw.  | 
    | [in] | exclude | An array of objects to exclude from being snapped to. The caller owns the pointed array.  | 
  
   
- Returns
 - True on success of initializing the snap. 
 
 
 
◆ Update()
Updates the snaps to use the current settings. 
- Returns
 - true if successful, otherwise false. 
 
 
 
◆ Snap()
Snap routine. 
- Parameters
 - 
  
    | [in] | p | The position to snap to in global space.  | 
    | [out] | result | The position to snap to in global space.  | 
    | [in] | flags | The flags to limit snapping on selection or to a specific type: SNAPFLAGS  | 
  
   
- Returns
 - true on success of finding a snap point, false if no point was found in range to snap to. 
 
 
 
◆ Intersect()
Snap intersection routine. 
- Parameters
 - 
  
    | [in] | p | The position to snap to in global space.  | 
    | [in] | n | The normal of the guide being intersected with in global space.  | 
    | [in] | plane | true if the intersection should be with a plane, false if with a ray/line.  | 
    | [out] | result | The result of the successful intersection, user owns this.  | 
    | [in] | flags | The flags to limit snapping on selection or to a specific type: SNAPFLAGS  | 
  
   
- Returns
 - true on success of finding an intersection, false if no intersection was found in range. 
 
 
 
◆ AddInferred()
Adds an inferred guide point, line or plane to the scene for snapping to. 
- Parameters
 - 
  
    | [in] | doc | The current document. The caller owns the pointed document.  | 
    | [in] | mat | The matrix for the point (axis), line, or plane, z points along the line or as the normal for the plane.  | 
    | [in] | type | The type of inferred guide to add: INFERREDGUIDETYPE  | 
  
   
- Returns
 - true on success of adding the guide, false for a memory error attempting to do so. 
 
 
 
◆ FlushInferred()
Flushes inferred system guides and inferred elements. 
- Note
 - Should be called at mouse release. 
 
- Returns
 - true if all inferred guides were removed, otherwise false. 
 
 
 
◆ SetToolObject()
Sets the active object and pass it to snap system if is created from current tool. 
- Note
 - Important for tool guide. 
 
- Parameters
 - 
  
    | [in] | op | The new object created in the tool. The caller owns the pointed object.  | 
  
   
 
 
◆ SetCustomExcludeList()
Passes to the snap a new exclusion list. 
- Note
 - Has to be done before a snap call and will stay valid just for the next snap session.
 This is useful if different exclusion types are needed during the drag without reinitializing the class.  
- Parameters
 - 
  
    | [in] | snapExcludeList | A pointer to a maxon::BaseArray of exclusion data or nullptr to clear internal pointer. The caller owns the pointed array.  |