Foxit PDF SDK
foxit.pdf.SnapPointMgr Class Reference
Inheritance diagram for foxit.pdf.SnapPointMgr:
foxit.common.Base

Public Types

enum  SnapPointFlags { SnapPointFlags.e_FlagEndpoint = 0x0001, SnapPointFlags.e_FlagMidpoint = 0x0002, SnapPointFlags.e_FlagIntersectionPoint = 0x0004, SnapPointFlags.e_FlagNearestPoint = 0x0008 }
 Enumeration for snapping point flags which are used to specify what kind of point in a path is to be snapped.
More...
 

Public Member Functions

 SnapPointMgr (PDFPage page)
 Constructor, from a parsed PDF page object.
More...
 
 SnapPointMgr (SnapPointMgr other)
 Constructor, with another snap point manager object.
More...
 
SnappedPoint GetSnappedPointAtPos (PointF position, int flags)
 Get the snapped point information at/around a specified position in PDF coordinate system.
More...
 
bool IsEmpty ()
 Check whether current object is empty or not.
More...
 
void Reload ()
 Reload current manager.
More...
 

Detailed Description

This class represents a manager for snapping point. This class can be used to snap point in a path with specified snapping flags.

Member Enumeration Documentation

◆ SnapPointFlags

Enumeration for snapping point flags which are used to specify what kind of point in a path is to be snapped.

Values of this enumeration can be used alone or in combination.

Enumerator
e_FlagEndpoint 

If set, that means to get the endpoint of a path.

e_FlagMidpoint 

If set, that means to get the midpoint for two endpoints of a path.

e_FlagIntersectionPoint 

If set, that means to get the intersection of two intersecting paths.

e_FlagNearestPoint 

If set, that means to get the nearest point (which is in a path) to the specified point.

Constructor & Destructor Documentation

◆ SnapPointMgr() [1/2]

foxit.pdf.SnapPointMgr.SnapPointMgr ( PDFPage  page)
inline

Constructor, from a parsed PDF page object.

Parameters
[in]pageA valid PDF page object. This page should has been parsed.

◆ SnapPointMgr() [2/2]

foxit.pdf.SnapPointMgr.SnapPointMgr ( SnapPointMgr  other)
inline

Constructor, with another snap point manager object.

Parameters
[in]otherAnother snap point manager object.

Member Function Documentation

◆ GetSnappedPointAtPos()

SnappedPoint foxit.pdf.SnapPointMgr.GetSnappedPointAtPos ( PointF  position,
int  flags 
)
inline

Get the snapped point information at/around a specified position in PDF coordinate system.

Parameters
[in]positionA specified position, in PDF coordinate system.
[in]flagsFlags for snapping point. Please refer to values starting from foxit.pdf.SnapPointMgr.SnapPointFlags.e_FlagEndpoint and this should be one or a combination of these values.
Returns
Information for a snapped point. If the return value of function SnappedPoint.IsEmpty for the returned snapped point object is true, that means no suitable point can be snapped.

◆ IsEmpty()

bool foxit.pdf.SnapPointMgr.IsEmpty ( )
inline

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.

◆ Reload()

void foxit.pdf.SnapPointMgr.Reload ( )
inline

Reload current manager.

This function should be called after any path in related PDF page has been modified.

Returns
None.