本文整理汇总了C++中ObjectWrapper::Type方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectWrapper::Type方法的具体用法?C++ ObjectWrapper::Type怎么用?C++ ObjectWrapper::Type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectWrapper
的用法示例。
在下文中一共展示了ObjectWrapper::Type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ModifyObject
//ModifyObject will do all the work in a full modifier
//This includes casting objects to their correct form, doing modifications
//changing their parameters, etc
void ProjectionHolderUVW::ModifyObject(TimeValue t, ModContext &mc, ObjectState * os, INode *node)
{
ObjectWrapper object;
object.Init(t,*os,false, ObjectWrapper::allEnable, ObjectWrapper::triObject);
if( object.IsEmpty() )
return;
// Check topology
if( object.NumFaces() != mData.mFaces.Count() )
return;
for( int i=0; i<object.NumFaces(); i++ ) {
GenFace face = object.GetFace(i);
if( face.numVerts != mData.mFaces[i].numVerts )
return;
}
if( mData.miMapChannel != VERTEX_CHANNEL_NUM ) {
// Check Channel Support
if( !object.GetChannelSupport(mData.miMapChannel) )
object.SetChannelSupport( mData.miMapChannel, true );
object.SetNumMapVerts( mData.miMapChannel, mData.mP3Data.Count() );
for( int i=0; i<mData.mP3Data.Count(); i++ )
object.SetMapVert( mData.miMapChannel, i, mData.mP3Data[i] );
for( int i=0; i<mData.mFaces.Count(); i++ ) {
object.SetMapFace( mData.miMapChannel, i, mData.mFaces[i] );
// Material ID Support
if( mData.mDoMaterialIDs )
object.SetMtlID(i, mData.mMatID[i] );
}
os->obj->PointsWereChanged();
}
else {
object.SetNumVerts( mData.mP3Data.Count() );
for( int i=0; i<mData.mP3Data.Count(); i++ )
object.SetVert( i, mData.mP3Data[i] );
for( int i=0; i<mData.mFaces.Count(); i++ ) {
object.SetFace( i, mData.mFaces[i] );
// Material ID Support
if( mData.mDoMaterialIDs )
object.SetMtlID(i, mData.mMatID[i] );
}
os->obj->PointsWereChanged();
if( object.Type() == ObjectWrapper::polyObject ) {
MNMesh *poly = object.GetPolyMesh();
if( poly )
poly->FillInMesh();
}
else if( object.Type() == ObjectWrapper::triObject ) {
Mesh *mesh = object.GetTriMesh();
if( mesh )
mesh->InvalidateTopologyCache();
}
}
Interval iv;
iv = FOREVER;
iv &= mData.mSrcInterval;
if( mData.miMapChannel > 0 )
iv &= os->obj->ChannelValidity (t, TEXMAP_CHAN_NUM);
else if( mData.miMapChannel == VERTEX_CHANNEL_NUM ) {
iv &= os->obj->ChannelValidity(t,GEOM_CHAN_NUM);
iv &= os->obj->ChannelValidity(t,TOPO_CHAN_NUM);
}
else
iv &= os->obj->ChannelValidity(t,VERT_COLOR_CHAN_NUM);
if( mData.miMapChannel > 0 )
os->obj->UpdateValidity(TEXMAP_CHAN_NUM,iv);
else if( mData.miMapChannel == VERTEX_CHANNEL_NUM ) {
os->obj->UpdateValidity(GEOM_CHAN_NUM,iv);
os->obj->UpdateValidity(TOPO_CHAN_NUM,iv);
}
else
os->obj->UpdateValidity(VERT_COLOR_CHAN_NUM,iv);
}