|
Rhino C++ API
9.0
|
#include <opennurbs_point.h>
Public Types | |
| enum | : unsigned { DefaultPointCount = 400 } |
| enum | List : unsigned { List::None = 0, List::A = 1, List::B = 2, List::AandB = 3 } |
| The ON_PointPairing::List enum is used to specify a point list. More... | |
Public Member Functions | |
| ON_PointPairing ()=default | |
| ON_PointPairing (const ON_PointPairing &)=default | |
| ~ON_PointPairing ()=default | |
| bool | AppendPoint (ON_PointPairing::List point_list, ON_3dPoint P) |
| bool | AppendPoint (ON_PointPairing::List point_list, ON_3dPoint P, double bias) |
| const double * | BiasArrayForExperts (ON_PointPairing::List point_list) const |
| double | ChamferDistance (bool bNormalized) const |
| The chamfer distance is the sum of the distances from each point in A[] to the nearest point in B[], plus the sum of the distances from each point in B[] to the nearest point in A[]. More... | |
| void | Clear () |
| void | ClearPairing () |
| void | ClearPoints (ON_PointPairing::List point_list) |
| bool | CopyList (ON_PointPairing::List source, ON_PointPairing::List destination) |
| CopyList() is typically used to copy one list to the other. More... | |
| bool | EvaluationsCached () const |
| This is useful if you need to know when the values returned by PairingDeviation() and ChamferDistance() are cached or need to be evaluated from scratch. More... | |
| const ON_3dPoint | FirstPoint (ON_PointPairing::List point_list) const |
| const ON_3dPoint | LastPoint (ON_PointPairing::List point_list) const |
| const ON_Line | MaximumSeparation (ON_PointPairing::List list) const |
| Get a line connecting the points in A[] and B[] that have the maximum separation. The from point is always an A[] point. The to point is always a B[] point. More... | |
| const ON_2udex | MaximumSeparationPair (ON_PointPairing::List list) const |
| Get the indices of the points in A[] and B[] that have the maximum separation. The i component of the returned ON_2dex is always an index into A[]. The j component of the returned ON_2dex is always an index into B[]. More... | |
| ON_PointPairing & | operator= (const ON_PointPairing &)=default |
| const unsigned | PairCount () const |
| const ON_2udex | Pairing (unsigned point_index) const |
| If A[] and B[] are the point lists, then the point in B[] closest to A[k] is B[Pairing(k).j] and the point in A[] closest to B[k] is A[Pairing(k).i]. More... | |
| const ON_2udex * | PairingArrayForExperts () const |
| double | PairingDeviation (bool bNormalized) const |
| The pairing deviation is 1/2 the sum of the squared distances from each point in A[] to the nearest point in B[], plus the sum of the squared distances from each point in B[] to the nearest point in A[]. The 1/2 is applied to simplify derivative caluculations involving distance squared. More... | |
| const ON_SHA1_Hash | PairingHash () const |
| const ON_3dPoint | Point (ON_PointPairing::List point_list, unsigned point_index) const |
| const ON_3dPoint * | PointArrayForExperts (ON_PointPairing::List point_list) const |
| const unsigned | PointCount (ON_PointPairing::List point_list) const |
| const ON_SHA1_Hash | PointHash (ON_PointPairing::List point_list) const |
| const ON_BoundingBox | PointsBoundingBox (ON_PointPairing::List point_list) const |
| bool | ReservePointCapacity (ON_PointPairing::List point_list, size_t capacity) |
| bool | SetPointCount (ON_PointPairing::List point_list, size_t point_count) |
| bool | SetPoints (ON_PointPairing::List point_list, const ON_SimpleArray< ON_3dPoint > &points) |
| Set the points in the specified list to points[]. More... | |
| bool | SetPoints (ON_PointPairing::List point_list, size_t point_count, const ON_3dPoint *points, const double *biases) |
| Set the points in the specified list to points[]. More... | |
| bool | SetPointsFromCurve (ON_PointPairing::List point_list, double maximum_chord_variance, const class ON_Curve &curve, ON_Interval curve_subdomain, size_t point_count) |
| Set a point list by evluating a curve. More... | |
| bool | SetPointsFromSurface (ON_PointPairing::List point_list, const class ON_Surface &surface, ON_Interval surface_subdomain0, ON_Interval surface_subdomain1, bool bPeriodicPoints0, bool bPeriodicPoints1, size_t point_count0, size_t point_count1) |
| const ON_wString | ToString () const |
| bool | ValidPairs () const |
Static Public Member Functions | |
| static double | Normalizer (size_t point_count, bool bPeriodicPoints) |
|
strong |
The ON_PointPairing::List enum is used to specify a point list.
| Enumerator | |
|---|---|
| None | Unset pointlist |
| A | Point list A |
| B | Point list B |
| AandB | Point lists A and B |
|
default |
|
default |
|
default |
| bool ON_PointPairing::AppendPoint | ( | ON_PointPairing::List | point_list, |
| ON_3dPoint | P | ||
| ) |
| bool ON_PointPairing::AppendPoint | ( | ON_PointPairing::List | point_list, |
| ON_3dPoint | P, | ||
| double | bias | ||
| ) |
| const double* ON_PointPairing::BiasArrayForExperts | ( | ON_PointPairing::List | point_list | ) | const |
| double ON_PointPairing::ChamferDistance | ( | bool | bNormalized | ) | const |
The chamfer distance is the sum of the distances from each point in A[] to the nearest point in B[], plus the sum of the distances from each point in B[] to the nearest point in A[].
| bNormalized | When bNormalized is true, the sum described above is divided by 2*PairCount() and the returned value is the average of the distances in the sums. The normalized value is useful when studying the effect the number of points on the ChamferDistance and when you want to work with smaller values on large point sets. |
| void ON_PointPairing::Clear | ( | ) |
| void ON_PointPairing::ClearPairing | ( | ) |
| void ON_PointPairing::ClearPoints | ( | ON_PointPairing::List | point_list | ) |
| bool ON_PointPairing::CopyList | ( | ON_PointPairing::List | source, |
| ON_PointPairing::List | destination | ||
| ) |
CopyList() is typically used to copy one list to the other.
| source | A or B. |
| destination | A or B. If source and destination identify the same list, nothing is changed. |
| bool ON_PointPairing::EvaluationsCached | ( | ) | const |
This is useful if you need to know when the values returned by PairingDeviation() and ChamferDistance() are cached or need to be evaluated from scratch.
| const ON_3dPoint ON_PointPairing::FirstPoint | ( | ON_PointPairing::List | point_list | ) | const |
| const ON_3dPoint ON_PointPairing::LastPoint | ( | ON_PointPairing::List | point_list | ) | const |
| const ON_Line ON_PointPairing::MaximumSeparation | ( | ON_PointPairing::List | list | ) | const |
Get a line connecting the points in A[] and B[] that have the maximum separation. The from point is always an A[] point. The to point is always a B[] point.
| list | list = ON_PointPairing::List::A or ON_PointPairing::List::B. If list = A, then the maximum separation from a point in A[] to its closest point is B[] is returned. If list = B, then the maximum separation from a point in B[] to its closest point is A[] is returned. Note that these are typially different lines. |
| const ON_2udex ON_PointPairing::MaximumSeparationPair | ( | ON_PointPairing::List | list | ) | const |
Get the indices of the points in A[] and B[] that have the maximum separation. The i component of the returned ON_2dex is always an index into A[]. The j component of the returned ON_2dex is always an index into B[].
| list | list = ON_PointPairing::List::A or ON_PointPairing::List::B. If list = A, then the maximum separation from a point in A[] to its closest point is B[] is returned. If list = B, then the maximum separation from a point in B[] to its closest point is A[] is returned. Note that these are typially different pairs. |
|
static |
|
default |
| const unsigned ON_PointPairing::PairCount | ( | ) | const |
| const ON_2udex ON_PointPairing::Pairing | ( | unsigned | point_index | ) | const |
If A[] and B[] are the point lists, then the point in B[] closest to A[k] is B[Pairing(k).j] and the point in A[] closest to B[k] is A[Pairing(k).i].
| point_index | 0 <= point_index < PairCount() |
| const ON_2udex* ON_PointPairing::PairingArrayForExperts | ( | ) | const |
| double ON_PointPairing::PairingDeviation | ( | bool | bNormalized | ) | const |
The pairing deviation is 1/2 the sum of the squared distances from each point in A[] to the nearest point in B[], plus the sum of the squared distances from each point in B[] to the nearest point in A[]. The 1/2 is applied to simplify derivative caluculations involving distance squared.
| bNormalized | When bNormalized is true, the sum described above is divided by PairCount() and the returned value is the average of the squared distances in the sums. The normalized value is useful when studying the effect of the number of points on the PairingDeviation value and when you want to work with smaller values on large point sets. |
| const ON_SHA1_Hash ON_PointPairing::PairingHash | ( | ) | const |
| const ON_3dPoint ON_PointPairing::Point | ( | ON_PointPairing::List | point_list, |
| unsigned | point_index | ||
| ) | const |
| const ON_3dPoint* ON_PointPairing::PointArrayForExperts | ( | ON_PointPairing::List | point_list | ) | const |
| const unsigned ON_PointPairing::PointCount | ( | ON_PointPairing::List | point_list | ) | const |
| point_list |
| const ON_SHA1_Hash ON_PointPairing::PointHash | ( | ON_PointPairing::List | point_list | ) | const |
| point_list |
| const ON_BoundingBox ON_PointPairing::PointsBoundingBox | ( | ON_PointPairing::List | point_list | ) | const |
| bool ON_PointPairing::ReservePointCapacity | ( | ON_PointPairing::List | point_list, |
| size_t | capacity | ||
| ) |
| bool ON_PointPairing::SetPointCount | ( | ON_PointPairing::List | point_list, |
| size_t | point_count | ||
| ) |
| bool ON_PointPairing::SetPoints | ( | ON_PointPairing::List | point_list, |
| const ON_SimpleArray< ON_3dPoint > & | points | ||
| ) |
Set the points in the specified list to points[].
| point_list | Specifies which list to set. |
| points | The asociated bias will be 1 for all points. |
| bool ON_PointPairing::SetPoints | ( | ON_PointPairing::List | point_list, |
| size_t | point_count, | ||
| const ON_3dPoint * | points, | ||
| const double * | biases | ||
| ) |
Set the points in the specified list to points[].
| point_list | Specifies which list to set. |
| point_count | Number of points in the points[] array. |
| points | |
| biases | If biases is not nullptr, it must point to an array of point_count doubles. The points will have the bias applied in the ChamferDistance() and PairingDeviation() evaluations. Typically bias values >= 1 and are employed when the PairingDeviation() is used as part of an optimization objective function. |
| bool ON_PointPairing::SetPointsFromCurve | ( | ON_PointPairing::List | point_list, |
| double | maximum_chord_variance, | ||
| const class ON_Curve & | curve, | ||
| ON_Interval | curve_subdomain, | ||
| size_t | point_count | ||
| ) |
Set a point list by evluating a curve.
| point_list | Specifies which point list(s) will be set. |
| maximum_chord_variance | There are two ways to sample points from the curve, equal parameter and equal arc length. Equal parameter sampling samples the curve at equally spaced parameter values. Equal arc length sampling samples the curve at equally spaced arc length values. In general, equal parameter sampling is faster while equal arc length sampling produces more uniformly distributed points. The maximum_chord_variance parameter controls what type of sampling is used. If maximum_chord_variance = 1.0, then equal arc length sampling is unconditionally used. If maximum_chord_variance > 1.0, then equal arc length sampling is used if the ratio of (longest chord) / (shortest chord) calculated from the equal parameter points is > maximum_chord_variance. Otherwise, equal parameter sampling is used unconditionally. Suggestion: If you want equal parameter sampling, plass ON_DBL_QNAN. If you want equal arc length sampling, plass 1.0. If you want to strike a balance between speed and a uniform sampling, pass 4.0. |
| curve | The curve is evaluated to create the point list. |
| curve_subdomain | If you want to restrict the evaluation to subset of the curve, pass an increasing interval that is contained in curve.Domain(). If you want to evaluate of the entire curve, pass curve.Domain(), ON_Interval::EmptyInterval, or ON_Interval::Nan. |
| bPeriodicPoints |
| point_count |
| bool ON_PointPairing::SetPointsFromSurface | ( | ON_PointPairing::List | point_list, |
| const class ON_Surface & | surface, | ||
| ON_Interval | surface_subdomain0, | ||
| ON_Interval | surface_subdomain1, | ||
| bool | bPeriodicPoints0, | ||
| bool | bPeriodicPoints1, | ||
| size_t | point_count0, | ||
| size_t | point_count1 | ||
| ) |
| point_list | Specifies which point list(s) will be set. |
| surface | The surface is evaluated to create the point list. |
| surface_subdomain0 | If you want to restrict the evaluation to subset of the surface, pass an increasing interval that is contained in surface.Domain(0). If you want to evaluate of the entire surface, pass surface.Domain(0), ON_Interval::EmptyInterval, or ON_Interval::Nan. |
| surface_subdomain1 | If you want to restrict the evaluation to subset of the surface, pass an increasing interval that is contained in surface.Domain(1). If you want to evaluate of the entire surface, pass surface.Domain(1), ON_Interval::EmptyInterval, or ON_Interval::Nan. |
| bPeriodicPoints0 |
| bPeriodicPoints1 |
| point_count0 | Grid count in the first parameter domain direction. The total number of pionts will be is point_count0 * point_count1. |
| point_count1 | Grid count in the second domain direction. The total number of pionts will be is point_count0 * point_count1. |
| const ON_wString ON_PointPairing::ToString | ( | ) | const |
| bool ON_PointPairing::ValidPairs | ( | ) | const |
1.8.17