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

#include <opennurbs_subd.h>

Public Member Functions

 ON_SubDEdgeChain ()=default
 
 ON_SubDEdgeChain (const ON_SubDEdgeChain &)=default
 
 ~ON_SubDEdgeChain ()=default
 
unsigned int AddAllNeighbors (ON_ChainDirection direction, ON_SubD::ChainType chain_type)
 
unsigned int AddEdge (const ON_SubDEdge *edge)
 
unsigned int AddOneNeighbor (ON_ChainDirection direction, ON_SubD::ChainType chain_type)
 
unsigned int BeginEdgeChain (ON_UUID persistent_subd_id, ON_SubDRef subd_ref, const ON_SimpleArray< const ON_SubDEdge * > &initial_edge_chain)
 
unsigned int BeginEdgeChain (ON_UUID persistent_subd_id, ON_SubDRef subd_ref, const ON_SimpleArray< ON_SubDEdgePtr > &initial_edge_chain)
 
unsigned int BeginEdgeChain (ON_UUID persistent_subd_id, ON_SubDRef subd_ref, const ON_SubDEdge *const *initial_edge_chain, size_t edge_count)
 
unsigned int BeginEdgeChain (ON_UUID persistent_subd_id, ON_SubDRef subd_ref, const ON_SubDEdge *initial_edge)
 
unsigned int BeginEdgeChain (ON_UUID persistent_subd_id, ON_SubDRef subd_ref, const ON_SubDEdgePtr *initial_edge_chain, size_t edge_count)
 
unsigned int BeginEdgeChain (ON_UUID persistent_subd_id, ON_SubDRef subd_ref, ON_SubDEdgePtr initial_edge)
 
void ClearEdgeChain ()
 
const ON_3dPoint ControlNetPoint (int vertex_index) const
 
void Dump (class ON_TextLog &text_log) const
 
const ON_SubDEdgeEdge (int edge_index) const
 
const ON_SimpleArray< ON_SubDEdgePtr > & EdgeChain () const
 
unsigned int EdgeCount () const
 
const ON_SubDEdgePtr EdgePtr (int edge_index) const
 
ON_NurbsCurveEdgeSurfaceCurve (ON_NurbsCurve *destination) const
 
const ON_3dPoint FirstControlNetPoint () const
 
const ON_SubDEdgeFirstEdge () const
 
const ON_SubDEdgePtr FirstEdgePtr () const
 
const ON_SubDVertexFirstVertex () const
 
bool GetSideComponents (unsigned relative_side, ON_SimpleArray< ON_SubDComponentPtr > &side_components) const
 
const ON_SHA1_Hash Hash () const
 
bool HasPersistentEdgeIds () const
 
bool HasRuntimeEdgePtrs () const
 
bool InChain (const ON_SubDEdge *edge) const
 
bool InChain (const ON_SubDEdgePtr edge_ptr) const
 
bool InChain (const ON_SubDVertex *vertex) const
 
bool IsClosedLoop () const
 
bool IsConvexLoop (bool bStrictlyConvex) const
 
const ON_3dPoint LastControlNetPoint () const
 
const ON_SubDEdgeLastEdge () const
 
const ON_SubDEdgePtr LastEdgePtr () const
 
const ON_SubDVertexLastVertex () const
 
ON_NurbsCurveLoftCurve (ON_NurbsCurve *destination) const
 
ON_SubDEdgeChainoperator= (const ON_SubDEdgeChain &)=default
 
const ON_UUID PersistentSubDId () const
 
bool Read (class ON_BinaryArchive &archive)
 
unsigned int RemoveEdges (const ON_SubDEdge *first_edge, const ON_SubDEdge *last_edge)
 
void Reverse ()
 
bool SetPersistentEdgeIdsFromRuntimeEdgePtrs () const
 
bool SetRuntimeEdgePtrsFromPersistentSubD (ON_UUID persistent_subd_id, ON_SubDRef persistent_subd_ref)
 
void SetStatusCheck (bool bEnableStatusCheck, ON_ComponentStatus status_check_pass, ON_ComponentStatus status_check_fail)
 
bool StatusCheck (const ON_SubDEdge *edge) const
 
bool StatusCheckEnabled () const
 
const ON_ComponentStatus StatusCheckFail () const
 
const ON_ComponentStatus StatusCheckPass () const
 
const ON_SubDSubD () const
 
const ON_SubDRef SubDRef () const
 
const ON_SubDVertexVertex (int vertex_index) const
 
bool Write (class ON_BinaryArchive &archive) const
 

Static Public Member Functions

static const ON_SubDEdgePtr EdgeChainNeighbor (ON_SubDEdgePtr starting_edge, ON_ChainDirection search_direction, ON_SubD::ChainType chain_type)
 
static const ON_SubDEdgePtr EdgeChainNeighbor (ON_SubDEdgePtr starting_edge, ON_ChainDirection search_direction, ON_SubD::ChainType chain_type, bool bEnableStatusCheck, ON_ComponentStatus status_pass, ON_ComponentStatus status_fail)
 
static ON_NurbsCurveGetEdgeSurfaceCurve (const ON_SimpleArray< ON_SubDEdgePtr > &edge_chain, unsigned int *converted_count, ON_NurbsCurve *destination)
 
static ON_NurbsCurveGetEdgeSurfaceCurve (const ON_SubDEdgePtr *edge_chain, size_t edge_count, unsigned int *converted_count, ON_NurbsCurve *destination)
 
static ON_NurbsCurveGetLoftCurve (const ON_SimpleArray< ON_SubDEdgePtr > &edge_chain, bool bRequireCreases, ON_NurbsCurve *destination)
 
