Rhino C++ API  7.18
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
ON_SubDMeshFragment Class Reference

#include <opennurbs_subd.h>

Inheritance diagram for ON_SubDMeshFragment:
ON_SubDManagedMeshFragment

Public Types

enum  : unsigned int { MaximumSideSegmentCount = (1U << ON_SubDDisplayParameters::MaximumDensity) }
 
enum  : unsigned { MaximumVertexCount = 0x1000 }
 

Public Member Functions

const ON_BoundingBox BoundingBox (ON_SubDComponentLocation subd_appearance) const
 
const ON_Plane CenterFrame () const
 
const ON_3dVector CenterNormal () const
 
const ON_3dPoint CenterPoint () const
 
const ON_3dPoint CenterTextureCoordinate () const
 
const ON_ColorColorArray (ON_SubDComponentLocation subd_appearance) const
 
unsigned ColorArrayCount (ON_SubDComponentLocation subd_appearance) const
 
size_t ColorArrayStride (ON_SubDComponentLocation subd_appearance) const
 
unsigned int ColorCapacity () const
 
unsigned int ColorCount () const
 
bool ColorsExist () const
 
const ON_BoundingBox ControlNetQuadBoundingBox () const
 
const ON_SubDMeshFragment ControlNetQuadFragmentForExperts () const
 
const ON_3dPoint ControlNetQuadPoint (bool bGridOrder, unsigned point_index) const
 
bool CopyFrom (const ON_SubDMeshFragment &src_fragment)
 
bool CopyFrom (const ON_SubDMeshFragment &src_fragment, unsigned int display_density)
 
const ON_Color CornerColor (unsigned int grid_corner_index) const
 
const ON_SurfaceCurvature CornerCurvature (unsigned int grid_corner_index) const
 
const ON_Plane CornerFrame (unsigned int grid_corner_index) const
 
const ON_3dVector CornerNormal (unsigned int grid_corner_index) const
 
const ON_3dPoint CornerPoint (unsigned int grid_corner_index) const
 
const ON_SurfaceCurvatureCurvatureArray (ON_SubDComponentLocation subd_appearance) const
 
unsigned CurvatureArrayCount (ON_SubDComponentLocation subd_appearance) const
 
unsigned int CurvatureCapacity () const
 
unsigned int CurvatureCount () const
 
bool CurvaturesExist () const
 
bool DeleteManagedArrays ()
 
void DeleteManagedCurvatureCapacity () const
 
void Dump (ON_TextLog &text_log) const
 
unsigned int FaceCornerIndex () const
 
unsigned int FaceFragmentCount () const
 
const ON_SubDMeshFragmentFirstFaceFragment () const
 
bool GetControlNetQuad (bool bGridOrder, ON_3dPoint quad_points[4], ON_3dVector &quad_normal) const
 
unsigned int GetFaceFragments (const ON_SubDMeshFragment **fragments, size_t fragments_capacity) const
 
unsigned int GetFaceFragments (ON_SimpleArray< const ON_SubDMeshFragment * > &fragments) const
 
bool GetTextureCoordinteCorners (bool bGridOrder, ON_3dPoint texture_coordinate_corners[4]) const
 
const ON_SubDMeshFragmentGridGrid (ON_SubDComponentLocation subd_appearance) const
 
const bool HasValidPointAndNormalGrid () const
 
bool IsFaceCornerFragment () const
 
bool IsFullFaceFragment () const
 
const ON_SubDMeshFragmentLastFaceFragment () const
 
bool ManagedArrays () const
 
const ON_SubDMeshFragmentNextFaceFragment (bool bReturnFirstFromLast) const
 
const double * NormalArray (ON_SubDComponentLocation subd_appearance) const
 
unsigned NormalArrayCount (ON_SubDComponentLocation subd_appearance) const
 
size_t NormalArrayStride (ON_SubDComponentLocation subd_appearance) const
 
unsigned int NormalCapacity () const
 
unsigned int NormalCount () const
 
const ON_2dPoint PackRectCenter () const
 
const ON_2dPoint PackRectCorner (unsigned int grid_corner_index) const
 
const double * PointArray (ON_SubDComponentLocation subd_appearance) const
 
unsigned PointArrayCount (ON_SubDComponentLocation subd_appearance) const
 
size_t PointArrayStride (ON_SubDComponentLocation subd_appearance) const
 
unsigned int PointCapacity () const
 
unsigned int PointCount () const
 
const ON_SubDMeshFragmentPreviousFaceFragment (bool bReturnLastFromFirstFirst) const
 
bool ReserveManagedCurvatureCapacity () const
 
bool ReserveManagedVertexCapacity (size_t vertex_capacity)
 
bool SetColors (ON_Color color) const
 
void SetColorsExist (bool bSetColorsExist) const
 
bool SetColorsFromCallback (const ON_MappingTag &fragment_colors_mapping_tag, const ON_SubD &subd, ON__UINT_PTR callback_context, const ON_Color(*color_callback)(ON__UINT_PTR callback_context, const ON_MappingTag &mapping_tag, const ON_SubD &subd, ON_SubDComponentPtr cptr, const ON_3dPoint &P, const ON_3dVector &N, const ON_3dPoint &T, const ON_SurfaceCurvature &K)) const
 
void SetControlNetQuad (bool bGridOrder, const ON_3dPoint quad_points[4], ON_3dVector quad_normal)
 
void SetCurvaturesExist (bool bSetCurvaturesExist) const
 
void SetNgonFaceFragmentPackRectCorners (bool bGridOrder, const ON_2dPoint face_pack_rect_corners[4], ON_2dVector face_pack_rect_size, ON_2udex ngon_grid_size, ON_2dVector ngon_sub_pack_rect_size, ON_2dVector ngon_sub_pack_rect_delta)
 
void SetNgonFaceFragmentTextureCoordinateCorners (bool bGridOrder, const ON_3dPoint face_texture_coordinate_corners[4], ON_2dVector face_pack_rect_size, ON_2udex ngon_grid_size, ON_2dVector ngon_sub_pack_rect_size, ON_2dVector ngon_sub_pack_rect_delta, bool bSetTextureCoordinates) const
 
void SetPackedTextureCoordinates () const
 
void SetPackRectCornersForExperts (bool bGridOrder, const ON_2dPoint fragment_pack_rect_corners[4])
 
void SetQuadOr3gonFaceFragmentPackRectCorners (bool bGridOrder, const ON_2dPoint face_pack_rect_corners[4])
 
void SetQuadOr3gonFaceFragmentTextureCoordinateCorners (bool bGridOrder, const ON_3dPoint face_texture_coordinate_corners[4], bool bSetTextureCoordinates) const
 
void SetTextureCoordinateCornersForExperts (bool bGridOrder, const ON_3dPoint fragment_texture_coordinate_corners[4], bool bSetTextureCoordinates) const
 
void SetTextureCoordinatesExist (bool bTextureCoordinatesExist) const
 
void SetTextureCoordinatesFromCorners () const
 
bool SetUnmanagedVertexCapacity (size_t vertex_capacity)
 
void SetUnpackedTextureCoordinates () const
 
bool SetVertexCount (size_t vertex_count)
 
bool SetVertexTextureCoordinate (ON_2udex grid2dex, ON_3dPoint texture_coordinate) const
 
bool SetVertexTextureCoordinate (unsigned grid2dex_i, unsigned grid2dex_j, ON_3dPoint texture_coordinate) const
 
bool SetVertexTextureCoordinate (unsigned grid_point_index, ON_3dPoint texture_coordinate) const
 
const ON_Plane SideFrame (unsigned int grid_side_index) const
 
const ON_3dVector SideNormal (unsigned int grid_side_index) const
 
const ON_3dPoint SidePoint (unsigned int grid_side_index) const
 
ON_ComponentStatus Status () const
 
const class ON_SubDEdgeSubDEdge (unsigned int grid_side_index) const
 
const class ON_SubDEdgePtr SubDEdgePtr (unsigned int grid_side_index) const
 
