本文整理汇总了C++中Assembly::get_parent方法的典型用法代码示例。如果您正苦于以下问题:C++ Assembly::get_parent方法的具体用法?C++ Assembly::get_parent怎么用?C++ Assembly::get_parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assembly
的用法示例。
在下文中一共展示了Assembly::get_parent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
StringDictionary EntityBrowser<Assembly>::get_entities(const Assembly& assembly, const string& type) const
{
StringDictionary entities;
if (type == "bsdf")
{
entities = build_entity_dictionary(assembly.bsdfs());
}
else if (type == "edf")
{
entities = build_entity_dictionary(assembly.edfs());
}
else if (type == "material")
{
entities = build_entity_dictionary(assembly.materials());
}
else if (type == "surface_shader")
{
entities = build_entity_dictionary(assembly.surface_shaders());
}
else if (type == "environment_edf")
{
entities = build_entity_dictionary(get_parent_scene(&assembly)->environment_edfs());
}
else if (type == "environment_shader")
{
entities = build_entity_dictionary(get_parent_scene(&assembly)->environment_shaders());
}
else
{
entities = EntityBrowser<BaseGroup>::get_entities(type);
}
const Assembly* parent_assembly = dynamic_cast<const Assembly*>(assembly.get_parent());
if (parent_assembly)
{
merge_dictionary(entities, get_entities(*parent_assembly, type));
}
else
{
const Scene* parent_scene = dynamic_cast<const Scene*>(assembly.get_parent());
assert(parent_scene);
merge_dictionary(entities, EntityBrowser<Scene>(*parent_scene).get_entities(type));
}
return entities;
}