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

#include <opennurbs_subd_data.h>

Public Member Functions

 ON_SubDQuadNeighborhood ()=default
 
 ~ON_SubDQuadNeighborhood ()
 
const ON_SubDFaceCenterQuad () const
 
const ON_SubDVertexCenterVertex (int vi) const
 
const ON_SubDFaceCornerFace (unsigned int fvi) const
 
unsigned int ExtraordinaryCenterVertexIndex (ON_SubDVertexTag vertex_tag_filter, unsigned int minimum_edge_count_filter) const
 
unsigned int GetLimitSubSurfaceMultiPatchCV (bool bEnableApproximatePatch, double srf_cv[5][5][3], ON_SubDSurfaceNurbsFragment::BispanAccuracy patch_type[4])
 
bool GetLimitSubSurfaceSinglePatchCV (unsigned int fvi, double srf_cv[4][4][3])
 
bool GetLimitSurfaceCV (double *srf_cv, unsigned int srf_cv_grid_size) const
 
bool IsSet () const
 
bool IsValid () const
 
bool Set (const ON_SubDFace *center_quad_face)
 
const ON_SubDFaceSideFace (unsigned int fei) const
 
bool Subdivide (const unsigned int q0fvi, ON_SubD_FixedSizeHeap &fsh, class ON_SubDQuadNeighborhood *q1ft) const
 

Static Public Member Functions

static const ON_2dex CenterVertexDex (int vi)
 
static void Clear (ON_SubDQuadNeighborhood *subd_quad_nbd, bool bRetainFixedSizeHeap)
 
static ON_2dex DeltaDex (unsigned int corner_index, int delta_i, int delta_j)
 
static bool GetLimitPoint (const ON_SubDVertex *vertex, double limitP[3], double limitN[3])
 
static bool GetSubdivisionPoint (const ON_SubDEdge *edge, double P1[3])
 
static bool GetSubdivisionPoint (const ON_SubDFace *face, double P1[3])
 
static bool GetSubdivisionPoint (const ON_SubDVertex *vertex, double P1[3])
 
static ON_2dex GridDex (unsigned int grid_size, unsigned int corner_index, unsigned int i, unsigned int j)
 

Public Attributes

bool m_bBoundaryCrease [4] = {}
 
bool m_bExactQuadrantPatch [4] = {}
 
bool m_bExtraordinaryCornerVertex [4] = {}
 
bool m_bIsCubicPatch = false
 
unsigned char m_boundary_crease_count = 0
 
const ON_SubDEdgem_center_edges [4] = {}
 
unsigned char m_current_subdivision_level = 0
 current subdivision level of contents More...
 
const ON_SubDEdgem_edge_grid [4][2] = {}
 
unsigned char m_exact_quadrant_patch_count = 0
 
unsigned char m_extraordinary_corner_vertex_count = 0
 
const ON_SubDFacem_face_grid [3][3] = {}
 
class ON_SubD_FixedSizeHeapm_fsh = nullptr
 If not null, the storage for the referenced subd information is from m_fsh. More...
 
unsigned char m_initial_subdivision_level = 0
 Subdivsion level of the quad from the original SubD. (When the original SubD face is an n-gon, m_initial_subdivision_level=1) More...
 
unsigned char m_sharp_edge_count = 0
 m_sharp_edge_count = number of sharp edges in the quad boundary and m_edge_grid[4][2]
More...
 
double m_srf_cv1 [5][5][3]
 level 1 subdivision control points More...
 
const ON_SubDVertexm_vertex_grid [4][4] = {}
 vertex net m_quad_face corners = ([1][1], [2][1], [2][2], [1][2]) More...
 

Detailed Description

ON_SubDQuadNeighborhood

Constructor & Destructor Documentation

◆ ON_SubDQuadNeighborhood()

ON_SubDQuadNeighborhood::ON_SubDQuadNeighborhood ( )
default

