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

#include <opennurbs_subd.h>

Inheritance diagram for ON_SubDFace:
ON_SubDComponentBase

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
 
const ON_3dVector ControlNetCenterNormal () const
 
const ON_3dPoint ControlNetCenterPoint () const
 
const ON_3dPoint ControlNetPoint (unsigned int i) const
 
const class ON_SubDEdgeEdge (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 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 IsConvex () const
 
bool IsNotConvex () const
 
bool IsNotPlanar (double planar_tolerance=ON_ZERO_TOLERANCE) const
 
bool IsPlanar (double planar_tolerance=ON_ZERO_TOLERANCE) const
 
unsigned int MarkedEdgeCount () const
 
unsigned int MarkedVertexCount () const
 
int MaterialChannelIndex () const
 
const class ON_SubDMeshFragmentMeshFragments () const
 
const ON_ComponentStatus NeighborhoodStatusLogicalOr (bool bIncludeVertices, bool bIncludeEdges) const
 
const ON_SubDEdgeNextEdge (const ON_SubDEdge *edge) const
 
unsigned int NextEdgeArrayIndex (unsigned int edge_array_index) const
 
ON_SubDFaceoperator= (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_SubDEdgePrevEdge (const ON_SubDEdge *edge) const
 
unsigned int PrevEdgeArrayIndex (unsigned int edge_array_index) const
 
const ON_SubDEdgeQuadOppositeEdge (const ON_SubDEdge *edge) const
 
const ON_SubDVertexQuadOppositeVertex (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 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
 
const ON_3dPoint SubdivisionPoint () const
 
const ON_BoundingBox SurfaceBoundingBox (const ON_SubD &subd) const
 
const ON_Plane SurfaceCenterFrame () const
 
const ON_3dVector SurfaceCenterNormal () const
 
const ON_3dPoint SurfaceCenterPoint () const
 
const ON_3dPoint TextureCenterPoint () const
 
const ON_3dPoint TexturePoint (unsigned int i) const
 
bool TexturePointsAreSet () const
 
unsigned int TexturePointsCapacity () const
 
bool Transform (bool bTransformationSavedSubdivisionPoint, const class ON_Xform &xform)
 
const class ON_SubDVertexVertex (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_SubDComponentBaseoperator= (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_SubDEdgePtrm_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_SubDFacem_next_face = nullptr
 linked list of faces on this level More...
 
const class ON_SubDFacem_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_SubDVertexm_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...
 

Detailed Description

ON_SubDFace

Member Enumeration Documentation

◆ anonymous enum

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 

Constructor & Destructor Documentation

◆ ON_SubDFace() [1/2]

ON_SubDFace::ON_SubDFace ( )
default

◆ ~ON_SubDFace()

ON_SubDFace::~ON_SubDFace ( )
default

◆ ON_SubDFace() [2/2]

ON_SubDFace::ON_SubDFace ( const ON_SubDFace )
default

Member Function Documentation

◆ BoundingBox()

const ON_BoundingBox ON_SubDFace::BoundingBox ( ON_SubDComponentLocation  subd_appearance,
const ON_SubD subd 
) const

◆ CenterFrame()

const ON_Plane ON_SubDFace::CenterFrame ( ON_SubDComponentLocation  subd_appearance) const

◆ CenterNormal()

const ON_3dVector ON_SubDFace::CenterNormal ( ON_SubDComponentLocation  subd_appearance) const

◆ CenterPoint()

const ON_3dPoint ON_SubDFace::CenterPoint ( ON_SubDComponentLocation  subd_appearance) const

◆ ClearMaterialChannelIndex()

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.

◆ ClearPackId()

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.

◆ ClearPackRect()

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.

◆ ClearPerFaceColor()

void ON_SubDFace::ClearPerFaceColor ( ) const

Description: Remove per face color setting. The face will use the color assigned to the subd object.

◆ ClearSavedSubdivisionPoints() [1/2]

void ON_SubDFace::ClearSavedSubdivisionPoints ( ) const

Description: Clears saved subdivision and limit surface information for this face. Attached edges and vertices are not modifed.

◆ ClearSavedSubdivisionPoints() [2/2]

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.

◆ ClearTexturePoints()

void ON_SubDFace::ClearTexturePoints ( ) const

Description: Remove all texture points. Remarks: Texture points are a mutable property on ON_SubDFace.

◆ ComponentIndex()

const ON_COMPONENT_INDEX ON_SubDFace::ComponentIndex ( ) const

◆ ComponentPtr()

const ON_SubDComponentPtr ON_SubDFace::ComponentPtr ( ) const

◆ ControlNetBoundingBox()

const ON_BoundingBox ON_SubDFace::ControlNetBoundingBox ( ) const

◆ ControlNetCenterFrame()

const ON_Plane ON_SubDFace::ControlNetCenterFrame ( ) const

◆ ControlNetCenterNormal()

const ON_3dVector ON_SubDFace::ControlNetCenterNormal ( ) const

◆ ControlNetCenterPoint()

const ON_3dPoint ON_SubDFace::ControlNetCenterPoint ( ) const

◆ ControlNetPoint()

const ON_3dPoint ON_SubDFace::ControlNetPoint ( unsigned int  i) const

◆ Edge()

const class ON_SubDEdge* ON_SubDFace::Edge ( unsigned int  i) const

◆ EdgeArrayIndex()

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.

◆ EdgeCount()

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.

◆ EdgeDirection()

ON__UINT_PTR ON_SubDFace::EdgeDirection ( unsigned int  i) const

◆ EdgeMark()

bool ON_SubDFace::EdgeMark ( unsigned int  i,
bool  bMissingEgeReturnValue 
) const

◆ EdgeMarkBits()

ON__UINT8 ON_SubDFace::EdgeMarkBits ( unsigned int  i,
ON__UINT8  missing_edge_return_value 
) const

◆ EdgePtr()

const ON_SubDEdgePtr ON_SubDFace::EdgePtr ( unsigned int  i) const

◆ EdgePtrFromEdge()

const ON_SubDEdgePtr ON_SubDFace::EdgePtrFromEdge ( const class ON_SubDEdge e) const

◆ EvaluateCatmullClarkSubdivisionPoint()

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.

◆ FaceId()

unsigned int ON_SubDFace::FaceId ( ) const

◆ FaceModifiedNofification()

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.

◆ FromVertices() [1/2]

static const ON_SubDFacePtr ON_SubDFace::FromVertices ( const ON_SimpleArray< const ON_SubDVertex * > &  vertex_list)
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.

◆ FromVertices() [2/2]

static const ON_SubDFacePtr ON_SubDFace::FromVertices ( const ON_SubDVertex *const *  vertex_list,
size_t  face_vertices_count 
)
static

◆ GetCenterPointAndNormal()

bool ON_SubDFace::GetCenterPointAndNormal ( ON_SubDComponentLocation  subd_appearance,
double *  P,
double *  N 
) const

◆ GetEdgeArray()

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.

◆ GetFacePackRectCorners()

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().

◆ 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 renderered 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.

◆ GetNgonSubPackRectSizeAndDelta()

static const ON_2udex ON_SubDFace::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

Description: Calculate how a packing rectangle assigned to an ON_SubDFace will be subdivided into n sub packing rectanges 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

◆ GetQuadSurface() [1/3]

bool ON_SubDFace::GetQuadSurface ( class ON_BezierSurface limit_surface) const

◆ GetQuadSurface() [2/3]

bool ON_SubDFace::GetQuadSurface ( class ON_NurbsSurface limit_surface) const

◆ GetQuadSurface() [3/3]

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.

◆ GetSubdivisionPoint()

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>

◆ GetSurfaceCenterPointAndNormal()

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 frament. False if the limit mesh fragment was not found and nan values were returned.

◆ HasEdges()

bool ON_SubDFace::HasEdges ( ) const

Description: Rapidly verifies that:

  1. EdgeCount() >= 3
  2. Every edge is not null and has 2 non-null vertices.
  3. The end vertex of and edge is identical to the start vertex of the next edge.
  4. Every edge has FaceCount() >= 1.
  5. Every vertex has EdgeCount() >= 2 and FaceCount() >= 1.
  6. The first 4 edges are unique.
  1. The first 4 vertices are unique. Returns: True if the 5 conditions above are true. Remarks: The face can still be invalid, but if HasValidEdges() returns true, it is save to deference pointers returned by the face's Edge() and Vertex() functions.

◆ IsConvex()

bool ON_SubDFace::IsConvex ( ) const

◆ IsNotConvex()

bool ON_SubDFace::IsNotConvex ( ) const

◆ IsNotPlanar()

bool ON_SubDFace::IsNotPlanar ( double  planar_tolerance = ON_ZERO_TOLERANCE) const

◆ IsPlanar()

bool ON_SubDFace::IsPlanar ( double  planar_tolerance = ON_ZERO_TOLERANCE) const

◆ IsValidPackRect()

static bool ON_SubDFace::IsValidPackRect ( ON_2dPoint  pack_rect_origin,
ON_2dVector  pack_rect_size,
int  packing_rotation_degrees 
)
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 mulitple of 90. Returns: True if the input parameters define a valid pack rectangle.

◆ MarkedEdgeCount()

unsigned int ON_SubDFace::MarkedEdgeCount ( ) const

Returns: Number of edges in the face's boundary with Edge().m_status.RuntimeMark() = true;

◆ MarkedVertexCount()

unsigned int ON_SubDFace::MarkedVertexCount ( ) const

Returns: Number of vertices in the face's boundary with Vertex().m_status.RuntimeMark() = true;

◆ MaterialChannelIndex()

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.

◆ MeshFragments()

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.

◆ NeighborhoodStatusLogicalOr()

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()

◆ NextEdge()

const ON_SubDEdge* ON_SubDFace::NextEdge ( const ON_SubDEdge edge) const

◆ NextEdgeArrayIndex()

unsigned int ON_SubDFace::NextEdgeArrayIndex ( unsigned int  edge_array_index) const

◆ operator=()

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

◆ PackId()

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.

◆ PackRectCorner()

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().

◆ PackRectGapInPixels()

static double ON_SubDFace::PackRectGapInPixels ( double  pack_rect_distance_in_pixels)
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.

◆ PackRectIsSet()

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.

◆ PackRectOrigin()

const ON_2dPoint ON_SubDFace::PackRectOrigin ( ) const

Returns Lower left coordinate of this face's pack rect in normalized pack rect coordinates.

◆ PackRectRotationDegrees()

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.

◆ PackRectRotationRadians()

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.

◆ PackRectSize()

const ON_2dVector ON_SubDFace::PackRectSize ( ) const

Returns Size of this face's pack rect in normalized pack rect coordinates.

◆ PerFaceColor()

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.

◆ PrevEdge()

const ON_SubDEdge* ON_SubDFace::PrevEdge ( const ON_SubDEdge edge) const

◆ PrevEdgeArrayIndex()

unsigned int ON_SubDFace::PrevEdgeArrayIndex ( unsigned int  edge_array_index) const

◆ QuadOppositeEdge()

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.

◆ QuadOppositeVertex()

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.

◆ Read()

static bool ON_SubDFace::Read ( class ON_BinaryArchive archive,
class ON_SubD subd,
class ON_SubDFace *&  face 
)
static

◆ RemoveEdgeFromArray() [1/2]

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.

◆ RemoveEdgeFromArray() [2/2]

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.

◆ ReplaceEdgeInArray()

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.

◆ ReverseEdgeList()

bool ON_SubDFace::ReverseEdgeList ( )

Description: Reverse the order and orientation of the edges that form the boundary of this face.

◆ RotateEdgeArray()

bool ON_SubDFace::RotateEdgeArray ( unsigned int  fei0)

Description: Rotates the edge array so that Edge(fei0) becomes the first edge in the edge array.

◆ SetEdgeMarks()

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.

◆ SetMaterialChannelIndex()

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.

◆ SetPackIdForExperts()

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.

◆ SetPackRectForExperts()

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 mulitple 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.

◆ SetPerFaceColor()

void ON_SubDFace::SetPerFaceColor ( ON_Color  color) const

Description: Set per face color.

Parameters: color - [in]

◆ SetTexturePoint()

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.AddFaceTexturePointStorage(this). Texture points are a mutable property on ON_SubDFace.

◆ SetVertexMarks()

unsigned int ON_SubDFace::SetVertexMarks ( bool  bMark) const

Description: Set the mark of every vertex attached to this face. Returns: Number of marks changed.

◆ SubdivisionPoint()

const ON_3dPoint ON_SubDFace::SubdivisionPoint ( ) const

◆ SurfaceBoundingBox()

const ON_BoundingBox ON_SubDFace::SurfaceBoundingBox ( const ON_SubD subd) const

◆ SurfaceCenterFrame()

const ON_Plane ON_SubDFace::SurfaceCenterFrame ( ) const

◆ SurfaceCenterNormal()

const ON_3dVector ON_SubDFace::SurfaceCenterNormal ( ) const

◆ SurfaceCenterPoint()

const ON_3dPoint ON_SubDFace::SurfaceCenterPoint ( ) const

◆ TextureCenterPoint()

const ON_3dPoint ON_SubDFace::TextureCenterPoint ( ) const

◆ TexturePoint()

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

◆ TexturePointsAreSet()

bool ON_SubDFace::TexturePointsAreSet ( ) const

Returns: If texture points are set, then true is returned. Otherwise, false is returned.

◆ TexturePointsCapacity()

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).

◆ Transform()

bool ON_SubDFace::Transform ( bool  bTransformationSavedSubdivisionPoint,
const class ON_Xform xform 
)

Description: Apply a tranxfomration matrix to vertex 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 isometry (rotation, translation, ...), a uniform scale, or a composition of these types, 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]

◆ Vertex()

const class ON_SubDVertex* ON_SubDFace::Vertex ( unsigned int  i) const

◆ VertexEdgePair() [1/2]

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.

◆ VertexEdgePair() [2/2]

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.

◆ VertexIndex()

unsigned int ON_SubDFace::VertexIndex ( const ON_SubDVertex vertex) const

◆ VertexMark()

bool ON_SubDFace::VertexMark ( unsigned int  i,
bool  bMissingVertexReturnValue 
) const

◆ VertexMarkBits()

ON__UINT8 ON_SubDFace::VertexMarkBits ( unsigned int  i,
ON__UINT8  missing_vertex_return_value 
) const

◆ Write()

bool ON_SubDFace::Write ( class ON_BinaryArchive archive) const

Friends And Related Function Documentation

◆ ON_Internal_SubDFaceMeshFragmentAccumulator

friend class ON_Internal_SubDFaceMeshFragmentAccumulator
friend

◆ ON_SubDArchiveIdMap

friend class ON_SubDArchiveIdMap
friend

◆ ON_SubDEdge

friend class ON_SubDEdge
friend

◆ ON_SubDHeap

friend class ON_SubDHeap
friend

◆ ON_SubDVertex

friend class ON_SubDVertex
friend

Member Data Documentation

◆ Empty

const ON_SubDFace ON_SubDFace::Empty
static

◆ m_edge4

ON_SubDEdgePtr ON_SubDFace::m_edge4[4]

◆ m_edge_count

unsigned short ON_SubDFace::m_edge_count = 0

◆ m_edgex

ON_SubDEdgePtr* ON_SubDFace::m_edgex = nullptr

◆ m_edgex_capacity

unsigned short ON_SubDFace::m_edgex_capacity = 0

◆ m_level_zero_face_id

unsigned int ON_SubDFace::m_level_zero_face_id = 0

id of level zero face

◆ m_next_face

const class ON_SubDFace* ON_SubDFace::m_next_face = nullptr

linked list of faces on this level

◆ m_prev_face

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