本文整理汇总了C++中Box3d::makeEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ Box3d::makeEmpty方法的具体用法?C++ Box3d::makeEmpty怎么用?C++ Box3d::makeEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Box3d
的用法示例。
在下文中一共展示了Box3d::makeEmpty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: meshUnderXformOut
//-*****************************************************************************
void meshUnderXformOut( const std::string &iName )
{
OArchive archive( Alembic::AbcCoreHDF5::WriteArchive(), iName );
TimeSamplingPtr ts( new TimeSampling( 1.0 / 24.0, 0.0 ) );
OXform xfobj( archive.getTop(), "xf", ts );
OPolyMesh meshobj( xfobj, "mesh", ts );
OPolyMeshSchema::Sample mesh_samp(
V3fArraySample( ( const V3f * )g_verts, g_numVerts ),
Int32ArraySample( g_indices, g_numIndices ),
Int32ArraySample( g_counts, g_numCounts ) );
XformSample xf_samp;
XformOp rotOp( kRotateYOperation );
Box3d childBounds;
childBounds.makeEmpty();
childBounds.extendBy( V3d( 1.0, 1.0, 1.0 ) );
childBounds.extendBy( V3d( -1.0, -1.0, -1.0 ) );
xf_samp.setChildBounds( childBounds );
double rotation = 0.0;
for ( std::size_t i = 0 ; i < 100 ; ++i )
{
xf_samp.addOp( rotOp, rotation );
xfobj.getSchema().set( xf_samp );
meshobj.getSchema().set( mesh_samp );
rotation += 30.0;
}
}
示例2: setTime
//-*****************************************************************************
void ISubDDrw::setTime( chrono_t iSeconds )
{
IObjectDrw::setTime( iSeconds );
if ( !valid() )
{
m_drwHelper.makeInvalid();
return;
}
// Use nearest for now.
ISampleSelector ss( iSeconds, ISampleSelector::kNearIndex );
ISubDSchema::Sample psamp;
if ( m_subD.getSchema().isConstant() )
{
psamp = m_samp;
}
else if ( m_subD.getSchema().getNumSamples() > 0 )
{
m_subD.getSchema().get( psamp, ss );
}
// Get the stuff.
P3fArraySamplePtr P = psamp.getPositions();
Int32ArraySamplePtr indices = psamp.getFaceIndices();
Int32ArraySamplePtr counts = psamp.getFaceCounts();
Box3d bounds;
bounds.makeEmpty();
if ( m_boundsProp && m_boundsProp.getNumSamples() > 0 )
{ bounds = m_boundsProp.getValue( ss ); }
// Update the mesh hoo-ha.
m_drwHelper.update( P, V3fArraySamplePtr(),
indices, counts, bounds );
if ( !m_drwHelper.valid() )
{
m_subD.reset();
return;
}
// The Object update computed child bounds.
// Extend them by this.
if ( !m_drwHelper.getBounds().isEmpty() )
{
m_bounds.extendBy( m_drwHelper.getBounds() );
}
}
示例3: main
//-*****************************************************************************
//-*****************************************************************************
// DO IT.
//-*****************************************************************************
//-*****************************************************************************
int main( int argc, char *argv[] )
{
if ( argc != 2 )
{
std::cerr << "USAGE: " << argv[0] << " <AlembicArchive.abc>"
<< std::endl;
exit( -1 );
}
// Scoped.
g_bounds.makeEmpty();
{
IArchive archive( Alembic::AbcCoreHDF5::ReadArchive(),
argv[1], ErrorHandler::kQuietNoopPolicy );
visitObject( archive.getTop() );
}
std::cout << "/" << " " << g_bounds.min << " " << g_bounds.max << std::endl;
return 0;
}
示例4: 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;
}
示例5: worldToVoxel
void worldToVoxel(const Field3D::FieldMapping* mapping,
const Box3d &wsBounds,
Box3d &vsBounds)
{
V3d test1, test2;
mapping->worldToVoxel(test1, test2);
//! \todo Make this integrate over time
V3d wsVerts[] = {
V3d(wsBounds.min.x, wsBounds.min.y, wsBounds.min.z),
V3d(wsBounds.max.x, wsBounds.min.y, wsBounds.min.z),
V3d(wsBounds.min.x, wsBounds.max.y, wsBounds.min.z),
V3d(wsBounds.max.x, wsBounds.max.y, wsBounds.min.z),
V3d(wsBounds.min.x, wsBounds.min.y, wsBounds.max.z),
V3d(wsBounds.max.x, wsBounds.min.y, wsBounds.max.z),
V3d(wsBounds.min.x, wsBounds.max.y, wsBounds.max.z),
V3d(wsBounds.max.x, wsBounds.max.y, wsBounds.max.z)
};
vsBounds.makeEmpty();
V3d vsP;
for (int i = 0; i < 8; i++) {
mapping->worldToVoxel(wsVerts[i], vsP);
vsBounds.extendBy(vsP);
}
}