Rhino C++ API  8.13
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
ON_SubDMesh Class Reference

ON_SubDMesh is used to store a high density traditional quad mesh of a SubD surface or a mesh of a SubD control net. In general, is is better to use an ON_SubDMeshFragmentIterator(subd) that iterates the ON_MeshFragments cached on the ON_SubD. More...

#include <opennurbs_subd.h>

Public Member Functions

 ON_SubDMesh ()=default
 
 ON_SubDMesh (const ON_SubDMesh &)=default
 
 ~ON_SubDMesh ()=default
 
unsigned int AbsoluteSubDDisplayDensity () const
 
ON_BoundingBox BoundingBox () const
 
void Clear ()
 
void ClearTree ()
 
ON__UINT64 ContentSerialNumber () const
 
ON_SubDMesh Copy () const
 
ON_SubDMeshCopyFrom (const ON_SubDMesh &src)
 
unsigned int DisplayDensity () const
 
ON_SubDDisplayParameters DisplayParameters () const
 
const ON_SubDMeshFragmentFaceFragment (const class ON_SubDFace *face) const
 
const ON_SubDMeshFragmentFirstFragment () const
 linked list of mesh fragments More...
 
unsigned int FragmentCount () const
 
const ON_RTreeFragmentTree () const
 
bool GetEdgeCenterPointAndNormal (const class ON_SubDEdge *edge, unsigned int edge_face_index, double *P, double *N) const
 
bool GetFaceCenterPointAndNormal (const class ON_SubDFace *face, double *P, double *N) const
 
bool GetTightBoundingBox (ON_BoundingBox &bbox, bool bGrowBox, const ON_Xform *xform) const
 
bool IsEmpty () const
 
ON_SubDMeshoperator= (const ON_SubDMesh &)=default
 
ON_SubD SubD () const
 
ON_SubDRef SubDRef () const
 
class ON_SubDMeshImplSubLimple () const
 
unsigned int SubLimpleUseCount () const
 
ON_MeshToMesh (ON_Mesh *destination_mesh) const
 
ON_MeshToMesh (unsigned int mesh_density, ON_Mesh *destination_mesh) const
 