const class ON_SubDFaceSubDFace () const
 
const class ON_SubDVertexSubDVertex (unsigned int grid_corner_index) const
 
const class ON_SubDVertexPtr SubDVertexPtr (unsigned int grid_corner_index) const
 
const ON_BoundingBox SurfaceBoundingBox () const
 
const double * TextureCoordinateArray (ON_SubDComponentLocation subd_appearance) const
 
unsigned TextureCoordinateArrayCount (ON_SubDComponentLocation subd_appearance) const
 
size_t TextureCoordinateArrayStride (ON_SubDComponentLocation subd_appearance) const
 
unsigned int TextureCoordinateCapacity () const
 
const ON_3dPoint TextureCoordinateCorner (unsigned int grid_corner_index) const
 
unsigned int TextureCoordinateCount () const
 
bool TextureCoordinatesExist () const
 
bool Transform (const ON_Xform &xform)
 
bool UnmanagedArrays () const
 
void UnsetControlNetQuad ()
 
unsigned VertexCapacity () const
 
unsigned VertexCount () const
 
const ON_3dVector VertexNormal (ON_2udex grid2dex) const
 
const ON_3dVector VertexNormal (unsigned grid2dex_i, unsigned grid2dex_j) const
 
const ON_3dVector VertexNormal (unsigned grid_point_index) const
 
const ON_3dPoint VertexPoint (ON_2udex grid2dex) const
 
const ON_3dPoint VertexPoint (unsigned grid2dex_i, unsigned grid2dex_j) const
 
const ON_3dPoint VertexPoint (unsigned grid_point_index) const
 
const ON_3dPoint VertexTextureCoordinate (ON_2udex grid2dex) const
 
const ON_3dPoint VertexTextureCoordinate (unsigned grid2dex_i, unsigned grid2dex_j) const
 
const ON_3dPoint VertexTextureCoordinate (unsigned grid_point_index) const
 
const ON_3dPoint VertexTextureCoordinateFromCorners (ON_2udex grid2dex) const
 
const ON_3dPoint VertexTextureCoordinateFromCorners (unsigned grid2dex_i, unsigned grid2dex_j) const
 
const ON_3dPoint VertexTextureCoordinateFromCorners (unsigned grid_point_index) const
 

Static Public Member Functions

static unsigned int DisplayDensityFromSideSegmentCount (unsigned int side_segment_count)
 
static unsigned int FaceCountFromDisplayDensity (unsigned int display_density)
 
static unsigned int FullFragmentMeshPointCountFromDensity (unsigned int mesh_density)
 
static unsigned int FullFragmentMeshQuadCountFromDensity (unsigned int mesh_density)
 
static bool Get3gonFaceFragmentPackRectCorners (bool bFaceGridOrder, const ON_2dPoint face_pack_rect_corners[4], unsigned int fragment_index, bool bFragmentGridOrder, ON_2dPoint fragment_pack_rect_corners[4])
 
static bool GetNgonFaceFragmentPackRectCorners (unsigned int ngon_edge_count, unsigned int ngon_fragment_index, bool bGridOrder, const ON_2dPoint face_pack_rect_corners[4], ON_2dVector face_pack_rect_size, ON_2udex ngon_grid_size, ON_2dVector ngon_sub_pack_rect_size, ON_2dVector ngon_sub_pack_rect_delta, ON_2dPoint fragment_pack_rect_corners[4])
 
static unsigned int HalfFragmentMeshPointCountFromDensity (unsigned int mesh_density)
 
static unsigned int HalfFragmentMeshQuadCountFromDensity (unsigned int mesh_density)
 
static unsigned int PointCountFromDisplayDensity (unsigned int display_density)
 
static unsigned int QuadGridPointCountFromSideCount (unsigned int side_segment_count)
 
static unsigned int QuadGridQuadCountFromSideCount (unsigned int side_segment_count)
 
static bool SealAdjacentSides (bool bTestNearEqual, bool bCopyNormals, const ON_SubDMeshFragment &src_fragment, unsigned int i0, unsigned int i1, ON_SubDMeshFragment &dst_fragment, unsigned int j0, unsigned int j1)
 
static bool SealNormals (bool bTestNearEqual, const double *src, double *dst)
 
static bool SealPoints (bool bTestNearEqual, const double *src, double *dst)
 
static unsigned int SidePointCountFromSideCount (unsigned int side_segment_count)
 
static unsigned int SideSegmentCountFromDisplayDensity (unsigned int display_density)
 
static bool SideSegmentCountIsValid (unsigned int side_segment_count)
 
static size_t SizeofFragment (unsigned int display_density, bool bCurvatureArray)
 

Public Attributes

const class ON_SubDFacem_face
 
unsigned short m_face_fragment_count
 Number of fragments that will be delivered for this face. More...
 
unsigned short m_face_fragment_index
 First fragment has index = 0. Last fragment has index = m_face_fragment_count-1. More...
 
unsigned short m_face_vertex_index [4]
 
ON_SubDMeshFragmentGrid m_grid
 Information to resolve m_P[], m_N[], and m_T[] into a grid of NxN quads. More...
 
double * m_N
 surface normals More...
 
size_t m_N_stride
 stride between normals for m_N[] as an array of 8 byte doubles (so 0 or >= 3) More...
 
ON_SubDMeshFragmentm_next_fragment
 
double * m_P
 surface points More...
 
size_t m_P_stride
 stride between points for m_P[] as an array of 8 byte doubles (so 0 or >= 3) More...
 
ON_SubDMeshFragmentm_prev_fragment
 
ON_BoundingBox m_surface_bbox
 3d bounding box of grid vertex points. More...
 
double * m_T
 
size_t m_T_stride
 stride between texture points for m_T[] as an array of 8 byte doubles (so 0 or >= 3) More...
 

Static Public Attributes

static const ON_SubDMeshFragment Empty
 Every field of ON_SubDMeshFragment::Empty is zero. More...
 

Friends

class ON_SubDHeap
 
class ON_SubDManagedMeshFragment
 
class ON_SubDMeshImpl
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : unsigned int
Enumerator
MaximumSideSegmentCount 

◆ anonymous enum

anonymous enum : unsigned

The mesh fragment is a grid of quads. There are m_side_count quad edges along each side of the tesselation, There are a total of m_side_count X m_side_count quads, and m_P_count = (m_side_count+1)*(m_side_count+1).

Enumerator
MaximumVertexCount 

64x64 grid of points

Member Function Documentation

◆ BoundingBox()

const ON_BoundingBox ON_SubDMeshFragment::BoundingBox ( ON_SubDComponentLocation  subd_appearance) const

◆ CenterFrame()

const ON_Plane ON_SubDMeshFragment::CenterFrame ( ) const

◆ CenterNormal()

const ON_3dVector ON_SubDMeshFragment::CenterNormal ( ) const

◆ CenterPoint()

const ON_3dPoint ON_SubDMeshFragment::CenterPoint ( ) const

Parameters: grid_side_index - [in] grid side N is between corner index N and corner index (N+1)%4. Returns: Limit surface location at the center of the grid side or ON_3dPoint::NanPoint if the fragment is empty. Remarks: For partial fragments (IsFaceCornerFragment() = true), grid_corner_index = 2 is the only corner that corresponds to a SubD vertex. For partial fragments (IsFaceCornerFragment() = true), grid_side_index = 1 and grid_side_index = 2 correspond to half of original SuD edges.

◆ CenterTextureCoordinate()

const ON_3dPoint ON_SubDMeshFragment::CenterTextureCoordinate ( ) const

◆ ColorArray()

const ON_Color* ON_SubDMeshFragment::ColorArray ( ON_SubDComponentLocation  subd_appearance) const

◆ ColorArrayCount()

unsigned ON_SubDMeshFragment::ColorArrayCount ( ON_SubDComponentLocation  subd_appearance) const

◆ ColorArrayStride()

