StdMeshers_ProxyMesh* aProxyMesh)
{
StdMeshers_ProxyMesh::setMesh( aMesh );
- //myResMap.clear();
+
+ if ( aShape.ShapeType() != TopAbs_SOLID &&
+ aShape.ShapeType() != TopAbs_SHELL )
+ return false;
+
vector<const SMDS_MeshElement*> myPyramids;
- //myNbTriangles = 0;
- //myShape = aShape;
SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
SMESH_MesherHelper helper(aMesh);
myElemSearcher = SMESH_MeshEditor(&aMesh).GetElementSearcher();
const SMESHDS_SubMesh * aSubMeshDSFace;
+ Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5);
+ Handle(TColgp_HArray1OfVec) VN = new TColgp_HArray1OfVec(1,4);
+ vector<const SMDS_MeshNode*> FNodes(5);
+ gp_Pnt PC;
+ gp_Vec VNorm;
for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next())
{
aSubMeshDSFace = aProxyMesh->GetSubMesh( aShapeFace );
else
aSubMeshDSFace = meshDS->MeshElements( aShapeFace );
+
vector<const SMDS_MeshElement*> trias, quads;
bool hasNewTrias = false;
+
if ( aSubMeshDSFace )
{
- bool isRev = SMESH_Algo::IsReversedSubMesh( TopoDS::Face(aShapeFace), meshDS );
+ bool isRev = false;
+ if ( helper.NbAncestors( aShapeFace, aMesh, aShape.ShapeType() ) > 1 )
+ isRev = SMESH_Algo::IsReversedSubMesh( TopoDS::Face(aShapeFace), meshDS );
SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements();
while ( iteratorElem->more() ) // loop on elements on a geometrical face
{
const SMDS_MeshElement* face = iteratorElem->next();
- //cout<<endl<<"================= face->GetID() = "<<face->GetID()<<endl;
- // preparation step using face info
- Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5);
- Handle(TColgp_HArray1OfVec) VN = new TColgp_HArray1OfVec(1,4);
- vector<const SMDS_MeshNode*> FNodes(5);
- gp_Pnt PC;
- gp_Vec VNorm;
+ // preparation step to get face info
int stat = Preparation(face, PN, VN, FNodes, PC, VNorm);
switch ( stat )
{
} // case QUAD:
} // switch ( stat )
+ } // end loop on elements on a face submesh
- bool sourceSubMeshIsProxy = false;
- if ( aProxyMesh )
- {
- // move proxy sub-mesh from other proxy mesh to this
- sourceSubMeshIsProxy = takeProxySubMesh( aShapeFace, aProxyMesh );
- // move tmp elements added in mesh
- takeTmpElemsInMesh( aProxyMesh );
- }
- if ( hasNewTrias )
- {
- StdMeshers_ProxyMesh::SubMesh* prxSubMesh = getProxySubMesh( aShapeFace );
- prxSubMesh->ChangeElements( trias.begin(), trias.end() );
+ bool sourceSubMeshIsProxy = false;
+ if ( aProxyMesh )
+ {
+ // move proxy sub-mesh from other proxy mesh to this
+ sourceSubMeshIsProxy = takeProxySubMesh( aShapeFace, aProxyMesh );
+ // move tmp elements added in mesh
+ takeTmpElemsInMesh( aProxyMesh );
+ }
+ if ( hasNewTrias )
+ {
+ StdMeshers_ProxyMesh::SubMesh* prxSubMesh = getProxySubMesh( aShapeFace );
+ prxSubMesh->ChangeElements( trias.begin(), trias.end() );
- // delete tmp quadrangles removed from aProxyMesh
- if ( sourceSubMeshIsProxy )
- for ( unsigned i = 0; i < quads.size(); ++i )
- removeTmpElement( quads[i] );
- }
- } // end loop on elements on a face submesh
+ // delete tmp quadrangles removed from aProxyMesh
+ if ( sourceSubMeshIsProxy )
+ for ( unsigned i = 0; i < quads.size(); ++i )
+ removeTmpElement( quads[i] );
+ }
}
} // end for(TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next()) {
for ( unsigned i = 0 ; i < _sdVec.size(); ++i )
{
_SolidData& data = _sdVec[i];
+ TopTools_MapOfShape FFMap;
map< TGeomID, TopoDS_Shape >::iterator s2s = data._shrinkShape2Shape.begin();
for (; s2s != data._shrinkShape2Shape.end(); ++s2s )
if ( s2s->second.ShapeType() == TopAbs_FACE )
+ {
f2sdMap.insert( make_pair( getMeshDS()->ShapeToIndex( s2s->second ), &data ));
+
+ if ( FFMap.Add( (*s2s).second ))
+ // Put mesh faces on the shrinked FACE to the proxy sub-mesh to avoid
+ // usage of mesh faces made in addBoundaryElements() by the 3D algo or
+ // by StdMeshers_QuadToTriaAdaptor
+ if ( SMESHDS_SubMesh* smDS = getMeshDS()->MeshElements( s2s->second ))
+ {
+ StdMeshers_ProxyMesh::SubMesh* proxySub =
+ data._proxyMesh->getFaceSubM( TopoDS::Face( s2s->second ), /*create=*/true);
+ SMDS_ElemIteratorPtr fIt = smDS->GetElements();
+ while ( fIt->more() )
+ proxySub->AddElement( fIt->next() );
+ }
+ }
}
SMESH_MesherHelper helper( *_mesh );
helper.SetSubShape(F);
- // Put mesh faces on the shrinked FACE to the proxy sub-mesh to avoid
- // usage of mesh faces made in addBoundaryElements() by the 3D algo or
- // by StdMeshers_QuadToTriaAdaptor
- {
- StdMeshers_ProxyMesh::SubMesh* proxySub =
- data._proxyMesh->getFaceSubM( F, /*create=*/true);
- SMDS_ElemIteratorPtr fIt = smDS->GetElements();
- while ( fIt->more() )
- proxySub->AddElement( fIt->next() );
- }
// ===========================
// Prepare data for shrinking
// ===========================