bool Transform (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 (const ON_Xform &xform)
 
bool Update (bool bShareUpdate)
 

Static Public Member Functions

static ON_SubDMeshCreate (const ON_SubD &subd, const class ON_SubDDisplayParameters &limit_mesh_parameters, ON_SubDMesh *destination_mesh)
 
static ON_SubDMeshCreate (ON_SubDFaceIterator fit, const class ON_SubDDisplayParameters &limit_mesh_parameters, ON_SubDMesh *destination_mesh)
 
static void Swap (ON_SubDMesh &a, ON_SubDMesh &b)
 
static ON_MeshToMesh (class ON_SubDMeshFragmentIterator &frit, unsigned int mesh_density, ON_Mesh *destination_mesh)
 

Static Public Attributes

static const ON_SubDMesh Empty
 

Friends

class ON_SubDMeshImpl
 

Detailed Description

ON_SubDMesh is used to store a high density traditional quad mesh of a SubD surface or a mesh of a SubD control net. In general, is is better to use an ON_SubDMeshFragmentIterator(subd) that iterates the ON_MeshFragments cached on the ON_SubD.

ON_SubDMesh

Constructor & Destructor Documentation

◆ ON_SubDMesh() [1/2]

ON_SubDMesh::ON_SubDMesh ( )
default

◆ ~ON_SubDMesh()

ON_SubDMesh::~ON_SubDMesh ( )
default

◆ ON_SubDMesh() [2/2]

ON_SubDMesh::ON_SubDMesh ( const ON_SubDMesh )
default

Member Function Documentation

◆ AbsoluteSubDDisplayDensity()

unsigned int ON_SubDMesh::AbsoluteSubDDisplayDensity ( ) const

Returns: The absolute subd display density used to create this display mesh.

◆ BoundingBox()

ON_BoundingBox ON_SubDMesh::BoundingBox ( ) const

◆ Clear()

void ON_SubDMesh::Clear ( )

Description: Clears everything.

◆ ClearTree()

void ON_SubDMesh::ClearTree ( )

Description: If the tree is not needed and memory resources are tight, then call ClearTree() to remove the RTree.

◆ ContentSerialNumber()

ON__UINT64 ON_SubDMesh::ContentSerialNumber ( ) const

Returns: A runtime number that changes if the limit mesh content changes. 0: Empty limit mesh Remarks: This is a runtime number. It is not saved in archives and begins at 1 with each new runtime instance of the opennurbs library.

◆ Copy()

ON_SubDMesh ON_SubDMesh::Copy ( ) const

◆ CopyFrom()

ON_SubDMesh& ON_SubDMesh::CopyFrom ( const ON_SubDMesh src)

◆ Create() [1/2]

static ON_SubDMesh* ON_SubDMesh::Create ( const ON_SubD subd,
const class ON_SubDDisplayParameters limit_mesh_parameters,
ON_SubDMesh destination_mesh 
)
static

◆ Create() [2/2]

static ON_SubDMesh* ON_SubDMesh::Create ( ON_SubDFaceIterator  fit,
const class ON_SubDDisplayParameters limit_mesh_parameters,
ON_SubDMesh destination_mesh 
)
static

Description: This version is for expert users who want to take responsibility for managing the subd and limit mesh

◆ DisplayDensity()

unsigned int ON_SubDMesh::DisplayDensity ( ) const
Deprecated:
AbsoluteSubDDisplayDensity

◆ DisplayParameters()

ON_SubDDisplayParameters ON_SubDMesh::DisplayParameters ( ) const

◆ FaceFragment()

const ON_SubDMeshFragment* ON_SubDMesh::FaceFragment ( const class ON_SubDFace face) const

Parameters: face - [in] Returns: The first fragment for this face or nullptr if none is found. If the face is not a quad, then there will be multiple partial fragments for the face and this is the first on. The others follow using m_next_fragment.

◆ FirstFragment()

const ON_SubDMeshFragment* ON_SubDMesh::FirstFragment ( ) const

linked list of mesh fragments

◆ FragmentCount()

unsigned int ON_SubDMesh::FragmentCount ( ) const

◆ FragmentTree()

const ON_RTree& ON_SubDMesh::FragmentTree ( ) const

Description: The ON__INT_PTRs in the tree are const ON_SubDMeshFragment* pointers.

◆ GetEdgeCenterPointAndNormal()

bool ON_SubDMesh::GetEdgeCenterPointAndNormal ( const class ON_SubDEdge edge,
unsigned int  edge_face_index,
double *  P,
double *  N 
) const

Description: Get the limit surface point location and normal for the edge's midpoint from the limit mesh grid. Parameters: edge - [in] edge_face_index - [in] Index of the face to use for the normal. If the edge is a crease, then each attached face may have a different normal. Pass 0 when in doubt. 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.

◆ GetFaceCenterPointAndNormal()

bool ON_SubDMesh::GetFaceCenterPointAndNormal ( const class ON_SubDFace face,
double *  P,
double *  N 
) const

Description: Get the limit surface point location and normal for the face's center from the limit mesh grid. Parameters: face - [in] 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.

◆ GetTightBoundingBox()

bool ON_SubDMesh::GetTightBoundingBox ( ON_BoundingBox bbox,
bool  bGrowBox,
const ON_Xform xform 
) const

◆ IsEmpty()

bool ON_SubDMesh::IsEmpty ( ) const

◆ operator=()

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

◆ SubD()

ON_SubD ON_SubDMesh::SubD ( ) const

◆ SubDRef()

ON_SubDRef ON_SubDMesh::SubDRef ( ) const

◆ SubLimple()

class ON_SubDMeshImpl* ON_SubDMesh::SubLimple ( ) const

Description: Pretend this function and ON_SubDMeshImpl do not exist. Returns: Something that you are pretending does not exist. Remarks: It is intentional that the definition of ON_SubDMeshImpl class is not available in the opennurbs library interface (not in a header file). The size and design of ON_SubDMeshImpl will change constantly. If you choose to hack and whack so you can dereference an ON_SubDMeshImpl* pointer, then your code will crash unpredictably.

◆ SubLimpleUseCount()

unsigned int ON_SubDMesh::SubLimpleUseCount ( ) const

◆ Swap()

static void ON_SubDMesh::Swap ( ON_SubDMesh a,
ON_SubDMesh b 
)
static

◆ ToMesh() [1/3]

static ON_Mesh* ON_SubDMesh::ToMesh ( class ON_SubDMeshFragmentIterator frit,
unsigned int  mesh_density,
ON_Mesh destination_mesh 
)
static

Description: Parameters: frit - [in] A fragment iterator from an ON_SubDMesh or ON_SubD. mesh_density - [in] Larger numbers return denser meshes. MinimumMeshDensity() <= mesh_density <= MaximumMeshDensity() destination_mesh - [in] If destination_mesh is not nullptr, then the returned mesh will be store here. Otherwise the returned mesh will be allocated with a call to new ON_Mesh(). Returns: If this limit mesh is not empty, an ON_Mesh representation of this limit mesh. Otherwise, nullptr.

◆ ToMesh() [2/3]

ON_Mesh* ON_SubDMesh::ToMesh ( ON_Mesh destination_mesh) const

Description: Parameters: destination_mesh - [in] If destination_mesh is not nullptr, then the returned mesh will be store here. Otherwise the returned mesh will be allocated with a call to new ON_Mesh(). Returns: If this limit mesh is not empty, an ON_Mesh representation of this limit mesh. Otherwise, nullptr.

◆ ToMesh() [3/3]

ON_Mesh* ON_SubDMesh::ToMesh ( unsigned int  mesh_density,
ON_Mesh destination_mesh 
) const

Description: Parameters: mesh_density - [in] Larger numbers return denser meshes. destination_mesh - [in] If destination_mesh is not nullptr, then the returned mesh will be store here. Otherwise the returned mesh will be allocated with a call to new ON_Mesh(). Returns: If this limit mesh is not empty, an ON_Mesh representation of this limit mesh. Otherwise, nullptr.

◆ Transform() [1/2]

bool ON_SubDMesh::Transform ( 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 
)

◆ Transform() [2/2]

bool ON_SubDMesh::Transform ( const ON_Xform xform)

◆ Update()

bool ON_SubDMesh::Update ( bool  bShareUpdate)

Description: If the subd referenced by m_subd_ref changes, then call Update to update the limit mesh.

Friends And Related Function Documentation

◆ ON_SubDMeshImpl

friend class ON_SubDMeshImpl
friend

Member Data Documentation

◆ Empty

const ON_SubDMesh ON_SubDMesh::Empty
static