Rhino C++ API
8.13
|
#include <opennurbs_plus.h>
Public Member Functions | |
ON_CurveTreeNode () | |
~ON_CurveTreeNode () | |
bool | AdjustParameter () const |
const ON_CurveTreeNode * | Evaluate (double t, int der_count, int v_stride, double *v, int side=0) const |
const ON_CurveTreeNode * | FindLeaf (double t, int side=0) const |
const ON_CurveTreeNode * | GetClosestPoint (ON_3dPoint P, double *t, ON_3dPoint *closestpt=0, double maximum_distance=0.0, const ON_Interval *cdomain=0) const |
bool | GetTightBoundingBox (ON_BoundingBox &bbox, bool bGrowBox=false, const ON_Xform *xform=nullptr) const |
int | IntersectCurve (const class ON_CurveTreeNode *cnodeB, ON_SimpleArray< ON_X_EVENT > &x, double intersection_tolerance=0.0, double overlap_tolerance=0.0, const ON_Interval *curveA_domain=0, const ON_Interval *curveB_domain=0) const |
int | IntersectPlane (const class ON_Plane &plane, ON_SimpleArray< ON_X_EVENT > &x, double intersection_tolerance=0.0, double overlap_tolerance=0.0, const ON_Interval *curve_domain=0) const |
int | IntersectPlane (const class ON_PlaneEquation &plane_equation, ON_SimpleArray< ON_X_EVENT > &x, double intersection_tolerance=0.0, double overlap_tolerance=0.0, const ON_Interval *curve_domain=0) const |
int | IntersectSelf (ON_SimpleArray< ON_X_EVENT > &x, double intersection_tolerance=0.0, const ON_Interval *curve_domain=0) const |
int | IntersectSurface (const class ON_SurfaceTreeNode *snodeB, ON_SimpleArray< ON_X_EVENT > &x, double intersection_tolerance=0.0, double overlap_tolerance=0.0, const ON_Interval *curveA_domain=0, const ON_Interval *surfaceB_udomain=0, const ON_Interval *surfaceB_vdomain=0) const |
bool | IsFartherThan (double d, const ON_3dPoint &P) const |
bool | IsFartherThan (double d, const ON_CurveTreeNode *other) const |
bool | IsFartherThan (double d, const ON_PlaneEquation &e) const |
bool | IsFartherThan (double d, const ON_SurfaceTreeNode *other) const |
bool | IsFartherThanAlt (double d, const ON_SurfaceTreeNode *other) const |
todo is this really the final soln More... | |
bool | IsValid (ON_TextLog *text_log=0, int level=0, int side=-1, const ON_Curve *curve=0) const |
double | MaximumDistanceUpperBound (const ON_CurveTreeNode *other) const |
double | MaximumDistanceUpperBound (const ON_SurfaceTreeNode *other) const |
double | MaximumDistanceUpperBound (ON_3dPoint P) const |
double | MinimumDistanceLowerBound (const ON_CurveTreeNode *other) const |
double | MinimumDistanceLowerBound (const ON_SurfaceTreeNode *other) const |
double | MinimumDistanceLowerBound (ON_3dPoint P) const |
double | MinimumDistanceUpperBound (const ON_CurveTreeNode *other) const |
double | MinimumDistanceUpperBound (const ON_SurfaceTreeNode *other) const |
double | MinimumDistanceUpperBound (ON_3dPoint P) const |
ON_CurveTreeNode * | NextLeaf () const |
ON_CurveTreeNode * | PrevLeaf () const |
bool | SetBezier (const ON_BezierCurve &Crv) |
bool | SetBezier (int dim, bool is_rat, int order, const double *cv, int stride) |
bool | Split (double s, ON_CurveTreeNode &left_node, ON_CurveTreeNode &right_node) const |
const ON_CurveTreeNode * | TreeContaining (double t0, int side) const |
const ON_CurveTreeNode * | TreeContaining (ON_Interval range) const |
Public Attributes | |
ON_BoundingBox | m_bbox |
ON_CurveTreeBezier * | m_bez |
unsigned char | m_bezmem |
ON_Interval | m_domain |
ON_CurveTreeNode * | m_down [2] |
unsigned char | m_nodemem |
unsigned int | m_nodesn |
serial number of this node More... | |
unsigned char | m_nodetype |
Memory management accounting information. More... | |
unsigned char | m_reserved_ON_CurveTreeNode [5] |
keep class size a multiple of 16 More... | |
unsigned int | m_treesn |
serial number of this tree More... | |
ON_CurveTreeNode * | m_up |
A curve cache is a simple binary tree of bezier curves and is used to speed up geometric calculations.
ON_CurveTreeNode::ON_CurveTreeNode | ( | ) |
ON_CurveTreeNode::~ON_CurveTreeNode | ( | ) |
bool ON_CurveTreeNode::AdjustParameter | ( | ) | const |
Description: Used to determine if the node's parametization differs from the tree's curve parametization. If the parameterizations are different, then use ON_Curve::GetCurveParameterFromNurbFormParameter to convert node parameters to curve parameters and ON_Curve::GetCurveParameterFromNurbFormParameter to convert curve parameters to node parameters. Returns: True if the node's parametization differs from the tree's curve parametization. See Also: ON_Curve::GetCurveParameterFromNurbFormParameter ON_Curve::GetCurveParameterFromNurbFormParameter
const ON_CurveTreeNode* ON_CurveTreeNode::Evaluate | ( | double | t, |
int | der_count, | ||
int | v_stride, | ||
double * | v, | ||
int | side = 0 |
||
) | const |
Description: Evaluate the portion of the curve covered by this node. Parameters: t - [in] evaluation parameter with respect to the node's domain. der_count - [in] (>=0) number of derivatives to evaluate v_stride - [in] stride to use for the v[] array v - [out] array of length (der_count+1)*v_stride curve(t) is returned in (v[0],...,v[m_dim-1]), curve'(t) is returned in (v[v_stride],...,v[v_stride+m_dim-1]), curve"(t) is returned in (v[2*v_stride],...,v[2*v_stride+m_dim-1]), etc. side - [in] optional - determines which side to evaluate from =0 default (from above) <0 to evaluate from below, >0 to evaluate from above Returns: If successful, returns a pointer to the leaf node that was used in the evaluation. If null is returned, the evaluation could not be performed. Remarks: If the evaluation parameter is outside this node's domain, the bezier on the appropriate end is used to ev
const ON_CurveTreeNode* ON_CurveTreeNode::FindLeaf | ( | double | t, |
int | side = 0 |
||
) | const |
Description: Starting at this node, find the leaf node whose domain contains that parameter t. Parameters: t - [in] side [in] If t lies at the start/end of a domain, side controls which leaf is returned. If side >= 0, the node with domain (t,...) is returned. If side < 0, the node with domain (...,t) is returned. Returns: Pointer to the node that contains t. If t < the start of this node's domain, the node for the start is returned. If t > the end of this node's domain, the node for the end parameter is returned.
const ON_CurveTreeNode* ON_CurveTreeNode::GetClosestPoint | ( | ON_3dPoint | P, |
double * | t, | ||
ON_3dPoint * | closestpt = 0 , |
||
double | maximum_distance = 0.0 , |
||
const ON_Interval * | cdomain = 0 |
||
) | const |
bool ON_CurveTreeNode::GetTightBoundingBox | ( | ON_BoundingBox & | bbox, |
bool | bGrowBox = false , |
||
const ON_Xform * | xform = nullptr |
||
) | const |
Description: Get tight bounding box of the portion of the curve covered by this node. Parameters: tight_bbox - [in/out] tight bounding box bGrowBox -[in] (default=false)
If true and the input tight_bbox is valid, then returned tight_bbox is the union of the input tight_bbox and the node's tight bounding box. xform -[in] (default=nullptr) If not nullptr, the tight bounding box of the transformed node is calculated. The node is not modified. Returns: True if the returned tight_bbox is set to a valid bounding box.
int ON_CurveTreeNode::IntersectCurve | ( | const class ON_CurveTreeNode * | cnodeB, |
ON_SimpleArray< ON_X_EVENT > & | x, | ||
double | intersection_tolerance = 0.0 , |
||
double | overlap_tolerance = 0.0 , |
||
const ON_Interval * | curveA_domain = 0 , |
||
const ON_Interval * | curveB_domain = 0 |
||
) | const |
int ON_CurveTreeNode::IntersectPlane | ( | const class ON_Plane & | plane, |
ON_SimpleArray< ON_X_EVENT > & | x, | ||
double | intersection_tolerance = 0.0 , |
||
double | overlap_tolerance = 0.0 , |
||
const ON_Interval * | curve_domain = 0 |
||
) | const |
int ON_CurveTreeNode::IntersectPlane | ( | const class ON_PlaneEquation & | plane_equation, |
ON_SimpleArray< ON_X_EVENT > & | x, | ||
double | intersection_tolerance = 0.0 , |
||
double | overlap_tolerance = 0.0 , |
||
const ON_Interval * | curve_domain = 0 |
||
) | const |
int ON_CurveTreeNode::IntersectSelf | ( | ON_SimpleArray< ON_X_EVENT > & | x, |
double | intersection_tolerance = 0.0 , |
||
const ON_Interval * | curve_domain = 0 |
||
) | const |
int ON_CurveTreeNode::IntersectSurface | ( | const class ON_SurfaceTreeNode * | snodeB, |
ON_SimpleArray< ON_X_EVENT > & | x, | ||
double | intersection_tolerance = 0.0 , |
||
double | overlap_tolerance = 0.0 , |
||
const ON_Interval * | curveA_domain = 0 , |
||
const ON_Interval * | surfaceB_udomain = 0 , |
||
const ON_Interval * | surfaceB_vdomain = 0 |
||
) | const |
bool ON_CurveTreeNode::IsFartherThan | ( | double | d, |
const ON_3dPoint & | P | ||
) | const |
bool ON_CurveTreeNode::IsFartherThan | ( | double | d, |
const ON_CurveTreeNode * | other | ||
) | const |
bool ON_CurveTreeNode::IsFartherThan | ( | double | d, |
const ON_PlaneEquation & | e | ||
) | const |
Description: Quickly determine if the shortest distance from the point P to the portion of the curve covered by this node is greater than d. Parameters: d - [in] distance (> 0.0) P - [in] other - [in] Returns: True if if the shortest distance from the point P to the portion of the curve covered by this node is greater than d. Remarks: This is conceptually the same but faster than calling MinimumDistanceUpperBound(other) > d.
bool ON_CurveTreeNode::IsFartherThan | ( | double | d, |
const ON_SurfaceTreeNode * | other | ||
) | const |
bool ON_CurveTreeNode::IsFartherThanAlt | ( | double | d, |
const ON_SurfaceTreeNode * | other | ||
) | const |
todo is this really the final soln
bool ON_CurveTreeNode::IsValid | ( | ON_TextLog * | text_log = 0 , |
int | level = 0 , |
||
int | side = -1 , |
||
const ON_Curve * | curve = 0 |
||
) | const |
double ON_CurveTreeNode::MaximumDistanceUpperBound | ( | const ON_CurveTreeNode * | other | ) | const |
double ON_CurveTreeNode::MaximumDistanceUpperBound | ( | const ON_SurfaceTreeNode * | other | ) | const |
double ON_CurveTreeNode::MaximumDistanceUpperBound | ( | ON_3dPoint | P | ) | const |
Description: Quickly find an upper bound on the distance from a P to the portion of the curve covered by this node. Parameters: P - [in] Returns: A distance that is greater than or equal to the longest distance from P to a point on the curve covered by this node. Put another way, if Q is any point on the portion of the curve covered by this node, then P.DistanceTo(Q) <= MaximumDistanceTo(P);
double ON_CurveTreeNode::MinimumDistanceLowerBound | ( | const ON_CurveTreeNode * | other | ) | const |
double ON_CurveTreeNode::MinimumDistanceLowerBound | ( | const ON_SurfaceTreeNode * | other | ) | const |
double ON_CurveTreeNode::MinimumDistanceLowerBound | ( | ON_3dPoint | P | ) | const |
Description: Quickly find a lower bound on the distance from this curve node to the other object. Parameters: P - [in] other - [in] Returns: A distance that is less than or equal to the shortest distance from this curve node to the other object. Put another way, if Q is any point Q on the portion of the curve covered by this node and P is any point on the other object, then P.DistanceTo(Q) >= MinimumDistanceTo();
double ON_CurveTreeNode::MinimumDistanceUpperBound | ( | const ON_CurveTreeNode * | other | ) | const |
double ON_CurveTreeNode::MinimumDistanceUpperBound | ( | const ON_SurfaceTreeNode * | other | ) | const |
double ON_CurveTreeNode::MinimumDistanceUpperBound | ( | ON_3dPoint | P | ) | const |
Description: Quickly find an upper bound on the shortest distance from this curve node to the other object. Parameters: P - [in] other - [in] Returns: A distance that is greater than or equal to the shortest distance from this curve node to the other object. Put another way, there exists a point Q on the portion of the curve covered by this node and a point P on the other object such that P.DistanceTo(Q) <= MinimumDistanceUpperBound();
ON_CurveTreeNode* ON_CurveTreeNode::NextLeaf | ( | ) | const |
Next() moves to the next leaf interval in the curve tree if this node is a leaf node.
ON_CurveTreeNode* ON_CurveTreeNode::PrevLeaf | ( | ) | const |
Prev() moves to the previous leaf interval in the curve tree if this node is a leaf node.
bool ON_CurveTreeNode::SetBezier | ( | const ON_BezierCurve & | Crv | ) |
Set from a bezier or from the defining data for a bezier. Sets m_bbox, m_bez, m_radius. Leaves m_domain unchanged.
bool ON_CurveTreeNode::SetBezier | ( | int | dim, |
bool | is_rat, | ||
int | order, | ||
const double * | cv, | ||
int | stride | ||
) |
bool ON_CurveTreeNode::Split | ( | double | s, |
ON_CurveTreeNode & | left_node, | ||
ON_CurveTreeNode & | right_node | ||
) | const |
Description: Expert user tool to split a curve tree node. Does not modify this node's m_down[] pointers or left and right's m_up pointers. Care must be take to guard against memory leaks and double deletes. Parameters: s - [in] normalized (bezier parameter) 0 < s < 1 The corresponding surface domain parameter is m_domain.ParameterAt(s). left_node - [in] node to hold the left half. right_node - [in] node to hold the right half. Returns: True if input is valid and split was performed.
const ON_CurveTreeNode* ON_CurveTreeNode::TreeContaining | ( | double | t0, |
int | side | ||
) | const |
Returns the smallest subtree that contain the given semi-open interval with beginning, (or ending respectively) at t0 when side =0 or 1 ( or side = -1 ). Returns nullptr if range is not contained the domain of this subtree.
const ON_CurveTreeNode* ON_CurveTreeNode::TreeContaining | ( | ON_Interval | range | ) | const |
Returns the smallest subtree that contain the given interval. Returns nullptr if range is not contained the domain of this subtree.
ON_BoundingBox ON_CurveTreeNode::m_bbox |
Bounding box of the portion of the curve with domain [m_domain.Min(), m_domain.Max()]
ON_CurveTreeBezier* ON_CurveTreeNode::m_bez |
All leaf nodes have a bezier. Non-leaf nodes may have a nullptr here. The domain of m_bez is always [0,1] and m_domain records the portion of the curve that this bezier curve corresponds to.
unsigned char ON_CurveTreeNode::m_bezmem |
0 = do not destroy 1 = destroy with delete 2 = destroy with free
ON_Interval ON_CurveTreeNode::m_domain |
m_domain records the portion of the curve's domain that this node defines. It is always increasing an included in the curve's domain. The parameters are NURBS form parameters.
ON_CurveTreeNode* ON_CurveTreeNode::m_down[2] |
m_down[] moves towards the leaf nodes. Either both m_down[0] and m_down[1] are nullptr, or both are not nullptr. m_down[0] covers the portion of the curve from m_domain.Min() to m_domain.Mid(). m_down[1] covers the portion of the curve from m_domain.Mid() to m_domain.Max().
unsigned char ON_CurveTreeNode::m_nodemem |
0 = do not destroy 1 = destroy with delete 2 = destroy with free
unsigned int ON_CurveTreeNode::m_nodesn |
serial number of this node
unsigned char ON_CurveTreeNode::m_nodetype |
Memory management accounting information.
8 bits to flag special nodes 1 = root node 2 = meta node (no domain) 4 = reparam
unsigned char ON_CurveTreeNode::m_reserved_ON_CurveTreeNode[5] |
keep class size a multiple of 16
unsigned int ON_CurveTreeNode::m_treesn |
serial number of this tree
ON_CurveTreeNode* ON_CurveTreeNode::m_up |
m_up moves towards the root node. If m_up is nullptr, the node is the root node.