static ON_NurbsCurveGetLoftCurve (const ON_SimpleArray< ON_SubDEdgePtr > &edge_chain, ON_NurbsCurve *destination)
 
static ON_NurbsCurveGetLoftCurve (const ON_SubDEdgePtr *edge_chain, size_t edge_count, bool bReequireCreases, ON_NurbsCurve *destination)
 
static ON_NurbsCurveGetLoftCurve (const ON_SubDEdgePtr *edge_chain, size_t edge_count, ON_NurbsCurve *destination)
 
static bool GetSideComponents (const ON_SimpleArray< ON_SubDEdgePtr > &edge_chain, unsigned relative_side, ON_SimpleArray< ON_SubDComponentPtr > &side_components)
 
static bool IsSingleEdgeChain (const ON_SimpleArray< ON_SubDEdgePtr > &edges)
 
static bool IsSingleEdgeChain (const ON_SimpleArray< ON_SubDEdgePtr > &edges, bool &bIsClosed, bool &bIsSorted)
 
static bool IsValidEdgeChain (const ON_SimpleArray< ON_SubDEdgePtr > &edge_chain, bool bCheckForDuplicateEdges)
 
static bool IsValidEdgeChain (const ON_SubDEdgePtr *edge_chain, size_t edge_count, bool bCheckForDuplicateEdges)
 
static unsigned int OrientEdgesIntoEdgeChains (const ON_SimpleArray< const ON_SubDEdge * > &edges, ON_SimpleArray< ON_SubDEdgePtr > &edge_chains)
 
static unsigned int OrientEdgesIntoEdgeChains (const ON_SimpleArray< ON_SubDComponentPtr > &edges, ON_SimpleArray< ON_SubDEdgePtr > &edge_chains)
 
static unsigned int OrientEdgesIntoEdgeChains (const ON_SubD &subd, const ON_SimpleArray< ON_COMPONENT_INDEX > &edges, ON_SimpleArray< ON_SubDEdgePtr > &edge_chains)
 
static void ReverseEdgeChain (ON_SimpleArray< ON_SubDEdgePtr > &edge_chain)
 
static void ReverseEdgeChain (ON_SubDEdgePtr *edge_chain, size_t edge_count)
 
static unsigned int SortEdgesIntoEdgeChains (const ON_SimpleArray< const ON_SubDEdge * > &unsorted_edges, ON_SimpleArray< ON_SubDEdgePtr > &sorted_edges)
 
static unsigned int SortEdgesIntoEdgeChains (const ON_SimpleArray< const ON_SubDEdge * > &unsorted_edges, unsigned int minimum_chain_length, ON_SimpleArray< ON_SubDEdgePtr > &edge_chains)
 
static unsigned int SortEdgesIntoEdgeChains (const ON_SimpleArray< ON_SubDComponentPtr > &unsorted_edges, ON_SimpleArray< ON_SubDEdgePtr > &sorted_edges)
 
static unsigned int SortEdgesIntoEdgeChains (const ON_SimpleArray< ON_SubDComponentPtr > &unsorted_edges, unsigned int minimum_chain_length, ON_SimpleArray< ON_SubDEdgePtr > &sorted_edges)
 
static unsigned int SortEdgesIntoEdgeChains (const ON_SimpleArray< ON_SubDEdgePtr > &unsorted_edges, ON_SimpleArray< ON_SubDEdgePtr > &sorted_edges)
 
static unsigned int SortEdgesIntoEdgeChains (const ON_SimpleArray< ON_SubDEdgePtr > &unsorted_edges, unsigned int minimum_chain_length, ON_SimpleArray< ON_SubDEdgePtr > &edge_chains)
 
static unsigned int SortEdgesIntoEdgeChains (const ON_SubD &subd, const ON_SimpleArray< ON_COMPONENT_INDEX > &unsorted_edges, ON_SimpleArray< ON_SubDEdgePtr > &sorted_edges)
 
static unsigned int SortEdgesIntoEdgeChains (const ON_SubD &subd, const ON_SimpleArray< ON_COMPONENT_INDEX > &unsorted_edges, unsigned int minimum_chain_length, ON_SimpleArray< ON_SubDEdgePtr > &edge_chains)
 

Static Public Attributes

static const ON_SubDEdgeChain Empty
 

Constructor & Destructor Documentation

◆ ON_SubDEdgeChain() [1/2]

ON_SubDEdgeChain::ON_SubDEdgeChain ( )
default

◆ ~ON_SubDEdgeChain()

ON_SubDEdgeChain::~ON_SubDEdgeChain ( )
default

◆ ON_SubDEdgeChain() [2/2]

ON_SubDEdgeChain::ON_SubDEdgeChain ( const ON_SubDEdgeChain )
default

Member Function Documentation

◆ AddAllNeighbors()

unsigned int ON_SubDEdgeChain::AddAllNeighbors ( ON_ChainDirection  direction,
ON_SubD::ChainType  chain_type 
)

◆ AddEdge()

unsigned int ON_SubDEdgeChain::AddEdge ( const ON_SubDEdge edge)

◆ AddOneNeighbor()

unsigned int ON_SubDEdgeChain::AddOneNeighbor ( ON_ChainDirection  direction,
ON_SubD::ChainType  chain_type 
)

◆ BeginEdgeChain() [1/6]

unsigned int ON_SubDEdgeChain::BeginEdgeChain ( ON_UUID  persistent_subd_id,
ON_SubDRef  subd_ref,
const ON_SimpleArray< const ON_SubDEdge * > &  initial_edge_chain 
)

