本文整理汇总了C++中alembic::abc::IObject::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::getName方法的具体用法?C++ IObject::getName怎么用?C++ IObject::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类alembic::abc::IObject
的用法示例。
在下文中一共展示了IObject::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: traverse
void traverse(Abc::IObject object, bool includeSelf)
{
if (includeSelf)
{
std::cout << "---------------------------------" << std::endl;
std::cout << object.getFullName() << std::endl;
if (Mat::IMaterial::matches(object.getHeader()))
{
std::cout << "(is material, local data shown)\n";
Mat::IMaterial mat(object, Abc::kWrapExisting);
printMaterialSchema(mat.getSchema());
TESTING_ASSERT(object.getName() == "materialA" ||
object.getName() == "materialB");
}
else
{
Mat::MaterialFlatten mafla(object);
std::string name = object.getName();
std::cout << name << " " << mafla.empty() << std::endl;
TESTING_ASSERT(
(!mafla.empty() &&
(name == "geoA" || name == "geoB" || name == "geoC")) ||
(mafla.empty() &&
(name == "geometry" || name == "materials")));
if (!mafla.empty())
{
std::cout << "(flattened material via has and/or assigned)\n";
printFlattenedMafla(mafla);
}
else
{
std::cout << "(neither is, has or is assigned)\n";
}
}
}
for (size_t i = 0; i < object.getNumChildren(); ++i)
{
traverse(object.getChild(i), true);
}
}
示例2: is_leaf
//-*****************************************************************************
bool is_leaf( AbcG::IObject iObj )
{
if ( !iObj.getParent().valid() ) {
return true;
}
Abc::IObject parent = iObj.getParent();
int numChildren = parent.getNumChildren();
Abc::IObject test = parent.getChild(numChildren - 1);
if ( test.valid() && test.getName() != iObj.getName() ) {
return false;
}
return true;
}
示例3: prescanAlembicHierarchy
// returns the number of nodes
int prescanAlembicHierarchy(AbcArchiveCache* pArchiveCache,
AbcObjectCache* pRootObjectCache,
std::vector<std::string>& nodes,
std::map<std::string, bool>& map,
bool bIncludeChildren)
{
for (int i = 0; i < nodes.size(); i++) {
boost::to_upper(nodes[i]);
}
std::list<AlembicSelectionStackElement> sceneStack;
for (size_t j = 0; j < pRootObjectCache->childIdentifiers.size(); j++) {
AbcObjectCache* pChildObjectCache =
&(pArchiveCache->find(pRootObjectCache->childIdentifiers[j])->second);
sceneStack.push_back(
AlembicSelectionStackElement(pChildObjectCache, false));
}
int nNumNodes = 0;
while (!sceneStack.empty()) {
AlembicSelectionStackElement sElement = sceneStack.back();
Alembic::Abc::IObject iObj = sElement.pObjectCache->obj;
bool bSelected = sElement.bSelected;
sceneStack.pop_back();
nNumNodes++;
bool bCreateNullNode = false;
int nMergedGeomNodeIndex = -1;
AbcObjectCache* pMergedChildObjectCache = NULL;
getMergeInfo(pArchiveCache, sElement.pObjectCache, bCreateNullNode,
nMergedGeomNodeIndex, &pMergedChildObjectCache);
std::string name;
std::string fullname;
if (nMergedGeomNodeIndex != -1) { // we are merging
Alembic::AbcGeom::IObject mergedGeomChild = pMergedChildObjectCache->obj;
name = mergedGeomChild.getName();
fullname = mergedGeomChild.getFullName();
}
else { // geometry node(s) under a dummy node (in pParentMaxNode)
name = iObj.getName();
fullname = iObj.getFullName();
}
bool bSelectChildren = false;
if (bSelected) {
map[fullname] = true;
bSelectChildren = true;
}
else {
boost::to_upper(name);
for (int i = 0; i < nodes.size(); i++) {
const char* cstrName = name.c_str();
const char* cstrNode = nodes[i].c_str();
if (name.find(nodes[i]) != std::string::npos) {
if (bIncludeChildren) {
bSelectChildren = true;
}
std::vector<std::string> parts;
boost::split(parts, fullname, boost::is_any_of("/"));
std::string nodeName;
for (int j = 1; j < parts.size(); j++) {
nodeName += "/";
nodeName += parts[j];
map[nodeName] = true;
}
}
}
}
// push the children as the last step, since we need to who the parent is
// first (we may have merged)
for (size_t j = 0; j < sElement.pObjectCache->childIdentifiers.size();
j++) {
AbcObjectCache* pChildObjectCache =
&(pArchiveCache->find(sElement.pObjectCache->childIdentifiers[j])
->second);
Alembic::AbcGeom::IObject childObj = pChildObjectCache->obj;
NodeCategory::type childCat = NodeCategory::get(childObj);
if (childCat == NodeCategory::UNSUPPORTED)
continue; // skip over unsupported types
// I assume that geometry nodes are always leaf nodes. Thus, if we merged
// a geometry node will its parent transform, we don't
// need to push that geometry node to the stack.
// A geometry node can't be combined with its transform node, the
// transform node has other tranform nodes as children. These
// nodes must be pushed.
if (nMergedGeomNodeIndex != j) {
sceneStack.push_back(
AlembicSelectionStackElement(pChildObjectCache, bSelectChildren));
}
//.........这里部分代码省略.........