本文整理汇总了C++中IObject::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::getName方法的具体用法?C++ IObject::getName怎么用?C++ IObject::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObject
的用法示例。
在下文中一共展示了IObject::getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: recursivelyReadChildren
void recursivelyReadChildren( IObject& parent )
{
unsigned int numChildren = parent.getNumChildren();
std::cout << " has " << numChildren << " children"
<< std::endl;
for (unsigned int ii=0; ii<numChildren; ii++)
{
IObject child = parent.getChild(ii);
std::cout << " " << child.getName();
unsigned int expectedChildren = 2;
if (child.getName().substr(6,1) == "2")
// bottom of the hierarchy
expectedChildren = 0;
unsigned int children = child.getNumChildren();
ABCA_ASSERT( children == expectedChildren,
"Expected " << expectedChildren << " children " <<
"but found " << children );
recursivelyReadChildren( child );
}
return;
}
示例2: parseFeature
bool Chain::parseFeature (TiXmlElement *element) {
int n_features = 0;
element->QueryIntAttribute ("size", &n_features);
ssi_msg (SSI_LOG_LEVEL_DETAIL, "found %u feature", n_features);
if (n_features > 0) {
_n_features = n_features;
_features = new IFeature *[_n_features];
for (ssi_size_t i = 0; i < _n_features; i++) {
_features[i] = 0;
}
TiXmlElement *item = 0;
for (ssi_size_t i = 0; i < _n_features; i++) {
if (i == 0) {
item = element->FirstChildElement ("item");
} else {
item = item->NextSiblingElement ("item");
}
if (!item) {
ssi_wrn ("feature: failed parsing '%u'th <item> tag", i);
return false;
}
IObject *object = _xmlpipe->parseObject (item, false);
if (!object) {
ssi_wrn ("filter: class not found");
return false;
}
if (object->getType () != SSI_FEATURE) {
ssi_wrn ("feature: class is not a feature");
return false;
}
IFeature *feature = ssi_pcast (IFeature, object);
if (!feature) {
ssi_wrn ("feature: failed loading feature object");
return false;
}
ssi_msg (SSI_LOG_LEVEL_DETAIL, "load %u. feature '%s'", i+1, object->getName ());
_features[i] = feature;
}
}
return true;
}
示例3: ApplyResources
void ApplyResources( IObject object, ProcArgs &args )
{
std::string resourceName;
//first check full name...
resourceName = args.getResource( object.getFullName() );
if ( resourceName.empty() )
{
//...and then base name
resourceName = args.getResource( object.getName() );
}
if ( !resourceName.empty() )
{
RestoreResource(resourceName);
}
}
示例4: getNamedCamera
bool getNamedCamera( IObject iObjTop, const std::string &iName, ICamera &iCam )
{
// Return true if found
const Alembic::AbcGeom::MetaData &md = iObjTop.getMetaData();
if ( (iObjTop.getName() == iName) && (ICamera::matches( md )) )
{
iCam = ICamera(iObjTop, kWrapExisting );
return true;
}
// now the child objects
for ( size_t i = 0 ; i < iObjTop.getNumChildren() ; i++ )
{
if (getNamedCamera(IObject( iObjTop, iObjTop.getChildHeader( i ).getName() ), iName, iCam ))
return true;
}
return false;
}