Parameters: persistent_subd_id - [in] If this edge chain needs to persist in a 3dm archive, then persistent_subd_id should identify the subd in its current context. If that context is an ONX_Model, then the persistent id is the ON_ModelGeometryComponent.Id(). If that context is a CRhinoDoc, then the persistent id is CRhinoObject.ModelObjectId(). If the edge chain is being used in a runtime context and will not be saved in a 3dm archive or otherwise serialized, then persistent_subd_id can be ON_nil_uuid.

◆ BeginEdgeChain() [2/6]

unsigned int ON_SubDEdgeChain::BeginEdgeChain ( ON_UUID  persistent_subd_id,
ON_SubDRef  subd_ref,
const ON_SimpleArray< ON_SubDEdgePtr > &  initial_edge_chain 
)

Parameters: persistent_subd_id - [in] If this edge chain needs to persist in a 3dm archive, then persistent_subd_id should identify the subd in its current context. If that context is an ONX_Model, then the persistent id is the ON_ModelGeometryComponent.Id(). If that context is a CRhinoDoc, then the persistent id is CRhinoObject.ModelObjectId(). If the edge chain is being used in a runtime context and will not be saved in a 3dm archive or otherwise serialized, then persistent_subd_id can be ON_nil_uuid.

◆ BeginEdgeChain() [3/6]

unsigned int ON_SubDEdgeChain::BeginEdgeChain ( ON_UUID  persistent_subd_id,
ON_SubDRef  subd_ref,
const ON_SubDEdge *const *  initial_edge_chain,
size_t  edge_count 
)

Parameters: persistent_subd_id - [in] If this edge chain needs to persist in a 3dm archive, then persistent_subd_id should identify the subd in its current context. If that context is an ONX_Model, then the persistent id is the ON_ModelGeometryComponent.Id(). If that context is a CRhinoDoc, then the persistent id is CRhinoObject.ModelObjectId(). If the edge chain is being used in a runtime context and will not be saved in a 3dm archive or otherwise serialized, then persistent_subd_id can be ON_nil_uuid.

◆ BeginEdgeChain() [4/6]

unsigned int ON_SubDEdgeChain::BeginEdgeChain ( ON_UUID  persistent_subd_id,
ON_SubDRef  subd_ref,
const ON_SubDEdge initial_edge 
)

Parameters: persistent_subd_id - [in] If this edge chain needs to persist in a 3dm archive, then persistent_subd_id should identify the subd in its current context. If that context is an ONX_Model, then the persistent id is the ON_ModelGeometryComponent.Id(). If that context is a CRhinoDoc, then the persistent id is CRhinoObject.ModelObjectId(). If the edge chain is being used in a runtime context and will not be saved in a 3dm archive or otherwise serialized, then persistent_subd_id can be ON_nil_uuid.

◆ BeginEdgeChain() [5/6]

unsigned int ON_SubDEdgeChain::BeginEdgeChain ( ON_UUID  persistent_subd_id,
ON_SubDRef  subd_ref,
const ON_SubDEdgePtr initial_edge_chain,
size_t  edge_count 
)

Parameters: persistent_subd_id - [in] If this edge chain needs to persist in a 3dm archive, then persistent_subd_id should identify the subd in its current context. If that context is an ONX_Model, then the persistent id is the ON_ModelGeometryComponent.Id(). If that context is a CRhinoDoc, then the persistent id is CRhinoObject.ModelObjectId(). If the edge chain is being used in a runtime context and will not be saved in a 3dm archive or otherwise serialized, then persistent_subd_id can be ON_nil_uuid.

◆ BeginEdgeChain() [6/6]

unsigned int ON_SubDEdgeChain::BeginEdgeChain ( ON_UUID  persistent_subd_id,
ON_SubDRef  subd_ref,
ON_SubDEdgePtr  initial_edge 
)

Parameters: persistent_subd_id - [in] If this edge chain needs to persist in a 3dm archive, then persistent_subd_id should identify the subd in its current context. If that context is an ONX_Model, then the persistent id is the ON_ModelGeometryComponent.Id(). If that context is a CRhinoDoc, then the persistent id is CRhinoObject.ModelObjectId(). If the edge chain is being used in a runtime context and will not be saved in a 3dm archive or otherwise serialized, then persistent_subd_id can be ON_nil_uuid.

◆ ClearEdgeChain()

void ON_SubDEdgeChain::ClearEdgeChain ( )

◆ ControlNetPoint()

const ON_3dPoint ON_SubDEdgeChain::ControlNetPoint ( int  vertex_index) const

◆ Dump()

void ON_SubDEdgeChain::Dump ( class ON_TextLog text_log) const

◆ Edge()

const ON_SubDEdge* ON_SubDEdgeChain::Edge ( int  edge_index) const

◆ EdgeChain()

const ON_SimpleArray<ON_SubDEdgePtr>& ON_SubDEdgeChain::EdgeChain ( ) const

Returns: Current EdgeChain

◆ EdgeChainNeighbor() [1/2]

static const ON_SubDEdgePtr ON_SubDEdgeChain::EdgeChainNeighbor ( ON_SubDEdgePtr  starting_edge,
ON_ChainDirection  search_direction,
ON_SubD::ChainType  chain_type 
)
static

Edge chain tools Description: Get the neighboring link in an edge chain. Parameters: starting_edge - [in] search_direction - [in] ON_ChainDirection::Previous or ON_ChainDirection::Next. The search direction is relative to this->EdgeDirection(). chain_type - [in] Determines what edge/vertex tag conditions must be satisified by the neighbor. Returns: The next or previous edge in the chain if it exists. Otherwise, nullptr is returned. Remarks: When multiple edges are candidates, there is a bias to preserve smooth/crease and a bias to preserve face count. If the biases don't reduce the list of candidates to one or bStopAtBreak is true and a creaase/smooth break is encountered, then ON_SubDEdgePtr::Null is returned.

