Rhino C++ API
8.14
|
#include <opennurbs_subd.h>
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 |
void | Clear () ON_NOEXCEPT |
Clear all information except the memory management inforation. More... | |
void | ClearColors () const |
void | ClearControlNetQuad () |
void | ClearCurvatures () const |
void | ClearPackRect () |
void | ClearSurfaceBoundingBox () |
void | ClearTextureCoordinates () const |
const ON_Color * | ColorArray (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 | ColorsExistForExperts () 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_SurfaceCurvature * | CurvatureArray (ON_SubDComponentLocation subd_appearance) const |
unsigned | CurvatureArrayCount (ON_SubDComponentLocation subd_appearance) const |
size_t | CurvatureArrayStride (ON_SubDComponentLocation subd_appearance) const |
unsigned int | CurvatureCapacity () const |
unsigned int | CurvatureCount () const |
bool | CurvaturesExistForExperts () const |
bool | DeleteManagedArrays () |
void | Dump (ON_TextLog &text_log) const |
unsigned int | FaceCornerIndex () const |
unsigned int | FaceFragmentCount () const |
const ON_SubDMeshFragment * | FirstFaceFragment () 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 |
unsigned | GetNormalCurvatures (const unsigned sample_count, const unsigned comb_count_params, const bool get_first_comb, const bool getKu, const bool getKv, ON_SimpleArray< ON_3dPoint > *P, ON_SimpleArray< ON_3dVector > *Kuv) const |
bool | GetTextureCoordinteCorners (bool bGridOrder, ON_3dPoint texture_coordinate_corners[4]) const |
const ON_SubDMeshFragmentGrid & | Grid (ON_SubDComponentLocation subd_appearance) const |
const bool | HasValidPointAndNormalGrid () const |
bool | InterlacedArrays () const |
True if the memory for points, normals, textures, colors, and curvatures is interlaced. More... | |
bool | IsFaceCornerFragment () const |
bool | IsFullFaceFragment () const |
const ON_SubDMeshFragment * | LastFaceFragment () const |
bool | ManagedArrays () const |
const ON_SubDMeshFragment * | NextFaceFragment (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_SubDMeshFragment * | PreviousFaceFragment (bool bReturnLastFromFirstFirst) const |
bool | ReserveManagedVertexCapacity (size_t vertex_capacity) |
bool | SetColors (ON_Color color) const |
void | SetColorsExistForExperts (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) |
bool | SetCurvatures (bool bLazy) const |
void | SetCurvaturesExistForExperts (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 | SetTextureCoordinatesExistForExperts (bool bTextureCoordinatesExist) const |
void | SetTextureCoordinatesFromCorners () const |
bool | SetUnmanagedVertexCapacityForExperts (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_SubDEdge * | SubDEdge (unsigned int grid_side_index) const |
const class ON_SubDEdgePtr | SubDEdgePtr (unsigned int grid_side_index) const |
const class ON_SubDFace * | SubDFace () const |
const class ON_SubDVertex * | SubDVertex (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 | TextureCoordinatesExistForExperts () const |
bool | Transform (bool bKeepTextures, bool bKeepCurvatures, bool bKeepColors, const ON_Xform &xform) |
This version transforms the points and normals and attempts possible transformations to the curvatures, texture coordinates and colors, if they are kept: More... | |
bool | Transform (bool bKeepTextures, bool bKeepCurvatures, bool bKeepColors, const ON_Xform &xform, const ON_Xform &xformNormals, const ON_Xform &xformTextures, const ON_Xform &xformCurvatures, const ON_Xform &xformColors) |
This version transforms the points, normals, curvatures, texture coordinates, and colors, if they are kept. More... | |
bool | Transform (const ON_Xform &xform) |
This simple version transforms the points and normals and attempts possible transformations to the curvatures, texture coordinates and colors: More... | |
bool | UnmanagedArrays () const |
void | UnsetControlNetQuad () |
unsigned | VertexCapacity () const |
const ON_Color | VertexColor (ON_2udex grid2dex) const |
const ON_Color | VertexColor (unsigned grid2dex_i, unsigned grid2dex_j) const |
const ON_Color | VertexColor (unsigned grid_point_index) const |
unsigned | VertexCount () const |
const ON_SurfaceCurvature | VertexCurvature (ON_2udex grid2dex) const |
const ON_SurfaceCurvature | VertexCurvature (unsigned grid2dex_i, unsigned grid2dex_j) const |
const ON_SurfaceCurvature | VertexCurvature (unsigned grid_point_index) 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_SubDFaceParameter | VertexSubDFaceParameter (ON_2udex grid2dex) const |
Get the SubD face evaluation parameter for the SubD surface point where this vertex is located. More... | |
const ON_SubDFaceParameter | VertexSubDFaceParameter (unsigned grid2dex_i, unsigned grid2dex_j) const |
Get the SubD face evaluation parameter for the SubD surface point where this vertex is located. More... | |
const ON_SubDFaceParameter | VertexSubDFaceParameter (unsigned grid_point_index) const |
Get the SubD face evaluation parameter for the SubD surface point where this vertex is located. More... | |
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) |
Public Attributes | |
const class ON_SubDFace * | m_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_SubDMeshFragment * | m_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_SubDMeshFragment * | m_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 |
anonymous enum : unsigned |
const ON_BoundingBox ON_SubDMeshFragment::BoundingBox | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
const ON_Plane ON_SubDMeshFragment::CenterFrame | ( | ) | const |
const ON_3dVector ON_SubDMeshFragment::CenterNormal | ( | ) | const |
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.
const ON_3dPoint ON_SubDMeshFragment::CenterTextureCoordinate | ( | ) | const |
void ON_SubDMeshFragment::Clear | ( | ) |
Clear all information except the memory management inforation.
The intent is to be able to clear and reuse the fragment at its current vertex capacity.
Secifically:
Set referenced SubDFace to nullptr. Set vertex count to zero. Set existance of textures, curvatures, and colors to false. Set control net quad values to nans. Set the grid to ON_SubDMeshFragmentGrid::Empty. Set the surface bounding box to nan.
Does not change vertex capacity or deallocate managed arrays.
void ON_SubDMeshFragment::ClearColors | ( | ) | const |
Call ClearColors() if vertex colors do not exist or are no longer valid.
void ON_SubDMeshFragment::ClearControlNetQuad | ( | ) |
void ON_SubDMeshFragment::ClearCurvatures | ( | ) | const |
Call ClearCurvatures() if the fragment points are changed and any existing curvature values are now invalid.
void ON_SubDMeshFragment::ClearPackRect | ( | ) |
Description: Clears the pack rectangle. Remarks: Does not change the value of ON_SubDFace::PackId() or ON_SubDFace::TextureCoordinateType() Use ON_SubDFace::ClearPackId() to clear the pack id.
void ON_SubDMeshFragment::ClearSurfaceBoundingBox | ( | ) |
void ON_SubDMeshFragment::ClearTextureCoordinates | ( | ) | const |
const ON_Color* ON_SubDMeshFragment::ColorArray | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
subd_appearance | Specifies which array (surface points or control net corners) |
unsigned ON_SubDMeshFragment::ColorArrayCount | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
subd_appearance | Specifies which array (surface points or control net corners) |
size_t ON_SubDMeshFragment::ColorArrayStride | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
unsigned int ON_SubDMeshFragment::ColorCapacity | ( | ) | const |
Returns: If the grid has memory to store colors, then VertexCapacity() is returned. Otherwise 0 is returned. Remarks: Use ColorCount() > 0 to determine if the color values are actually set.
unsigned int ON_SubDMeshFragment::ColorCount | ( | ) | const |
Returns: If grid vertex colors are available, then VertexCount() is returned. Otherwise 0 is returned. Remarks: Use ColorCapacity() to get the capacity of m_C[].
bool ON_SubDMeshFragment::ColorsExistForExperts | ( | ) | const |
Returns: True if vertex color exist bit is set. This bit is used for control net and color array setting. Remarks: Use ColorCount() to determine if vertex colors are set.
const ON_BoundingBox ON_SubDMeshFragment::ControlNetQuadBoundingBox | ( | ) | const |
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.
const ON_3dPoint ON_SubDMeshFragment::ControlNetQuadPoint | ( | bool | bGridOrder, |
unsigned | point_index | ||
) | const |
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;
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 accommodate the requested display density.
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.
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.
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.
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.
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.
const ON_SurfaceCurvature* ON_SubDMeshFragment::CurvatureArray | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
subd_appearance | Specifies which array (surface points or control net corners) |
unsigned ON_SubDMeshFragment::CurvatureArrayCount | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
subd_appearance | Specifies which array (surface points or control net corners) |
size_t ON_SubDMeshFragment::CurvatureArrayStride | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
unsigned int ON_SubDMeshFragment::CurvatureCapacity | ( | ) | const |
Returns: If the grid has memory to store curvatures, then VertexCapacity() is returned. Otherwise 0 is returned. Remarks: Use CurvatureCount() > 0 to determine if the curvature values are actually set.
unsigned int ON_SubDMeshFragment::CurvatureCount | ( | ) | const |
Returns: If the grid has set curvatures, then VertexCount() is returned. Otherwise 0 is returned. Remarks: Use CurvatureCapacity() to get capacity of the m_K[] array (set or unset). This function return the number of set curvatures.
bool ON_SubDMeshFragment::CurvaturesExistForExperts | ( | ) | const |
Returns: True if the curvatures exist bit is set. This bit is used for control net and vertex values. Remarks: Use CurvatureCount() to determine if vertices have set curvature values.
bool ON_SubDMeshFragment::DeleteManagedArrays | ( | ) |
True if the memory in the m_P[], m_N[], m_T[], m_K[], and m_C[] arrays is managed by this ON_SubDMeshFragment instance, this function deletes it and zeros the appropriate ponters and strides. Otherwise nothing is done.
|
static |
Returns: base 2 log of side_segment_count. Remarks: side_segment_count = 2^display_density
void ON_SubDMeshFragment::Dump | ( | ON_TextLog & | text_log | ) | const |
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.
|
static |
Parameters: display_density - [in] >= 0 Returns: total number of faces in the limit mesh fragment.
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.
const ON_SubDMeshFragment* ON_SubDMeshFragment::FirstFaceFragment | ( | ) | const |
Returns: First fragment for this->m_face.
|
static |
Returns: Number of mesh points in a full sized fragment with the specified mesh density.
|
static |
Returns: Number of mesh quads in a full sized fragment with the specified mesh density.
|
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]
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]
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.
unsigned int ON_SubDMeshFragment::GetFaceFragments | ( | ON_SimpleArray< const ON_SubDMeshFragment * > & | fragments | ) | const |
|
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 determines 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]
unsigned ON_SubDMeshFragment::GetNormalCurvatures | ( | const unsigned | sample_count, |
const unsigned | comb_count_params, | ||
const bool | get_first_comb, | ||
const bool | getKu, | ||
const bool | getKv, | ||
ON_SimpleArray< ON_3dPoint > * | P, | ||
ON_SimpleArray< ON_3dVector > * | Kuv | ||
) | const |
Description: Computes normal curvature values for this fragment. Evaluation points are uniformly spaced over the fragment to fill the N, Ku, Kv arrays. Parameters: sample_count - [in] How many samples to get in both directions. comb_count_params - [in] How many combs to get in both directions (+1 if get_first_comb is false). get_first_comb - [in] Wheter to skip combs at u = 0 and v = 0. The parameters at which to get the combs are the same when:
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]
const ON_SubDMeshFragmentGrid& ON_SubDMeshFragment::Grid | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
|
static |
Returns: Number of mesh points in a half sized fragment with the specified mesh density.
|
static |
Returns: Number of mesh quads in a half sized fragment with the specified mesh density.
const bool ON_SubDMeshFragment::HasValidPointAndNormalGrid | ( | ) | const |
bool ON_SubDMeshFragment::InterlacedArrays | ( | ) | const |
True if the memory for points, normals, textures, colors, and curvatures is interlaced.
bool ON_SubDMeshFragment::IsFaceCornerFragment | ( | ) | const |
Returns: True if the fragment covers a corner of the SubD face.
bool ON_SubDMeshFragment::IsFullFaceFragment | ( | ) | const |
Returns: True if the fragment covers the entire SubD face.
const ON_SubDMeshFragment* ON_SubDMeshFragment::LastFaceFragment | ( | ) | const |
Returns: Last fragment for this->m_face.
bool ON_SubDMeshFragment::ManagedArrays | ( | ) | const |
Returns: True if the memory in the m_P[], m_N[], m_T[], m_K[], and m_C[] arrays is managed by this ON_SubDMeshFragment instance and can be deleted by calling DeleteManagedArrays(). False if an external agent is managing the memory.
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.
const double* ON_SubDMeshFragment::NormalArray | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
unsigned ON_SubDMeshFragment::NormalArrayCount | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
size_t ON_SubDMeshFragment::NormalArrayStride | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
unsigned int ON_SubDMeshFragment::NormalCapacity | ( | ) | const |
unsigned int ON_SubDMeshFragment::NormalCount | ( | ) | const |
Returns: If grid vertex surface normals are available, then VertexCount() is returned. Otherwise 0 is returned.
const ON_2dPoint ON_SubDMeshFragment::PackRectCenter | ( | ) | const |
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.
const double* ON_SubDMeshFragment::PointArray | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
unsigned ON_SubDMeshFragment::PointArrayCount | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
size_t ON_SubDMeshFragment::PointArrayStride | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
unsigned int ON_SubDMeshFragment::PointCapacity | ( | ) | const |
unsigned int ON_SubDMeshFragment::PointCount | ( | ) | const |
Returns: If grid vertex points are available, then VertexCount() is returned. Otherwise 0 is returned.
|
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 triangular collection of triangles.
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.
|
static |
Returns: If side_segment_count is valid, then (side_segment_count+1)^2 is returned. Otherwise 0 is returned.
|
static |
Returns: If side_segment_count is valid, then side_segment_count^2 is returned. Otherwise 0 is returned.
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[], m_T[], m_K[], and m_C[] arrays). The memory for the arrays is managed by something besides this ON_SubDMeshFragment instance. Parameters: vertex_capacity - [in] A value no larger than ON_SubDMeshFragment::MaximumVertexCount. Returns: True if successful
|
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.
|
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 occurred.
|
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 occurred.
bool ON_SubDMeshFragment::SetColors | ( | ON_Color | color | ) | const |
Description: Set all vertex colors in m_C[] to color. Parameters: color - [in]
void ON_SubDMeshFragment::SetColorsExistForExperts | ( | bool | bSetColorsExist | ) | const |
Parameters: bSetColorsExist - [in] True if vertex colors exist. False vertex colors do not exist or are no longer valid. SetColorsExist(false) and ClearColors() are two ways to do the same thing.
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:
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]
bool ON_SubDMeshFragment::SetCurvatures | ( | bool | bLazy | ) | const |
Description: Computes curvature values at grid points for this fragment. Note that fragment curvature values are a mutable property and can be set at any time after the fragment's points are set. Parameters: bLazy - [in] If bLazy is true and if CurvaturesExist() is true, then no changes are made. If bLazy is false, the curvature values are unconditionally calculated from the fragment's surface and saved in m_K[]. Returns: True if curvatures are set. False if curvatures cannot be set.
void ON_SubDMeshFragment::SetCurvaturesExistForExperts | ( | bool | bSetCurvaturesExist | ) | const |
Parameters: bSetCurvaturesExist - [in] True if curvatures exist. False vertex curvatures do not exist or are no longer valid. Note that SetCurvaturesExist(false) and ClearCurvatures() are two ways to do the same thing. Remarks: When curvatures exist, CurvatureCount() = CurvatureCapacity(). When curvatures do not exist, CurvatureCount() = 0. Typically
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 determines which sub pack rect is assigned to each of the n ON_SubDMeshFragments use to render the n-gon face. Remarks: It is critical 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.
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 determines which sub pack rect is assigned to each of the n ON_SubDMeshFragments use to render the n-gon face. Remarks: It is critical 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.
void ON_SubDMeshFragment::SetPackedTextureCoordinates | ( | ) | const |
Description: Set the texture coordinates in m_T[] from the values in m_pack_rect[].
void ON_SubDMeshFragment::SetPackRectCornersForExperts | ( | bool | bGridOrder, |
const ON_2dPoint | fragment_pack_rect_corners[4] | ||
) |
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 critical 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.
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 critical 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.
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.
void ON_SubDMeshFragment::SetTextureCoordinatesExistForExperts | ( | bool | bTextureCoordinatesExist | ) | const |
void ON_SubDMeshFragment::SetTextureCoordinatesFromCorners | ( | ) | const |
Description: Set the texture coordinates in m_T[] from the values in m_ctrlnetT[].
bool ON_SubDMeshFragment::SetUnmanagedVertexCapacityForExperts | ( | size_t | vertex_capacity | ) |
Description: Sets number of fragment vertices available (number of elements available in the m_P[], m_N[], m_T[], m_K[], and m_C[] arrays). The memory for the arrays is managed by something besides this ON_SubDMeshFragment instance. Parameters: vertex_capacity - [in] A value no larger than ON_SubDMeshFragment::MaximumVertexCount. Returns: True if successful
void ON_SubDMeshFragment::SetUnpackedTextureCoordinates | ( | ) | const |
Description: Set the this fragments texture coordinates in m_T[] to cover (0,1)x(0,1)
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.
bool ON_SubDMeshFragment::SetVertexTextureCoordinate | ( | ON_2udex | grid2dex, |
ON_3dPoint | texture_coordinate | ||
) | const |
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.
bool ON_SubDMeshFragment::SetVertexTextureCoordinate | ( | unsigned | grid_point_index, |
ON_3dPoint | texture_coordinate | ||
) | const |
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.
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.
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.
|
static |
Returns: If side_segment_count is valid, then (side_segment_count+1) is returned. Otherwise 0 is returned.
|
static |
Returns: side_segment_count = 2^display_density
|
static |
Returns: true if side_segment_count is valid. Otherwise 0 is returned.
|
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 m_K[] arrays.
ON_ComponentStatus ON_SubDMeshFragment::Status | ( | ) | const |
Returns: Status of the face.
const class ON_SubDEdge* ON_SubDMeshFragment::SubDEdge | ( | unsigned int | grid_side_index | ) | const |
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.
const class ON_SubDFace* ON_SubDMeshFragment::SubDFace | ( | ) | const |
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.
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.
const ON_BoundingBox ON_SubDMeshFragment::SurfaceBoundingBox | ( | ) | const |
const double* ON_SubDMeshFragment::TextureCoordinateArray | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
unsigned ON_SubDMeshFragment::TextureCoordinateArrayCount | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
size_t ON_SubDMeshFragment::TextureCoordinateArrayStride | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
unsigned int ON_SubDMeshFragment::TextureCoordinateCapacity | ( | ) | const |
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.
unsigned int ON_SubDMeshFragment::TextureCoordinateCount | ( | ) | const |
Returns: If grid texture coordinates are available, then VertexCount() is returned. Otherwise 0 is returned.
bool ON_SubDMeshFragment::TextureCoordinatesExistForExperts | ( | ) | const |
bool ON_SubDMeshFragment::Transform | ( | bool | bKeepTextures, |
bool | bKeepCurvatures, | ||
bool | bKeepColors, | ||
const ON_Xform & | xform | ||
) |
This version transforms the points and normals and attempts possible transformations to the curvatures, texture coordinates and colors, if they are kept:
bKeepTextures | |
bKeepCurvatures | |
bKeepColors | |
xform |
bool ON_SubDMeshFragment::Transform | ( | bool | bKeepTextures, |
bool | bKeepCurvatures, | ||
bool | bKeepColors, | ||
const ON_Xform & | xform, | ||
const ON_Xform & | xformNormals, | ||
const ON_Xform & | xformTextures, | ||
const ON_Xform & | xformCurvatures, | ||
const ON_Xform & | xformColors | ||
) |
This version transforms the points, normals, curvatures, texture coordinates, and colors, if they are kept.
bKeepTextures | |
bKeepCurvatures | |
bKeepColors | |
xform | |
xformNormals | |
xformTextures | |
xformCurvatures | |
xformColors |
bool ON_SubDMeshFragment::Transform | ( | const ON_Xform & | xform | ) |
This simple version transforms the points and normals and attempts possible transformations to the curvatures, texture coordinates and colors:
Typically lots of fragments are being transformed and the type and context of the transformation determines if and how normals, texture coordinate, curvature and color inforation should be preserved, transformed, or destroyed. It is better to determine the answers to these questions and call the version of Transform with the bKeepTextures, bKeepCurvatures and bKeepColors parameters.
For example if the transformation is an isometry and the colors are set from the curvatures, then curvatures and colors should be kept. If the transformation is a similarity, the curvatures should be scaled and the colors destroyed. If the transformation is not a similarity both colors and curvatures should be destroyed.
If the texture coordinates are set from grid location (fake surface paramaters), then the texture coordinates should be kept. If transform is not an identity and the texture coordinates come from a world object mapping, they should generally be destroyed.
xform |
bool ON_SubDMeshFragment::UnmanagedArrays | ( | ) | const |
Returns: True if the memory in the m_P[], m_N[], m_T[], m_K[], and m_C[] arrays is managed by something besides this ON_SubDMeshFragment instance.
void ON_SubDMeshFragment::UnsetControlNetQuad | ( | ) |
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().
const ON_Color ON_SubDMeshFragment::VertexColor | ( | unsigned | grid2dex_i, |
unsigned | grid2dex_j | ||
) | const |
Description: Get the per vertex color assigned to 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 colo for the specified fragment grid point. When per vertex colors are not set, ON_Color::Unset is returned.
const ON_Color ON_SubDMeshFragment::VertexColor | ( | unsigned | grid_point_index | ) | const |
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().
const ON_SurfaceCurvature ON_SubDMeshFragment::VertexCurvature | ( | ON_2udex | grid2dex | ) | const |
const ON_SurfaceCurvature ON_SubDMeshFragment::VertexCurvature | ( | unsigned | grid2dex_i, |
unsigned | grid2dex_j | ||
) | const |
Description: Get the principal surface curvature 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 principal surface curvature for the specified fragment grid point. When curvatures are not set, ON_SurfaceCurvature::Nan is returned.
const ON_SurfaceCurvature ON_SubDMeshFragment::VertexCurvature | ( | unsigned | grid_point_index | ) | const |
const ON_3dVector ON_SubDMeshFragment::VertexNormal | ( | ON_2udex | grid2dex | ) | const |
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:
const ON_3dVector ON_SubDMeshFragment::VertexNormal | ( | unsigned | grid_point_index | ) | const |
const ON_3dPoint ON_SubDMeshFragment::VertexPoint | ( | ON_2udex | grid2dex | ) | const |
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:
const ON_3dPoint ON_SubDMeshFragment::VertexPoint | ( | unsigned | grid_point_index | ) | const |
const ON_SubDFaceParameter ON_SubDMeshFragment::VertexSubDFaceParameter | ( | ON_2udex | grid2dex | ) | const |
Get the SubD face evaluation parameter for the SubD surface point where this vertex is located.
grid2dex_i | 0 <= grid2dex.i <= m_grid.SideSegmentCount() |
grid2dex_j | 0 <= grid2dex.j <= m_grid.SideSegmentCount() |
const ON_SubDFaceParameter ON_SubDMeshFragment::VertexSubDFaceParameter | ( | unsigned | grid2dex_i, |
unsigned | grid2dex_j | ||
) | const |
Get the SubD face evaluation parameter for the SubD surface point where this vertex is located.
grid2dex_i | 0 <= grid2dex_i <= m_grid.SideSegmentCount() |
grid2dex_j | 0 <= grid2dex_j <= m_grid.SideSegmentCount() |
const ON_SubDFaceParameter ON_SubDMeshFragment::VertexSubDFaceParameter | ( | unsigned | grid_point_index | ) | const |
Get the SubD face evaluation parameter for the SubD surface point where this vertex is located.
grid_point_index | 0 <= grid_point_index <= m_grid.GridPointCount() |
const ON_3dPoint ON_SubDMeshFragment::VertexTextureCoordinate | ( | ON_2udex | grid2dex | ) | const |
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.
const ON_3dPoint ON_SubDMeshFragment::VertexTextureCoordinate | ( | unsigned | grid_point_index | ) | const |
const ON_3dPoint ON_SubDMeshFragment::VertexTextureCoordinateFromCorners | ( | ON_2udex | grid2dex | ) | const |
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.
const ON_3dPoint ON_SubDMeshFragment::VertexTextureCoordinateFromCorners | ( | unsigned | grid_point_index | ) | const |
|
friend |
|
friend |
|
friend |
|
static |
Every field of ON_SubDMeshFragment::Empty is zero.
const class ON_SubDFace* ON_SubDMeshFragment::m_face |
unsigned short ON_SubDMeshFragment::m_face_fragment_count |
Number of fragments that will be delivered for this face.
unsigned short ON_SubDMeshFragment::m_face_fragment_index |
First fragment has index = 0. Last fragment has index = m_face_fragment_count-1.
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
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.
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 accommodate up to m_P_capacity normals. If m_N is not nullptr and m_N_stride=0, then m_N[] can accommodate 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).
size_t ON_SubDMeshFragment::m_N_stride |
stride between normals for m_N[] as an array of 8 byte doubles (so 0 or >= 3)
ON_SubDMeshFragment* ON_SubDMeshFragment::m_next_fragment |
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.
size_t ON_SubDMeshFragment::m_P_stride |
stride between points for m_P[] as an array of 8 byte doubles (so 0 or >= 3)
ON_SubDMeshFragment* ON_SubDMeshFragment::m_prev_fragment |
ON_BoundingBox ON_SubDMeshFragment::m_surface_bbox |
3d bounding box of grid vertex points.
|
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 accommodate 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)
|
mutable |
stride between texture points for m_T[] as an array of 8 byte doubles (so 0 or >= 3)