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

#include <opennurbs_rendering.h>

Inheritance diagram for ON_ObjectRenderingAttributes:
ON_RenderingAttributes

Public Member Functions

 ON_ObjectRenderingAttributes ()
 
bool AddMappingChannel (const ON_UUID &plugin_id, int mapping_channel_id, const ON_UUID &mapping_id)
 
ON_MappingRefAddMappingRef (const ON_UUID &plugin_id)
 
bool AdvancedTexturePreview () const
 
bool ChangeMappingChannel (const ON_UUID &plugin_id, int old_mapping_channel_id, int new_mapping_channel_id)
 
int Compare (const ON_ObjectRenderingAttributes &other) const
 
void Default ()
 
bool DeleteMappingChannel (const ON_UUID &plugin_id, const ON_UUID &mapping_id)
 
bool DeleteMappingChannel (const ON_UUID &plugin_id, int mapping_channel_id)
 
bool DeleteMappingRef (const ON_UUID &plugin_id)
 
void EnableAdvancedTexturePreview (bool b)
 
bool IsValid (ON_TextLog *text_log) const
 
const ON_MappingChannelMappingChannel (const ON_UUID &plugin_id, const ON_UUID &mapping_id) const
 
const ON_MappingChannelMappingChannel (const ON_UUID &plugin_id, int mapping_channel_id) const
 
const ON_MappingRefMappingRef (const ON_UUID &plugin_id) const
 
bool Read (ON_BinaryArchive &archive)
 
bool Transform (const ON_Xform &xform)
 
bool Write (ON_BinaryArchive &archive) const
 
- Public Member Functions inherited from ON_RenderingAttributes
 ON_RenderingAttributes ()
 
int Compare (const ON_RenderingAttributes &other) const
 
void Default ()
 
bool IsValid (ON_TextLog *text_log) const
 
const ON_MaterialRefMaterialRef (const ON_UUID &plugin_id) const
 
bool Read (ON_BinaryArchive &archive)
 
bool Write (ON_BinaryArchive &archive) const
 

Static Public Member Functions

static int OCSMappingChannelId (void)
 

Public Attributes

bool m_bCastsShadows
 default is true More...
 
bool m_bReceivesShadows
 default is true More...
 
ON_ClassArray< ON_MappingRefm_mappings
 
- Public Attributes inherited from ON_RenderingAttributes
ON_ClassArray< ON_MaterialRefm_materials
 

Constructor & Destructor Documentation

◆ ON_ObjectRenderingAttributes()

ON_ObjectRenderingAttributes::ON_ObjectRenderingAttributes ( )

Member Function Documentation

◆ AddMappingChannel()

bool ON_ObjectRenderingAttributes::AddMappingChannel ( const ON_UUID plugin_id,
int  mapping_channel_id,
const ON_UUID mapping_id 
)

Parameters: plugin_id - [in] mapping_channel_id - [in] mapping_id - [in] ON_TextureMapping id Returns: True if the mapping channel was added or a pefect match already existed. False if a mapping channel with a different mapping_id already exists for this plug-in and channel.

◆ AddMappingRef()

ON_MappingRef* ON_ObjectRenderingAttributes::AddMappingRef ( const ON_UUID plugin_id)

Parameters: plugin_id - [in] Returns: If a mapping ref exists, it is returned. Otherwise one is added.

◆ AdvancedTexturePreview()

bool ON_ObjectRenderingAttributes::AdvancedTexturePreview ( ) const

Returns: True if advancded texture preview is enabled.

◆ ChangeMappingChannel()

bool ON_ObjectRenderingAttributes::ChangeMappingChannel ( const ON_UUID plugin_id,
int  old_mapping_channel_id,
int  new_mapping_channel_id 
)

Parameters: plugin_id - [in] old_mapping_channel_id - [in] new_mapping_channel_id - [in] Returns: True if a matching mapping channel was found and changed.

◆ Compare()

int ON_ObjectRenderingAttributes::Compare ( const ON_ObjectRenderingAttributes other) const

◆ Default()

void ON_ObjectRenderingAttributes::Default ( )

◆ DeleteMappingChannel() [1/2]

bool ON_ObjectRenderingAttributes::DeleteMappingChannel ( const ON_UUID plugin_id,
const ON_UUID mapping_id 
)

◆ DeleteMappingChannel() [2/2]

bool ON_ObjectRenderingAttributes::DeleteMappingChannel ( const ON_UUID plugin_id,
int  mapping_channel_id 
)

Parameters: plugin_id - [in] mapping_channel_id - [in] mapping_id - [in] ON_TextureMapping id Returns: True if a matching mapping channel was deleted.

◆ DeleteMappingRef()

bool ON_ObjectRenderingAttributes::DeleteMappingRef ( const ON_UUID plugin_id)

Parameters: plugin_id - [in] Returns: If a mapping ref exists, it is returned. Otherwise one is added.

◆ EnableAdvancedTexturePreview()

void ON_ObjectRenderingAttributes::EnableAdvancedTexturePreview ( bool  b)

Parameters: bEnable - [in] false - (default) Do not generate bitmap textures that approximate procedural textures. true - generate bitmap textures that approximate procedural textures and use these for quick previews. Returns: True if advancded texture preview is enabled.

◆ IsValid()

bool ON_ObjectRenderingAttributes::IsValid ( ON_TextLog text_log) const

◆ MappingChannel() [1/2]

const ON_MappingChannel* ON_ObjectRenderingAttributes::MappingChannel ( const ON_UUID plugin_id,
const ON_UUID mapping_id 
) const

◆ MappingChannel() [2/2]

const ON_MappingChannel* ON_ObjectRenderingAttributes::MappingChannel ( const ON_UUID plugin_id,
int  mapping_channel_id 
) const

Parameters: plugin_id - [in] mapping_channel_id - [in] mapping_id - [in] ON_TextureMapping id Returns: A pointer to the plug-in's mapping channel, if there is one. Otherwise nullptr is returned.

◆ MappingRef()

const ON_MappingRef* ON_ObjectRenderingAttributes::MappingRef ( const ON_UUID plugin_id) const

Parameters: plugin_id - [in] Returns: A pointer to the plug-in's mapping reference, if there is one. Otherwise nullptr is returned.

◆ OCSMappingChannelId()

static int ON_ObjectRenderingAttributes::OCSMappingChannelId ( void  )
static

Returns: The mapping channel id to use when calling MappingChannel to retrieve the OCS mapping if there is one. See CRhinoTextureMapping::OcsMappingTransformForObject for an easy helper function to get the transform per object

◆ Read()

bool ON_ObjectRenderingAttributes::Read ( ON_BinaryArchive archive)

◆ Transform()

bool ON_ObjectRenderingAttributes::Transform ( const ON_Xform xform)

Description: Update mapping channel transformations. Parameters: xform - [in] Transformation applied to parent object. Returns: True is successful. False if there are mapping channels and xform cannot be inverted.

◆ Write()

bool ON_ObjectRenderingAttributes::Write ( ON_BinaryArchive archive) const

Member Data Documentation

◆ m_bCastsShadows

bool ON_ObjectRenderingAttributes::m_bCastsShadows

default is true

◆ m_bReceivesShadows

bool ON_ObjectRenderingAttributes::m_bReceivesShadows

default is true

◆ m_mappings

ON_ClassArray<ON_MappingRef> ON_ObjectRenderingAttributes::m_mappings

Use AddMappingRef() or AddMappingChannel() if you want to add an element to this array.

Every mapping ref in this array must have a distinct value of ON_MappingRef.m_plugin_id.