Rhino C++ API  7.19
Public Member Functions | Public Attributes | List of all members
ON_CurveTree Class Reference

#include <opennurbs_plus.h>

Inheritance diagram for ON_CurveTree:
ON_CurveTreeNode

Public Member Functions

 ON_CurveTree ()
 
 ~ON_CurveTree ()
 
bool CreateTree (const ON_BezierCurve &bez_curve, const ON_Interval *node_domain=0, int max_span_depth=0, double maxar=0.0)
 
bool CreateTree (const ON_NurbsCurve &nurbs_curve, int max_span_depth=0, double maxar=0.0)
 
void DestroyTree ()
 
ON_CurveTreeNodeFirstLeaf () const
 First() returns the first leaf interval in the curve tree. More...
 
bool IsValid (ON_TextLog *text_log=0, const ON_Curve *curve=0) const
 
ON_CurveTreeNodeLastLeaf () const
 Last() returns the last leaf interval in the curve tree. More...
 
ON_CurveTreeNodeNewLeaf ()
 
ON_CurveTreeNodeNewNode ()
 
bool ReturnNode (ON_CurveTreeNode *node)
 
- Public Member Functions inherited from ON_CurveTreeNode
 ON_CurveTreeNode ()
 
 ~ON_CurveTreeNode ()
 
bool AdjustParameter () const
 
const ON_CurveTreeNodeEvaluate (double t, int der_count, int v_stride, double *v, int side=0) const
 
const ON_CurveTreeNodeFindLeaf (double t, int side=0) const
 
const ON_CurveTreeNodeGetClosestPoint (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_CurveTreeNodeNextLeaf () const
 
ON_CurveTreeNodePrevLeaf () 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_CurveTreeNodeTreeContaining (double t0, int side) const
 
const ON_CurveTreeNodeTreeContaining (ON_Interval range) const
 

Public Attributes

ON_CurveTreeNodem_root
 root node of the binary tree More...
 
- Public Attributes inherited from ON_CurveTreeNode
ON_BoundingBox m_bbox
 
ON_CurveTreeBezierm_bez
 
unsigned char m_bezmem
 
ON_Interval m_domain
 
ON_CurveTreeNodem_down [2]
 
unsigned char m_nodemem
 
unsigned int m_nodesn
 serial number of this node More...
 
unsigned char m_nodetype
 Memory managment 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_CurveTreeNodem_up
 

Constructor & Destructor Documentation

◆ ON_CurveTree()

ON_CurveTree::ON_CurveTree ( )

◆ ~ON_CurveTree()

ON_CurveTree::~ON_CurveTree ( )

Member Function Documentation

◆ CreateTree() [1/2]

bool ON_CurveTree::CreateTree ( const ON_BezierCurve bez_curve,
const ON_Interval node_domain = 0,
int  max_span_depth = 0,
double  maxar = 0.0 
)

Desciription: Initialize the tree based on a bezier curve. Parameters: bez_curve - [in] domain - [in] used to set the node's domain fields. (This does not restrict the portion of the bezier the tree covers.) max_span_depth - [in] advanced control - use default maxar - [in] advanced control - use default mp - [in] memory pool Returns: True if successful

◆ CreateTree() [2/2]

bool ON_CurveTree::CreateTree ( const ON_NurbsCurve nurbs_curve,
int  max_span_depth = 0,
double  maxar = 0.0 
)

Desciription: Initialize the tree based on a NURBS curve. Parameters: nurbs_curve - [in] max_span_depth - [in] advanced control - use default maxar - [in] advanced control - use default mp - [in] memory pool Returns: True if successful

◆ DestroyTree()

void ON_CurveTree::DestroyTree ( )

Description: Destroy existing information. Leaves tree in a state where it can be reused for another curve.

◆ FirstLeaf()

ON_CurveTreeNode* ON_CurveTree::FirstLeaf ( ) const

First() returns the first leaf interval in the curve tree.

◆ IsValid()

bool ON_CurveTree::IsValid ( ON_TextLog text_log = 0,
const ON_Curve curve = 0 
) const

◆ LastLeaf()

ON_CurveTreeNode* ON_CurveTree::LastLeaf ( ) const

Last() returns the last leaf interval in the curve tree.

◆ NewLeaf()

ON_CurveTreeNode* ON_CurveTree::NewLeaf ( )

Description: Expert user tool to get a curve tree leaf node. This node will be destroyed by this tree's destructor. Returns: A surface tree node with m_bez and m_bez->m_cv. Never delete or free the returned pointer, m_bez, or m_bez->m_cv.

◆ NewNode()

ON_CurveTreeNode* ON_CurveTree::NewNode ( )

Description: Expert user tool to get a curve tree interior node. This node will be destroyed by this tree's destructor. Returns: A surface tree node. Never delete or free the returned pointer.

◆ ReturnNode()

bool ON_CurveTree::ReturnNode ( ON_CurveTreeNode node)

Description: Expert user tool to return a node for reuse that was created by calling this curve tree's NewNode or NewLeaf. Parameters: node - [in] Returns: True if the node was successfully returned. If false, then the node has been damaged or was not created by calling this curve tree's NewNode() or NewLeaf().

Member Data Documentation

◆ m_root

ON_CurveTreeNode* ON_CurveTree::m_root

root node of the binary tree

often points to "this"