本文整理汇总了C++中TopTools_IndexedMapOfShape::Assign方法的典型用法代码示例。如果您正苦于以下问题:C++ TopTools_IndexedMapOfShape::Assign方法的具体用法?C++ TopTools_IndexedMapOfShape::Assign怎么用?C++ TopTools_IndexedMapOfShape::Assign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TopTools_IndexedMapOfShape
的用法示例。
在下文中一共展示了TopTools_IndexedMapOfShape::Assign方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Ng_OCC_GetFMap
// Extract the face map from the OCC geometry
// The face map basically gives an index to each face in the geometry,
// which can be used to access a specific face
DLL_HEADER Ng_Result Ng_OCC_GetFMap(Ng_OCC_Geometry * geom,
Ng_OCC_TopTools_IndexedMapOfShape * FMap)
{
OCCGeometry* occgeom = (OCCGeometry*)geom;
TopTools_IndexedMapOfShape *occfmap = (TopTools_IndexedMapOfShape *)FMap;
// Copy the face map from the geometry to the given variable
occfmap->Assign(occgeom->fmap);
if(occfmap->Extent())
{
return NG_OK;
}
else
{
return NG_ERROR;
}
}
示例2: run_impl
bool occ_make_mesh::run_impl()
{
io::FileType ft;
if (filetype.valid())
ft = io::from_string( filetype() );
else
ft = io::from_filename( filename() );
try
{
output_parameter_proxy<netgen::mesh> omp(output_mesh);
::netgen::OCCGeometry * geometry;
if (ft == io::OCC_STEP)
geometry = ::netgen::LoadOCC_STEP( filename().c_str() );
else if (ft == io::OCC_IGES)
geometry = ::netgen::LoadOCC_IGES( filename().c_str() );
else
{
error(1) << "File type \"" << io::to_string(ft) << "\" is not supported" << std::endl;
return false;
}
// http://sourceforge.net/p/netgen-mesher/discussion/905307/thread/7176bc7d/
TopTools_IndexedMapOfShape FMap;
FMap.Assign( geometry->fmap );
if (!FMap.Extent())
{
std::cout << "Error retrieving Face map... (OpenCascade error)" << endl;
return false;
}
::netgen::MeshingParameters mp;
mp.elementorder = 0;
mp.quad = 0;
mp.inverttets = 0;
mp.inverttrigs = 0;
if (cell_size.valid())
{
mp.uselocalh = 1;
mp.maxh = cell_size();
}
mp.curvaturesafety = curvature_safety_factor();
mp.segmentsperedge = segments_per_edge();
mp.grading = grading();
int perfstepsend = 6;
omp()().geomtype = ::netgen::Mesh::GEOM_OCC;
::netgen::occparam.resthcloseedgeenable = 0; //mp.closeedgeenable;
::netgen::occparam.resthcloseedgefac = 1.0; //mp.closeedgefact;
::netgen::mparam = mp;
omp()().DeleteMesh();
::netgen::OCCSetLocalMeshSize( *geometry, omp()() );
::netgen::OCCFindEdges(*geometry, omp()());
::netgen::OCCMeshSurface(*geometry, omp()(), perfstepsend);
omp()().CalcSurfacesOfNode();
::netgen::MeshVolume(mp, omp()());
::netgen::RemoveIllegalElements( omp()() );
::netgen::MeshQuality3d( omp()() );
::netgen::OptimizeVolume(mp, omp()() );
}
catch (::netgen::NgException const & ex)
{
error(1) << "Netgen Error: " << ex.What() << std::endl;
return false;
}
return true;
}