Definition at line 44 of file NucMeshGeo.H.
|
std::unique_ptr< SMESH_Mesh > | computeMesh (SMESH_Gen &generator) |
| Construct a mesh using the shapes in the map and their ShapeData . More...
|
|
int | getDim () const |
| Get dimension of geometry. More...
|
|
void | setDim (int dim) |
| Set the dimension. More...
|
|
std::vector< TopoDS_Shape > | modify (BRepBuilderAPI_MakeShape &op, const std::vector< TopoDS_Shape > &shapes, const std::vector< TopAbs_ShapeEnum > &typesToTraverse={ TopAbs_VERTEX, TopAbs_EDGE, TopAbs_FACE, TopAbs_SOLID}) |
| Modify this geoMetadata after a BRepBuilderAPI_MakeShape operation. More...
|
|
std::vector< TopoDS_Shape > | modify (BRepBuilderAPI_MakeShape &op, const TopTools_ListOfShape &shapes, const std::vector< TopAbs_ShapeEnum > &typesToTraverse={ TopAbs_VERTEX, TopAbs_EDGE, TopAbs_FACE, TopAbs_SOLID}) |
|
std::array< std::vector< TopoDS_Shape >, 2 > | modify (BRepAlgoAPI_BooleanOperation &op, const std::vector< TopAbs_ShapeEnum > &typesToTraverse={ TopAbs_VERTEX, TopAbs_EDGE, TopAbs_FACE, TopAbs_SOLID}) |
|
std::vector< TopoDS_Shape > | modify (BRepBuilderAPI_Sewing &op, const std::vector< TopoDS_Shape > &shapes, const std::vector< TopAbs_ShapeEnum > &typesToTraverse={ TopAbs_VERTEX, TopAbs_EDGE, TopAbs_FACE, TopAbs_SOLID}) |
|
void | deleteShapes (const TopoDS_Shape &shape) |
| Remove a shape from the map. More...
|
|
void | deleteShapes (const std::vector< TopoDS_Shape > &shapes) |
| Delete a set of shapes. More...
|
|
TopoDS_Compound | buildCompound () const |
| Create a compound from shapes present in the map that have same dimension as the instance. More...
|
|
std::shared_ptr< ShapeData > * | get (const TopoDS_Shape &shape) |
| Get the data from the map. More...
|
|
const std::shared_ptr< ShapeData > * | get (const TopoDS_Shape &shape) const |
| Get the data from the map. More...
|
|
std::pair< MapType::iterator, bool > | insert (const TopoDS_Shape &shape, std::shared_ptr< ShapeData > shapeData) |
|
template<typename T > |
std::pair< MapType::iterator, bool > | insertForward (const TopoDS_Shape &shape, T &&shapeData) |
| Helper to insert a shape and data into the map. More...
|
|
template<typename T , typename... Args> |
std::pair< MapType::iterator, bool > | insertConstruct (const TopoDS_Shape &shape, Args &&...args) |
| Helper to insert a shape and construct data. More...
|
|
MapType & | getMap () |
|
const MapType & | getMap () const |
| Get the shapes and data. More...
|
|
std::unique_ptr< SMESH_Mesh > NEM::NUCMESH::NucMeshGeo::computeMesh |
( |
SMESH_Gen & |
generator | ) |
|
Note there is a default edge hypothesis (StdMeshers_AutomaticLength), edge algorithm (StdMeshers_Regular_1D), and face algorithm (StdMeshers_MEFISTO_2D). Geometry and mesh regenerated on each call.
- Returns
- Generated mesh
Definition at line 48 of file NucMeshGeo.C.
References NEM::GEO::GeoManager::buildCompound(), NEM::GEO::GeoManager::isChild(), NEM::GEO::GeoManager::map_, mesh, and NEM::DRV::JSON::shapeType.
Referenced by NEM::SRV::NucMeshSrv::FillOutputPortInformation().
49 std::unique_ptr<SMESH_Mesh>
mesh{generator.CreateMesh(
false)};
50 std::vector<std::unique_ptr<SMESH_Hypothesis>> hypotheses;
52 mesh->ShapeToMesh(compound);
54 auto edgeAlgId = generator.GetANewId();
55 hypotheses.emplace_back(
new StdMeshers_Regular_1D{edgeAlgId, &generator});
56 mesh->AddHypothesis(compound, edgeAlgId);
57 auto edgeHypId = generator.GetANewId();
58 hypotheses.emplace_back(
59 new StdMeshers_Adaptive1D{edgeHypId, &generator});
60 mesh->AddHypothesis(compound, edgeHypId);
63 auto faceAlgId = generator.GetANewId();
64 hypotheses.emplace_back(
new StdMeshers_MEFISTO_2D{faceAlgId, &generator});
65 mesh->AddHypothesis(compound, faceAlgId);
67 std::unordered_set<TopoDS_Shape, ShapeMapHasher_Hash, ShapeMapHasher_KeyEqual>
69 for (
auto &shape :
map_) {
71 static constexpr std::array<TopAbs_ShapeEnum, 4> shapeTypes{
72 TopAbs_VERTEX, TopAbs_EDGE, TopAbs_FACE, TopAbs_SOLID};
74 for (TopExp_Explorer explorer{shape.first,
shapeType}; explorer.More();
76 auto &subShape = explorer.Current();
77 auto findIter = map_.find(subShape);
78 if (findIter != map_.end() &&
79 generated_shapes.find(subShape) == generated_shapes.end()) {
81 dynamic_cast<NucMeshShapeData *>(findIter->second.get())) {
82 nmData->setupAlgos(explorer.Current(), generator, *
mesh,
85 generated_shapes.emplace(subShape);
91 generator.Compute(*
mesh, compound);
static constexpr auto shapeType
bool isChild(const TopoDS_Shape &shape) const
std::shared_ptr< meshBase > mesh
TopoDS_Compound buildCompound() const
Create a compound from shapes present in the map that have same dimension as the instance.