◆ ~ON_SubDQuadNeighborhood()

ON_SubDQuadNeighborhood::~ON_SubDQuadNeighborhood ( )

Member Function Documentation

◆ CenterQuad()

const ON_SubDFace* ON_SubDQuadNeighborhood::CenterQuad ( ) const

Returns: The center quad face m_face[1][1].

◆ CenterVertex()

const ON_SubDVertex* ON_SubDQuadNeighborhood::CenterVertex ( int  vi) const

◆ CenterVertexDex()

static const ON_2dex ON_SubDQuadNeighborhood::CenterVertexDex ( int  vi)
static

◆ Clear()

static void ON_SubDQuadNeighborhood::Clear ( ON_SubDQuadNeighborhood subd_quad_nbd,
bool  bRetainFixedSizeHeap 
)
static

Description: Clear current settings so the ON_SubDQuadNeighborhood can be reused. Parameters: subd_quad_nbd - [in/out] ON_SubDQuadNeighborhood to clear. bRetainFixedSizeHeap - [in] The m_fsh heap is always reset. When bRetainFixedSizeHeap is true, m_fsh is not set to nullptr.

◆ CornerFace()

const ON_SubDFace* ON_SubDQuadNeighborhood::CornerFace ( unsigned int  fvi) const

Parameters: fei - [in] center quad face vertex index (0 to 3) Returns: A pointer to the neighbor face opposite m_face[1][1]->Vertex(fvi). This face will be null if the vertex valence is not 4 or any of its edges are creases. m_face[0][0] = the neighbor diagonal from m_face[1][1]->Vertex(0) m_face[0][2] = the neighbor diagonal from m_face[1][1]->Vertex(1) m_face[2][2] = the neighbor diagonal from m_face[1][1]->Vertex(2) m_face[2][0] = the neighbor diagonal from m_face[1][1]->Vertex(3)

◆ DeltaDex()

static ON_2dex ON_SubDQuadNeighborhood::DeltaDex ( unsigned int  corner_index,
int  delta_i,
int  delta_j 
)
static

◆ ExtraordinaryCenterVertexIndex()

unsigned int ON_SubDQuadNeighborhood::ExtraordinaryCenterVertexIndex ( ON_SubDVertexTag  vertex_tag_filter,
unsigned int  minimum_edge_count_filter 
) const

Parameters: vertex_tag_filter - [in] If vertex_tag_filter is not ON_SubDVertexTag::Unset, then the indexed vertex must have the specified tag. minimum_edge_count_filter - [in] The index vertex must have at least this many edges. Returns: 0: m_vertex_grid[1][1] is the unique extraordinary center quad vertex 1: m_vertex_grid[2][1] is the unique extraordinary center quad vertex 2: m_vertex_grid[2][2] is the unique extraordinary center quad vertex 3: m_vertex_grid[3][2] is the unique extraordinary center quad vertex ON_UNSET_UINT_INDEX (otherwise)

◆ GetLimitPoint()

static bool ON_SubDQuadNeighborhood::GetLimitPoint ( const ON_SubDVertex vertex,
double  limitP[3],
double  limitN[3] 
)
static

◆ GetLimitSubSurfaceMultiPatchCV()

unsigned int ON_SubDQuadNeighborhood::GetLimitSubSurfaceMultiPatchCV ( bool  bEnableApproximatePatch,
double  srf_cv[5][5][3],
ON_SubDSurfaceNurbsFragment::BispanAccuracy  patch_type[4] 
)