size_t ON_SubDMeshFragment::ColorArrayStride ( ON_SubDComponentLocation  subd_appearance) const

◆ ColorCapacity()

unsigned int ON_SubDMeshFragment::ColorCapacity ( ) const

◆ ColorCount()

unsigned int ON_SubDMeshFragment::ColorCount ( ) const

Returns: If grid vertex colors are available, then VertexCount() is returned. Otherwise 0 is returned.

◆ ColorsExist()

bool ON_SubDMeshFragment::ColorsExist ( ) const

Returns: True if vertex color values are set on this fragment.

◆ ControlNetQuadBoundingBox()

const ON_BoundingBox ON_SubDMeshFragment::ControlNetQuadBoundingBox ( ) const

◆ ControlNetQuadFragmentForExperts()

const ON_SubDMeshFragment ON_SubDMeshFragment::ControlNetQuadFragmentForExperts ( ) const

Description: Create a one quad fragment with m_P = this->m_ctrlnetP[], m_P_stride = 3 m_N = this->m_ctrlnetN, m_N_stride = 0 m_T = this->m_ctrlnetT, m_T_stride = 3 NOTE WELL: 1) "this" must remain in scope and unchanged while the returned value is used because the returned value references memory in thism_ctrlnetX[] arrays. 2) The next/prev pointers on the returned fragment are copied from this, but the returned value is not reciprocally referenced by next/prev in the linked list. Returns: A control net quad fragment that can be used locally when the SubDAppearance is ON_SubDComponentLocation::ControlNet. The points, normals, and texture_coordinates of the returned fragment are the control net quad points, normals, and texture coordinates of this fragment. m_grid is a single quad grid.

◆ ControlNetQuadPoint()

const ON_3dPoint ON_SubDMeshFragment::ControlNetQuadPoint ( bool  bGridOrder,
unsigned  point_index 
) const

◆ CopyFrom() [1/2]

bool ON_SubDMeshFragment::CopyFrom ( const ON_SubDMeshFragment src_fragment)

No construction for performance reasons. If you require initialization, use = ON_SubDMeshFragment::Empty

ON_SubDMeshFragment() = default; ~ON_SubDMeshFragment() = default; ON_SubDMeshFragment(const ON_SubDMeshFragment&) = default; ON_SubDMeshFragment& operator=(const ON_SubDMeshFragment&) = default;

◆ CopyFrom() [2/2]

bool ON_SubDMeshFragment::CopyFrom ( const ON_SubDMeshFragment src_fragment,
unsigned int  display_density 
)

Parameters: src_fragment - [in] fragment to copy display_density - [in] The desired display density of the copy.

If display_density = ON_UNSET_UINT_INDEX, then this->m_P_capacity must be at least srf_fragment.m_P_count, all points are copied, and this->m_grid = srf_fragment.m_grid.

Otherwise, src_fragment must have enough points to provide the specified denisity and this must have enough point capacity to store the specified density.

this - [out] This must have a point capacity large enough to accomodate the requested display density.

◆ CornerColor()

const ON_Color ON_SubDMeshFragment::CornerColor ( unsigned int  grid_corner_index) const

Parameters: grid_corner_index - [in] 0, 1, 2, or 3 Returns: vertex color at the grid corner or ON_Color::UnsetColor if thre are not vertex colors. Remarks: For partial fragments (IsFaceCornerFragment() = true), grid_corner_index = 2 is the only corner that corresponds to a SubD vertex. For partial fragments (IsFaceCornerFragment() = true), grid_side_index = 1 and grid_side_index = 2 correspond to half of original SuD edges.

◆ CornerCurvature()

const ON_SurfaceCurvature ON_SubDMeshFragment::CornerCurvature ( unsigned int  grid_corner_index) const

Parameters: grid_corner_index - [in] 0, 1, 2, or 3 Returns: vertex surface curvature at the grid corner or ON_SurfaceCurvature::Nan if there are not vertex curvatures. Remarks: For partial fragments (IsFaceCornerFragment() = true), grid_corner_index = 2 is the only corner that corresponds to a SubD vertex. For partial fragments (IsFaceCornerFragment() = true), grid_side_index = 1 and grid_side_index = 2 correspond to half of original SuD edges.

◆ CornerFrame()

const ON_Plane ON_SubDMeshFragment::CornerFrame ( unsigned int  grid_corner_index) const

Parameters: grid_corner_index - [in] grid side N is between corner index N and corner index (N+1)%4. Returns: Limit surface frame at the grid corner or ON_3dPoint::NanPoint if the fragment is empty. Remarks: For partial fragments (IsFaceCornerFragment() = true), grid_corner_index = 2 is the only corner that corresponds to a SubD vertex. For partial fragments (IsFaceCornerFragment() = true), grid_side_index = 1 and grid_side_index = 2 correspond to half of original SuD edges.

◆ CornerNormal()

const ON_3dVector ON_SubDMeshFragment::CornerNormal ( unsigned int  grid_corner_index) const

Parameters: grid_corner_index - [in] 0, 1, 2, or 3 Returns: Limit surface normal at the grid corner or ON_3dPoint::NanPoint if the fragment is empty. Remarks: For partial fragments (IsFaceCornerFragment() = true), grid_corner_index = 2 is the only corner that corresponds to a SubD vertex. For partial fragments (IsFaceCornerFragment() = true), grid_side_index = 1 and grid_side_index = 2 correspond to half of original SuD edges.

◆ CornerPoint()

const ON_3dPoint ON_SubDMeshFragment::CornerPoint ( unsigned int  grid_corner_index) const

Parameters: grid_corner_index - [in] 0, 1, 2, or 3 Returns: Limit surface location at the grid corner or ON_3dPoint::NanPoint if the fragment is empty. Remarks: For partial fragments (IsFaceCornerFragment() = true), grid_corner_index = 2 is the only corner that corresponds to a SubD vertex. For partial fragments (IsFaceCornerFragment() = true), grid_side_index = 1 and grid_side_index = 2 correspond to half of original SuD edges.

◆ CurvatureArray()

const ON_SurfaceCurvature* ON_SubDMeshFragment::CurvatureArray ( ON_SubDComponentLocation  subd_appearance) const

◆ CurvatureArrayCount()

unsigned ON_SubDMeshFragment::CurvatureArrayCount ( ON_SubDComponentLocation  subd_appearance) const

◆ CurvatureCapacity()

unsigned int ON_SubDMeshFragment::CurvatureCapacity ( ) const

◆ CurvatureCount()

unsigned int ON_SubDMeshFragment::CurvatureCount ( ) const

Returns: If grid vertex principal curvatures and sectional curvatures are available, then VertexCount() is returned. Otherwise 0 is returned.

◆ CurvaturesExist()

bool ON_SubDMeshFragment::CurvaturesExist ( ) const

Returns: True if vertex color values are set on this fragment.

◆ DeleteManagedArrays()

bool ON_SubDMeshFragment::DeleteManagedArrays ( )

◆ DeleteManagedCurvatureCapacity()

void ON_SubDMeshFragment::DeleteManagedCurvatureCapacity ( ) const

Description: Deletes capacity added by ReserveManagedCurvatureCapacity().

◆ DisplayDensityFromSideSegmentCount()

static unsigned int ON_SubDMeshFragment::DisplayDensityFromSideSegmentCount ( unsigned int  side_segment_count)
static

Returns: base 2 log of side_segment_count. Remarks: side_segment_count = 2^display_density

◆ Dump()

void ON_SubDMeshFragment::Dump ( ON_TextLog text_log) const

◆ FaceCornerIndex()

unsigned int ON_SubDMeshFragment::FaceCornerIndex ( ) const

Returns: If IsFaceCornerFragment() is true, then the index of the face's vertex for the corner is returned. Otherwise, ON_UNSET_UINT_INDEX is returned.

◆ FaceCountFromDisplayDensity()

static unsigned int ON_SubDMeshFragment::FaceCountFromDisplayDensity ( unsigned int  display_density)
static