◆ EdgeChainNeighbor() [2/2]

static const ON_SubDEdgePtr ON_SubDEdgeChain::EdgeChainNeighbor ( ON_SubDEdgePtr  starting_edge,
ON_ChainDirection  search_direction,
ON_SubD::ChainType  chain_type,
bool  bEnableStatusCheck,
ON_ComponentStatus  status_pass,
ON_ComponentStatus  status_fail 
)
static

Description: Get the neighboring link in an edge chain. Parameters: starting_edge - [in] search_direction - [in] ON_ChainDirection::Previous or ON_ChainDirection::Next. The search direction is relative to this->EdgeDirection(). chain_type - [in] Determines what edge/vertex tag conditions must be satisified by the neighbor. bEnableStatusCheck - [in] status_pass - [in] status_fail - [in] If bEnableStatusFilter is false, then no status checks are performed. If bEnableStatusFilter is true, ON_ComponentStatus::StatusCheck(candidate_edge->m_status,status_pass,status_fail) must be true for candidate_edge to be returned. Returns: The next or previous edge in the chain if it exists. Otherwise, nullptr is returned. Remarks: When multiple edges are candidates, there is a bias to preserve smooth/crease and a bias to preserve face count. If the biases don't reduce the list of candidates to one or bStopAtBreak is true and a creaase/smooth break is encountered, then ON_SubDEdgePtr::Null is returned.

◆ EdgeCount()

unsigned int ON_SubDEdgeChain::EdgeCount ( ) const

◆ EdgePtr()

const ON_SubDEdgePtr ON_SubDEdgeChain::EdgePtr ( int  edge_index) const

◆ EdgeSurfaceCurve()

ON_NurbsCurve* ON_SubDEdgeChain::EdgeSurfaceCurve ( ON_NurbsCurve destination) const

◆ FirstControlNetPoint()

const ON_3dPoint ON_SubDEdgeChain::FirstControlNetPoint ( ) const

◆ FirstEdge()

const ON_SubDEdge* ON_SubDEdgeChain::FirstEdge ( ) const

◆ FirstEdgePtr()

const ON_SubDEdgePtr ON_SubDEdgeChain::FirstEdgePtr ( ) const

◆ FirstVertex()

const ON_SubDVertex* ON_SubDEdgeChain::FirstVertex ( ) const

◆ GetEdgeSurfaceCurve() [1/2]

static ON_NurbsCurve* ON_SubDEdgeChain::GetEdgeSurfaceCurve ( const ON_SimpleArray< ON_SubDEdgePtr > &  edge_chain,
unsigned int *  converted_count,
ON_NurbsCurve destination 
)
static

Parameters: edge_count - [in] edge_chain[] - [in] A chain of contiguous edges. The conversion into a NURBS curve will stop if a link is not contiguous with the previous link. converted_count = [in] If not nullptr, the number of edges converted into the returned curve is returned. ON_NurbsCurve* destination - [in] If not nullptr, the limit curve is created in this instance. Returns: A NURBS curve that lies on the limit surface edges. The domain is (0,edge_count+1) and the subdomain for the i-th edge is (i,i+1).

◆ GetEdgeSurfaceCurve() [2/2]

static ON_NurbsCurve* ON_SubDEdgeChain::GetEdgeSurfaceCurve ( const ON_SubDEdgePtr edge_chain,
size_t  edge_count,
unsigned int *  converted_count,
ON_NurbsCurve destination 
)
static

◆ GetLoftCurve() [1/4]

static ON_NurbsCurve* ON_SubDEdgeChain::GetLoftCurve ( const ON_SimpleArray< ON_SubDEdgePtr > &  edge_chain,
bool  bRequireCreases,
ON_NurbsCurve destination 
)
static

◆ GetLoftCurve() [2/4]

static ON_NurbsCurve* ON_SubDEdgeChain::GetLoftCurve ( const ON_SimpleArray< ON_SubDEdgePtr > &  edge_chain,
ON_NurbsCurve destination 
)
static

◆ GetLoftCurve() [3/4]

static ON_NurbsCurve* ON_SubDEdgeChain::GetLoftCurve ( const ON_SubDEdgePtr edge_chain,
size_t  edge_count,
bool  bReequireCreases,
ON_NurbsCurve destination 
)
static

◆ GetLoftCurve() [4/4]

static ON_NurbsCurve* ON_SubDEdgeChain::GetLoftCurve ( const ON_SubDEdgePtr edge_chain,
size_t  edge_count,
ON_NurbsCurve destination 
)
static

◆ GetSideComponents() [1/2]

static bool ON_SubDEdgeChain::GetSideComponents ( const ON_SimpleArray< ON_SubDEdgePtr > &  edge_chain,
unsigned  relative_side,
ON_SimpleArray< ON_SubDComponentPtr > &  side_components 
)
static

See above.

◆ GetSideComponents() [2/2]

bool ON_SubDEdgeChain::GetSideComponents ( unsigned  relative_side,
ON_SimpleArray< ON_SubDComponentPtr > &  side_components 
) const

Description: Get the edges and faces on a specified side of the edge chain. Parameters: relative_side - [in] 0: Get edges and faces on the ON_SubDEdgePtr::RelativeFace(0) side (left). 1: Get edges and faces on the ON_SubDEdgePtr::RelativeFace(1) side (right).

side_components - [out] side_components[] is a sequence of made of vertices, edges, and faces that record the edges and faces that are on the specified side of the edge chain.

When a vertex is in side_components[], ON_SubDComponentPtr.Vertex() is not nullptr and the vertex is between two conscutive edges in the edge chain.

