Rhino C++ API
8.13
|
#include <opennurbs_subd.h>
Public Types | |
enum | : unsigned int { MaximumEdgeCount = 0xFFF0U } |
Public Member Functions | |
ON_SubDFace ()=default | |
ON_SubDFace (const ON_SubDFace &)=default | |
~ON_SubDFace ()=default | |
const ON_BoundingBox | BoundingBox (ON_SubDComponentLocation subd_appearance, const ON_SubD &subd) const |
const ON_Plane | CenterFrame (ON_SubDComponentLocation subd_appearance) const |
const ON_3dVector | CenterNormal (ON_SubDComponentLocation subd_appearance) const |
const ON_3dPoint | CenterPoint (ON_SubDComponentLocation subd_appearance) const |
void | ClearMaterialChannelIndex () const |
void | ClearPackId () |
void | ClearPackRect () |
void | ClearPerFaceColor () const |
void | ClearSavedSubdivisionPoints () const |
void | ClearSavedSubdivisionPoints (bool bClearNeighborhood) const |
void | ClearTexturePoints () const |
const ON_COMPONENT_INDEX | ComponentIndex () const |
const ON_SubDComponentPtr | ComponentPtr () const |
const ON_BoundingBox | ControlNetBoundingBox () const |
const ON_Plane | ControlNetCenterFrame () const |
The face's control net center frame is a plane with normal equal to this->ControlNetCenterNormal() and origin equal to this->ControlNetCenterPoint(). The x and y axes of the frame have no predictable relationship to the face or SubD control net topology. More... | |
const ON_3dVector | ControlNetCenterNormal () const |
When the face's control net polygon is planar, the face's control net normal is a unit vector perpindicular to the plane that points outwards. If the control net polygon is not planar, the control net normal is control net normal is a unit vector that is the average of the control polygon's corner normals. More... | |
const ON_3dPoint | ControlNetCenterPoint () const |
The face's control net center point is the average of the face's vertex control net points. This is the same point as the face's subdivision point. More... | |
const ON_3dPoint | ControlNetPoint (unsigned int i) const |
const ON_3dPoint | DoubleSubdivisionPoint () const |
Get the location of the subdivision point of faces's subdivision vertex. More... | |
const ON_3dPoint | DoubleSubdivisionPoint (unsigned subdivided_region_index) const |
Get the location of one of 2*EdgeCount() double subdivision points on the face. More... | |
const class ON_SubDEdge * | Edge (unsigned int i) const |
unsigned int | EdgeArrayIndex (const ON_SubDEdge *e) const |
unsigned int | EdgeCount () const |
ON__UINT_PTR | EdgeDirection (unsigned int i) const |
bool | EdgeMark (unsigned int i, bool bMissingEgeReturnValue) const |
ON__UINT8 | EdgeMarkBits (unsigned int i, ON__UINT8 missing_edge_return_value) const |
const ON_SubDEdgePtr | EdgePtr (unsigned int i) const |
const ON_SubDEdgePtr | EdgePtrFromEdge (const class ON_SubDEdge *e) const |
bool | EvaluateCatmullClarkSubdivisionPoint (double subdivision_point[3]) const |
unsigned int | FaceId () const |
void | FaceModifiedNofification () const |
bool | GetCenterPointAndNormal (ON_SubDComponentLocation subd_appearance, double *P, double *N) const |
unsigned int | GetCornerEdges (const ON_SubDVertex *corner_vertex, ON_SubDEdgePtr &entering_edge, ON_SubDEdgePtr &leaving_edge) const |
Get the edges in the face's boundary that are on either side of a face corner. More... | |
unsigned int | GetEdgeArray (ON_SimpleArray< ON_SubDEdgePtr > &face_edge_array) const |
bool | GetFacePackRectCorners (bool bGridOrder, ON_2dPoint face_pack_rect_corners[4]) const |
bool | GetMeshFragmentPackRectCorners (bool bGridOrder, unsigned int fragment_index, ON_2dPoint mesh_fragment_pack_rect_corners[4]) const |
bool | GetQuadSurface (class ON_BezierSurface &limit_surface) const |
bool | GetQuadSurface (class ON_NurbsSurface &limit_surface) const |
bool | GetQuadSurface (double *limit_surface_cv, size_t limit_surface_cv_stride0, size_t limit_surface_cv_stride1) const |
bool | GetSubdivisionPoint (double subdivision_point[3]) const |
bool | GetSurfaceCenterPointAndNormal (double *P, double *N) const |
bool | HasEdges () const |
bool | HasSharpEdges () const |
Determine if this SubD face has sharp edges. See ON_SubDEdge::IsSharp() for more information about sharp edges. More... | |
bool | IsConvex () const |
bool | IsNotConvex () const |
bool | IsNotPlanar (double planar_tolerance=ON_ZERO_TOLERANCE) const |
Determine if the face's control net polygon is not planar. More... | |
bool | IsPlanar (double planar_tolerance=ON_ZERO_TOLERANCE) const |
Determine if the face's control net polygon is planar. More... | |
unsigned int | MarkedEdgeCount () const |
unsigned int | MarkedVertexCount () const |
int | MaterialChannelIndex () const |
double | MaximumEdgeSharpness () const |
Get the maximum sharpeness of the edges that form the face's boundary. (Creased edges have zero sharpness.) More... | |
const class ON_SubDMeshFragment * | MeshFragments () const |
const ON_ComponentStatus | NeighborhoodStatusLogicalOr (bool bIncludeVertices, bool bIncludeEdges) const |
const ON_SubDEdge * | NextEdge (const ON_SubDEdge *edge) const |
unsigned int | NextEdgeArrayIndex (unsigned int edge_array_index) const |
ON_SubDFace & | operator= (const ON_SubDFace &)=default |
unsigned int | PackId () const |
const ON_2dPoint | PackRectCorner (bool bGridOrder, int corner_index) const |
bool | PackRectIsSet () const |
const ON_2dPoint | PackRectOrigin () const |
unsigned | PackRectRotationDegrees () const |
double | PackRectRotationRadians () const |
const ON_2dVector | PackRectSize () const |
const ON_Color | PerFaceColor () const |
const ON_SubDEdge * | PrevEdge (const ON_SubDEdge *edge) const |
unsigned int | PrevEdgeArrayIndex (unsigned int edge_array_index) const |
const ON_SubDEdge * | QuadOppositeEdge (const ON_SubDEdge *edge) const |
const ON_SubDVertex * | QuadOppositeVertex (const ON_SubDVertex *vertex) const |
bool | RemoveEdgeFromArray (const ON_SubDEdge *e) |
bool | RemoveEdgeFromArray (unsigned int i, ON_SubDEdgePtr &removed_edge) |
bool | ReplaceEdgeInArray (unsigned int fei0, ON_SubDEdge *edge_to_remove, ON_SubDEdge *edge_to_insert) |
bool | ReplaceEdgeInArray (unsigned int fei0, ON_SubDEdge *edge_to_remove, ON_SubDEdgePtr edgeptr_to_insert) |
bool | ReverseEdgeList () |
bool | RotateEdgeArray (unsigned int fei0) |
unsigned int | SetEdgeMarks (bool bMark) const |
void | SetMaterialChannelIndex (int material_channel_index) const |
void | SetPackIdForExperts (unsigned int pack_id) |
bool | SetPackRectForExperts (ON_2dPoint pack_rect_origin, ON_2dVector pack_rect_size, int packing_rotation_degrees) |
void | SetPerFaceColor (ON_Color color) const |
bool | SetTexturePoint (unsigned i, ON_3dPoint texture_point) const |
unsigned int | SetVertexMarks (bool bMark) const |
unsigned int | SharpEdgeCount () const |
Number of sharp edges attached to this face. See ON_SubDEdge::IsSharp() for more information about sharp edges. More... | |
unsigned int | SharpEdgeCount (ON_SubDEdgeSharpness &sharpness_range) const |
Get the range of sharpness values assigned to this face's sharp edges and return the number of sharp edges. See ON_SubDEdge::IsSharp() for more information about sharp edges. More... | |
const ON_3dPoint | SubdivisionPoint () const |
const ON_3dPoint | SubdivisionPoint (unsigned subdivision_count) const |
Get the location of the face's subdivision vertex. More... | |
const ON_BoundingBox | SurfaceBoundingBox (const ON_SubD &subd) const |
const ON_Plane | SurfaceCenterFrame () const |
Get the limit surface tangent plane at the center of the face. The plane's origin is the point on the limit surface at the center of the face. The plane's z axis is the limit surface normal vector at the center of the face. More... | |
const ON_3dVector | SurfaceCenterNormal () const |
Get the limit surface normal vector at the center of the face. More... | |
const ON_3dPoint | SurfaceCenterPoint () const |
Get the point on the limit surface that is at the center of the face. More... | |
const ON_3dPoint | TextureCenterPoint () const |
const ON_3dPoint | TexturePoint (unsigned int i) const |
bool | TexturePointsAreSet () const |
unsigned int | TexturePointsCapacity () const |
ON__UINT32 | TopologyCRC32 (bool bIncludeSubdivisionProperties) const |
Get a 32 bit CRC that is useful in detecting when a face's connections to attached vertices or edges have been changed. More... | |
const ON_SHA1_Hash | TopologyHash (bool bIncludeSubdivisionProperties) const |
Get a SHA-1 hash that is useful in detecting when a face's connections to attached vertices or edges have been changed. See also ON_SubDFace::TopologyCRC32() which, in practice, is just as reliable as the hash. More... | |
bool | Transform (bool bTransformationSavedSubdivisionPoint, bool bKeepCurvatures, bool bKeepTextures, bool bKeepColors, const ON_Xform &xform, const ON_Xform &xformNormals, const ON_Xform &xformCurvatures, const ON_Xform &xformTextures, const ON_Xform &xformColors) |
bool | Transform (bool bTransformationSavedSubdivisionPoint, const class ON_Xform &xform) |
const class ON_SubDVertex * | Vertex (unsigned int i) const |
const ON_SubDComponentPtrPair | VertexEdgePair (const ON_SubDVertex *vertex) const |
const ON_SubDComponentPtrPair | VertexEdgePair (unsigned vertex_index) const |
unsigned int | VertexIndex (const ON_SubDVertex *vertex) const |
bool | VertexMark (unsigned int i, bool bMissingVertexReturnValue) const |
ON__UINT8 | VertexMarkBits (unsigned int i, ON__UINT8 missing_vertex_return_value) const |
bool | Write (class ON_BinaryArchive &archive) const |
Public Member Functions inherited from ON_SubDComponentBase | |
ON_SubDComponentBase ()=default | |
ON_SubDComponentBase (const ON_SubDComponentBase &)=default | |
~ON_SubDComponentBase ()=default | |
unsigned int | ArchiveId () const |
bool | ClearMark () const |
ON__UINT8 | ClearMarkBits () const |
void | ClearSavedSubdivisionPoint () const |
void | ClearSubdivisionDisplacement () const |
bool | GetSavedSubdivisionPoint (double subdivision_point[3]) const |
bool | GetSubdivisionDisplacement (double *) const |
bool | InSymmetrySet () const |
bool | IsActive () const |
bool | IsSymmetrySetPrimaryMotif () const |
bool | Mark () const |
ON__UINT8 | MarkBits () const |
ON_SubDComponentBase & | operator= (const ON_SubDComponentBase &)=default |
const ON_3dPoint | SavedSubdivisionPoint () const |
bool | SavedSubdivisionPointIsSet () const |
void | SetArchiveId (unsigned int archive_id) const |
bool | SetMark () const |
bool | SetMark (bool bMark) const |
ON__UINT8 | SetMarkBits (ON__UINT8 mark_bits) const |
bool | SetSavedSubdivisionPoint (const double subdivision_point[3]) const |
bool | SetSubdivisionDisplacement (const double *) |
void | SetSubdivisionLevel (unsigned level) |
const ON_ComponentStatus | Status () const |
const ON_3dVector | SubdivisionDisplacement () const |
bool | SubdivisionDisplacementIsNonzero () const |
const unsigned | SubdivisionLevel () const |
Static Public Member Functions | |
static const ON_SubDFacePtr | FromVertices (const ON_SimpleArray< const ON_SubDVertex * > &vertex_list) |
static const ON_SubDFacePtr | FromVertices (const ON_SubDVertex *const *vertex_list, size_t face_vertices_count) |
static const ON_2udex | GetNgonSubPackRectSizeAndDelta (unsigned int ngon_edge_count, ON_2dVector ngon_face_pack_rect_size, ON_2dVector &ngon_sub_pack_rect_size, ON_2dVector &ngon_sub_pack_rect_delta) |
static bool | IsValidPackRect (ON_2dPoint pack_rect_origin, ON_2dVector pack_rect_size, int packing_rotation_degrees) |
static double | PackRectGapInPixels (double pack_rect_distance_in_pixels) |
static bool | Read (class ON_BinaryArchive &archive, class ON_SubD &subd, class ON_SubDFace *&face) |
Static Public Member Functions inherited from ON_SubDComponentBase | |
static int | CompareId (const ON_SubDComponentBase *lhs, const ON_SubDComponentBase *rhs) |
Public Attributes | |
ON_SubDEdgePtr | m_edge4 [4] |
unsigned short | m_edge_count = 0 |
ON_SubDEdgePtr * | m_edgex = nullptr |
unsigned short | m_edgex_capacity = 0 |
unsigned int | m_level_zero_face_id = 0 |
id of level zero face More... | |
const class ON_SubDFace * | m_next_face = nullptr |
linked list of faces on this level More... | |
const class ON_SubDFace * | m_prev_face = nullptr |
m_prev_face, m_next_face must be the first data members of ON_SubDFace More... | |
Public Attributes inherited from ON_SubDComponentBase | |
unsigned int | m_group_id = 0U |
unsigned int | m_id = 0 |
ON_ComponentStatus | m_status = ON_ComponentStatus::NoneSet |
const class ON_SubDVertex * | m_subd_point1 = nullptr |
Static Public Attributes | |
static const ON_SubDFace | Empty |
Static Public Attributes inherited from ON_SubDComponentBase | |
static const ON_SubDComponentBase | Unset |
Friends | |
class | ON_Internal_SubDFaceMeshFragmentAccumulator |
class | ON_SubDArchiveIdMap |
class | ON_SubDEdge |
class | ON_SubDHeap |
class | ON_SubDVertex |
Additional Inherited Members | |
Protected Types inherited from ON_SubDComponentBase | |
enum | ModifiedFlags : unsigned char { Modified1Bit = 0x01, Modified2Bit = 0x02, ModifiedFlagsMask = 0x03 } |
enum | SavedPointsFlags : unsigned char { SubdivisionPointBit = 0x40, SurfacePointBit = 0x80, CachedPointMask = 0xC0 } |
Protected Member Functions inherited from ON_SubDComponentBase | |
void | CopyBaseFrom (const ON_SubDComponentBase *src, bool bCopySymmetrySetNext) |
void | Internal_ClearModifiedFlags () const |
void | Internal_ClearSubdivisionPointAndSurfacePointFlags () const |
void | Internal_ClearSubdivisionPointFlag () const |
void | Internal_ClearSurfacePointFlag () const |
bool | Internal_Modified1IsSet () const |
bool | Internal_Modified1or2IsSet () const |
void | Internal_SetModified1Flag () const |
void | Internal_SetModified2Flag () const |
void | Internal_SetSavedSurfacePointFlag (bool bSavedSurfacePointFlag) const |
bool | Internal_SubdivisionPointFlag () const |
bool | Internal_SurfacePointFlag () const |
void | Internal_TransformComponentBase (bool bTransformationSavedSubdivisionPoint, const class ON_Xform &xform) |
Protected Attributes inherited from ON_SubDComponentBase | |
unsigned char | m_level = 0U |
unsigned char | m_saved_points_flags = 0U |
double | m_saved_subd_point1 [3] |
GetSubdivisionPoint( bUseSavedSubdivisionPoint=true ) can change the value of m_cache_subd_P. More... | |
anonymous enum : unsigned int |
Array of m_edge_count edges that form the boundary of the face. The edges are in ordered to form a continuous loop.
The first four are in m_edge4[0], ..., m_edge4[3]. When m_edge_count > 4, the fifth and additional edges are in m_edgex[0], ..., m_edgex[m_edge_count-5];
The value of ON_SubDEdgePtr.EdgeDirection() is 0 if the edge's natural orientation from m_vertex[0] to m_vertex[1] agrees with the face's boundary orientation.
The value of ON_SubDEdgePtr.EdgeDirection() is 1 if the edge's natural orientation from m_vertex[0] to m_vertex[1] is opposited the face's boundary orientation.
Enumerator | |
---|---|
MaximumEdgeCount |
|
default |
|
default |
|
default |
const ON_BoundingBox ON_SubDFace::BoundingBox | ( | ON_SubDComponentLocation | subd_appearance, |
const ON_SubD & | subd | ||
) | const |
const ON_Plane ON_SubDFace::CenterFrame | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
const ON_3dVector ON_SubDFace::CenterNormal | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
const ON_3dPoint ON_SubDFace::CenterPoint | ( | ON_SubDComponentLocation | subd_appearance | ) | const |
void ON_SubDFace::ClearMaterialChannelIndex | ( | ) | const |
Description: Remove the per face rendering material channel index. The face will use the material assigned to the subd object.
void ON_SubDFace::ClearPackId | ( | ) |
Description: Sets PackId() to zero. Remarks: Does not change the values of ON_SubDFace::PackRectOrigin(), ON_SubDFace::PackRectSize(), ON_SubDFace::PackRectRotationDegrees(), or ON_SubDFace::TextureCoordinateType() Use ON_SubDFace::ClearPackRect() to clear the pack rectangle.
void ON_SubDFace::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_SubDFace::ClearPerFaceColor | ( | ) | const |
Description: Remove per face color setting. The face will use the color assigned to the subd object.
void ON_SubDFace::ClearSavedSubdivisionPoints | ( | ) | const |
Description: Clears saved subdivision and limit surface information for this face. Attached edges and vertices are not modified.
void ON_SubDFace::ClearSavedSubdivisionPoints | ( | bool | bClearNeighborhood | ) | const |
Description: Clears saved subdivision and limit surface information for this face. Parameters: bClearNeighborhood - [in] If true, all vertices, edges and face attached to this face are also cleared.
void ON_SubDFace::ClearTexturePoints | ( | ) | const |
Description: Remove all texture points. Remarks: Texture points are a mutable property on ON_SubDFace.
const ON_COMPONENT_INDEX ON_SubDFace::ComponentIndex | ( | ) | const |
const ON_SubDComponentPtr ON_SubDFace::ComponentPtr | ( | ) | const |
const ON_BoundingBox ON_SubDFace::ControlNetBoundingBox | ( | ) | const |
const ON_Plane ON_SubDFace::ControlNetCenterFrame | ( | ) | const |
The face's control net center frame is a plane with normal equal to this->ControlNetCenterNormal() and origin equal to this->ControlNetCenterPoint(). The x and y axes of the frame have no predictable relationship to the face or SubD control net topology.
const ON_3dVector ON_SubDFace::ControlNetCenterNormal | ( | ) | const |
When the face's control net polygon is planar, the face's control net normal is a unit vector perpindicular to the plane that points outwards. If the control net polygon is not planar, the control net normal is control net normal is a unit vector that is the average of the control polygon's corner normals.
const ON_3dPoint ON_SubDFace::ControlNetCenterPoint | ( | ) | const |
The face's control net center point is the average of the face's vertex control net points. This is the same point as the face's subdivision point.
const ON_3dPoint ON_SubDFace::ControlNetPoint | ( | unsigned int | i | ) | const |
const ON_3dPoint ON_SubDFace::DoubleSubdivisionPoint | ( | ) | const |
Get the location of the subdivision point of faces's subdivision vertex.
const ON_3dPoint ON_SubDFace::DoubleSubdivisionPoint | ( | unsigned | subdivided_region_index | ) | const |
Get the location of one of 2*EdgeCount() double subdivision points on the face.
subdivided_region_index | 0 <= subdivided_region_index < 2*face.EdgeCount(). This parameter specifies which of the 2*face.EdgeCount() possible points to return. |
When subdivided_region_index = 2*i (even), the subdivision point of the subdivided face with 4 corners face.Vertex(i).SubdivisionPoint(), face.Edge(i).SubdivisionPoint(), face.SubdivisionPoint(), face.Edge(i-1).SubdivisionPoint() is returned.
When subdivided_region_index = 2*i+1 (odd), the subdivision point of the subdivided edge connecting face.Edge(i).SubdivisionPoint() and face.SubdivisionPoint() is returned.
const class ON_SubDEdge* ON_SubDFace::Edge | ( | unsigned int | i | ) | const |
unsigned int ON_SubDFace::EdgeArrayIndex | ( | const ON_SubDEdge * | e | ) | const |
Returns: If e is part of the face's boundary, then the index of the edge is returned. Otherwise, ON_UNSET_UINT_INDEX is returned.
unsigned int ON_SubDFace::EdgeCount | ( | ) | const |
Description: Returns the number of edges and (number of vertices) in the face's boundary. Remarks: Boundaries that vist the same vertex or same edge multiple times are not permitted. So the number of vertices and number of edges is always the same.
ON__UINT_PTR ON_SubDFace::EdgeDirection | ( | unsigned int | i | ) | const |
bool ON_SubDFace::EdgeMark | ( | unsigned int | i, |
bool | bMissingEgeReturnValue | ||
) | const |
const ON_SubDEdgePtr ON_SubDFace::EdgePtr | ( | unsigned int | i | ) | const |
const ON_SubDEdgePtr ON_SubDFace::EdgePtrFromEdge | ( | const class ON_SubDEdge * | e | ) | const |
bool ON_SubDFace::EvaluateCatmullClarkSubdivisionPoint | ( | double | subdivision_point[3] | ) | const |
Description: Evaluates the Catmull-Clark subdivision point ignoring all cached information. This function is typically used in testing and debugging code and in ordinary cases, it is faster and better to call SubdivisionPoint() or GetSubdivisionPoint(). Parameters: subdivision_point - [out] The Catmull-Clark face subdivision point is returned here.
unsigned int ON_SubDFace::FaceId | ( | ) | const |
void ON_SubDFace::FaceModifiedNofification | ( | ) | const |
Description: Call this function if the face is modified and it will clear any cached subdivision information that needs to be recalculated.
|
static |
Parameters: vertex_list - [in] vertices in face boundary. vertex_list[0] can be any vertex in the face boundary and vertex_list[] can traverse the boundary in order or reversed. Return: If there is a face whose boundary vertex list is face_vertices[], then that face is returned and ON_SubDFacePtr.FaceDirection() indicates the orientation of face_vertices[]. Otherwise ON_SubDFacePtr::Null is returned.
|
static |
bool ON_SubDFace::GetCenterPointAndNormal | ( | ON_SubDComponentLocation | subd_appearance, |
double * | P, | ||
double * | N | ||
) | const |
unsigned int ON_SubDFace::GetCornerEdges | ( | const ON_SubDVertex * | corner_vertex, |
ON_SubDEdgePtr & | entering_edge, | ||
ON_SubDEdgePtr & | leaving_edge | ||
) | const |
Get the edges in the face's boundary that are on either side of a face corner.
corner_vertex | Vertex used to identify the face corner. |
entering_edge | The face's boundary edge ending at corner_vertex is retuned here. |
leaving_edge | The face's boundary edge beginning at corner_vertex is retuned here. |
unsigned int ON_SubDFace::GetEdgeArray | ( | ON_SimpleArray< ON_SubDEdgePtr > & | face_edge_array | ) | const |
Description: Get the face's boundary. Parameters: face_edge_array - [out] The boundary of the face is returned in canonical counter-clockwise order. Returns: Number of edges in the face's boundary.
bool ON_SubDFace::GetFacePackRectCorners | ( | bool | bGridOrder, |
ON_2dPoint | face_pack_rect_corners[4] | ||
) | const |
Parameters: bGridOrder - [in] false: counter clockwise quad order. true: fragment grid order mesh_fragment_pack_rect_corners - [out] Pack rectangle corners for the specified mesh fragment are returned here. face_pack_rect_corners[i] = this->PackRectCorner(bGridOrder,i); Returns: True if the input is valid and the face's pack rectangle corner coordinates were returned. False otherwise. Remarks: Compare with ON_SubDFace.GetMeshFragmentPackRectCorners().
bool ON_SubDFace::GetMeshFragmentPackRectCorners | ( | bool | bGridOrder, |
unsigned int | fragment_index, | ||
ON_2dPoint | mesh_fragment_pack_rect_corners[4] | ||
) | const |
Parameters: bGridOrder - [in] false: counter clockwise quad order. true: fragment grid order fragment_index - [in] If the face is a quad (EdgeCount() = 4), then fragment_index must be zero. If the face is a n-gon (EdgeCount() = n and n != 4), then 0 <= fragment_index < EdgeCount(). mesh_fragment_pack_rect_corners - [out] Pack rectangle corners for the specified mesh fragment are returned here. If the face is a quad, mesh_fragment_pack_rect_corners[] are the pack rect texture points for the quad corners in the order specified by bGridOrder and standard linear interpolation between the 4 corners will produce reasonable texture mapping coordinates. If the face is an n-gon, mesh_fragment_pack_rect_corners[0] is the pack rect texture point at face->Vertex(fragment_index). For n-gons, the n fragments are assigned non-overlapping rectangular subsetsof the face's pack rect. Interpolating between corner values will not produce good texture mapping coordinates. Pack rects are create useful and optimal texture mapping results when the SubD is rendered from its mesh fragmantes. Returns: True if the input is valid and the pack rectangle corner coordinates for the specified mesh fragment were returned. False otherwise. Remarks: A quad face (EdgeCount()=4) is rendered using 1 ON_SubDMeshFragment. An n-gon face (EdgeCount()=n and n != 4) is rendered using n ON_SubDMeshFragments. These n fragments correspond the SubD quads the n-gon face would generate with one level of Catmull-Clark subdivision.
|
static |
Description: Calculate how a packing rectangle assigned to an ON_SubDFace will be subdivided into n sub packing rectangles for an ngon when n >= 5. Parameters: ngon_edge_count - [in] >= 5. ngon_face_pack_rect_size - [in] ngon_face_pack_rect_size.x > 0 and ngon_face_pack_rect_size.y > 0 The width and height of the sizeof the ngon's entire packing rectangle. This is typically ON_SubD_Face::PackRectSize() once that property is coorectly set. ngon_sub_pack_rect_size - [out] The size of sub pack rects. If input is not valid, then ON_2dVector::ZeroVector is returned. ngon_sub_pack_rect_delta - [out] The delta from one sub pack rect to the next. If input is not valid, then ON_2dVector::ZeroVector is returned. Returns: When the input is valid, ON_2udex(i,j) is returned and specifies the face's packing rectangle should be divided into i X j sub packing rectangles. Otherwise, ON_2udex(0,0) is returned and
bool ON_SubDFace::GetQuadSurface | ( | class ON_BezierSurface & | limit_surface | ) | const |
bool ON_SubDFace::GetQuadSurface | ( | class ON_NurbsSurface & | limit_surface | ) | const |
bool ON_SubDFace::GetQuadSurface | ( | double * | limit_surface_cv, |
size_t | limit_surface_cv_stride0, | ||
size_t | limit_surface_cv_stride1 | ||
) | const |
Description: Get the bicubic b-spline control points for the limit surface. The corresponding knots are uniform. Parameters: vertex - [in] limit_surface_cv_stride0 - [int] limit_surface_cv_stride1 - [out] limit_surface_cv - [out] control points for a cubic spline surface CV[i][j][k] = limit_surface_cv[i*limit_bspline_cv_stride0 + j*limit_bspline_cv_stride1 + k] 0 <= i < 4, 0 <= j < 4, 0 <= k < 3 Returns: true if successful false if the limit surface for this face is not a cubic surface Remarks: The knots for the bicubic b-spline surface are uniform.
bool ON_SubDFace::GetSubdivisionPoint | ( | double | subdivision_point[3] | ) | const |
Parameters: subdivision_point - [out] The average of the face vertex locations. Returns: true if successful summary> The SubD face Catmull-Clark subdivision point. /summary>
bool ON_SubDFace::GetSurfaceCenterPointAndNormal | ( | double * | P, |
double * | N | ||
) | const |
Description: Get the limit surface point location and normal at the center of the face. Parameters: P - [out] P = limit surface location or ON_3dPoint::NanPoint if not available. N - [out] N = limit surface unit normal or ON_3dVector::NanVector if not available. Returns: True if the point and normal were set from the limit mesh fragment. False if the limit mesh fragment was not found and nan values were returned.
bool ON_SubDFace::HasEdges | ( | ) | const |
Description: Rapidly verifies that:
bool ON_SubDFace::HasSharpEdges | ( | ) | const |
Determine if this SubD face has sharp edges. See ON_SubDEdge::IsSharp() for more information about sharp edges.
bool ON_SubDFace::IsConvex | ( | ) | const |
bool ON_SubDFace::IsNotConvex | ( | ) | const |
bool ON_SubDFace::IsNotPlanar | ( | double | planar_tolerance = ON_ZERO_TOLERANCE | ) | const |
Determine if the face's control net polygon is not planar.
planar_tolerance |
bool ON_SubDFace::IsPlanar | ( | double | planar_tolerance = ON_ZERO_TOLERANCE | ) | const |
Determine if the face's control net polygon is planar.
planar_tolerance |
|
static |
Parameters: pack_rect_origin - [in] Lower left corner. Valid origins have (0 <= origin.x < 1) and (0 <= origin.y < 1) pack_rect_size - [in] vector from lower left corner to upper right corner. Valid deltas have (0 < delta.x, 0 < delta.y, (origin.x+delta.x) <= 1) and (origin.y+delta.y) <= 1. packing_rotation_degrees - [in] Valid packing_rotation_degrees are a multiple of 90. Returns: True if the input parameters define a valid pack rectangle.
unsigned int ON_SubDFace::MarkedEdgeCount | ( | ) | const |
Returns: Number of edges in the face's boundary with Edge().m_status.RuntimeMark() = true;
unsigned int ON_SubDFace::MarkedVertexCount | ( | ) | const |
Returns: Number of vertices in the face's boundary with Vertex().m_status.RuntimeMark() = true;
int ON_SubDFace::MaterialChannelIndex | ( | ) | const |
Returns: This face's rendering material channel index.
Remarks: If base_material is the ON_Material assigned to render this subd, MaterialChannelIndex() > 0, and ON_UUID face_material_id = base_material.MaterialChannelIdFromIndex( face.MaterialChannelIndex() ) is not nil, then face_material_id identifies an override rendering material for this face. Otherwise base_material is used to reneder this face.
double ON_SubDFace::MaximumEdgeSharpness | ( | ) | const |
Get the maximum sharpeness of the edges that form the face's boundary. (Creased edges have zero sharpness.)
const class ON_SubDMeshFragment* ON_SubDFace::MeshFragments | ( | ) | const |
Returns: A linked list of limit mesh fragments that cover this face. Nullptr if none are currently available.
If the face is a quad, there is a single fragment. If the face is an n-gon with 4 != n, then the list has n fragments. The i-th fragment covers the subdivision quad with its corner at Vertex(i).
Remarks: Use the returned fragments immediately or make a copies you manage for later use.
Use ON_SubD.UpdateSurfaceMeshCache(false) or ON_SubD.UpdateSurfaceMeshCache(true) to create the face fragments.
ON_SubDFace.ClearSavedSubdivisionPoints() removes any saved fragments and is called when the face or nearby components are modified.
const ON_ComponentStatus ON_SubDFace::NeighborhoodStatusLogicalOr | ( | bool | bIncludeVertices, |
bool | bIncludeEdges | ||
) | const |
Parameters: bIncludeVertices - [in] If true, then attached vertices are included. bIncludeEdges - [in] If true, then attached edges are included. Returns: A ON_ComponentStatusLogicalOr() of this vertex's status and the specified attached components. See Also: ON_SubDComponentBase::Status()
const ON_SubDEdge* ON_SubDFace::NextEdge | ( | const ON_SubDEdge * | edge | ) | const |
unsigned int ON_SubDFace::NextEdgeArrayIndex | ( | unsigned int | edge_array_index | ) | const |
|
default |
unsigned int ON_SubDFace::PackId | ( | ) | const |
Returns: 0: unset pack id.
0: set pack id.
Remarks: Faces that share the same PackId() must be neighboring quad faces that form a larger rectangular grid of quads. Single faces that are not quads and isolated quads cannot share a pack id with other faces.
const ON_2dPoint ON_SubDFace::PackRectCorner | ( | bool | bGridOrder, |
int | corner_index | ||
) | const |
Parameters: bGridOrder - [in] false: counter clockwise quad order. true: fragment grid order corner_index - [in] 0, 1, 2, or 3 Returns: Specified pack rectangle corner coordinates. The pack rect is the (x0,x0+dx) x (y0,y0+dy) rectangle inside the unit square (0,1)x(0,1) where (x0,y0) = PackRectOrigin() and (dx,dy) = PackRectSize().
|
static |
Parameters: pack_rect_distance_in_pixels - [in] A (normalized pack rect distance) * ON_SubD::TextureImageSuggestedMinimumSize Returns: Suggested gap between adjacent pack rects for a texture images with width and height >= ON_SubD::TextureImageSuggestedMinimumSize. This value will be 0.0 when pack_rect_distance_in_pixels is too small to permit a gap of 1 or more pixels without visibly adverse effects in a texture map clarity.
bool ON_SubDFace::PackRectIsSet | ( | ) | const |
Returns: true if the pack rect is set. Remarks: Faces that share the same PackId() must be neighboring quad faces that form a larger rectangular grid of quads. Single faces that are not quads and isolated quads cannot share a pack id with other faces.
const ON_2dPoint ON_SubDFace::PackRectOrigin | ( | ) | const |
Returns Lower left coordinate of this face's pack rect in normalized pack rect coordinates.
unsigned ON_SubDFace::PackRectRotationDegrees | ( | ) | const |
Returns: 0, 90, 180, or 270 Remarks: This rotation is used to keep pack rect coordinates continuous in quad packs containing faces with inconsistent topological orientations, which is the most common situation.
double ON_SubDFace::PackRectRotationRadians | ( | ) | const |
Returns: 0, 0.5*ON_PI, ON_PI, or 1.5*ON_PI Remarks: This rotation is used to keep pack rect coordinates continuous in quad packs containing faces with inconsistent topological orientations, which is the most common situation.
const ON_2dVector ON_SubDFace::PackRectSize | ( | ) | const |
Returns Size of this face's pack rect in normalized pack rect coordinates.
const ON_Color ON_SubDFace::PerFaceColor | ( | ) | const |
Returns: Per face color. A value of ON_Color::UnsetColor indicates the face uses the color assigned to the subd object.
const ON_SubDEdge* ON_SubDFace::PrevEdge | ( | const ON_SubDEdge * | edge | ) | const |
unsigned int ON_SubDFace::PrevEdgeArrayIndex | ( | unsigned int | edge_array_index | ) | const |
const ON_SubDEdge* ON_SubDFace::QuadOppositeEdge | ( | const ON_SubDEdge * | edge | ) | const |
Description: If the face is a quad, get the opposite side edge. Parameters: edge - [in] an edge on this face. Returns: If the face is a quad and edge is an edge of the face, then the edge on the opposite side is returned. Otherwise, nullptr is returned.
const ON_SubDVertex* ON_SubDFace::QuadOppositeVertex | ( | const ON_SubDVertex * | vertex | ) | const |
Description: If the face is a quad, get the opposite corner vertex. Parameters: vertex - [in] a vertex on this face. Returns: If the face is a quad and vertex is a vertex of the face, then the vertex on the opposite corner is returned. Otherwise, nullptr is returned.
|
static |
bool ON_SubDFace::RemoveEdgeFromArray | ( | const ON_SubDEdge * | e | ) |
Description: Expert user tool to remove an edge from the face's edge array. Remarks: Does not modify the edge. If the face is referenced in the edge's face array, then the face must be removed from the edge's face array.
bool ON_SubDFace::RemoveEdgeFromArray | ( | unsigned int | i, |
ON_SubDEdgePtr & | removed_edge | ||
) |
Description: Expert user tool to remove an edge from the face's edge array. Remarks: Does not modify the edge. If the face is referenced in the edge's face array, then the face must be removed from the edge's face array.
bool ON_SubDFace::ReplaceEdgeInArray | ( | unsigned int | fei0, |
ON_SubDEdge * | edge_to_remove, | ||
ON_SubDEdge * | edge_to_insert | ||
) |
Description: Expert user tool to replace one edge with another in the face's edge array. Parameters: edge_to_remove - [in] edge_to_insert - [in] The inserted edge is assigned the same boundary orientation as the removed edge. Remarks: Does not modify the edge. The corresponding reference to this face must be removed from the first edge and added to the second edge.
bool ON_SubDFace::ReplaceEdgeInArray | ( | unsigned int | fei0, |
ON_SubDEdge * | edge_to_remove, | ||
ON_SubDEdgePtr | edgeptr_to_insert | ||
) |
Description: Expert user tool to replace one edge with another in the face's edge array. Parameters: edge_to_remove - [in] edgeptr_to_insert - [in] The inserted edge is assigned the same boundary orientation specified in edgeptr_to_insert. Remarks: Does not modify the edge. The corresponding reference to this face must be removed from the first edge and added to the second edge.
bool ON_SubDFace::ReverseEdgeList | ( | ) |
Description: Reverse the order and orientation of the edges that form the boundary of this face.
bool ON_SubDFace::RotateEdgeArray | ( | unsigned int | fei0 | ) |
Description: Rotates the edge array so that Edge(fei0) becomes the first edge in the edge array.
unsigned int ON_SubDFace::SetEdgeMarks | ( | bool | bMark | ) | const |
Description: Set the mark of every boundary edge attached to this face. Returns: Number of marks changed.
void ON_SubDFace::SetMaterialChannelIndex | ( | int | material_channel_index | ) | const |
Description: Set the per face rendering material channel index.
Parameters: material_channel_index - [in] A value between 0 and ON_Material::MaximumMaterialChannelIndex, inclusive. This value is typically 0 or the value returned from ON_Material::MaterialChannelIndexFromId().
Remarks: If base_material is the ON_Material assigned to render this subd and ON_UUID face_material_id = base_material.MaterialChannelIdFromIndex( material_channel_index ) is not nil, then face_material_id identifies an override rendering material for this face. Otherwise base_material is used to reneder this face.
void ON_SubDFace::SetPackIdForExperts | ( | unsigned int | pack_id | ) |
Description:
The ON_SubD::PackFaces() function uses this function to set the value of ON_SubDFace::PackId(). Unless you are an expert and doing something very carefully and very fancy, to not call this function. You must also set the pack rectangle correctly. Remarks: Faces that share the same PackId() must be neighboring quad faces that form a larger rectangular grid of quads. Single faces that are not quads and isolated quads cannot share a pack id with other faces.
bool ON_SubDFace::SetPackRectForExperts | ( | ON_2dPoint | pack_rect_origin, |
ON_2dVector | pack_rect_size, | ||
int | packing_rotation_degrees | ||
) |
Description: The ON_SubD::PackFaces() function uses this function to set the face's pack rectangle (ON_SubDFace::PackRectOrigin(), ON_SubDFace::PackRectSize(), ON_SubDFace::PackRectRotationDegrees()). Unless you are an expert and doing something very carefully and very fancy, to not call this function. The lower left corner will be origin, the upper right corner will be delta. You must also set the pack id correctly. Parameters: pack_rect_origin - [in] Lower left corner. Valid origins have (0 <= origin.x < 1) and (0 <= origin.y < 1) pack_rect_size - [in] vector from lower left corner to upper right corner. Valid deltas have (0 < delta.x, 0 < delta.y, (origin.x+delta.x) <= 1) and (origin.y+delta.y) <= 1. packing_rotation_degrees - [in] Valid packing_rotation_degrees are a multiple of 90. Return: True if input is valid and the pack rectangle was set. False if the input was not vaie and the pack rectangle coordinates were set to nan.
void ON_SubDFace::SetPerFaceColor | ( | ON_Color | color | ) | const |
Description: Set per face color.
Parameters: color - [in]
bool ON_SubDFace::SetTexturePoint | ( | unsigned | i, |
ON_3dPoint | texture_point | ||
) | const |
Description: Set the texture point at the specified face vertex. Parameters: i - [in] 0 <= 0 < this->EdgeCount() Parameters: texture_point - [in] Returns: If this->TexturePointsCanBeSet() is true and i is a valid index, then the texture point is set and true is returned. Otherwise, false is returned. Remarks: To allocate texture point storage, call ON_SubD.AllocateFaceTexturePoints(this). Texture points are a mutable property on ON_SubDFace.
unsigned int ON_SubDFace::SetVertexMarks | ( | bool | bMark | ) | const |
Description: Set the mark of every vertex attached to this face. Returns: Number of marks changed.
unsigned int ON_SubDFace::SharpEdgeCount | ( | ) | const |
Number of sharp edges attached to this face. See ON_SubDEdge::IsSharp() for more information about sharp edges.
unsigned int ON_SubDFace::SharpEdgeCount | ( | ON_SubDEdgeSharpness & | sharpness_range | ) | const |
Get the range of sharpness values assigned to this face's sharp edges and return the number of sharp edges. See ON_SubDEdge::IsSharp() for more information about sharp edges.
sharpness_range | The range of sharpness values is returned here. (0,0) is returned if there are no sharp edges. |
const ON_3dPoint ON_SubDFace::SubdivisionPoint | ( | ) | const |
const ON_3dPoint ON_SubDFace::SubdivisionPoint | ( | unsigned | subdivision_count | ) | const |
Get the location of the face's subdivision vertex.
subdivision_count | subdivision_count >= 1 is the number of subdivisions to perform. |
const ON_BoundingBox ON_SubDFace::SurfaceBoundingBox | ( | const ON_SubD & | subd | ) | const |
const ON_Plane ON_SubDFace::SurfaceCenterFrame | ( | ) | const |
Get the limit surface tangent plane at the center of the face. The plane's origin is the point on the limit surface at the center of the face. The plane's z axis is the limit surface normal vector at the center of the face.
const ON_3dVector ON_SubDFace::SurfaceCenterNormal | ( | ) | const |
Get the limit surface normal vector at the center of the face.
const ON_3dPoint ON_SubDFace::SurfaceCenterPoint | ( | ) | const |
Get the point on the limit surface that is at the center of the face.
const ON_3dPoint ON_SubDFace::TextureCenterPoint | ( | ) | const |
const ON_3dPoint ON_SubDFace::TexturePoint | ( | unsigned int | i | ) | const |
Description: Get the texture point at the specified face vertex. Parameters: i - [in] 0 <= 0 < this->EdgeCount() Returns: If texture
bool ON_SubDFace::TexturePointsAreSet | ( | ) | const |
Returns: If texture points are set, then true is returned. Otherwise, false is returned.
unsigned int ON_SubDFace::TexturePointsCapacity | ( | ) | const |
Returns: Number of texture points that can be set on this face. Remarks: To allocate texture point storage, call ON_SubD.AddFaceTexturePointCapacity(this).
ON__UINT32 ON_SubDFace::TopologyCRC32 | ( | bool | bIncludeSubdivisionProperties | ) | const |
Get a 32 bit CRC that is useful in detecting when a face's connections to attached vertices or edges have been changed.
bIncludeSubdivisionProperties | Pass true if you want to include nontopological subdivision properties (control net points) that help determine the faces's subdivision point in the hash. |
const ON_SHA1_Hash ON_SubDFace::TopologyHash | ( | bool | bIncludeSubdivisionProperties | ) | const |
Get a SHA-1 hash that is useful in detecting when a face's connections to attached vertices or edges have been changed. See also ON_SubDFace::TopologyCRC32() which, in practice, is just as reliable as the hash.
bIncludeSubdivisionProperties | Pass true if you want to include nontopological subdivision properties (control net points) that help determine the faces's subdivision point in the hash. |
bool ON_SubDFace::Transform | ( | bool | bTransformationSavedSubdivisionPoint, |
bool | bKeepCurvatures, | ||
bool | bKeepTextures, | ||
bool | bKeepColors, | ||
const ON_Xform & | xform, | ||
const ON_Xform & | xformNormals, | ||
const ON_Xform & | xformCurvatures, | ||
const ON_Xform & | xformTextures, | ||
const ON_Xform & | xformColors | ||
) |
Description: Apply a transformation matrix to face geometry information. This version transforms the points, normals, curvatures, texture coordinates, and colors, if they are kept.
Parameters: bTransformationSavedSubdivisionPoint - [in] If the transformation is being applied to every vertex, edge and face in every level of a subdivision object, and the transformation is an orientation preserving isometry (rotation, translation, ...), then set bTransformationSavedSubdivisionPoint = true to apply the transformation to saved subdivision and saved limit point information. In all other cases, set bTransformationSavedSubdivisionPoint = false and any saved subdivision points or saved limit points will be deleted. When in doubt, pass false. bKeepTExtures - [in] bKeepCurvatures - [in] bKeepColors - [in] xform - [in] xformNormals - [in] xformTextures - [in] xformCurvatures - [in] xformColors - [in]
bool ON_SubDFace::Transform | ( | bool | bTransformationSavedSubdivisionPoint, |
const class ON_Xform & | xform | ||
) |
Description: Apply a transformation matrix to face geometry information.
Parameters: bTransformationSavedSubdivisionPoint - [in] If the transformation is being applied to every vertex, edge and face in every level of a subdivision object, and the transformation is an orientation preserving isometry (rotation, translation, ...), then set bTransformationSavedSubdivisionPoint = true to apply the transformation to saved subdivision and saved limit point information. In all other cases, set bTransformationSavedSubdivisionPoint = false and any saved subdivision points or saved limit points will be deleted. When in doubt, pass false.
xform - [in]
const class ON_SubDVertex* ON_SubDFace::Vertex | ( | unsigned int | i | ) | const |
const ON_SubDComponentPtrPair ON_SubDFace::VertexEdgePair | ( | const ON_SubDVertex * | vertex | ) | const |
Returns; If the vertex is in this face's boundary, pair of face boundary edges at the vertex is returned with face boundary orientations, that is vertex = pair.First().EdgePtr().RelativeVertex(1) and vertex = pair.Second().EdgePtr().RelativeVertex(0). Otherwise, ON_SubDComponentPtrPair::Null is returned.
const ON_SubDComponentPtrPair ON_SubDFace::VertexEdgePair | ( | unsigned | vertex_index | ) | const |
Returns; If the vertex is in this face's boundary, pair of face boundary edges at the vertex is returned with face boundary orientations, that is vertex = pair.First().EdgePtr().RelativeVertex(1) and vertex = pair.Second().EdgePtr().RelativeVertex(0). Otherwise, ON_SubDComponentPtrPair::Null is returned.
unsigned int ON_SubDFace::VertexIndex | ( | const ON_SubDVertex * | vertex | ) | const |
bool ON_SubDFace::VertexMark | ( | unsigned int | i, |
bool | bMissingVertexReturnValue | ||
) | const |
ON__UINT8 ON_SubDFace::VertexMarkBits | ( | unsigned int | i, |
ON__UINT8 | missing_vertex_return_value | ||
) | const |
bool ON_SubDFace::Write | ( | class ON_BinaryArchive & | archive | ) | const |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
static |
ON_SubDEdgePtr ON_SubDFace::m_edge4[4] |
unsigned short ON_SubDFace::m_edge_count = 0 |
ON_SubDEdgePtr* ON_SubDFace::m_edgex = nullptr |
unsigned short ON_SubDFace::m_edgex_capacity = 0 |
unsigned int ON_SubDFace::m_level_zero_face_id = 0 |
id of level zero face
const class ON_SubDFace* ON_SubDFace::m_next_face = nullptr |
linked list of faces on this level
const class ON_SubDFace* ON_SubDFace::m_prev_face = nullptr |
m_prev_face, m_next_face must be the first data members of ON_SubDFace
linked list of faces on this level