Parameters: display_density - [in] >= 0 Returns: total number of faces in the limit mesh fragment.

◆ FaceFragmentCount()

unsigned int ON_SubDMeshFragment::FaceFragmentCount ( ) const

Returns: Number of fragments that cover this face. 1 for quads and N>= 3 for faces with N sides when N != 4.

◆ FirstFaceFragment()

const ON_SubDMeshFragment* ON_SubDMeshFragment::FirstFaceFragment ( ) const

Returns: First fragment for this->m_face.

◆ FullFragmentMeshPointCountFromDensity()

static unsigned int ON_SubDMeshFragment::FullFragmentMeshPointCountFromDensity ( unsigned int  mesh_density)
static

Returns: Number of mesh points in a full sized fragment with the specified mesh density.

◆ FullFragmentMeshQuadCountFromDensity()

static unsigned int ON_SubDMeshFragment::FullFragmentMeshQuadCountFromDensity ( unsigned int  mesh_density)
static

Returns: Number of mesh quads in a full sized fragment with the specified mesh density.

◆ Get3gonFaceFragmentPackRectCorners()

static bool ON_SubDMeshFragment::Get3gonFaceFragmentPackRectCorners ( bool  bFaceGridOrder,
const ON_2dPoint  face_pack_rect_corners[4],
unsigned int  fragment_index,
bool  bFragmentGridOrder,
ON_2dPoint  fragment_pack_rect_corners[4] 
)
static

Description: This functions gets the pack rect corners on fragments used to render 3-gon ON_SubDFaces. When an ON_SubDFace is an 3-gon, it is rendered with 3 ON_SubDMeshFragments. Parameters: bFacePackRectGridOrder - [in] Order for face_pack_rect_corners[]. face_pack_rect_corners - [in] The points returned by ON_SubDFace::PackRectCorner(bGridOrder, i) fragment_index - [in] 0 <= ngon_fragment_index < 3 bFragmentPackRectGridOrder - [in] Order for face_pack_rect_corners[]. fragment_pack_rect_corners - [out]

◆ GetControlNetQuad()

bool ON_SubDMeshFragment::GetControlNetQuad ( bool  bGridOrder,
ON_3dPoint  quad_points[4],
ON_3dVector quad_normal 
) const

Parameters: bGridOrder - [in] If true, then points are returned in fragment grid order. Otherwise, points are returned in counter-clockwise quad order. quad_points - [out] quad_normal - [out]

◆ GetFaceFragments() [1/2]

unsigned int ON_SubDMeshFragment::GetFaceFragments ( const ON_SubDMeshFragment **  fragments,
size_t  fragments_capacity 
) const

Parameters: fragments_capacity - in Capacity of the fragments[] array. fragments[] - out Fragments are returned here.

◆ GetFaceFragments() [2/2]

unsigned int ON_SubDMeshFragment::GetFaceFragments ( ON_SimpleArray< const ON_SubDMeshFragment * > &  fragments) const

◆ GetNgonFaceFragmentPackRectCorners()

static bool ON_SubDMeshFragment::GetNgonFaceFragmentPackRectCorners ( unsigned int  ngon_edge_count,
unsigned int  ngon_fragment_index,
bool  bGridOrder,
const ON_2dPoint  face_pack_rect_corners[4],
ON_2dVector  face_pack_rect_size,
ON_2udex  ngon_grid_size,
ON_2dVector  ngon_sub_pack_rect_size,
ON_2dVector  ngon_sub_pack_rect_delta,
ON_2dPoint  fragment_pack_rect_corners[4] 
)
static

Description: This functions gets the pack rect corners for fragments used to render n-gon ON_SubDFaces when n >= 5. When an ON_SubDFace is an n-gon, it is rendered with n ON_SubDMeshFragments. Parameters: ngon_fragment_index - [in] 0 <= ngon_fragment_index < ngon_edge_count bGridOrder - [in] Order for face_pack_rect_corners[]. face_pack_rect_corners - [in] The points returned by ON_SubDFace::PackRectCorner(bGridOrder, i) face_pack_rect_size - [in] The n-gon face's ON_SubDFace::PackRectSize() value. ngon_grid_size - [in] ngon_sub_pack_rect_size - [in] ngon_sub_pack_rect_delta - [in] These three parameters are values from ON_SubDFace::GetNgonSubPackRectSizeAndDelta(). ngon_grid_size, ngon_sub_pack_rect_size, and ngon_sub_pack_rect_delta are identical for all the ON_SubDMeshFragments used to render the n-gon face. The value of m_face_fragment_index detemines which sub pack rect is assigned to each of the n ON_SubDMeshFragments use to render the n-gon face. fragment_pack_rect_corners - [out]

◆ GetTextureCoordinteCorners()

bool ON_SubDMeshFragment::GetTextureCoordinteCorners ( bool  bGridOrder,
ON_3dPoint  texture_coordinate_corners[4] 
) const

Description: Get the texture coordinate corners. Parameters: bGridOrder - [in] If true, then points are returned in fragment grid order. Otherwise, points are returned in counter-clockwise quad order. texture_coordinate_corners - [out]

◆ Grid()

const ON_SubDMeshFragmentGrid& ON_SubDMeshFragment::Grid ( ON_SubDComponentLocation  subd_appearance) const

◆ HalfFragmentMeshPointCountFromDensity()

static unsigned int ON_SubDMeshFragment::HalfFragmentMeshPointCountFromDensity ( unsigned int  mesh_density)
static

Returns: Number of mesh points in a half sized fragment with the specified mesh density.

◆ HalfFragmentMeshQuadCountFromDensity()

static unsigned int ON_SubDMeshFragment::HalfFragmentMeshQuadCountFromDensity ( unsigned int  mesh_density)
static

Returns: Number of mesh quads in a half sized fragment with the specified mesh density.

◆ HasValidPointAndNormalGrid()

const bool ON_SubDMeshFragment::HasValidPointAndNormalGrid ( ) const

◆ IsFaceCornerFragment()

bool ON_SubDMeshFragment::IsFaceCornerFragment ( ) const

Returns: True if the fragment covers a corner of the SubD face.

◆ IsFullFaceFragment()

bool ON_SubDMeshFragment::IsFullFaceFragment ( ) const

Returns: True if the fragment covers the entire SubD face.

◆ LastFaceFragment()

const ON_SubDMeshFragment* ON_SubDMeshFragment::LastFaceFragment ( ) const

Returns: Last fragment for this->m_face.

◆ ManagedArrays()

bool ON_SubDMeshFragment::ManagedArrays ( ) const

Returns: True if the memory in the m_P[], m_N[], and m_T[] is managed by this ON_SubDManagedMeshFragment instance.

◆ NextFaceFragment()

const ON_SubDMeshFragment* ON_SubDMeshFragment::NextFaceFragment ( bool  bReturnFirstFromLast) const

Parameters: bReturnFirstFromLast - in If false and this is the last fragment, then nullptr is returned. If true and this is the last fragment, then FirstFaceFragment() is returned. Returns: Next fragment for this->m_face.

◆ NormalArray()

const double* ON_SubDMeshFragment::NormalArray ( ON_SubDComponentLocation  subd_appearance) const

◆ NormalArrayCount()

unsigned ON_SubDMeshFragment::NormalArrayCount ( ON_SubDComponentLocation  subd_appearance) const

◆ NormalArrayStride()

size_t ON_SubDMeshFragment::NormalArrayStride ( ON_SubDComponentLocation  subd_appearance) const

◆ NormalCapacity()

unsigned int ON_SubDMeshFragment::NormalCapacity ( ) const

◆ NormalCount()

unsigned int ON_SubDMeshFragment::NormalCount ( ) const

Returns: If grid vertex surface normals are available, then VertexCount() is returned. Otherwise 0 is returned.

◆ PackRectCenter()

const ON_2dPoint ON_SubDMeshFragment::PackRectCenter ( ) const

◆ PackRectCorner()

const ON_2dPoint ON_SubDMeshFragment::PackRectCorner ( unsigned int  grid_corner_index) const