When an edge is in side_components[], ON_SubDComponentPtr.EdgePtr() is not nullptr, the edge is on the specified side of the edge chain (not in the edge chain), and ON_SubDComponentPtr.EdgePtr().RelativeVertex(0) is a vertex on the edge chain.

When a face is in side_components[], ON_SubDComponentPtr.Face() is not nullptr, then at least one vertex of f is part of the edge chain and f is on the specified side of the edge chain.

If a vertex v is side_components[], then it is preceded and followed by the same face (...f,v,f,...), there are consecutive edges in the edge chain (...e0,e1,...), and e0 and e1 are consecutive edges in f's boundary.

If ...eptr0,f,eptr1,... is in side_components[], v0 = eptr0.RelativeVertex(0), v1 = eptr0.RelativeVertex(0), and v0 == v1, then eptr0 and eptr1 are conecutive edges in the boundary of f and v0==v1 is a vertex in the edge chain.

If ...eptr0,f,eptr1,... is in side_components[], v0 = eptr0.RelativeVertex(0), v1 = eptr0.RelativeVertex(0), and v0 != v1, then there is an edge c from v0 to v1 that is in the edge chain and eptr0,c,eptr1 are conecutive edges in the boundary of f.

If ...eptr0,f,v,... is in side_components[] and v0 = eptr0.RelativeVertex(0), and then v0 != v, then there is an edge c from v0 to v that is in the edge chain, and eptr0,c are conecutive edges in the boundary of f.

If ...v,f,eptr1,... is in side_components[] and v1 = eptr1.RelativeVertex(0), and then v != v1, then there is an edge c from v to v1 that is in the edge chain, and c,eptr1 conecutive edges in the boundary of f.

Remarks: If the SubD is not an oriented manifold along the entire side of the chain, then there may be gaps in chain_side[]. When there are face fans at a chain vertex, there will be faces that do not have an edge on the chain.

◆ Hash()

const ON_SHA1_Hash ON_SubDEdgeChain::Hash ( ) const

Returns: A SHA1 hash of the edge and vertex ids. Useful for determining when two edge chains from different subds (one generally a modified copy) involve the same edges and vertices.

◆ HasPersistentEdgeIds()

bool ON_SubDEdgeChain::HasPersistentEdgeIds ( ) const

◆ HasRuntimeEdgePtrs()

bool ON_SubDEdgeChain::HasRuntimeEdgePtrs ( ) const

◆ InChain() [1/3]

bool ON_SubDEdgeChain::InChain ( const ON_SubDEdge edge) const

◆ InChain() [2/3]

bool ON_SubDEdgeChain::InChain ( const ON_SubDEdgePtr  edge_ptr) const

◆ InChain() [3/3]

bool ON_SubDEdgeChain::InChain ( const ON_SubDVertex vertex) const

◆ IsClosedLoop()

bool ON_SubDEdgeChain::IsClosedLoop ( ) const

Returns: True if the edge chain has 3 or more edges that form a closed loop.

◆ IsConvexLoop()

bool ON_SubDEdgeChain::IsConvexLoop ( bool  bStrictlyConvex) const

Parameters: bStrictlyConvex - [in] If true, then a colinear pair of edges is not considered convex. Returns: True if the edge chain has 3 or more edges that forma a convex loop.

◆ IsSingleEdgeChain() [1/2]

static bool ON_SubDEdgeChain::IsSingleEdgeChain ( const ON_SimpleArray< ON_SubDEdgePtr > &  edges)
static

Description: Determin if the array of ON_SubDEdgePtrs in edges[] can be sorted into a single edge chain. Parameters: edges - [in] Set of edges to test. Returns: If the array of edges[] can be sorted into a single edge chain with no self intersections, then true is returned. Otherwise false is returned. Remarks: This test usesthe MarkBits() values on the edges and vertices and restores the values to the input state. Multiple threads may not simultaneously use any SubD tools on that rely on markbits on the same ON_SubD.

◆ IsSingleEdgeChain() [2/2]

static bool ON_SubDEdgeChain::IsSingleEdgeChain ( const ON_SimpleArray< ON_SubDEdgePtr > &  edges,
bool &  bIsClosed,
bool &  bIsSorted 
)
static

Description: Determin if the array of ON_SubDEdgePtrs in edges[] can be sorted into a single edge chain. Parameters: edges - [in] Set of edges to test. bIsClosed - [out] If true is returned and edges[] sorts into a closed edge chain, then bIsClosed is true. Otherwise bIsClosed is false. bIsSorted - [out] If true is returned and edges[] is currently sorted into an edge chain, then bIsSorted is true. Otherwise bIsSorted is false. Returns: If the array of edges[] can be sorted into a single edge chain with no self intersections, then true is returned. Otherwise false is returned. Remarks: This test usesthe MarkBits() values on the edges and vertices and restores the values to the input state. Multiple threads may not simultaneously use any SubD tools on that rely on markbits on the same ON_SubD.

◆ IsValidEdgeChain() [1/2]

static bool ON_SubDEdgeChain::IsValidEdgeChain ( const ON_SimpleArray< ON_SubDEdgePtr > &  edge_chain,
bool  bCheckForDuplicateEdges 
)
static

Description: Checks that all edge and vertex pointers are not nullptr and that adjacent edges in the list share the same vertex. Parameters: edge_chain - [in] Edge chain to test bCheckForDuplicateEdges - [in] If bCheckForDuplicateEdges true, then false is returned if there are duplicate edges or duplicate interior vertices. Returns: True if edge_chain[] is valid.

◆ IsValidEdgeChain() [2/2]