Parameters: bEnableApproximatePatch - [in] If true, an approximate patches may be generated. This parameter should be true only when all permitted subdivisions have been performed and a minimum of 2 subdivisions have been performed. This insures all faces are quads and each quad has at most one extraordinary vertex and the approximate patches will have C2 continuity with any neighboring exact patches. srf_cv[5][5] CVs for a uniform cubic NURBS patch. If a patch cv srf_cv[j][j] does not exist or cannot be set, then all three coordinates of srf_cv[j][j] are set to ON_UNSET_VALUE. patch_type - [out] patch_type[0] the type of cubic bispan for the 4x4 grid (srf_cv[0][0] ... srf_cv[3][3]) patch_type[1] the type of cubic bispan for the 4x4 grid (srf_cv[1][0] ... srf_cv[4][3]) patch_type[2] the type of cubic bispan for the 4x4 grid (srf_cv[1][1] ... srf_cv[4][4]) patch_type[3] the type of cubic bispan for the 4x4 grid (srf_cv[0][1] ... srf_cv[3][4]) Returns: 0 - 4: Number of bispans set in srf_cv[5][5]

◆ GetLimitSubSurfaceSinglePatchCV()

bool ON_SubDQuadNeighborhood::GetLimitSubSurfaceSinglePatchCV ( unsigned int  fvi,
double  srf_cv[4][4][3] 
)

Description: Get the limit sub surface exact patch for the specified corner. Returns: true when srf_cv are set to a the CVs for a bicubic uniform cubic NURBS bispan patch

◆ GetLimitSurfaceCV()

bool ON_SubDQuadNeighborhood::GetLimitSurfaceCV ( double *  srf_cv,
unsigned int  srf_cv_grid_size 
) const

Description: Get the limit surface for the entire quad

Parameters
srf_cvdouble srf_cv[4][4][3]
srf_cv_grid_size4 or 5

◆ GetSubdivisionPoint() [1/3]

static bool ON_SubDQuadNeighborhood::GetSubdivisionPoint ( const ON_SubDEdge edge,
double  P1[3] 
)
static

◆ GetSubdivisionPoint() [2/3]

static bool ON_SubDQuadNeighborhood::GetSubdivisionPoint ( const ON_SubDFace face,
double  P1[3] 
)
static

◆ GetSubdivisionPoint() [3/3]

static bool ON_SubDQuadNeighborhood::GetSubdivisionPoint ( const ON_SubDVertex vertex,
double  P1[3] 
)
static

◆ GridDex()

static ON_2dex ON_SubDQuadNeighborhood::GridDex ( unsigned int  grid_size,
unsigned int  corner_index,
unsigned int  i,
unsigned int  j 
)
static

◆ IsSet()

bool ON_SubDQuadNeighborhood::IsSet ( ) const
inline

◆ IsValid()

bool ON_SubDQuadNeighborhood::IsValid ( ) const

◆ Set()

bool ON_SubDQuadNeighborhood::Set ( const ON_SubDFace center_quad_face)

◆ SideFace()

const ON_SubDFace* ON_SubDQuadNeighborhood::SideFace ( unsigned int  fei) const

Parameters: fei - [in] center quad face edge index (0 to 3) Returns: A pointer to the neighbor face across m_face[1][1]->Edge(fei) This face will be null if the edge is a crease or has 2 != m_face_count m_face[0][1] = the neighbor across m_face[1][1]->Edge(0) or null if the Edge(0) is a crease. m_face[1][2] = the neighbor across m_face[1][1]->Edge(1) or null if the Edge(1) is a crease m_face[2][1] = the neighbor across m_face[1][1]->Edge(2) or null if the Edge(2) is a crease m_face[1][0] = the neighbor across m_face[1][1]->Edge(3) or null if the Edge(3) is a crease

◆ Subdivide()

bool ON_SubDQuadNeighborhood::Subdivide ( const unsigned int  q0fvi,
ON_SubD_FixedSizeHeap fsh,
class ON_SubDQuadNeighborhood q1ft 
) const

Description: Apply a single iteration of the built-in quad subdivision algorithm to this.

Member Data Documentation

◆ m_bBoundaryCrease

bool ON_SubDQuadNeighborhood::m_bBoundaryCrease[4] = {}