Parameters: grid_corner_index - [in] grid side N is between corner index N and corner index (N+1)%4. Returns: Pack rect corner point. Remarks: For partial fragments (IsFaceCornerFragment() = true), grid_corner_index = 2 is the only corner that corresponds to a SubD vertex. For partial fragments (IsFaceCornerFragment() = true), grid_side_index = 1 and grid_side_index = 2 correspond to half of original SuD edges.

◆ PointArray()

const double* ON_SubDMeshFragment::PointArray ( ON_SubDComponentLocation  subd_appearance) const

◆ PointArrayCount()

unsigned ON_SubDMeshFragment::PointArrayCount ( ON_SubDComponentLocation  subd_appearance) const

◆ PointArrayStride()

size_t ON_SubDMeshFragment::PointArrayStride ( ON_SubDComponentLocation  subd_appearance) const

◆ PointCapacity()

unsigned int ON_SubDMeshFragment::PointCapacity ( ) const

◆ PointCount()

unsigned int ON_SubDMeshFragment::PointCount ( ) const

Returns: If grid vertex points are available, then VertexCount() is returned. Otherwise 0 is returned.

◆ PointCountFromDisplayDensity()

static unsigned int ON_SubDMeshFragment::PointCountFromDisplayDensity ( unsigned int  display_density)
static

Parameters: display_density - [in] >= 0 Returns: total number of points in the limit mesh fragment. Remarks: The number of points is the same for quad or tri subdivision limit mesh fragments, even though one is a rectanglular collection of quads and the other is a trianglular collection of triangles.

◆ PreviousFaceFragment()

const ON_SubDMeshFragment* ON_SubDMeshFragment::PreviousFaceFragment ( bool  bReturnLastFromFirstFirst) const

Parameters: bReturnLastFromFirstFirst - in If false and this is the first fragment, then nullptr is returned. If true and this is the first fragment, then LastFaceFragment() is returned. Returns: Previous fragment for this->m_face.

◆ QuadGridPointCountFromSideCount()

static unsigned int ON_SubDMeshFragment::QuadGridPointCountFromSideCount ( unsigned int  side_segment_count)
static

Returns: If side_segment_count is valide, then (side_segment_count+1)^2 is returned. Otherwise 0 is returned.

◆ QuadGridQuadCountFromSideCount()

static unsigned int ON_SubDMeshFragment::QuadGridQuadCountFromSideCount ( unsigned int  side_segment_count)
static

Returns: If side_segment_count is valide, then side_segment_count^2 is returned. Otherwise 0 is returned.

◆ ReserveManagedCurvatureCapacity()

bool ON_SubDMeshFragment::ReserveManagedCurvatureCapacity ( ) const

Description: Adds managed curvature capacity to store vertex curvatures.

◆ ReserveManagedVertexCapacity()

bool ON_SubDMeshFragment::ReserveManagedVertexCapacity ( size_t  vertex_capacity)

Description: Sets number of fragment vertices available (number of elements available in the m_P[], m_N[], and m_T[] arrays). The memory for the arrays is managed by something besides this ON_SubDManagedMeshFragment instance. Parameters: vertex_capacity - [in] A value no larger than ON_SubDMeshFragment::MaximumVertexCount. Returns: True if successful

◆ SealAdjacentSides()

static bool ON_SubDMeshFragment::SealAdjacentSides ( bool  bTestNearEqual,
bool  bCopyNormals,
const ON_SubDMeshFragment src_fragment,
unsigned int  i0,
unsigned int  i1,
ON_SubDMeshFragment dst_fragment,
unsigned int  j0,
unsigned int  j1 
)
static

Description: Copies location and optionally normal information from a side of src_fragment to a side of dst_fragment. This is often used for "sealing" adjacent fragments where the same edge is evaluated from different faces. All evaluations are as accurate as IEEE double precision arithmetic can produce. However there are often tiny differences (last few bits of the coordinate values differ) in vertext locations because we are using finite precision arithmetic with operations in different orders. In general, rendering, mesho topology, and edge analysis calculations perform poorly when tinity differences exist.

Parameters: bTestNearEqual - [in] If true, then the copy is performed only when the points or normals are nearly identical. In this case if the discrepance between coordinates is too large, then this function returns false. bCopyNormals - [in] If true, then normal information is copied along with point information. src_fragment - [in] source fragment i0, i1 - [in] indices for the src_fragment.m_S[] array.
dst_fragment - [in] destination fragment j0, j1 - [in] indices for dst_fragment.m_S[] array. abs(j0-j1) = abs(i0-i1); Remarks: It is required that max(i0,i1) - min(i0,i1) = max(j0,j1) - min(j0,j1) and all indices are valid for the respective fragments. The src_fragment point/normal identified by src_fragment.m_S[i] is copied to he dst_fragment point/normal identified by dst_fragment.m_S[j], where i0->j0, i1->j1.

◆ SealNormals()

static bool ON_SubDMeshFragment::SealNormals ( bool  bTestNearEqual,
const double *  src,
double *  dst 
)
static

Parameters: bTestNearEqual - [in] If true, then the copy is performed only when the points or normals are nearly identical. In this case if the discrepance between coordinates is too large, then this function returns false. src - [in] dst - [in/out] The 3d point (src[0],src[1],src2[2]) is copied to (dst[0],dst[1],dst[2]). Returns: True if a copy occured.

◆ SealPoints()

static bool ON_SubDMeshFragment::SealPoints ( bool  bTestNearEqual,
const double *  src,
double *  dst 
)
static

Parameters: bTestNearEqual - [in] If true, then the copy is performed only when the points or normals are nearly identical. In this case if the discrepance between coordinates is too large, then this function returns false. src - [in] dst - [in/out] The 3d point (src[0],src[1],src2[2]) is copied to (dst[0],dst[1],dst[2]). Returns: True if a copy occured.

◆ SetColors()

bool ON_SubDMeshFragment::SetColors ( ON_Color  color) const

Description: Set the vertex colors in m_C[] to color. Parameters: color - [in]

◆ SetColorsExist()

void ON_SubDMeshFragment::SetColorsExist ( bool  bSetColorsExist) const

Parameters: bSetColorsExist - [in] True if vertex colors exist. False vertex colors do not exist or are no longer valid.

◆ SetColorsFromCallback()

bool ON_SubDMeshFragment::SetColorsFromCallback ( const ON_MappingTag fragment_colors_mapping_tag,
const ON_SubD subd,
ON__UINT_PTR  callback_context,
const ON_Color(*)(ON__UINT_PTR callback_context, const ON_MappingTag &mapping_tag, const ON_SubD &subd, ON_SubDComponentPtr cptr, const ON_3dPoint &P, const ON_3dVector &N, const ON_3dPoint &T, const ON_SurfaceCurvature &K)  color_callback 
) const

Description: Set the vertex colors in m_C[] from a callback function. Parameters:

◆ SetControlNetQuad()

void ON_SubDMeshFragment::SetControlNetQuad ( bool  bGridOrder,
const ON_3dPoint  quad_points[4],
ON_3dVector  quad_normal 
)

Parameters: bGridOrder - [in] If true, then points are returned in fragment grid order. Otherwise, points are returned in counter-clockwise quad order. quad_points - [in]

◆ SetCurvaturesExist()

void ON_SubDMeshFragment::SetCurvaturesExist ( bool  bSetCurvaturesExist) const

Parameters: bSetCurvaturesExist - [in] True if vertex curvatures exist. False vertex curvatures do not exist or are no longer valid.

◆ SetNgonFaceFragmentPackRectCorners()

void ON_SubDMeshFragment::SetNgonFaceFragmentPackRectCorners ( bool  bGridOrder,
const ON_2dPoint  face_pack_rect_corners[4],
ON_2dVector  face_pack_rect_size,
ON_2udex  ngon_grid_size,
ON_2dVector  ngon_sub_pack_rect_size,
ON_2dVector  ngon_sub_pack_rect_delta 
)