static bool ON_SubDEdgeChain::IsValidEdgeChain ( const ON_SubDEdgePtr edge_chain,
size_t  edge_count,
bool  bCheckForDuplicateEdges 
)
static

Description: Checks that all edge and vertex pointers are not nullptr and that adjacent edges in the list share the same vertex. Parameters: edge_count - [in] Number of elements in edge_chain[] to test. edge_chain - [in] Edge chain to test bCheckForDuplicateEdges - [in] If bCheckForDuplicateEdges true, then false is returned if there are duplicate edges or duplicate interior vertices. Returns: True if edge_chain[] is valid.

◆ LastControlNetPoint()

const ON_3dPoint ON_SubDEdgeChain::LastControlNetPoint ( ) const

◆ LastEdge()

const ON_SubDEdge* ON_SubDEdgeChain::LastEdge ( ) const

◆ LastEdgePtr()

const ON_SubDEdgePtr ON_SubDEdgeChain::LastEdgePtr ( ) const

◆ LastVertex()

const ON_SubDVertex* ON_SubDEdgeChain::LastVertex ( ) const

◆ LoftCurve()

ON_NurbsCurve* ON_SubDEdgeChain::LoftCurve ( ON_NurbsCurve destination) const

Description: Get a NURBS curve that is appropriate for lofting SubDs. Parameters: destination - [in] If not nullptr, then the curve is created in this instance. Returns: A pointer to the curve or nullptr if the edge is not valid.

◆ operator=()

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

◆ OrientEdgesIntoEdgeChains() [1/3]

static unsigned int ON_SubDEdgeChain::OrientEdgesIntoEdgeChains ( const ON_SimpleArray< const ON_SubDEdge * > &  edges,
ON_SimpleArray< ON_SubDEdgePtr > &  edge_chains 
)
static

Description: Orient edges[] into edge chains preserving the order of edges[]. Returns: Number of chains in edge_chains[].

◆ OrientEdgesIntoEdgeChains() [2/3]

static unsigned int ON_SubDEdgeChain::OrientEdgesIntoEdgeChains ( const ON_SimpleArray< ON_SubDComponentPtr > &  edges,
ON_SimpleArray< ON_SubDEdgePtr > &  edge_chains 
)
static

Description: Orient edges[] into edge chains preserving the order of edges[]. Returns: Number of chains in edge_chains[].

◆ OrientEdgesIntoEdgeChains() [3/3]

static unsigned int ON_SubDEdgeChain::OrientEdgesIntoEdgeChains ( const ON_SubD subd,
const ON_SimpleArray< ON_COMPONENT_INDEX > &  edges,
ON_SimpleArray< ON_SubDEdgePtr > &  edge_chains 
)
static

Description: Orient edges[] into edge chains preserving the order of edges[]. Returns: Number of chains in edge_chains[].

◆ PersistentSubDId()

const ON_UUID ON_SubDEdgeChain::PersistentSubDId ( ) const

Returns: The persistent id of the parent subd object. If the context is an ONX_Model, then the persistent id is the ON_ModelGeometryComponent.Id(). If the context is a CRhinoDoc, then the persistent id is CRhinoObject.ModelObjectId().

◆ Read()

bool ON_SubDEdgeChain::Read ( class ON_BinaryArchive archive)

◆ RemoveEdges()

unsigned int ON_SubDEdgeChain::RemoveEdges ( const ON_SubDEdge first_edge,
const ON_SubDEdge last_edge 
)

◆ Reverse()

void ON_SubDEdgeChain::Reverse ( )

◆ ReverseEdgeChain() [1/2]

static void ON_SubDEdgeChain::ReverseEdgeChain ( ON_SimpleArray< ON_SubDEdgePtr > &  edge_chain)
static

Description: Reverse the orientation of the elements and the order of the elements in the edge_chain[] array. Parameters: edge_chain - [in/out]

◆ ReverseEdgeChain() [2/2]

static void ON_SubDEdgeChain::ReverseEdgeChain ( ON_SubDEdgePtr edge_chain,
size_t  edge_count 
)
static

Description: Reverse the orientation of the elements and the order of the elements in the edge_chain[] array. Parameters: edge_count - [in] Number of elements in edge_chain[] edge_chain - [in/out]

◆ SetPersistentEdgeIdsFromRuntimeEdgePtrs()

bool ON_SubDEdgeChain::SetPersistentEdgeIdsFromRuntimeEdgePtrs ( ) const

◆ SetRuntimeEdgePtrsFromPersistentSubD()

bool ON_SubDEdgeChain::SetRuntimeEdgePtrsFromPersistentSubD ( ON_UUID  persistent_subd_id,
ON_SubDRef  persistent_subd_ref 
)

Description: In situations where this edge chain is being read from a 3dm archive, or a similar serialization context, this function uses the saved edge id information to initialize the runtime ON_SubDEdgePtr information. Parameters: persistent_subd_id - [in] This id is passed to insure it matches the saved persistent_subd_id. The source of the id depends on the context of the model managing the subd. If that context is an ONX_Model, then the persistent id is the ON_ModelGeometryComponent.Id(). If that context is a CRhinoDoc, then the persistent id is CRhinoObject.ModelObjectId(). Returns: True if successful. False if not successful.

◆ SetStatusCheck()

void ON_SubDEdgeChain::SetStatusCheck ( bool  bEnableStatusCheck,
ON_ComponentStatus  status_check_pass,
ON_ComponentStatus  status_check_fail 
)

◆ SortEdgesIntoEdgeChains() [1/8]

static unsigned int ON_SubDEdgeChain::SortEdgesIntoEdgeChains ( const ON_SimpleArray< const ON_SubDEdge * > &  unsorted_edges,
ON_SimpleArray< ON_SubDEdgePtr > &  sorted_edges 
)
static

