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

ON_SubDHash provides a simple way to save a SubD's vertex, edge, and face SHA1 hashes. Typically it is used when a calculation needs to know if the current SubD has is geometrically identical to a previous SubD. When speed is not important, comparing the current value of ON_SubD::GeometryHash() to a previously save value of ON_SubD::GeometryHash() is functionally identical but typically much slower when the SubDs are different. More...

#include <opennurbs_subd.h>

Public Member Functions

 ON_SubDHash ()=default
 
 ON_SubDHash (const ON_SubDHash &)=default
 
 ~ON_SubDHash ()=default
 
void Dump (ON_TextLog &) const
 
unsigned int EdgeCount () const
 Copied from the SubD when the hash is created. More...
 
const ON_SHA1_Hash EdgeHash () const
 If two SubDs have identical EdgeHash() values, then the SubD edge information associated with HashType() is identical. More...
 
unsigned int FaceCount () const
 Copied from the SubD when the hash is created. More...
 
const ON_SHA1_Hash FaceHash () const
 If two SubDs have identical FaceHash() values, then the SubD face information associated with HashType() is identical. More...
 
ON_SubDHashType HashType () const
 
bool IsEmpty () const
 
bool IsNotEmpty () const
 
ON_SubDHashoperator= (const ON_SubDHash &)=default
 
bool Read (class ON_BinaryArchive &)
 
ON__UINT64 SubDGeometryContentSerialNumber () const
 The geometry content serial number can be used to quickly determine if a SubD is exactly the instance used to create this ON_SubDHash. If the geometry content serial numbers are equal, then the SubD is identical to the one use to create the hash. If the geometry content serial numbers differ, the current SubD hashes need to be checked against this to see what, if anything, changed. For example, moving a vertex will not change a topology hash. More...
 
const ON_SHA1_Hash SubDHash () const
 If two SubDs have identical SubDHash() values, then the SubD vertex, edge, and face information associated with HashType() is identical. More...
 
ON__UINT64 SubDRuntimeSerialNumber () const
 The runtime serial number can be used to identify the SubD that was hashed to created this ON_SubDHash. More...
 
unsigned int VertexCount () const
 Copied from the SubD when the hash is created. More...
 
const ON_SHA1_Hash VertexHash () const
 If two SubDs have identical VertexHash() values, then the SubD vertex information associated with HashType() is identical. More...
 
bool Write (class ON_BinaryArchive &) const
 

Static Public Member Functions

static int Compare (const ON_SubDHash &lhs, const ON_SubDHash &rhs)
 Dictionary compare of VertexCount(), EdgeCount(), FaceCount(), VertexHash(), EdgeHash(), and FaceHash() in that order. More...
 
static const ON_SubDHash Create (ON_SubDHashType hash_type, const class ON_SubD &subd)
 Saves the counts and hashes of the specified type. More...
 
static const ON_SubDHash Create (ON_SubDHashType hash_type, const class ON_SubDimple *subdimple)
 

Static Public Attributes

static const ON_SubDHash Empty
 All counts are zero and all hashes are ON_SHA1::EmptyContentHash. More...
 

Friends

class ON_SubDimple
 

Detailed Description

ON_SubDHash provides a simple way to save a SubD's vertex, edge, and face SHA1 hashes. Typically it is used when a calculation needs to know if the current SubD has is geometrically identical to a previous SubD. When speed is not important, comparing the current value of ON_SubD::GeometryHash() to a previously save value of ON_SubD::GeometryHash() is functionally identical but typically much slower when the SubDs are different.