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


C++ SMESHDS_Mesh::NbFaces方法代码示例

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


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

示例1: myNetGenMesher

App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
{
#ifdef FCWithNetgen

    Fem::FemMesh newMesh;

    Part::Feature *feat = Shape.getValue<Part::Feature*>();
    TopoDS_Shape shape = feat->Shape.getValue();

    NETGENPlugin_Mesher myNetGenMesher(newMesh.getSMesh(),shape,true);
    NETGENPlugin_Hypothesis* tet= new NETGENPlugin_Hypothesis(0,1,newMesh.getGenerator());
    tet->SetMaxSize(MaxSize.getValue());
    tet->SetSecondOrder(SecondOrder.getValue());
    tet->SetOptimize(Optimize.getValue());
    int iFineness = Fineness.getValue();
    tet->SetFineness((NETGENPlugin_Hypothesis::Fineness)iFineness);
    if(iFineness == 5){
        tet->SetGrowthRate(GrowthRate.getValue());
        tet->SetNbSegPerEdge(NbSegsPerEdge.getValue());
        tet->SetNbSegPerRadius(NbSegsPerRadius.getValue());
    }
    myNetGenMesher.SetParameters( tet);
    newMesh.getSMesh()->ShapeToMesh(shape);

    myNetGenMesher.Compute();

    // throw Base::RuntimeError("Compute Done\n");

    SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(newMesh.getSMesh())->GetMeshDS();
    const SMDS_MeshInfo& info = data->GetMeshInfo();
    int numFaces = data->NbFaces();
    int numNode = info.NbNodes();
  //int numTria = info.NbTriangles();
  //int numQuad = info.NbQuadrangles();
  //int numPoly = info.NbPolygons();
    int numVolu = info.NbVolumes();
  //int numTetr = info.NbTetras();
  //int numHexa = info.NbHexas();
  //int numPyrd = info.NbPyramids();
  //int numPris = info.NbPrisms();
  //int numHedr = info.NbPolyhedrons();

    Base::Console().Log("NetgenMesh: %i Nodes, %i Volumes, %i Faces\n",numNode,numVolu,numFaces);

      FemMesh.setValue(newMesh);
    return App::DocumentObject::StdReturn;
#else
    return new App::DocumentObjectExecReturn("The FEM module is built without NETGEN support. Meshing will not work!!!", this);
#endif
}
开发者ID:KeithSloan,项目名称:FreeCAD_sf_master,代码行数:50,代码来源:FemMeshShapeNetgenObject.cpp


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