Description: Unconditionally sort edges into chains.

Parameters: unsorted_edges - [in] If unsorted_edges[] contains three or more edges that share a common vertex, no edge chain will pass through that vertex.

sorted_edges - [out] The sorted_edges[] has the edges grouped into edge chains. A value of ON_SubDEdgePtr::Null is at the end of every chain including the last chain.

In an edge chain subsequent edges share a common vertex; i.e. sorted_edges[i].RelativeVertex(1) == sorted_edges[i+1].RelativeVertex(0). Returns: Number of chains in edge_chains[]. Remarks: This version of SortEdgesIntoEdgeChains() uses MarkBits() on the edges and vertices in unsorted_edges[]. The output values of MarkBits() on these components are zero. Multiple threads may not simultaneously use any SubD tools on that rely on markbits on the same ON_SubD.

◆ SortEdgesIntoEdgeChains() [2/8]

static unsigned int ON_SubDEdgeChain::SortEdgesIntoEdgeChains ( const ON_SimpleArray< const ON_SubDEdge * > &  unsorted_edges,
unsigned int  minimum_chain_length,
ON_SimpleArray< ON_SubDEdgePtr > &  edge_chains 
)
static

Description: Sort edges into a chains

Parameters: unsorted_edges - [in] To sort an array in place, pass the same array as both parameters. If unsorted_edges[] contains three or more edges that share a common vertex, then all of the edges that share that vertex are ignored. The edges can be from one or more SubDs.

unsigned int minimum_chain_length - [in] minimum number of edges to consider for a chain.

edge_chains - [out] The edge_chains[] has the edges grouped into edge chains.

In an edge chain subsequent edges share a common vertex; i.e. edge_chains[i].RelativeVertex(1) == edge_chains[i+1].RelativeVertex(0).

When edge_chains[i].RelativeVertex(1) != edge_chains[i+1].RelativeVertex(0), a chain ends at edge_chains[i] and another begins at edge_chains[i+1].

The first edge in every chain has the same orientation as the input edge from edge_chains[].

Returns: Number of chains in edge_chains[].

Remarks: When the orientation of the input edges is not intentionally set, the versions of SortEdgesIntoEdgeChains() above without a minimum_chain_length variable are a better choice.

◆ SortEdgesIntoEdgeChains() [3/8]

static unsigned int ON_SubDEdgeChain::SortEdgesIntoEdgeChains ( const ON_SimpleArray< ON_SubDComponentPtr > &  unsorted_edges,
ON_SimpleArray< ON_SubDEdgePtr > &  sorted_edges 
)
static

Description: Unconditionally sort edges into chains.

Parameters: unsorted_edges - [in] If unsorted_edges[] contains three or more edges that share a common vertex, no edge chain will pass through that vertex.

sorted_edges - [out] The sorted_edges[] has the edges grouped into edge chains. A value of ON_SubDEdgePtr::Null is at the end of every chain including the last chain.

In an edge chain subsequent edges share a common vertex; i.e. sorted_edges[i].RelativeVertex(1) == sorted_edges[i+1].RelativeVertex(0). Returns: Number of chains in edge_chains[]. Remarks: This version of SortEdgesIntoEdgeChains() uses MarkBits() on the edges and vertices in unsorted_edges[]. The output value of MarkBits() on these components is zero. Multiple threads may not simultaneously use any SubD tools on that rely on markbits on the same ON_SubD.

◆ SortEdgesIntoEdgeChains() [4/8]

static unsigned int ON_SubDEdgeChain::SortEdgesIntoEdgeChains ( const ON_SimpleArray< ON_SubDComponentPtr > &  unsorted_edges,
unsigned int  minimum_chain_length,
ON_SimpleArray< ON_SubDEdgePtr > &  sorted_edges 
)
static

Description: Sort edges into a chains

Parameters: unsorted_edges - [in] To sort an array in place, pass the same array as both parameters. If unsorted_edges[] contains three or more edges that share a common vertex, then all of the edges that share that vertex are ignored. The edges can be from one or more SubDs.

unsigned int minimum_chain_length - [in] minimum number of edges to consider for a chain.

edge_chains - [out] The edge_chains[] has the edges grouped into edge chains.

In an edge chain subsequent edges share a common vertex; i.e. edge_chains[i].RelativeVertex(1) == edge_chains[i+1].RelativeVertex(0).

When edge_chains[i].RelativeVertex(1) != edge_chains[i+1].RelativeVertex(0), a chain ends at edge_chains[i] and another begins at edge_chains[i+1].

The first edge in every chain has the same orientation as the input edge from edge_chains[].

Returns: Number of chains in edge_chains[].

Remarks: When the orientation of the input edges is not intentionally set, the versions of SortEdgesIntoEdgeChains() above without a minimum_chain_length variable are a better choice.

◆ SortEdgesIntoEdgeChains() [5/8]

static unsigned int ON_SubDEdgeChain::SortEdgesIntoEdgeChains ( const ON_SimpleArray< ON_SubDEdgePtr > &  unsorted_edges,
ON_SimpleArray< ON_SubDEdgePtr > &  sorted_edges 
)
static

Edge chain tools Description: Unconditionally sort edges into chains.

Parameters: unsorted_edges - [in] If unsorted_edges[] contains three or more edges that share a common vertex, no edge chain will pass through that vertex. To sort an array in place, pass the same array as both parameters.

sorted_edges - [out] The sorted_edges[] has the edges grouped into edge chains. A value of ON_SubDEdgePtr::Null is at the end of every chain including the last chain.

