void GMSHPlugin_Mesher::SetCompoundMeshVisibility()
{
- // Loop over all faces, if the face belongs to a compound entry then
- // for all (boundary) edges whithin the face visibility is set to 0,
- // if the face doesn't belong to a compound entry then visibility is
- // set to 1 for all its (boundary) edges. Later, in FillSMesh() func
- // getVisibility() (returns either 1 or 0) is used to decide weather
- // the mesh of edge should be transmitted to SMESH or not.
-
- for ( GModel::fiter itF = _gModel->firstFace(); itF != _gModel->lastFace(); ++itF )
+ // Loop over all regions (or faces), if the region (or face) belongs
+ // to a compound entry, then for all boundary faces (or Edges) within
+ // the region (or face) visibility is set to 0 otherwise is is set 1.
+ // Later, in FillSMesh() func getVisibility() (returns either 1 or 0)
+ // is used to decide weather the mesh of entry should be transmitted
+ // to SMESH or not. Note, visibility is set to 1 or 0 recurisvely, e.g.
+ // for a face its constructing edges and nodes will be effected.
+
+ for ( GModel::riter itR = _gModel->firstRegion(); itR != _gModel->lastRegion(); ++itR)
{
- std::vector< GEdge *> faceEdges = (*itF)->edges();
-
- for ( auto itE = faceEdges.begin(); itE != faceEdges.end(); ++itE )
+ std::vector< GFace *> regionFaces = (*itR)->faces();
+ for ( auto itF = regionFaces.begin(); itF != regionFaces.end(); ++itF )
{
- if ( ((*itF)->compound.size()) )
- (*itE)->setVisibility(0);
+ if ( ((*itR)->compound.size()) )
+ (*itF)->setVisibility(0,true);
else
- (*itE)->setVisibility(1);
+ (*itF)->setVisibility(1,true);
}
}
-
- // Loop over all edges, if the edge belongs to a compound entry then
- // for all (boundary) vertices whithin the edge visibility is set to
- // 0, if the edge doesn't belong to a compound entry then visibility
- // is set to 1 for all its (boundary) vertices. Later, in FillSMesh()
- // func getVisibility() (returns either 1 or 0) is used to decide we-
- // ather the mesh of vertices should be transmitted to SMESH or not.
-
- for ( GModel::eiter itE = _gModel->firstEdge(); itE != _gModel->lastEdge(); ++itE )
+ for ( GModel::fiter itF = _gModel->firstFace(); itF != _gModel->lastFace(); ++itF )
{
- std::vector<GVertex *> bndVerticies = (*itE)->vertices();
+ std::vector< GEdge *> faceEdges = (*itF)->edges();
- for( auto itV = bndVerticies.begin(); itV != bndVerticies.end(); ++itV )
+ for ( auto itE = faceEdges.begin(); itE != faceEdges.end(); ++itE )
{
- if(((*itE)->compound.size()))
- (*itV)->setVisibility(0);
+ if ( ((*itF)->compound.size()) )
+ (*itE)->setVisibility(0,true);
else
- (*itV)->setVisibility(1);
+ (*itE)->setVisibility(1,true);
}
}