Description: This functions sets the pack rect corners on fragments used to render n-gon ON_SubDFaces when n >= 5. When an ON_SubDFace is an n-gon, it is rendered with n ON_SubDMeshFragments. Parameters: bGridOrder = [in] Order for face_pack_rect_corners[]. face_texture_coordinate_corners - [in] The points returned by ON_SubDFace::PackRectCorner(bGridOrder, i) face_pack_rect_size - [in] The n-gon face's ON_SubDFace::PackRectSize() value. ngon_grid_size - [in] ngon_sub_pack_rect_size - [in] ngon_sub_pack_rect_delta - [in] These three parameters are values from ON_SubDFace::GetNgonSubPackRectSizeAndDelta(). ngon_grid_size, ngon_sub_pack_rect_size, and ngon_sub_pack_rect_delta are identical for all the ON_SubDMeshFragments used to render the n-gon face. The value of m_face_fragment_index detemines which sub pack rect is assigned to each of the n ON_SubDMeshFragments use to render the n-gon face. Remarks: It is critcial that m_face_fragment_count and m_face_fragment_index be set correctly before calling this function. A ON_SubDMeshFragment used to render an n-gon ON_SubDFace has m_face_fragment_count = n and m_face_fragment_index = 0, ..., n-1.

◆ SetNgonFaceFragmentTextureCoordinateCorners()

void ON_SubDMeshFragment::SetNgonFaceFragmentTextureCoordinateCorners ( bool  bGridOrder,
const ON_3dPoint  face_texture_coordinate_corners[4],
ON_2dVector  face_pack_rect_size,
ON_2udex  ngon_grid_size,
ON_2dVector  ngon_sub_pack_rect_size,
ON_2dVector  ngon_sub_pack_rect_delta,
bool  bSetTextureCoordinates 
) const

Description: When an ON_SubDFace is an n-gon with n >= 5, it is rendered with n ON_SubDMeshFragments. This functions sets the texture coordinates on those fragments.
Parameters: bGridOrder = [in] Order for face_pack_rect_corners[]. face_texture_coordinate_corners - [in] The points returned by ON_SubDFace::TextureCoordinateCorner(bGridOrder, i, false) face_pack_rect_size - [in] The n-gon face's ON_SubDFace::PackRectSize() value. ngon_grid_size - [in] ngon_sub_pack_rect_size - [in] ngon_sub_pack_rect_delta - [in] These three parameters are values from ON_SubDFace::GetNgonSubPackRectSizeAndDelta(). ngon_grid_size, ngon_sub_pack_rect_size, and ngon_sub_pack_rect_delta are identical for all the ON_SubDMeshFragments used to render the n-gon face. The value of m_face_fragment_index detemines which sub pack rect is assigned to each of the n ON_SubDMeshFragments use to render the n-gon face. Remarks: It is critcial that m_face_fragment_count and m_face_fragment_index be set correctly before calling this function. A ON_SubDMeshFragment used to render an n-gon ON_SubDFace has m_face_fragment_count = n and m_face_fragment_index = 0, ..., n-1.

◆ SetPackedTextureCoordinates()

void ON_SubDMeshFragment::SetPackedTextureCoordinates ( ) const

Description: Set the texture coordinates in m_T[] from the values in m_pack_rect[].

◆ SetPackRectCornersForExperts()

void ON_SubDMeshFragment::SetPackRectCornersForExperts ( bool  bGridOrder,
const ON_2dPoint  fragment_pack_rect_corners[4] 
)

◆ SetQuadOr3gonFaceFragmentPackRectCorners()

void ON_SubDMeshFragment::SetQuadOr3gonFaceFragmentPackRectCorners ( bool  bGridOrder,
const ON_2dPoint  face_pack_rect_corners[4] 
)

Description: This functions sets the pack rect corners on fragments used to render quad and 3-gon ON_SubDFaces. When an ON_SubDFace is a quad, it is rendered with one ON_SubDMeshFragment. When an ON_SubDFace is a 3-gon, it is rendered with three ON_SubDMeshFragments. Remarks: It is critcial that m_face_fragment_count and m_face_fragment_index be set correctly before calling this function. A ON_SubDMeshFragment used to render a quad ON_SubDFace has m_face_fragment_count = 1 and m_face_fragment_index = 0. A ON_SubDMeshFragment used to render a 3-gon ON_SubDFace has m_face_fragment_count = 3 and m_face_fragment_index = 0, 1 or 2.

◆ SetQuadOr3gonFaceFragmentTextureCoordinateCorners()

void ON_SubDMeshFragment::SetQuadOr3gonFaceFragmentTextureCoordinateCorners ( bool  bGridOrder,
const ON_3dPoint  face_texture_coordinate_corners[4],
bool  bSetTextureCoordinates 
) const

Description: This functions sets the texture coordinates on fragments used to render quad and 3-gon ON_SubDFaces. A quad ON_SubDFace is rendered with one ON_SubDMeshFragment. A 3-gon ON_SubDFace is rendered with three ON_SubDMeshFragments. Remarks: It is critcial that m_face_fragment_count and m_face_fragment_index be set correctly before calling this function. A ON_SubDMeshFragment used to render a quad ON_SubDFace has m_face_fragment_count = 1 and m_face_fragment_index = 0. A ON_SubDMeshFragment used to render a 3-gon ON_SubDFace has m_face_fragment_count = 3 and m_face_fragment_index = 0, 1 or 2.

◆ SetTextureCoordinateCornersForExperts()

void ON_SubDMeshFragment::SetTextureCoordinateCornersForExperts ( bool  bGridOrder,
const ON_3dPoint  fragment_texture_coordinate_corners[4],
bool  bSetTextureCoordinates 
) const

Description: Sets the values of each fragment's m_ctrlnetT[] member. Parameters: bSetTextureCoordinates If true, the texture coordinate corners are used ti set the fragment's m_T[] values after m_ctrlnetT[] is set.

◆ SetTextureCoordinatesExist()

void ON_SubDMeshFragment::SetTextureCoordinatesExist ( bool  bTextureCoordinatesExist) const

◆ SetTextureCoordinatesFromCorners()

void ON_SubDMeshFragment::SetTextureCoordinatesFromCorners ( ) const

Description: Set the texture coordinates in m_T[] from the values in m_ctrlnetT[].

◆ SetUnmanagedVertexCapacity()

bool ON_SubDMeshFragment::SetUnmanagedVertexCapacity ( size_t  vertex_capacity)

Description: Sets number of fragment vertices available (number of elements available in the m_P[], m_N[], and m_T[] arrays). The memory for the arrays is managed by something besides this ON_SubDManagedMeshFragment instance. Parameters: vertex_capacity - [in] A value no larger than ON_SubDMeshFragment::MaximumVertexCount. Returns: True if successful

◆ SetUnpackedTextureCoordinates()

void ON_SubDMeshFragment::SetUnpackedTextureCoordinates ( ) const

Description: Set the this fragments texture coordinates in m_T[] to cover (0,1)x(0,1)

◆ SetVertexCount()

bool ON_SubDMeshFragment::SetVertexCount ( size_t  vertex_count)

Description: Sets number of fragment vertices being used (number of elements being used in the m_P[], m_N[], and m_T[] arrays). Parameters: vertex_count - [in] A value no larger than ON_SubDMeshFragment::MaximumVertexCount.

◆ SetVertexTextureCoordinate() [1/3]

bool ON_SubDMeshFragment::SetVertexTextureCoordinate ( ON_2udex  grid2dex,
ON_3dPoint  texture_coordinate 
) const

◆ SetVertexTextureCoordinate() [2/3]

bool ON_SubDMeshFragment::SetVertexTextureCoordinate ( unsigned  grid2dex_i,
unsigned  grid2dex_j,
ON_3dPoint  texture_coordinate 
) const