In an edge chain subsequent edges share a common vertex; i.e. sorted_edges[i].RelativeVertex(1) == sorted_edges[i+1].RelativeVertex(0). Returns: Number of chains in edge_chains[]. Remarks: This version of SortEdgesIntoEdgeChains() uses MarkBits() on the edges and vertices in unsorted_edges[]. The output values of MarkBits() on these components are zero. Multiple threads may not simultaneously use any SubD tools on that rely on markbits on the same ON_SubD.

◆ SortEdgesIntoEdgeChains() [6/8]

static unsigned int ON_SubDEdgeChain::SortEdgesIntoEdgeChains ( const ON_SimpleArray< ON_SubDEdgePtr > &  unsorted_edges,
unsigned int  minimum_chain_length,
ON_SimpleArray< ON_SubDEdgePtr > &  edge_chains 
)
static

Description: Sort edges into a chains

Parameters: unsorted_edges - [in] To sort an array in place, pass the same array as both parameters. If unsorted_edges[] contains three or more edges that share a common vertex, then all of the edges that share that vertex are ignored. The edges can be from one or more SubDs.

unsigned int minimum_chain_length - [in] minimum number of edges to consider for a chain.

edge_chains - [out] The edge_chains[] has the edges grouped into edge chains.

In an edge chain subsequent edges share a common vertex; i.e. edge_chains[i].RelativeVertex(1) == edge_chains[i+1].RelativeVertex(0).

When edge_chains[i].RelativeVertex(1) != edge_chains[i+1].RelativeVertex(0), a chain ends at edge_chains[i] and another begins at edge_chains[i+1].

Reasonnable effort is made to keep the first edge in every chain with the same orientation as the input edge from edge_chains[]. However, this is not possible in every case, for example if the input is two edges sharing the same starting vertex.

NB: Reasonnable effort is made to keep the corner vertices on the exterior of the chains, however some chains will have corners in their interior, especially closed chains.

Returns: Number of chains in edge_chains[].

Remarks: When the orientation of the input edges is not intentionally set, the versions of SortEdgesIntoEdgeChains() above without a minimum_chain_length variable are a better choice.

◆ SortEdgesIntoEdgeChains() [7/8]

static unsigned int ON_SubDEdgeChain::SortEdgesIntoEdgeChains ( const ON_SubD subd,
const ON_SimpleArray< ON_COMPONENT_INDEX > &  unsorted_edges,
ON_SimpleArray< ON_SubDEdgePtr > &  sorted_edges 
)
static

Description: Unconditionally sort edges into chains.

Parameters: unsorted_edges - [in] If unsorted_edges[] contains three or more edges that share a common vertex, no edge chain will pass through that vertex.

sorted_edges - [out] The sorted_edges[] has the edges grouped into edge chains. A value of ON_SubDEdgePtr::Null is at the end of every chain including the last chain.

In an edge chain subsequent edges share a common vertex; i.e. sorted_edges[i].RelativeVertex(1) == sorted_edges[i+1].RelativeVertex(0). Returns: Number of chains in edge_chains[]. Remarks: This version of SortEdgesIntoEdgeChains() uses MarkBits() on the edges and vertices in unsorted_edges[]. The output value of MarkBits() on these components is zero. Multiple threads may not simultaneously use any SubD tools on that rely on markbits on the same ON_SubD.

◆ SortEdgesIntoEdgeChains() [8/8]

static unsigned int ON_SubDEdgeChain::SortEdgesIntoEdgeChains ( const ON_SubD subd,
const ON_SimpleArray< ON_COMPONENT_INDEX > &  unsorted_edges,
unsigned int  minimum_chain_length,
ON_SimpleArray< ON_SubDEdgePtr > &  edge_chains 
)
static

Description: Sort edges into a chains

Parameters: unsorted_edges - [in] To sort an array in place, pass the same array as both parameters. If unsorted_edges[] contains three or more edges that share a common vertex, then all of the edges that share that vertex are ignored. The edges can be from one or more SubDs.

unsigned int minimum_chain_length - [in] minimum number of edges to consider for a chain.

edge_chains - [out] The edge_chains[] has the edges grouped into edge chains.

In an edge chain subsequent edges share a common vertex; i.e. edge_chains[i].RelativeVertex(1) == edge_chains[i+1].RelativeVertex(0).

When edge_chains[i].RelativeVertex(1) != edge_chains[i+1].RelativeVertex(0), a chain ends at edge_chains[i] and another begins at edge_chains[i+1].

The first edge in every chain has the same orientation as the input edge from edge_chains[].

Returns: Number of chains in edge_chains[].

Remarks: When the orientation of the input edges is not intentionally set, the versions of SortEdgesIntoEdgeChains() above without a minimum_chain_length variable are a better choice.

◆ StatusCheck()

bool ON_SubDEdgeChain::StatusCheck ( const ON_SubDEdge edge) const

◆ StatusCheckEnabled()

bool ON_SubDEdgeChain::StatusCheckEnabled ( ) const

◆ StatusCheckFail()

const ON_ComponentStatus ON_SubDEdgeChain::StatusCheckFail ( ) const

◆ StatusCheckPass()

const ON_ComponentStatus ON_SubDEdgeChain::StatusCheckPass ( ) const

◆ SubD()

const ON_SubD& ON_SubDEdgeChain::SubD ( ) const

◆ SubDRef()

const ON_SubDRef ON_SubDEdgeChain::SubDRef ( ) const

◆ Vertex()

const ON_SubDVertex* ON_SubDEdgeChain::Vertex ( int  vertex_index) const

◆ Write()

bool ON_SubDEdgeChain::Write ( class ON_BinaryArchive archive) const

Member Data Documentation

◆ Empty

const ON_SubDEdgeChain ON_SubDEdgeChain::Empty
static