本文整理汇总了C++中IObject::getMetaData方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::getMetaData方法的具体用法?C++ IObject::getMetaData怎么用?C++ IObject::getMetaData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObject
的用法示例。
在下文中一共展示了IObject::getMetaData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: accumXform
//-*****************************************************************************
void accumXform( M44d &xf, IObject obj )
{
if ( ISimpleXform::matches( obj.getMetaData() ) )
{
ISimpleXform x( obj, kWrapExisting );
xf *= x.getSchema().getValue().getMatrix();
}
else if ( IXform::matches( obj.getMetaData() ) )
{
IXform x( obj, kWrapExisting );
XformSample xs;
x.getSchema().get( xs );
xf *= xs.getMatrix();
}
}
示例2: getBounds
//-*****************************************************************************
Box3d getBounds( IObject iObj )
{
Box3d bnds;
bnds.makeEmpty();
M44d xf = getFinalMatrix( iObj );
if ( IPolyMesh::matches( iObj.getMetaData() ) )
{
IPolyMesh mesh( iObj, kWrapExisting );
IPolyMeshSchema ms = mesh.getSchema();
V3fArraySamplePtr positions = ms.getValue().getPositions();
size_t numPoints = positions->size();
for ( size_t i = 0 ; i < numPoints ; ++i )
{
bnds.extendBy( (*positions)[i] );
}
}
else if ( ISubD::matches( iObj.getMetaData() ) )
{
ISubD mesh( iObj, kWrapExisting );
ISubDSchema ms = mesh.getSchema();
V3fArraySamplePtr positions = ms.getValue().getPositions();
size_t numPoints = positions->size();
for ( size_t i = 0 ; i < numPoints ; ++i )
{
bnds.extendBy( (*positions)[i] );
}
}
bnds.extendBy( Imath::transform( bnds, xf ) );
g_bounds.extendBy( bnds );
return bnds;
}
示例3: visitObject
//-*****************************************************************************
void visitObject( IObject iObj )
{
std::string path = iObj.getFullName();
const MetaData &md = iObj.getMetaData();
if ( IPolyMeshSchema::matches( md ) || ISubDSchema::matches( md ) )
{
Box3d bnds = getBounds( iObj );
std::cout << path << " " << bnds.min << " " << bnds.max << std::endl;
}
// now the child objects
for ( size_t i = 0 ; i < iObj.getNumChildren() ; i++ )
{
visitObject( IObject( iObj, iObj.getChildHeader( i ).getName() ) );
}
}
示例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;
}
示例5: pushName
//-*****************************************************************************
int pushName( IObject &iObj )
{
Abc::MetaData md = iObj.getMetaData();
if ( IPolyMesh::matches( md ) ||
IPoints::matches( md ) ||
ICurves::matches( md ) ||
INuPatch::matches( md ) ||
ISubD::matches( md )
)
{
OBJECT_MAP.push_back( iObj.getFullName() );
glPushName( OBJECT_MAP.size() );
//std::cout << OBJECT_MAP.size()
// << "\t"
// << iObj.getFullName()
// << std::endl;
return OBJECT_MAP.size();
} else {
return -1;
}
}