Description: Set the texture coordinate for the specified fragment grid point. Parameters: grid2dex_i - [in] 0 <= grid2dex_i < m_grid.SidePointCount() grid2dex_j - [in] 0 <= grid2dex_j < m_grid.SidePointCount() unsigned texture_coordinate_dimension - [in] 2 or 3 texture_coordinate - [in] Texture coordinates are mutable and are often modified on an otherwise const fragment. Returns: True if input was valid and the texture coordinate was set.

◆ SetVertexTextureCoordinate() [3/3]

bool ON_SubDMeshFragment::SetVertexTextureCoordinate ( unsigned  grid_point_index,
ON_3dPoint  texture_coordinate 
) const

◆ SideFrame()

const ON_Plane ON_SubDMeshFragment::SideFrame ( unsigned int  grid_side_index) const

Parameters: grid_side_index - [in] grid side N is between corner index N and corner index (N+1)%4. Returns: Limit surface frame at the grid corner or ON_3dPoint::NanPoint if the fragment is empty. Remarks: For partial fragments (IsFaceCornerFragment() = true), grid_corner_index = 2 is the only corner that corresponds to a SubD vertex. For partial fragments (IsFaceCornerFragment() = true), grid_side_index = 1 and grid_side_index = 2 correspond to half of original SuD edges.

◆ SideNormal()

const ON_3dVector ON_SubDMeshFragment::SideNormal ( unsigned int  grid_side_index) const

Parameters: grid_side_index - [in] grid side N is between corner index N and corner index (N+1)%4. Returns: Limit surface normal at the grid corner or ON_3dPoint::NanPoint if the fragment is empty. Remarks: For partial fragments (IsFaceCornerFragment() = true), grid_corner_index = 2 is the only corner that corresponds to a SubD vertex. For partial fragments (IsFaceCornerFragment() = true), grid_side_index = 1 and grid_side_index = 2 correspond to half of original SuD edges.

◆ SidePoint()

const ON_3dPoint ON_SubDMeshFragment::SidePoint ( unsigned int  grid_side_index) const

Parameters: grid_side_index - [in] grid side N is between corner index N and corner index (N+1)%4. Returns: Limit surface location at the midde of the grid side or ON_3dPoint::NanPoint if the fragment is empty. Remarks: For partial fragments (IsFaceCornerFragment() = true), grid_corner_index = 2 is the only corner that corresponds to a SubD vertex. For partial fragments (IsFaceCornerFragment() = true), grid_side_index = 1 and grid_side_index = 2 correspond to half of original SuD edges.

◆ SidePointCountFromSideCount()

static unsigned int ON_SubDMeshFragment::SidePointCountFromSideCount ( unsigned int  side_segment_count)
static

Returns: If side_segment_count is valide, then (side_segment_count+1) is returned. Otherwise 0 is returned.

◆ SideSegmentCountFromDisplayDensity()

static unsigned int ON_SubDMeshFragment::SideSegmentCountFromDisplayDensity ( unsigned int  display_density)
static

Returns: side_segment_count = 2^display_density

◆ SideSegmentCountIsValid()

static bool ON_SubDMeshFragment::SideSegmentCountIsValid ( unsigned int  side_segment_count)
static

Returns: true if side_segment_count is valid. Otherwise 0 is returned.

◆ SizeofFragment()

static size_t ON_SubDMeshFragment::SizeofFragment ( unsigned int  display_density,
bool  bCurvatureArray 
)
static

Parameters: display_density - [in] Determines grid size bCurvatureArray - [in] true to include room for the m_K[] array. Returns: Amount of memory needed for the fragment, the m_P[], m_N[], m_T[], m_C[], and optionally the m_K[] arrays.

◆ Status()

ON_ComponentStatus ON_SubDMeshFragment::Status ( ) const

Returns: Status of the face.

◆ SubDEdge()

const class ON_SubDEdge* ON_SubDMeshFragment::SubDEdge ( unsigned int  grid_side_index) const

◆ SubDEdgePtr()

const class ON_SubDEdgePtr ON_SubDMeshFragment::SubDEdgePtr ( unsigned int  grid_side_index) const

Parameters: grid_side_index - [in] 0 to 3 for quad grids. 0 to 2 for tri grids Returns: The subd edge that is on the identified side of the grid.

◆ SubDFace()

const class ON_SubDFace* ON_SubDMeshFragment::SubDFace ( ) const

◆ SubDVertex()

const class ON_SubDVertex* ON_SubDMeshFragment::SubDVertex ( unsigned int  grid_corner_index) const

Parameters: grid_corner_index - [in] 0, 1, 2, or 3 Remarks: For partial fragments (IsFaceCornerFragment() = true), grid_corner_index = 2 is the only corner that corresponds to a SubD vertex. For partial fragments (IsFaceCornerFragment() = true), grid_side_index = 1 and grid_side_index = 2 correspond to half of original SuD edges.

◆ SubDVertexPtr()

const class ON_SubDVertexPtr ON_SubDMeshFragment::SubDVertexPtr ( unsigned int  grid_corner_index) const

Parameters: grid_corner_index - [in] 0, 1, 2, or 3 Remarks: For partial fragments (IsFaceCornerFragment() = true), grid_corner_index = 2 is the only corner that corresponds to a SubD vertex. For partial fragments (IsFaceCornerFragment() = true), grid_side_index = 1 and grid_side_index = 2 correspond to half of original SuD edges.

◆ SurfaceBoundingBox()

const ON_BoundingBox ON_SubDMeshFragment::SurfaceBoundingBox ( ) const

◆ TextureCoordinateArray()

const double* ON_SubDMeshFragment::TextureCoordinateArray ( ON_SubDComponentLocation  subd_appearance) const

◆ TextureCoordinateArrayCount()

unsigned ON_SubDMeshFragment::TextureCoordinateArrayCount ( ON_SubDComponentLocation  subd_appearance) const

◆ TextureCoordinateArrayStride()

size_t ON_SubDMeshFragment::TextureCoordinateArrayStride ( ON_SubDComponentLocation  subd_appearance) const

◆ TextureCoordinateCapacity()

unsigned int ON_SubDMeshFragment::TextureCoordinateCapacity ( ) const

◆ TextureCoordinateCorner()

const ON_3dPoint ON_SubDMeshFragment::TextureCoordinateCorner ( unsigned int  grid_corner_index) const

Parameters: grid_corner_index - [in] grid side N is between corner index N and corner index (N+1)%4. Returns: Texture coordinate at that corner. Remarks: For partial fragments (IsFaceCornerFragment() = true), grid_corner_index = 2 is the only corner that corresponds to a SubD vertex. For partial fragments (IsFaceCornerFragment() = true), grid_side_index = 1 and grid_side_index = 2 correspond to half of original SuD edges.

◆ TextureCoordinateCount()

unsigned int ON_SubDMeshFragment::TextureCoordinateCount ( ) const

Returns: If grid texture coordinates are available, then VertexCount() is returned. Otherwise 0 is returned.

◆ TextureCoordinatesExist()

bool ON_SubDMeshFragment::TextureCoordinatesExist ( ) const

◆ Transform()

bool ON_SubDMeshFragment::Transform ( const ON_Xform xform)

◆ UnmanagedArrays()

bool ON_SubDMeshFragment::UnmanagedArrays ( ) const

Returns: True if the memory in the m_P[], m_N[], and m_T[] is managed by something besides this ON_SubDManagedMeshFragment instance.

◆ UnsetControlNetQuad()

void ON_SubDMeshFragment::UnsetControlNetQuad ( )

◆ VertexCapacity()

unsigned ON_SubDMeshFragment::VertexCapacity ( ) const

Returns: Capactity for vertices in the mesh fragment grid. VertexCapacity() should be >= VertexCount(). VertexCount() should be identical to m_grid.PointCount().

◆ VertexCount()

unsigned ON_SubDMeshFragment::VertexCount ( ) const

Returns: Number of vertices in the mesh fragment grid. VertexCount() should be identical to m_grid.GridPointCount(). VertexCapacity() should be >= VertexCount().

