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


C++ PatchMesh::GetMesh方法代码示例

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


在下文中一共展示了PatchMesh::GetMesh方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetRenderMesh

Mesh* TriPatchObject::GetRenderMesh(TimeValue t, INode *inode, View& view, BOOL& needDelete) {
	UpdatePatchMesh(t);
	TessApprox tess = patch.GetProdTess();
	if (tess.type == TESS_SET) {
		needDelete = FALSE;
		patch.InvalidateMesh(); // force this...
		// temporarlily set the view tess to prod tess
		TessApprox tempTess = patch.GetViewTess();
		patch.SetViewTess(tess);
		PrepareMesh(t);
		patch.SetViewTess(tempTess);
		return &patch.GetMesh();
	} else {
		Mesh *nmesh = new Mesh/*(mesh)*/;
		Matrix3 otm = inode->GetObjectTM(t);

		Box3 bbox;
		GetDeformBBox(t, bbox);
		tess.merge *= Length(bbox.Width())/1000.0f;
		TessApprox disp = patch.GetDispTess();
		disp.merge *= Length(bbox.Width())/1000.0f;

		GetGTessFunction();
		(*psGTessFunc)(&patch, BEZIER_PATCH, &otm, nmesh, &tess, &disp, &view, inode->GetMtl(), FALSE, FALSE);
		if (tess.merge > 0.0f && patch.GetProdTessWeld())
			WeldMesh(nmesh, tess.merge);
		needDelete = TRUE;
		return nmesh;
	}
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:30,代码来源:tripatch.cpp

示例2: UpdatePerNodeItems

bool TriPatchObject::UpdatePerNodeItems(const MaxSDK::Graphics::UpdateDisplayContext& updateDisplayContext,
										MaxSDK::Graphics::UpdateNodeContext& nodeContext,
										MaxSDK::Graphics::IRenderItemContainer& targetRenderItemContainer)
{
	Mesh& mesh = patch.GetMesh();
	if(mesh.getNumVerts()>0)
	{
		using namespace MaxSDK::Graphics;

		GenerateMeshRenderItemsContext generateRenderItemsContext;
		generateRenderItemsContext.GenerateDefaultContext(updateDisplayContext);
		generateRenderItemsContext.RemoveInvisibleMeshElementDescriptions(nodeContext.GetRenderNode());

		IMeshDisplay2* pMeshDisplay = static_cast<IMeshDisplay2*>(mesh.GetInterface(IMesh_DISPLAY2_INTERFACE_ID));
		if (NULL == pMeshDisplay)
		{
			return false;
		}

		pMeshDisplay->GetRenderItems(generateRenderItemsContext,nodeContext,targetRenderItemContainer);

		return true ;
	}

	return false;
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:26,代码来源:tripatch.cpp

示例3: Display

int TriPatchObject::Display(TimeValue t, INode* inode, ViewExp *vpt, int flags) {

	if ( ! vpt || ! vpt->IsAlive() )
	{
		// why are we here
		DbgAssert(!_T("Invalid viewport!"));
		return FALSE;
	}

	Matrix3 tm;
	GraphicsWindow *gw = vpt->getGW();
	gw->setTransform(inode->GetObjectTM(t));
	UpdatePatchMesh(t);

	if(!MaxSDK::Graphics::IsRetainedModeEnabled())
	{
		if(!(gw->getRndMode() & GW_BOX_MODE)) {
			PrepareMesh(t);
			Mesh& mesh = patch.GetMesh();
			if(mesh.getNumVerts()) {
				mesh.render( gw, inode->Mtls(),
					(flags&USE_DAMAGE_RECT) ? &vpt->GetDammageRect() : NULL, 
					COMP_ALL | (inode->Selected()?COMP_OBJSELECTED:0), inode->NumMtls());	
			}
		}
	}

	patch.render( gw, inode->Mtls(),
		(flags&USE_DAMAGE_RECT) ? &vpt->GetDammageRect() : NULL, 
		COMP_ALL | (inode->Selected()?COMP_OBJSELECTED:0), inode->NumMtls());	
	return(0);
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:32,代码来源:tripatch.cpp

示例4: ConvertToType

Object* TriPatchObject::ConvertToType(TimeValue t, Class_ID obtype) {
	if(obtype == patchObjectClassID || obtype == defObjectClassID || obtype == mapObjectClassID) {
		PatchObject *ob;
		UpdatePatchMesh(t);
		ob = new PatchObject();	
		ob->patch = patch;
		ob->SetChannelValidity(TOPO_CHAN_NUM,ObjectValidity(t));
		ob->SetChannelValidity(GEOM_CHAN_NUM,ObjectValidity(t));
		return ob;
		}

	if(obtype == triObjectClassID) {
		TriObject *ob = CreateNewTriObject();
		PrepareMesh(t);
		ob->GetMesh() = patch.GetMesh();
		ob->SetChannelValidity(TOPO_CHAN_NUM,ObjectValidity(t));
		ob->SetChannelValidity(GEOM_CHAN_NUM,ObjectValidity(t));
		return ob;
		}
#ifndef NO_NURBS
	if (obtype==EDITABLE_SURF_CLASS_ID) {
		PatchObject *pob;
		UpdatePatchMesh(t);
		pob = new PatchObject();	
		pob->patch = patch;
		Object *ob = BuildEMObjectFromPatchObject(pob);
		delete pob;
		ob->SetChannelValidity(TOPO_CHAN_NUM, ObjectValidity(t));
		ob->SetChannelValidity(GEOM_CHAN_NUM, ObjectValidity(t));
		return ob;
		}
#endif
	if (Object::CanConvertToType (obtype)) return Object::ConvertToType (t, obtype);

	if (CanConvertPatchObject (obtype)) {
		PatchObject *ob;
		UpdatePatchMesh(t);
		ob = new PatchObject();	
		ob->patch = patch;
		ob->SetChannelValidity(TOPO_CHAN_NUM,ObjectValidity(t));
		ob->SetChannelValidity(GEOM_CHAN_NUM,ObjectValidity(t));
		Object *ret = ob->ConvertToType (t, obtype);
		ob->DeleteThis ();
		return ret;
		}
	return NULL;
	}
开发者ID:DimondTheCat,项目名称:xray,代码行数:47,代码来源:tripatch.cpp

示例5: Display

int TriPatchObject::Display(TimeValue t, INode* inode, ViewExp *vpt, int flags) {
	Matrix3 tm;
	GraphicsWindow *gw = vpt->getGW();
	gw->setTransform(inode->GetObjectTM(t));
	UpdatePatchMesh(t);
	if(!(gw->getRndMode() & GW_BOX_MODE)) {
		PrepareMesh(t);
		Mesh& mesh = patch.GetMesh();
		if(mesh.getNumVerts()) {
			mesh.render( gw, inode->Mtls(),
				(flags&USE_DAMAGE_RECT) ? &vpt->GetDammageRect() : NULL, 
				COMP_ALL | (inode->Selected()?COMP_OBJSELECTED:0), inode->NumMtls());	
			}
		}
	patch.render( gw, inode->Mtls(),
		(flags&USE_DAMAGE_RECT) ? &vpt->GetDammageRect() : NULL, 
		COMP_ALL | (inode->Selected()?COMP_OBJSELECTED:0), inode->NumMtls());	
	return(0);
	}
开发者ID:DimondTheCat,项目名称:xray,代码行数:19,代码来源:tripatch.cpp

示例6: UpdateDisplay

bool TriPatchObject::UpdateDisplay(
	const MaxSDK::Graphics::MaxContext& maxContext, 
	const MaxSDK::Graphics::UpdateDisplayContext& displayContext)
{
	// create a mesh to display (leave it in cache)
	PrepareMesh(displayContext.GetDisplayTime());
	Mesh& mesh = patch.GetMesh();
	if(mesh.getNumVerts()>0)
	{
		using namespace MaxSDK::Graphics;

		GenerateMeshRenderItemsContext generateRenderItemsContext;
		generateRenderItemsContext.GenerateDefaultContext(displayContext);

		mesh.GenerateRenderItems(mRenderItemHandles,generateRenderItemsContext);
		return true ;
	}

	return false;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:20,代码来源:tripatch.cpp

示例7: PrepareDisplay

bool TriPatchObject::PrepareDisplay(const MaxSDK::Graphics::UpdateDisplayContext& prepareDisplayContext)
{
	PrepareMesh(prepareDisplayContext.GetDisplayTime());
	Mesh& mesh = patch.GetMesh();
	if(mesh.getNumVerts()>0)
	{
		using namespace MaxSDK::Graphics;

		mRenderItemHandles.ClearAllRenderItems();		
		IMeshDisplay2* pMeshDisplay = static_cast<IMeshDisplay2*>(mesh.GetInterface(IMesh_DISPLAY2_INTERFACE_ID));
		if (NULL == pMeshDisplay)
		{
			return false;
		}

		GenerateMeshRenderItemsContext generateMeshRenderItemsContext;
		generateMeshRenderItemsContext.GenerateDefaultContext(prepareDisplayContext);
		pMeshDisplay->PrepareDisplay(generateMeshRenderItemsContext);

		return true ;
	}

	return false;
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:24,代码来源:tripatch.cpp

示例8: CreateTriObjRep

ObjectHandle TriPatchObject::CreateTriObjRep(TimeValue t) {
	TriObject *tri = CreateNewTriObject();
	PrepareMesh(t);	// Turn it into a mesh
	tri->GetMesh() = patch.GetMesh();	// Place it into the TriObject
	return(ObjectHandle(tri));
	}
开发者ID:DimondTheCat,项目名称:xray,代码行数:6,代码来源:tripatch.cpp


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