Rhino C++ API  7.21
Public Member Functions | Static Public Attributes | List of all members
ON_WindingNumber Class Reference

#include <opennurbs_point.h>

Public Member Functions

 ON_WindingNumber ()=default
 
 ON_WindingNumber (const ON_WindingNumber &)=default
 
 ~ON_WindingNumber ()=default
 
ON__UINT32 AddBoundary (ON_2dPoint p)
 
ON__UINT32 AddBoundary (ON_2dPoint p, ON_2dPoint q)
 
ON__UINT32 AddBoundary (size_t point_count, const ON_2dPoint *boundary_points, bool bCloseBoundary)
 
ON__UINT32 AddBoundary (size_t point_count, const ON_2fPoint *boundary_points, bool bCloseBoundary)
 
ON__UINT32 AddBoundary (size_t point_count, const ON_3dPoint *boundary_points, bool bCloseBoundary)
 
ON__UINT32 AddBoundary (size_t point_count, const ON_3fPoint *boundary_points, bool bCloseBoundary)
 
ON__UINT32 AddBoundary (size_t point_count, size_t point_stride, const double *boundary_points, bool bCloseBoundary)
 
ON__UINT32 AddBoundary (size_t point_count, size_t point_stride, const float *boundary_points, bool bCloseBoundary)
 
ON__UINT32 AddBoundary (size_t point_count, size_t point_stride, const int *boundary_points, bool bCloseBoundary)
 
ON__UINT32 BoundarySegmentCount () const
 
ON_WindingNumberoperator= (const ON_WindingNumber &)=default
 
const ON_2dPoint PreviousBoundaryPoint () const
 
void SetWindingPoint (double x, double y)
 
void SetWindingPoint (ON_2dPoint winding_point)
 
ON__INT32 WindingNumber () const
 
const ON_2dPoint WindingPoint () const
 

Static Public Attributes

static const ON_WindingNumber Unset
 

Detailed Description

Description: Tool for efficiently calculating a boundary polyline winding number with input tools that do not require the boundary polyline to be a contiguous array of points.

Constructor & Destructor Documentation

◆ ON_WindingNumber() [1/2]

ON_WindingNumber::ON_WindingNumber ( )
default

◆ ~ON_WindingNumber()

ON_WindingNumber::~ON_WindingNumber ( )
default

◆ ON_WindingNumber() [2/2]

ON_WindingNumber::ON_WindingNumber ( const ON_WindingNumber )
default

Member Function Documentation

◆ AddBoundary() [1/9]

ON__UINT32 ON_WindingNumber::AddBoundary ( ON_2dPoint  p)

Description: After calling SetWindingPoint(), the boundary may be specified by one or more calls to various AddBoundary functions. The boundary may be specified one point at a time, one edge at a time, portions of the boundary at a time, or the entire boundary in a single call. The edges may be added in any order. The caller is responsible for insuring the collection calls to AddBoundary() results in a a continuous, oriented, and closed polyline. Parameters: p - [in] next point in boundary. Returns: Number of boundary edge segments added.

◆ AddBoundary() [2/9]

ON__UINT32 ON_WindingNumber::AddBoundary ( ON_2dPoint  p,
ON_2dPoint  q 
)

Description: After calling SetWindingPoint(), the boundary may be specified by one or more calls to various AddBoundary functions. The boundary may be specified one point at a time, one edge at a time, portions of the boundary at a time, or the entire boundary in a single call. The edges may be added in any order. The caller is responsible for insuring the collection calls to AddBoundary() results in a a continuous, oriented, and closed polyline. Parameters: p - [in] start of edge segment. Caller is responsible for insuring coordinates of p are valid doubles. q - [in] end of edge segment Caller is responsible for insuring coordinates of q are valid doubles. The calculation tolerates p==q. Returns: Number of boundary edge segments added.

◆ AddBoundary() [3/9]

ON__UINT32 ON_WindingNumber::AddBoundary ( size_t  point_count,
const ON_2dPoint boundary_points,
bool  bCloseBoundary 
)