◆ VertexNormal() [1/3]

const ON_3dVector ON_SubDMeshFragment::VertexNormal ( ON_2udex  grid2dex) const

◆ VertexNormal() [2/3]

const ON_3dVector ON_SubDMeshFragment::VertexNormal ( unsigned  grid2dex_i,
unsigned  grid2dex_j 
) const

Parameters: grid2dex_i - [in] 0 <= grid2dex_i < m_grid.SidePointCount() grid2dex_j - [in] 0 <= grid2dex_j < m_grid.SidePointCount() Returns:

◆ VertexNormal() [3/3]

const ON_3dVector ON_SubDMeshFragment::VertexNormal ( unsigned  grid_point_index) const

◆ VertexPoint() [1/3]

const ON_3dPoint ON_SubDMeshFragment::VertexPoint ( ON_2udex  grid2dex) const

◆ VertexPoint() [2/3]

const ON_3dPoint ON_SubDMeshFragment::VertexPoint ( unsigned  grid2dex_i,
unsigned  grid2dex_j 
) const

Parameters: grid2dex_i - [in] 0 <= grid2dex_i < m_grid.SidePointCount() grid2dex_j - [in] 0 <= grid2dex_j < m_grid.SidePointCount() Returns:

◆ VertexPoint() [3/3]

const ON_3dPoint ON_SubDMeshFragment::VertexPoint ( unsigned  grid_point_index) const

◆ VertexTextureCoordinate() [1/3]

const ON_3dPoint ON_SubDMeshFragment::VertexTextureCoordinate ( ON_2udex  grid2dex) const

◆ VertexTextureCoordinate() [2/3]

const ON_3dPoint ON_SubDMeshFragment::VertexTextureCoordinate ( unsigned  grid2dex_i,
unsigned  grid2dex_j 
) const

Description: Get the texture coordinate for the specified fragment grid point. Parameters: grid2dex_i - [in] 0 <= grid2dex_i < m_grid.SidePointCount() grid2dex_j - [in] 0 <= grid2dex_j < m_grid.SidePointCount() Returns: The texture coordinate for the specified fragment grid point. TextureCoordinateDimension() reports the number of coordinates to set. When it is 2, the z coordinate of the returned point is 0.0.

◆ VertexTextureCoordinate() [3/3]

const ON_3dPoint ON_SubDMeshFragment::VertexTextureCoordinate ( unsigned  grid_point_index) const

◆ VertexTextureCoordinateFromCorners() [1/3]

const ON_3dPoint ON_SubDMeshFragment::VertexTextureCoordinateFromCorners ( ON_2udex  grid2dex) const

◆ VertexTextureCoordinateFromCorners() [2/3]

const ON_3dPoint ON_SubDMeshFragment::VertexTextureCoordinateFromCorners ( unsigned  grid2dex_i,
unsigned  grid2dex_j 
) const

Parameters: grid2dex_i - [in] 0 <= grid2dex_i < m_grid.SidePointCount() grid2dex_j - [in] 0 <= grid2dex_j < m_grid.SidePointCount() Returns: The texture coordinates calculated by iterpolating the m_ctrlnetT[] values.

◆ VertexTextureCoordinateFromCorners() [3/3]

const ON_3dPoint ON_SubDMeshFragment::VertexTextureCoordinateFromCorners ( unsigned  grid_point_index) const

Friends And Related Function Documentation

◆ ON_SubDHeap

friend class ON_SubDHeap
friend

◆ ON_SubDManagedMeshFragment

friend class ON_SubDManagedMeshFragment
friend

◆ ON_SubDMeshImpl

friend class ON_SubDMeshImpl
friend

Member Data Documentation

◆ Empty

const ON_SubDMeshFragment ON_SubDMeshFragment::Empty
static

Every field of ON_SubDMeshFragment::Empty is zero.

◆ m_face

const class ON_SubDFace* ON_SubDMeshFragment::m_face

◆ m_face_fragment_count

unsigned short ON_SubDMeshFragment::m_face_fragment_count

Number of fragments that will be delivered for this face.

◆ m_face_fragment_index

unsigned short ON_SubDMeshFragment::m_face_fragment_index

First fragment has index = 0. Last fragment has index = m_face_fragment_count-1.

◆ m_face_vertex_index

unsigned short ON_SubDMeshFragment::m_face_vertex_index[4]

m_face_vertex_index[] stores the information needed for the Vertex() and Edge() functions to work.

If m_face is nullptr, then m_face_vertex_index[] has no meaning. If m_face is not nullptr and a corner of the grid is on a face vertex, then the corresponding m_face_vertex_index[] value will be <= ON_SubDFace::MaximumEdgeCount and m_face->Vertex(m_face_vertex_index[]) is the vertex. Otherwise, the corresponding m_face_vertex_index[] value will be > ON_SubDFace::MaximumEdgeCount.
Catmull-Clark limit meshes: When the original SubD face is a quad, a full fragment is created and m_face_vertex_index[4] = {0,1,2,3}. When the original SuD face is an N-gon with N != 4, a partial fragment is delivered and m_face_vertex_index[2] identifies the face vertex for that fragment. m_face_vertex_index[0,1,3] = a value > ON_SubDFace::MaximumEdgeCount

◆ m_grid

ON_SubDMeshFragmentGrid ON_SubDMeshFragment::m_grid

Information to resolve m_P[], m_N[], and m_T[] into a grid of NxN quads.

Normalized grid parameters useful for appling a texture to the grid are available from m_grid functions.

◆ m_N

double* ON_SubDMeshFragment::m_N

surface normals

3-dimensional grid vertex surface normals

The m_N[] and m_P[] arrays are parallel. Depending on the strides, m_P[], m_N[], and m_T[] can be separate or interlaced.

If m_N is not nullptr and m_N_stride>0, then m_N[] can accomodate up to m_P_capacity normals. If m_N is not nullptr and m_N_stride=0, then m_N[] can accomodate a single normal (flat shaded polygon face). The stride m_N_stride and memory m_N references is managed by some other class or function. Never modify m_N_stride, m_N, or the values in m_N. Use m_grid functions to get normal indices and quad face indices. Note well: m_N_stride can be 0 when the normal is constant (control net face normal for example).

◆ m_N_stride

size_t ON_SubDMeshFragment::m_N_stride

stride between normals for m_N[] as an array of 8 byte doubles (so 0 or >= 3)

◆ m_next_fragment

ON_SubDMeshFragment* ON_SubDMeshFragment::m_next_fragment

◆ m_P

double* ON_SubDMeshFragment::m_P

surface points

3-dimensional grid vertex points

Depending on the strides, m_P[], m_N[], and m_T[] can be separate or interlaced.

The stride m_P_stride and memory m_P references is managed by some other class or function. Never modify m_P_stride, m_P, or the values in m_P. Use m_grid functions to get point indices and quad face indices.

◆ m_P_stride

size_t ON_SubDMeshFragment::m_P_stride

stride between points for m_P[] as an array of 8 byte doubles (so 0 or >= 3)

◆ m_prev_fragment

ON_SubDMeshFragment* ON_SubDMeshFragment::m_prev_fragment

◆ m_surface_bbox

ON_BoundingBox ON_SubDMeshFragment::m_surface_bbox

3d bounding box of grid vertex points.

◆ m_T

double* ON_SubDMeshFragment::m_T
mutable

3d vertex texture coordinates.

Depending on the strides, m_P[], m_N[], and m_T[] can be separate or interlaced.

If m_T is not nullptr and m_T_stride>0, then m_T[] can accomodate up to m_P_capacity textures coordinates. Otherwise there are no texture coordinates. Never modify m_T_stride, m_T. Use m_grid functions to get texture indices and quad face indices. Note well: m_T_stride can be 0 when the texture coordinate is constant (one color per face for example)

◆ m_T_stride

size_t ON_SubDMeshFragment::m_T_stride
mutable

stride between texture points for m_T[] as an array of 8 byte doubles (so 0 or >= 3)