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


C++ MultiGrid::get_grid_objects方法代码示例

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


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

示例1: CopyGridLevel

void CopyGridLevel(MultiGrid& srcMG, Grid& destGrid,
				   ISubsetHandler& srcSH, ISubsetHandler& destSH,
				   int lvl, TAPos aPos)
{
	Grid::VertexAttachmentAccessor<TAPos> aaPos(destGrid, aPos);
	Grid::VertexAttachmentAccessor<TAPos> aaSrcPos(srcMG, aPos);
	GridObjectCollection goc = srcMG.get_grid_objects();

	AVertex aNewVrt;
	srcMG.attach_to_vertices(aNewVrt);
	Grid::VertexAttachmentAccessor<AVertex> aaNewVrt(srcMG, aNewVrt);

	for(int si = destSH.num_subsets(); si < srcSH.num_subsets(); ++si)
	{
		destSH.subset_info(si) = srcSH.subset_info(si);
	}

	for(VertexIterator vrtIter = goc.begin<Vertex>(lvl); vrtIter != goc.end<Vertex>(lvl); ++vrtIter)
	{
		Vertex* srcVrt  = *vrtIter;
		Vertex* destVrt = *destGrid.create_by_cloning(srcVrt);

		aaNewVrt[srcVrt] = destVrt;
		aaPos[destVrt] = aaSrcPos[srcVrt];
		destSH.assign_subset(destVrt, srcSH.get_subset_index(srcVrt));
	}

	CopyGridLevelElements<Edge>(srcMG, destGrid, srcSH, destSH, lvl, aNewVrt);
	CopyGridLevelElements<Face>(srcMG, destGrid, srcSH, destSH, lvl, aNewVrt);
	CopyGridLevelElements<Volume>(srcMG, destGrid, srcSH, destSH, lvl, aNewVrt);

	srcMG.detach_from_vertices(aNewVrt);
}
开发者ID:UG4,项目名称:ugcore,代码行数:33,代码来源:file_io.cpp

示例2: CopyGridLevelElements

void CopyGridLevelElements(MultiGrid& srcMG, Grid& destGrid,
				           ISubsetHandler& srcSH, ISubsetHandler& destSH,
						   int lvl, AVertex& aNewVrt)
{
	Grid::VertexAttachmentAccessor<AVertex> aaNewVrt(srcMG, aNewVrt);
	GridObjectCollection goc = srcMG.get_grid_objects();
	CustomVertexGroup vrts;

	typedef typename Grid::traits<TElem>::iterator iter_t;

	for(iter_t eIter = goc.begin<TElem>(lvl); eIter != goc.end<TElem>(lvl); ++eIter)
	{
		TElem* e = *eIter;
		vrts.resize(e->num_vertices());

		for(size_t iv = 0; iv < e->num_vertices(); ++iv)
		{
			vrts.set_vertex(iv, aaNewVrt[e->vertex(iv)]);
		}

		TElem* ne = *destGrid.create_by_cloning(e, vrts);
		destSH.assign_subset(ne, srcSH.get_subset_index(e));
	}
}
开发者ID:UG4,项目名称:ugcore,代码行数:24,代码来源:file_io.cpp


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