◆ m_bExactQuadrantPatch

bool ON_SubDQuadNeighborhood::m_bExactQuadrantPatch[4] = {}

◆ m_bExtraordinaryCornerVertex

bool ON_SubDQuadNeighborhood::m_bExtraordinaryCornerVertex[4] = {}

m_bExtraordinaryCornerVertex[] = true if the corresponding corner vertex of the center quad is extraordinary.

◆ m_bIsCubicPatch

bool ON_SubDQuadNeighborhood::m_bIsCubicPatch = false

true if the limit surface of the center quad is a smooth bi-cubic surface with CVs at the m_vertex_grid[][] locations.

◆ m_boundary_crease_count

unsigned char ON_SubDQuadNeighborhood::m_boundary_crease_count = 0

m_bBoundaryCrease[] = true if the corresponding m_center_edges[] is a crease AND neither end vertex is a dart.

◆ m_center_edges

const ON_SubDEdge* ON_SubDQuadNeighborhood::m_center_edges[4] = {}

edges of center face; m_center_edge[0] connects m_vertex_grid[1][1] and m_vertex_grid[2][1] m_center_edge[1] connects m_vertex_grid[2][1] and m_vertex_grid[2][2] m_center_edge[2] connects m_vertex_grid[2][2] and m_vertex_grid[1][2] m_center_edge[3] connects m_vertex_grid[1][2] and m_vertex_grid[1][1]

◆ m_current_subdivision_level

unsigned char ON_SubDQuadNeighborhood::m_current_subdivision_level = 0

current subdivision level of contents

◆ m_edge_grid

const ON_SubDEdge* ON_SubDQuadNeighborhood::m_edge_grid[4][2] = {}

◆ m_exact_quadrant_patch_count

unsigned char ON_SubDQuadNeighborhood::m_exact_quadrant_patch_count = 0

m_bExactCubicPatchCorner[] = true if the sub 4x4 grid of subdivision points for the corresponding quadrant can be used to create an exact quadrant cubic patch.

◆ m_extraordinary_corner_vertex_count

unsigned char ON_SubDQuadNeighborhood::m_extraordinary_corner_vertex_count = 0

m_face_grid[1][1] is extraordinary and interpolation through the limit point will eventually be required to get an approximate cubic patch or an exact quad mesh vertex.

◆ m_face_grid

const ON_SubDFace* ON_SubDQuadNeighborhood::m_face_grid[3][3] = {}

m_face[][] is a 3x3 grid of faces. Center face m_face[1][1] is the "central" quad face. Side faces Side faces are null if the edge is a crease or has 1 == m_face_count. m_face[1][0] = the neighbor across m_center_edges[0] m_face[2][1] = the neighbor across m_center_edges[1] m_face[1][2] = the neighbor across m_center_edges[2] m_face[0][1] = the neighbor across m_center_edges[3]

◆ m_fsh

class ON_SubD_FixedSizeHeap* ON_SubDQuadNeighborhood::m_fsh = nullptr

If not null, the storage for the referenced subd information is from m_fsh.

◆ m_initial_subdivision_level

unsigned char ON_SubDQuadNeighborhood::m_initial_subdivision_level = 0

Subdivsion level of the quad from the original SubD. (When the original SubD face is an n-gon, m_initial_subdivision_level=1)

◆ m_sharp_edge_count

unsigned char ON_SubDQuadNeighborhood::m_sharp_edge_count = 0

m_sharp_edge_count = number of sharp edges in the quad boundary and m_edge_grid[4][2]

◆ m_srf_cv1

double ON_SubDQuadNeighborhood::m_srf_cv1[5][5][3]

level 1 subdivision control points

◆ m_vertex_grid

const ON_SubDVertex* ON_SubDQuadNeighborhood::m_vertex_grid[4][4] = {}

vertex net m_quad_face corners = ([1][1], [2][1], [2][2], [1][2])