Description: After calling SetWindingPoint(), the boundary may be specified by one or more calls to various AddBoundary functions. The boundary may be specified one point at a time, one edge at a time, portions of the boundary at a time, or the entire boundary in a single call. The edges may be added in any order. The caller is responsible for insuring the collection calls to AddBoundary() results in a a continuous, oriented, and closed polyline. Parameters: point_count - [in] >= 2 number of points in boundary_points[] array. boundary_points - [in] Boundary points. bCloseBoundary - [in] If true, an edge segment is added from the last boundary point to the first boundary point. Returns: Number of boundary edge segments added. Remarks: The calculation tolerates zero length edge segments. The caller is responsible for insuring the coordinates in boundary_points[] are valid doubles.

◆ AddBoundary() [4/9]

ON__UINT32 ON_WindingNumber::AddBoundary ( size_t  point_count,
const ON_2fPoint boundary_points,
bool  bCloseBoundary 
)

Description: After calling SetWindingPoint(), the boundary may be specified by one or more calls to various AddBoundary functions. The boundary may be specified one point at a time, one edge at a time, portions of the boundary at a time, or the entire boundary in a single call. The edges may be added in any order. The caller is responsible for insuring the collection calls to AddBoundary() results in a a continuous, oriented, and closed polyline. Parameters: point_count - [in] >= 2 number of points in boundary_points[] array. boundary_points - [in] Boundary points. bCloseBoundary - [in] If true, an edge segment is added from the last boundary point to the first boundary point. Returns: Number of boundary edge segments added. Remarks: The calculation tolerates zero length edge segments. The caller is responsible for insuring the coordinates in boundary_points[] are valid doubles.

◆ AddBoundary() [5/9]

ON__UINT32 ON_WindingNumber::AddBoundary ( size_t  point_count,
const ON_3dPoint boundary_points,
bool  bCloseBoundary 
)

Description: After calling SetWindingPoint(), the boundary may be specified by one or more calls to various AddBoundary functions. The boundary may be specified one point at a time, one edge at a time, portions of the boundary at a time, or the entire boundary in a single call. The edges may be added in any order. The caller is responsible for insuring the collection calls to AddBoundary() results in a a continuous, oriented, and closed polyline. Parameters: point_count - [in] >= 2 number of points in boundary_points[] array. boundary_points - [in] Boundary points. bCloseBoundary - [in] If true, an edge segment is added from the last boundary point to the first boundary point. Returns: Number of boundary edge segments added. Remarks: The calculation tolerates zero length edge segments. The caller is responsible for insuring the coordinates in boundary_points[] are valid doubles.

◆ AddBoundary() [6/9]

ON__UINT32 ON_WindingNumber::AddBoundary ( size_t  point_count,
const ON_3fPoint boundary_points,
bool  bCloseBoundary 
)

Description: After calling SetWindingPoint(), the boundary may be specified by one or more calls to various AddBoundary functions. The boundary may be specified one point at a time, one edge at a time, portions of the boundary at a time, or the entire boundary in a single call. The edges may be added in any order. The caller is responsible for insuring the collection calls to AddBoundary() results in a a continuous, oriented, and closed polyline. Parameters: point_count - [in] >= 2 number of points in boundary_points[] array. boundary_points - [in] Boundary points. bCloseBoundary - [in] If true, an edge segment is added from the last boundary point to the first boundary point. Returns: Number of boundary edge segments added. Remarks: The calculation tolerates zero length edge segments. The caller is responsible for insuring the coordinates in boundary_points[] are valid doubles.

◆ AddBoundary() [7/9]

ON__UINT32 ON_WindingNumber::AddBoundary ( size_t  point_count,
size_t  point_stride,
const double *  boundary_points,
bool  bCloseBoundary 
)

Description: After calling SetWindingPoint(), the boundary may be specified by one or more calls to various AddBoundary functions. The boundary may be specified one point at a time, one edge at a time, portions of the boundary at a time, or the entire boundary in a single call. The edges may be added in any order. The caller is responsible for insuring the collection calls to AddBoundary() results in a a continuous, oriented, and closed polyline. Parameters: point_count - [in] >= 2 number of points in boundary_points[] array. point_stride - [in] >= 2 The i-th point has coordinates (boundary_points[i*point_stride],boundary_points[i*point_stride+1]). boundary_points - [in] Boundary points. bCloseBoundary - [in] If true, an edge segment is added from the last boundary point to the first boundary point. Returns: Number of boundary edge segments added. Remarks: The calculation tolerates zero length edge segments. The caller is responsible for insuring the coordinates in boundary_points[] are valid doubles.

