Rhino C++ API  7.21
Public Member Functions | Public Attributes | List of all members
ON_MappingChannel Class Reference

#include <opennurbs_mapchan.h>

Public Member Functions

 ON_MappingChannel ()
int Compare (const ON_MappingChannel &other) const
void Default ()
bool Read (ON_BinaryArchive &archive)
bool Write (ON_BinaryArchive &archive) const

Public Attributes

int m_mapping_channel_id
ON_UUID m_mapping_id
 Identifies an ON_TextureMapping. More...
int m_mapping_index
ON_Xform m_object_xform

Detailed Description


/ / Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. / OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert / McNeel & Associates. / / THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. / ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF / MERCHANTABILITY ARE HEREBY DISCLAIMED. /
/ For complete openNURBS copyright information see http://www.opennurbs.org. / ////////////////////////////////////////////////////////////// Class ON_MappingChannel

Description: ON_3dmObjectAttributes uses ON_MappingChannel to record which texture mapping function to use when applying a texture with a matching mapping channel id. When an object is rendered, if the material has textures and ON_Texture::m_mapping_channel_id = ON_MappingChannel::m_mapping_channel_id, then the mapping with id m_mapping_id is used to map the texture. Otherwise, the mesh m_T[] texture coordinates are used to apply the texture.

Constructor & Destructor Documentation

◆ ON_MappingChannel()

ON_MappingChannel::ON_MappingChannel ( )

Member Function Documentation

◆ Compare()

int ON_MappingChannel::Compare ( const ON_MappingChannel other) const

◆ Default()

void ON_MappingChannel::Default ( )

◆ Read()

bool ON_MappingChannel::Read ( ON_BinaryArchive archive)

◆ Write()

bool ON_MappingChannel::Write ( ON_BinaryArchive archive) const

Member Data Documentation

◆ m_mapping_channel_id

int ON_MappingChannel::m_mapping_channel_id

ON_Texture's with a matching m_mapping_channel_id value use the mapping identified by m_mapping_id. This id must be > 0 and <= 2147483647 (0x7FFFFFFF)

◆ m_mapping_id

ON_UUID ON_MappingChannel::m_mapping_id

Identifies an ON_TextureMapping.

◆ m_mapping_index

int ON_MappingChannel::m_mapping_index

RUNTIME textrure mapping table index. If -1, it needs to be set. This value is not saved int files.

◆ m_object_xform

ON_Xform ON_MappingChannel::m_object_xform

The default value of m_object_xform is the identity. When an object that uses this mapping is transformed by "T", m_object_xform is updated using the formula m_object_xform = T*m_object_xform. If texture coordinates are lost and need to be recalculated and m_object_xform is not the identity, then m_object_xform should be passed to ON_TextureMapping::Evaluate() as the mesh_xform parameter. When validating mapping coordinates, m_object_xform itself be passed to HasMatchingTextureCoordinates() as the object_transform parameter.