本文整理汇总了C++中IObject::getProperties方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::getProperties方法的具体用法?C++ IObject::getProperties怎么用?C++ IObject::getProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObject
的用法示例。
在下文中一共展示了IObject::getProperties方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getABCTimeSpan
//-*****************************************************************************
void getABCTimeSpan(IArchive archive, chrono_t& first, chrono_t& last)
{
// TO DO: Is the childBounds property reliable to get the full archive's span?
if (!archive.valid())
return;
IObject archiveTop = archive.getTop();
if ( archiveTop.getProperties().getPropertyHeader( ".childBnds" ) != NULL ) { // Try to get timing from childBounds first
IBox3dProperty childbnds = Alembic::Abc::IBox3dProperty( archive.getTop().getProperties(),
".childBnds", ErrorHandler::kQuietNoopPolicy);
TimeSamplingPtr ts = childbnds.getTimeSampling();
first = std::min(first, ts->getSampleTime(0) );
last = std::max(last, ts->getSampleTime(childbnds.getNumSamples()-1) );
return;
}
unsigned int numChildren = archiveTop.getNumChildren();
for (unsigned i=0; i<numChildren; ++i) // Visit every object to get its first and last sample
{
IObject obj( archiveTop.getChild( i ));
getObjectTimeSpan(obj, first, last, true);
}
}
示例2: scopingTest
void scopingTest(bool useOgawa)
{
{
OObject top;
{
OArchive archive;
if (useOgawa)
{
archive = CreateArchiveWithInfo(
Alembic::AbcCoreOgawa::WriteArchive(),
"archiveScopeTest.abc",
"Alembic test", "", MetaData() );
}
else
{
archive = CreateArchiveWithInfo(
Alembic::AbcCoreHDF5::WriteArchive(),
"archiveScopeTest.abc",
"Alembic test", "", MetaData() );
}
top = archive.getTop();
}
OObject childA( top, "a");
OObject childB( top, "b");
ODoubleProperty prop(top.getProperties(), "prop", 0);
TESTING_ASSERT(prop.getObject().getArchive().getName() ==
"archiveScopeTest.abc");
}
{
IObject top;
{
AbcF::IFactory factory;
AbcF::IFactory::CoreType coreType;
IArchive archive = factory.getArchive("archiveScopeTest.abc",
coreType);
TESTING_ASSERT( (useOgawa && coreType == AbcF::IFactory::kOgawa) ||
(!useOgawa && coreType == AbcF::IFactory::kHDF5) );
top = archive.getTop();
double start, end;
GetArchiveStartAndEndTime( archive, start, end );
TESTING_ASSERT( start == DBL_MAX && end == -DBL_MAX );
}
TESTING_ASSERT(top.getNumChildren() == 2 );
TESTING_ASSERT(top.getChildHeader("a") != NULL);
TESTING_ASSERT(top.getChildHeader("b") != NULL);
TESTING_ASSERT( ! top.getParent().valid() );
TESTING_ASSERT( top.getArchive().getName() ==
"archiveScopeTest.abc");
IScalarProperty prop(top.getProperties(), "prop");
TESTING_ASSERT(prop.valid());
TESTING_ASSERT(prop.getObject().getArchive().getName() ==
"archiveScopeTest.abc");
}
}
示例3: visibilityProperty
// Read side --------------------------------------
IVisibilityProperty
GetVisibilityProperty ( IObject & iObject )
{
ICompoundProperty prop = iObject.getProperties();
if ( prop.getPropertyHeader (kVisibilityPropertyName) )
{
IVisibilityProperty visibilityProperty ( prop,
kVisibilityPropertyName );
return visibilityProperty;
}
return IVisibilityProperty();
}
示例4: init
//-*****************************************************************************
void ICompoundProperty::init ( const IObject & iObject,
const Argument &iArg0,
const Argument &iArg1 )
{
getErrorHandler().setPolicy(
GetErrorHandlerPolicy( iObject, iArg0, iArg1 ) );
ALEMBIC_ABC_SAFE_CALL_BEGIN(
"ICompoundProperty::init( IObject )" );
m_property = iObject.getProperties().getPtr();
ALEMBIC_ABC_SAFE_CALL_END_RESET();
}
示例5: readDeepHierarchy
//-*****************************************************************************
void readDeepHierarchy( IObject parent, const int level, const IObject& orig )
{
if ( level > DEPTH )
{
ICompoundProperty p = parent.getProperties();
IInt32ArrayProperty iap( p, "intArrayProp" );
std::string fullName = const_cast<std::string&>(
iap.getObject().getFullName() );
PATH_PAIR ret = PATHS.insert( fullName );
Int32ArraySamplePtr sampPtr = iap.getValue();
TESTING_ASSERT( sampPtr->get()[5] == 5 );
TESTING_ASSERT( sampPtr->get()[99] == 99 );
TESTING_ASSERT( sampPtr->size() == ( size_t ) HIGHVAL );
TESTING_ASSERT( ret.second );
TESTING_ASSERT( fullName == parent.getFullName() );
// walk back up the tree until you find the first child object
// under the top object, and check that it's the one we started
// with.
IObject _p = parent;
while ( _p.getParent().getParent() )
{
_p = _p.getParent();
}
TESTING_ASSERT( _p.getFullName() == orig.getFullName() );
return;
}
std::ostringstream strm;
strm << level;
std::string levelName = strm.str();
readDeepHierarchy( IObject( parent, levelName ), level + 1, orig );
}
示例6: visitObject
//-*****************************************************************************
void visitObject( IObject iObj,
std::string iIndent )
{
// Object has a name, a full name, some meta data,
// and then it has a compound property full of properties.
std::string path = iObj.getFullName();
if ( path != "/" )
{
std::cout << "Object " << "name=" << path << std::endl;
}
// Get the properties.
ICompoundProperty props = iObj.getProperties();
visitProperties( props, iIndent );
// now the child objects
for ( size_t i = 0 ; i < iObj.getNumChildren() ; i++ )
{
visitObject( IObject( iObj, iObj.getChildHeader( i ).getName() ),
iIndent );
}
}