◆ AddBoundary() [8/9]

ON__UINT32 ON_WindingNumber::AddBoundary ( size_t  point_count,
size_t  point_stride,
const float *  boundary_points,
bool  bCloseBoundary 
)

Description: After calling SetWindingPoint(), the boundary may be specified by one or more calls to various AddBoundary functions. The boundary may be specified one point at a time, one edge at a time, portions of the boundary at a time, or the entire boundary in a single call. The edges may be added in any order. The caller is responsible for insuring the collection calls to AddBoundary() results in a a continuous, oriented, and closed polyline. Parameters: point_count - [in] >= 2 number of points in boundary_points[] array. point_stride - [in] >= 2 The i-th point has coordinates (boundary_points[i*point_stride],boundary_points[i*point_stride+1]). boundary_points - [in] Boundary points. bCloseBoundary - [in] If true, an edge segment is added from the last boundary point to the first boundary point. Returns: Number of boundary edge segments added. Remarks: The calculation tolerates zero length edge segments. The caller is responsible for insuring the coordinates in boundary_points[] are valid doubles.

◆ AddBoundary() [9/9]

ON__UINT32 ON_WindingNumber::AddBoundary ( size_t  point_count,
size_t  point_stride,
const int *  boundary_points,
bool  bCloseBoundary 
)

Description: After calling SetWindingPoint(), the boundary may be specified by one or more calls to various AddBoundary functions. The boundary may be specified one point at a time, one edge at a time, portions of the boundary at a time, or the entire boundary in a single call. The edges may be added in any order. The caller is responsible for insuring the collection calls to AddBoundary() results in a a continuous, oriented, and closed polyline. Parameters: point_count - [in] >= 2 number of points in boundary_points[] array. point_stride - [in] >= 2 The i-th point has coordinates (boundary_points[i*point_stride],boundary_points[i*point_stride+1]). boundary_points - [in] Boundary points. bCloseBoundary - [in] If true, an edge segment is added from the last boundary point to the first boundary point. Returns: Number of boundary edge segments added. Remarks: The calculation tolerates zero length edge segments. The caller is responsible for insuring the coordinates in boundary_points[] are valid doubles.

◆ BoundarySegmentCount()

ON__UINT32 ON_WindingNumber::BoundarySegmentCount ( ) const

Returns: Number of segments in the boundary.

◆ operator=()

ON_WindingNumber& ON_WindingNumber::operator= ( const ON_WindingNumber )
default

◆ PreviousBoundaryPoint()

const ON_2dPoint ON_WindingNumber::PreviousBoundaryPoint ( ) const

Returns: The end of the previous call to AddBoundary()

◆ SetWindingPoint() [1/2]

void ON_WindingNumber::SetWindingPoint ( double  x,
double  y 
)

Description: The calculation of the winding number begins with a call to SetWindingPoint(). Parameters: x - [in] y - [in] The coordinates of the winding point are (x,y). Remarks: Calling SetWindingPoint() erases results of any previous calculations.

◆ SetWindingPoint() [2/2]

void ON_WindingNumber::SetWindingPoint ( ON_2dPoint  winding_point)

Description: The calculation of the winding number begins with a call to SetWindingPoint(). Parameters: winding_point - [in] Remarks: Calling SetWindingPoint() erases results of any previous calculations.

◆ WindingNumber()

ON__INT32 ON_WindingNumber::WindingNumber ( ) const

Returns: The winding number of the boundary about the winding point.

◆ WindingPoint()

const ON_2dPoint ON_WindingNumber::WindingPoint ( ) const

Returns: The winding point.

Member Data Documentation

◆ Unset

const ON_WindingNumber ON_WindingNumber::Unset
static