-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
return myFacesWithImprinting;
}
+//=======================================================================
+//function : SetFacesWithSnapping
+//purpose : Set IDs of faces that already have surface layers
+//=======================================================================
+
+bool HYBRIDPlugin_Hypothesis::SetFacesWithSnapping(const std::vector<int>& theVal)
+{
+ if ( myFacesWithSnapping != theVal )
+ {
+ myFacesWithSnapping = theVal;
+ NotifySubMeshesHypothesisModification();
+ return true;
+ }
+ return false;
+}
+
+//=======================================================================
+//function : GetFacesWithSnapping
+//purpose : Return IDs of faces that already have surface layers
+//=======================================================================
+
+const std::vector<int>& HYBRIDPlugin_Hypothesis::GetFacesWithSnapping() const
+{
+ return myFacesWithSnapping;
+}
+
//=======================================================================
//function : SetToMeshHoles
//=======================================================================
elemRet = _enfEdges.insert(make_pair(elem,groupName));
added = added && elemRet.second;
}
- else if (elem->GetType() > SMDSAbs_Edge) {
- SMDS_ElemIteratorPtr it = elem->edgesIterator();
- for (;it->more();) {
- const SMDS_MeshElement* anEdge = it->next();
- elemRet = _enfEdges.insert(make_pair(anEdge,groupName));
- added = added && elemRet.second;
- }
- }
break;
case SMESH::FACE:
if (elem->GetType() == SMDSAbs_Face)
added = added && elemRet.second;
}
}
- else if (elem->GetType() > SMDSAbs_Face) { // Group of faces
- SMDS_ElemIteratorPtr it = elem->facesIterator();
- for (;it->more();) {
- const SMDS_MeshElement* aFace = it->next();
- if (aFace->NbCornerNodes() == 3) {
- elemRet = _enfTriangles.insert(make_pair(aFace,groupName));
- added = added && elemRet.second;
- }
- }
- }
break;
default:
break;
for ( size_t i = 0; i < myFacesWithImprinting.size(); ++i )
save << " " << myFacesWithImprinting[i];
+ save << " " << myFacesWithSnapping.size();
+ for ( size_t i = 0; i < myFacesWithSnapping.size(); ++i )
+ save << " " << myFacesWithSnapping[i];
+
return save;
}
}
}
+ isOK = static_cast<bool>(load >> separator);
if ( isOK )
{
i = atoi( separator.c_str() );
}
}
+ isOK = static_cast<bool>(load >> separator);
+ if ( isOK )
+ {
+ i = atoi( separator.c_str() );
+ isOK = ( i >= 0 );
+ if ( isOK )
+ {
+ myFacesWithSnapping.reserve( i );
+ while (( myFacesWithSnapping.size() < myFacesWithSnapping.capacity() ) &&
+ ( isOK = static_cast<bool>(load >> i)) )
+ myFacesWithSnapping.push_back( i );
+ }
+ }
+
return load;
}
cmd << " --boundary_layer_imprinting yes --boundary_layer_imprinting_tags ";
for ( size_t i = 0; i < faceImprintingIDs.size(); ++i )
cmd << faceImprintingIDs[i] << ",";
+
+ // faces with snapping
+ const std::vector<int>& faceSnappingIDs = hyp->GetFacesWithSnapping();
+ if ( !faceSnappingIDs.empty() )
+ cmd << " --boundary_layer_snapping yes --boundary_layer_snapping_tags ";
+ for ( size_t i = 0; i < faceSnappingIDs.size(); ++i )
+ cmd << faceSnappingIDs[i] << ",";
}
}
const char* value[] = { "yes" , "no" };
cmd << " --smooth_normals " << value[ res ];
}
-
+
+ // options as text
+ if ( hyp && !hyp->myTextOption.empty() ) {
+ cmd += " " + hyp->myTextOption;
+ }
#ifdef WIN32
cmd << " < NUL";
#endif