当前位置: 首页>>代码示例>>C++>>正文


C++ ObjectWrapper::SetMapFace方法代码示例

本文整理汇总了C++中ObjectWrapper::SetMapFace方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectWrapper::SetMapFace方法的具体用法?C++ ObjectWrapper::SetMapFace怎么用?C++ ObjectWrapper::SetMapFace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObjectWrapper的用法示例。


在下文中一共展示了ObjectWrapper::SetMapFace方法的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);
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:88,代码来源:ProjectionHolderUVW.cpp


注:本文中的ObjectWrapper::SetMapFace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。