Rhino C++ API  8.14
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ON_MappingTag Class Reference

#include <opennurbs_mesh.h>

Public Member Functions

 ON_MappingTag ()
 
 ON_MappingTag (const ON_TextureMapping &mapping, const ON_Xform *xform)
 
int Compare (const ON_MappingTag &other, bool bCompareId=true, bool bCompareCRC=true, bool bCompareXform=true) const
 
void Default ()
 
void Dump (ON_TextLog &) const
 
const ON_SHA1_Hash Hash () const
 
bool IsDefaultSurfaceParameterMapping () const
 
bool IsSet () const
 
bool Read (ON_BinaryArchive &)
 
void Set (const ON_TextureMapping &mapping)
 
void SetDefaultSurfaceParameterMappingTag ()
 
const ON_Xform Transform () const
 
void Transform (const ON_Xform &xform)
 
bool TransformIsIdentity () const
 
bool Write (ON_BinaryArchive &) const
 

Static Public Member Functions

static int CompareAll (const ON_MappingTag &lhs, const ON_MappingTag &rhs)
 
static int CompareAllFromPointer (const ON_MappingTag *lhs, const ON_MappingTag *rhs)
 
static bool TransformTreatedIsIdentity (const ON_Xform *xform)
 

Public Attributes

ON__UINT32 m_mapping_crc = 0
 
ON_UUID m_mapping_id = ON_nil_uuid
 
ON_TextureMapping::TYPE m_mapping_type = ON_TextureMapping::TYPE::no_mapping
 
ON_Xform m_mesh_xform = ON_Xform::IdentityTransformation
 

Static Public Attributes

static const ON_MappingTag SurfaceParameterMapping
 id = ON_TextureMapping::SurfaceParameterTextureMappingId type = ON_TextureMapping::TYPE::srfp_mapping More...
 
static const ON_MappingTag Unset
 

Constructor & Destructor Documentation

◆ ON_MappingTag() [1/2]

ON_MappingTag::ON_MappingTag ( )

◆ ON_MappingTag() [2/2]

ON_MappingTag::ON_MappingTag ( const ON_TextureMapping mapping,
const ON_Xform xform 
)

Member Function Documentation

◆ Compare()

int ON_MappingTag::Compare ( const ON_MappingTag other,
bool  bCompareId = true,
bool  bCompareCRC = true,
bool  bCompareXform = true 
) const

◆ CompareAll()

static int ON_MappingTag::CompareAll ( const ON_MappingTag lhs,
const ON_MappingTag rhs 
)
static

◆ CompareAllFromPointer()

static int ON_MappingTag::CompareAllFromPointer ( const ON_MappingTag lhs,
const ON_MappingTag rhs 
)
static

◆ Default()

void ON_MappingTag::Default ( )

◆ Dump()

void ON_MappingTag::Dump ( ON_TextLog ) const

◆ Hash()

const ON_SHA1_Hash ON_MappingTag::Hash ( ) const

Returns: A sha1 hash of the m_mapping_id, m_mapping_type, m_mapping_crc and m_mesh_xform the uniquely identifies the mapping tag but can be used where hashes are more convenient.

◆ IsDefaultSurfaceParameterMapping()

bool ON_MappingTag::IsDefaultSurfaceParameterMapping ( ) const

Returns: True if the mapping tag is for a mapping with type ON_TextureMapping::srfp_mapping with m_uvw = identity.

◆ IsSet()

bool ON_MappingTag::IsSet ( ) const

Returns: True if the mapping tag is set.

◆ Read()

bool ON_MappingTag::Read ( ON_BinaryArchive )

◆ Set()

void ON_MappingTag::Set ( const ON_TextureMapping mapping)

◆ SetDefaultSurfaceParameterMappingTag()

void ON_MappingTag::SetDefaultSurfaceParameterMappingTag ( )

Description: Sets the tag to the value the meshes have that come out of ON_Brep::CreateMesh().

◆ Transform() [1/2]

const ON_Xform ON_MappingTag::Transform ( ) const

Returns: World space transformation to apply to the object when using this mapping.

◆ Transform() [2/2]

void ON_MappingTag::Transform ( const ON_Xform xform)

◆ TransformIsIdentity()

bool ON_MappingTag::TransformIsIdentity ( ) const

Returns: True if Transform() will return the identity transformation.

◆ TransformTreatedIsIdentity()

static bool ON_MappingTag::TransformTreatedIsIdentity ( const ON_Xform xform)
static

Returns: True if ON_MappingTag will consider xform to be the identity transformation.

◆ Write()

bool ON_MappingTag::Write ( ON_BinaryArchive ) const

Member Data Documentation

◆ m_mapping_crc

ON__UINT32 ON_MappingTag::m_mapping_crc = 0

The m_mapping_crc is a CRC of a SHA1 hash of the parameters used in the calculation to set the current texture coordinates and/or vertex colors. This CRC is used to detect when the the texture coordinates and/or false colors need to be updated. (Saving the SHA1 hash itself would be better, but changing m_mapping_crc to a SHA1 hash would break the SDK.)

When m_mapping_id = ON_nil_uuid and m_mapping_type = ON_TextureMapping::TYPE::no_mapping, m_mapping_crc has no meaning and is ignored by operator== and operator!=.

When m_mapping_id = ON_MappingTag::SurfaceParameterMapping.m_mapping_id and m_mapping_type = ON_TextureMapping::TYPE::srfp_mapping, m_mapping_crc can be set from a uvw texture coordinate transformation.

◆ m_mapping_id

ON_UUID ON_MappingTag::m_mapping_id = ON_nil_uuid

m_mapping_id identifies the mapping used to create the texture coordinates and/or false colors.

◆ m_mapping_type

◆ m_mesh_xform

ON_Xform ON_MappingTag::m_mesh_xform = ON_Xform::IdentityTransformation

It and records transformations applied to the mesh after the texture coordinates were calculated. If the texture mapping does not change when the mesh is transformed, then set m_mesh_xform to zero so that compares will work right.

When m_mapping_id = ON_nil_uuid and m_mapping_type = ON_TextureMapping::TYPE::no_mapping, m_mesh_xform has no meaning and is ignored by operator== and operator!=.

When m_mapping_id = ON_MappingTag::SurfaceParameterMapping.m_mapping_id and m_mapping_type = ON_TextureMapping::TYPE::srfp_mapping, m_mesh_xform has no meaning and is ignored by operator== and operator!=.

◆ SurfaceParameterMapping

const ON_MappingTag ON_MappingTag::SurfaceParameterMapping
static

◆ Unset

const ON_MappingTag ON_MappingTag::Unset
static