Rhino C++ API
7.26
|
#include <opennurbs_plus_x.h>
Public Types | |
enum | DIRECTION { no_x_dir = 0, at_end_dir = 1, from_above_dir = 2, from_below_dir = 3, from_on_dir = 4, to_above_dir = 5, to_below_dir = 6, to_on_dir = 7 } |
enum | TYPE { no_x_event = 0, ccx_point = 1, ccx_overlap = 2, csx_point = 3, csx_overlap = 4 } |
Public Member Functions | |
ON_X_EVENT () | |
NO VIRTUAL FUNCTIONS IN THIS CLASS. More... | |
void | Dump (ON_TextLog &text_log) const |
bool | IsCCXEvent () const |
bool | IsCSXEvent () const |
bool | IsOverlapEvent () const |
bool | IsPointEvent () const |
bool | IsValid (ON_TextLog *text_log, double intersection_tolerance, double overlap_tolerance, const class ON_Curve *curveA, const class ON_Interval *curveA_domain, const class ON_Curve *curveB, const class ON_Interval *curveB_domain, const class ON_Surface *surfaceB, const class ON_Interval *surfaceB_domain0, const class ON_Interval *surfaceB_domain1) const |
bool | Local_Min (int ei) const |
void | Set_Local_Min (int ei, bool newvalue) |
Static Public Member Functions | |
static int | CleanList (double event_tolerance, double overlap_tolerance, int xevent_count, ON_X_EVENT *xevent, ON_Interval *domain=nullptr) |
static int | Compare (const ON_X_EVENT *a, const ON_X_EVENT *b) |
This class must use default copy constructor, operator=, and destructor. More... | |
static bool | CompareEquivalent (const ON_X_EVENT &XA, const ON_X_EVENT &XB, double RelativePointTol, ON_TextLog *log) |
static void | CopyEventPart (const ON_X_EVENT &src, int src_end, ON_X_EVENT &dst, int dst_end) |
static double | IntersectionTolerance (double intersection_tolerance) |
static bool | IsValidCurveCurveOverlap (ON_Interval curveA_domain, int sample_count, double overlap_tolerance, const class ON_CurveTreeNode *cnodeA, const class ON_CurveTreeNode *cnodeB, const ON_Interval *curveB_domain=0) |
static bool | IsValidCurvePlaneOverlap (ON_Interval curveA_domain, int sample_count, double endpoint_tolerance, double overlap_tolerance, const class ON_CurveTreeNode *cnodeA, const ON_PlaneEquation *plane_equation) |
static bool | IsValidCurveSurfaceOverlap (ON_Interval curveA_domain, int sample_count, double overlap_tolerance, const class ON_CurveTreeNode *cnodeA, const class ON_SurfaceTreeNode *snodeB, const ON_Interval *surfaceB_udomain=0, const ON_Interval *surfaceB_vdomain=0) |
static bool | IsValidList (int xevent_count, const ON_X_EVENT *xevent, ON_TextLog *text_log, double intersection_tolerance, double overlap_tolerance, const class ON_Curve *curveA, const class ON_Interval *curveA_domain, const class ON_Curve *curveB, const class ON_Interval *curveB_domain, const class ON_Surface *surfaceB, const class ON_Interval *surfaceB_domain0, const class ON_Interval *surfaceB_domain1) |
static double | OverlapTolerance (double intersection_tolerance, double overlap_tolerance) |
Public Attributes | |
ON_3dPoint | m_A [2] |
intersection points on first curve More... | |
double | m_a [2] |
intersection parameters on first curve More... | |
ON_3dPoint | m_B [2] |
intersection points on second curve or surface More... | |
double | m_b [4] |
intersection parameters on second curve or surface More... | |
const class ON_CurveTreeNode * | m_cnodeA [2] |
tree nodes where the intersection events occured. More... | |
const class ON_CurveTreeNode * | m_cnodeB [2] |
DIRECTION | m_dirA [2] |
DIRECTION | m_dirB [2] |
double | m_nodeA_t [2] |
nodeA bezier paramters corresponding to a[] values More... | |
double | m_nodeB_t [4] |
nodeB bezier paramters corresponding to b[] values. More... | |
const class ON_SurfaceTreeNode * | m_snodeB [2] |
TYPE | m_type |
ON_U | m_user |
unsigned int | m_x_eventsn |
Each intersection event is assigned a runtime serial number. More... | |
/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
/ For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// The ON_X_EVENT class is used to report curve-curve and curve-surface intersection events.
Event directions for use in the m_dirA[] and m_dirB[] fields. The "x_from_*" values are used to report the behavior of the curve as it enters the intersection event. The "x_to_*" values are used to report the behavior of the curve as it leaves the intersection event.
enum ON_X_EVENT::TYPE |
ON_X_EVENT::ON_X_EVENT | ( | ) |
NO VIRTUAL FUNCTIONS IN THIS CLASS.
Default construction sets everything to zero.
|
static |
Description: Expert user tool to cleanup a list of intersection events. Parameters: event_tolerance - [in] If the distance between events is <= event_tolerance, they will be considered to be the same event. Typically, event_tolerance is "small" and event_tolerance <= intersection_tolerance.
overlap_tolerance - [in] minimum length for an intersection overlap segment. Typically, overlap_tolerance is "large" and overlap_tolerance > intersection_tolerance
xevent_count - [in] xevent - [in/out] domain - [in] domain of the intersection problem. domain[0] is curve domain and either domain[1] is domain of second cuve or domain[1] x domain[2] is surface doamin domain = nullptr means no special handling of domain boundaries Returns: Length of cleaned list.
|
static |
This class must use default copy constructor, operator=, and destructor.
Description: Compares intersection events and sorts them in the canonical order. Returns: @untitled table -1 this < other 0 this == other +1 this > other Remarks: ON_CX_EVENT::Compare is used to sort intersection events into canonical order.
|
static |
Description: Compare intersection events Parameters: XA, XB are a pair of events to compare for equivalence RelativePointTol - 3d points are compared by || Pa - Pb || < ( 1 + ||Pa||) * RelativePointTol log [in] if not null and false is returned then a description of the error is appended to log. Returns: @untitled table true if the XA and XB represent the same intersections Remarks: use RelativePointTol=ON_UNSET_VALUE to use the default value of ON_SQRT_EPSILON
|
static |
Description: Expert user tool to copy portions of the itersection event information from one event to another.
If src.m_type is ON_X_EVENT::csx_*, then the m_b[] and m_nodeB_t[] values are treated as surface parameters, otherwise the values are treated as curve parameters. The m_type field is not copied. Parameters: src - [in] src_end - [in] 0 or 1 (m_A[] source index) dst - [out] dst_end - [in] 0 or 1 (m_A[] destination index)
void ON_X_EVENT::Dump | ( | ON_TextLog & | text_log | ) | const |
|
static |
Description: Convert input intersection tolerance to value used in calculations. Parameters: intersection_tolerance - [in] Returns: Value use in intersection calculations.
bool ON_X_EVENT::IsCCXEvent | ( | ) | const |
Returns: True if m_type is ccx_point or ccx_overlap
bool ON_X_EVENT::IsCSXEvent | ( | ) | const |
Returns: True if m_type is csx_point or csx_overlap
bool ON_X_EVENT::IsOverlapEvent | ( | ) | const |
Returns: True if m_type is ccx_overlap or csx_overlap.
bool ON_X_EVENT::IsPointEvent | ( | ) | const |
Returns: True if m_type is ccx_point or csx_point.
bool ON_X_EVENT::IsValid | ( | ON_TextLog * | text_log, |
double | intersection_tolerance, | ||
double | overlap_tolerance, | ||
const class ON_Curve * | curveA, | ||
const class ON_Interval * | curveA_domain, | ||
const class ON_Curve * | curveB, | ||
const class ON_Interval * | curveB_domain, | ||
const class ON_Surface * | surfaceB, | ||
const class ON_Interval * | surfaceB_domain0, | ||
const class ON_Interval * | surfaceB_domain1 | ||
) | const |
Description: Check intersection event values to make sure they are valid. Parameters: text_log - [in] If not null and an error is found, then a description of the error is printed to text_log. intersection_tolerance - [in] 0.0 or value used in intersection calculation. overlap_tolerance - [in] 0.0 or value used in intersection calculation. curveA - [in] nullptr or curveA passed to intersection calculation. curveA_domain - [in] nullptr or curveA domain used in intersection calculation. curveB - [in] nullptr or curveB passed to intersection calculation. curveB_domain - [in] nullptr or curveB domain used in intersection calculation. surfaceB - [in] nullptr or surfaceB passed to intersection calculation. surfaceB_domain0 - [in] nullptr or surfaceB "u" domain used in intersection calculation. surfaceB_domain1 - [in] nullptr or surfaceB "v" domain used in intersection calculation. Returns: True if event is valid.
|
static |
Description: Do a quick and simple test to see if this curve lies on some portion of curveB. Parameters: curveA_domain - [in] non empty interval sample_count - [in] minimum number of test points overlap_tolerance - [in] cnodeA - [in] cnodeB - [in] curveB_domain - [in] optional domain restriction Returns: True if sections overlap.
|
static |
Description: Do a quick and simple test to see if this curve lies on the plane. Parameters: curveA_domain - [in] non empty interval sample_count - [in] minimum number of test points endpont_tolerance - [in] tolerance to use when checking ends overlap_tolerance - [in] tolerance to use when checking interior cnodeA - [in] plane_equation - [in] Returns: True if curve lies on the plane
|
static |
Description: Do a quick and simple test to see if this curve lies on the surface. Parameters: curveA_domain - [in] non empty interval sample_count - [in] minimum number of test points overlap_tolerance - [in] cnodeA - [in] snodeB - [in] surfaceB_udomain - [in] optional domain restriction surfaceB_vdomain - [in] optional domain restriction Returns: True if sections overlap.
|
static |
Description: Expert user tool to check a list of intersection events. Parameters: xevent_count - [in] xevent - [in] text_log - [in] nullptr or place to describe errors. intersection_tolerance - [in] overlap_tolerance - [in] curveA - [in] curveA_domain - [in] (can be nullptr) curveB - [in] (nullptr for curve-surface intersection events) curveB_domain - [in] (can be nullptr) surfaceB - [in] (nullptr for curve-curve intersection events) surfaceB_domain0 - [in] (can be nullptr) surfaceB_domain1 - [in] (can be nullptr) Returns: True if list is valid.
bool ON_X_EVENT::Local_Min | ( | int | ei | ) | const |
An overlap start or end can be a local minimum of the function dist( C(t), S(u,v) ) for a curve surface intersection Local_Min(i) is true if (m_a[i], m_b[2*i], m_b[2*i+1]) is a local minimum of the function dist( C(t), S(u,v) ).
|
static |
Description: Convert input intersection tolerance to value used in calculations. Parameters: intersection_tolerance - [in] Returns: Value use in intersection calculations.
void ON_X_EVENT::Set_Local_Min | ( | int | ei, |
bool | newvalue | ||
) |
ON_3dPoint ON_X_EVENT::m_A[2] |
intersection points on first curve
double ON_X_EVENT::m_a[2] |
intersection parameters on first curve
ON_3dPoint ON_X_EVENT::m_B[2] |
intersection points on second curve or surface
double ON_X_EVENT::m_b[4] |
intersection parameters on second curve or surface
const class ON_CurveTreeNode* ON_X_EVENT::m_cnodeA[2] |
tree nodes where the intersection events occured.
const class ON_CurveTreeNode* ON_X_EVENT::m_cnodeB[2] |
DIRECTION ON_X_EVENT::m_dirA[2] |
There are cases when it is valuable to have direction flags on intersection events. The m_dirA[] and m_dirB[] fields provide a place to store these flags. Because this information is rarely used, it is not computed by the intersection routines. You can use ON_SetCurveCurveIntersectionDir or ON_SetCurveSurfaceIntersectionDir to fill in these fields.
DIRECTION ON_X_EVENT::m_dirB[2] |
double ON_X_EVENT::m_nodeA_t[2] |
nodeA bezier paramters corresponding to a[] values
double ON_X_EVENT::m_nodeB_t[4] |
nodeB bezier paramters corresponding to b[] values.
const class ON_SurfaceTreeNode* ON_X_EVENT::m_snodeB[2] |
TYPE ON_X_EVENT::m_type |
The m_type field determines how the values in the other fields are interpreted. See the detailed comment below for complete informtion
ON_U ON_X_EVENT::m_user |
This field is a scratch field for users. The constructor sets it to zero and the intersectors never use it.
unsigned int ON_X_EVENT::m_x_eventsn |
Each intersection event is assigned a runtime serial number.