本文整理汇总了C++中Assembly::get_uid方法的典型用法代码示例。如果您正苦于以下问题:C++ Assembly::get_uid方法的具体用法?C++ Assembly::get_uid怎么用?C++ Assembly::get_uid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assembly
的用法示例。
在下文中一共展示了Assembly::get_uid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bind_assembly_entity_to_input
void InputBinder::bind_assembly_entity_to_input(
const Scene& scene,
const SymbolTable& scene_symbols,
const Assembly& assembly,
const SymbolTable& assembly_symbols,
const char* entity_type,
const char* entity_name,
const char* param_value,
InputArray::iterator& input)
{
switch (assembly_symbols.lookup(param_value))
{
case SymbolTable::SymbolColor:
bind_color_to_input(
assembly.colors(),
param_value,
input);
break;
case SymbolTable::SymbolTextureInstance:
bind_texture_instance_to_input(
assembly.textures(),
assembly.texture_instances(),
assembly.get_uid(),
entity_type,
entity_name,
param_value,
input);
break;
case SymbolTable::SymbolNotFound:
// No entity with this name was found in this scope.
// Attempt to bind the input to a scene entity.
bind_scene_entity_to_input(
scene,
scene_symbols,
entity_type,
entity_name,
param_value,
input);
break;
default:
RENDERER_LOG_ERROR(
"while defining %s \"%s\": cannot bind \"%s\" to parameter \"%s\".",
entity_type,
entity_name,
param_value,
input.name());
++m_error_count;
break;
}
}
示例2: try_bind_assembly_entity_to_input
bool InputBinder::try_bind_assembly_entity_to_input(
const Scene& scene,
const SymbolTable& scene_symbols,
const Assembly& assembly,
const SymbolTable& assembly_symbols,
const char* entity_type,
const char* entity_name,
const char* param_value,
InputArray::iterator& input)
{
if (input.format() == InputFormatEntity)
{
#define BIND(symbol, collection) \
case symbol: \
input.bind(collection.get_by_name(param_value)); \
return true
switch (assembly_symbols.lookup(param_value))
{
BIND(SymbolTable::SymbolColor, assembly.colors());
BIND(SymbolTable::SymbolTexture, assembly.textures());
BIND(SymbolTable::SymbolTextureInstance, assembly.texture_instances());
BIND(SymbolTable::SymbolBSDF, assembly.bsdfs());
BIND(SymbolTable::SymbolBSSRDF, assembly.bssrdfs());
BIND(SymbolTable::SymbolEDF, assembly.edfs());
#ifdef APPLESEED_WITH_OSL
BIND(SymbolTable::SymbolShaderGroup, assembly.shader_groups());
#endif
BIND(SymbolTable::SymbolSurfaceShader, assembly.surface_shaders());
BIND(SymbolTable::SymbolMaterial, assembly.materials());
BIND(SymbolTable::SymbolLight, assembly.lights());
BIND(SymbolTable::SymbolObject, assembly.objects());
BIND(SymbolTable::SymbolObjectInstance, assembly.object_instances());
}
#undef BIND
}
else
{
switch (assembly_symbols.lookup(param_value))
{
case SymbolTable::SymbolColor:
bind_color_to_input(
assembly.colors(),
param_value,
input);
return true;
case SymbolTable::SymbolTextureInstance:
bind_texture_instance_to_input(
assembly.texture_instances(),
assembly.get_uid(),
entity_type,
entity_name,
param_value,
input);
return true;
}
}
return false;
}
示例3: ObjectCollectionItem
AssemblyItem::AssemblyItem(
EntityEditorContext& editor_context,
Assembly& assembly,
BaseGroup& parent,
BaseGroupItem* parent_item)
: BaseGroupItem(editor_context, g_class_uid, assembly)
, m_assembly(assembly)
, m_assembly_uid(assembly.get_uid())
, m_parent(parent)
, m_parent_item(parent_item)
{
set_title(QString::fromAscii(assembly.get_name()));
set_allow_edition(false);
insertChild(
3,
m_bsdf_collection_item = add_multi_model_collection_item<BSDF>(assembly.bsdfs()));
insertChild(
4,
m_bssrdf_collection_item = add_multi_model_collection_item<BSSRDF>(assembly.bssrdfs()));
insertChild(
5,
m_edf_collection_item = add_multi_model_collection_item<EDF>(assembly.edfs()));
insertChild(
6,
m_surface_shader_collection_item = add_multi_model_collection_item<SurfaceShader>(assembly.surface_shaders()));
insertChild(
7,
m_material_collection_item = new MaterialCollectionItem(
m_editor_context,
assembly.materials(),
assembly,
this));
insertChild(
8,
m_light_collection_item = add_multi_model_collection_item<Light>(assembly.lights()));
insertChild(
9,
m_object_collection_item =
new ObjectCollectionItem(
m_editor_context,
assembly.objects(),
assembly,
this));
insertChild(
10,
m_object_instance_collection_item =
new ObjectInstanceCollectionItem(
m_editor_context,
new_guid(),
EntityTraits<ObjectInstance>::get_human_readable_collection_type_name(),
assembly));
m_object_instance_collection_item->add_items(assembly.object_instances());
insertChild(
11,
m_volume_collection_item = add_multi_model_collection_item<Volume>(assembly.volumes()));
m_editor_context.m_item_registry.insert(m_assembly, this);
}