// Clear collected data
void reset()
{
- myFace2QuadMap.Clear();
StdMeshers_Quadrangle_2D::myQuadList.clear();
StdMeshers_Quadrangle_2D::myHelper = nullptr;
+ StdMeshers_Quadrangle_2D::myProxyMesh.reset();
+ myFace2QuadMap.Clear();
}
//================================================================================
//================================================================================
int countNbSides( const Prism_3D::TPrismTopo & thePrism,
- vector<int> & nbUnitePerEdge,
+ vector<int> & /*nbUnitePerEdge*/,
vector< double > & edgeLength)
{
int nbEdges = thePrism.myNbEdgesInWires.front(); // nb outer edges
cout << "mesh.AddNode( " << p[i].X() << ", "<< p[i].Y() << ", "<< p[i].Z() << ") # " << i <<" " ;
SMESH_Block::DumpShapeID( i, cout ) << endl;
}
+#else
+ (void)p; // unused in release mode
#endif
}
//purpose :
//=======================================================================
-bool StdMeshers_Prism_3D::CheckHypothesis(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
+bool StdMeshers_Prism_3D::CheckHypothesis(SMESH_Mesh& /*aMesh*/,
+ const TopoDS_Shape& /*aShape*/,
SMESH_Hypothesis::Hypothesis_Status& aStatus)
{
// no hypothesis
SMESH_MesherHelper helper( theMesh );
myHelper = &helper;
myPrevBottomSM = 0;
- TQuadrangleAlgo::Cleaner( TQuadrangleAlgo::instance( this ));
+ TQuadrangleAlgo::Cleaner quadCleaner( TQuadrangleAlgo::instance( this ));
int nbSolids = helper.Count( theShape, TopAbs_SOLID, /*skipSame=*/false );
if ( nbSolids < 1 )
}
TopTools_MapOfShape meshedSolids;
+ NCollection_DataMap< TopoDS_Shape, SMESH_subMesh* > meshedFace2AlgoSM;
list< Prism_3D::TPrismTopo > meshedPrism;
list< TopoDS_Face > suspectSourceFaces;
TopTools_ListIteratorOfListOfShape solidIt;
{
prism.Clear();
prism.myBottom = face;
+ if ( meshedFace2AlgoSM.IsBound( face ))
+ prism.myAlgoSM = meshedFace2AlgoSM.Find( face );
if ( !initPrism( prism, solid, selectBottom ) ||
!compute( prism ))
return false;
!myHelper->IsStructured( theMesh.GetSubMesh( prism.myTop )))
{
meshedFaces.push_front( prism.myTop );
+ if ( prism.myAlgoSM && prism.myAlgoSM->GetAlgo() )
+ {
+ meshedFace2AlgoSM.Bind( prism.myTop, prism.myAlgoSM );
+ meshedFace2AlgoSM.Bind( prism.myBottom, prism.myAlgoSM );
+ }
}
else
{
solidList.Remove( solidIt );
continue; // already computed prism
}
- if ( myHelper->IsBlock( solid )) {
- solidIt.Next();
- continue; // too trivial
+ if ( myHelper->IsBlock( solid ))
+ {
+ bool isStructBase = true;
+ if ( prismIt->myAlgoSM )
+ isStructBase = ( myHelper->IsSameElemGeometry( prismIt->myAlgoSM->GetSubMeshDS(),
+ SMDSGeom_QUADRANGLE ) &&
+ myHelper->IsStructured(prismIt->myAlgoSM ));
+ if ( isStructBase )
+ {
+ solidIt.Next();
+ continue; // too trivial
+ }
}
// find a source FACE of the SOLID: it's a FACE sharing a bottom EDGE with wFace
const TopoDS_Edge& wEdge = (*wQuad)->side[ QUAD_TOP_SIDE ].grid->Edge(0);
}
prism.Clear();
prism.myBottom = candidateF;
+ prism.myAlgoSM = prismIt->myAlgoSM;
mySetErrorToSM = false;
if ( !myHelper->IsSubShape( candidateF, prismIt->myShape3D ) &&
myHelper ->IsSubShape( candidateF, solid ) &&
!myHelper->GetMesh()->GetSubMesh( candidateF )->IsMeshComputed() &&
initPrism( prism, solid, /*selectBottom=*/false ) &&
!myHelper->GetMesh()->GetSubMesh( prism.myTop )->IsMeshComputed() &&
- !myHelper->GetMesh()->GetSubMesh( prism.myBottom )->IsMeshComputed() &&
- project2dMesh( sourceF, prism.myBottom ))
+ !myHelper->GetMesh()->GetSubMesh( prism.myBottom )->IsMeshComputed() )
{
- mySetErrorToSM = true;
- if ( !compute( prism ))
- return false;
- SMESHDS_SubMesh* smDS = theMesh.GetMeshDS()->MeshElements( prism.myTop );
- if ( !myHelper->IsSameElemGeometry( smDS, SMDSGeom_QUADRANGLE ))
+ if ( project2dMesh( sourceF, prism.myBottom ))
+ {
+ mySetErrorToSM = true;
+ if ( !compute( prism ))
+ return false;
+ SMESHDS_SubMesh* smDS = theMesh.GetMeshDS()->MeshElements( prism.myTop );
+ if ( !myHelper->IsSameElemGeometry( smDS, SMDSGeom_QUADRANGLE ))
+ {
+ meshedFaces.push_front( prism.myTop );
+ meshedFaces.push_front( prism.myBottom );
+ selectBottom = false;
+ if ( prism.myAlgoSM && prism.myAlgoSM->GetAlgo() )
+ {
+ meshedFace2AlgoSM.Bind( prism.myTop, prism.myAlgoSM );
+ meshedFace2AlgoSM.Bind( prism.myBottom, prism.myAlgoSM );
+ }
+ }
+ meshedPrism.push_back( prism );
+ meshedSolids.Add( solid );
+ }
+ else
{
- meshedFaces.push_front( prism.myTop );
- meshedFaces.push_front( prism.myBottom );
- selectBottom = false;
+ suspectSourceFaces.push_back( prism.myBottom );
+ if ( prism.myAlgoSM && prism.myAlgoSM->GetAlgo() )
+ meshedFace2AlgoSM.Bind( prism.myBottom, prism.myAlgoSM );
}
- meshedPrism.push_back( prism );
- meshedSolids.Add( solid );
}
InitComputeError();
}
allSubMeComputed = smIt->next()->IsMeshComputed();
if ( allSubMeComputed )
{
- faceSM->ComputeStateEngine( SMESH_subMesh::COMPUTE );
+ faceSM->ComputeStateEngine( SMESH_subMesh::COMPUTE_SUBMESH );
if ( !faceSM->IsEmpty() ) {
meshedFaces.push_front( face ); // higher priority
selectBottom = true;
{
// find any applicable algorithm assigned to any FACE of the main shape
std::vector< TopoDS_Shape > faces;
- if ( myPrevBottomSM &&
- myPrevBottomSM->GetAlgo()->IsApplicableToShape( thePrism.myBottom, /*all=*/false ))
+ if ( thePrism.myAlgoSM && thePrism.myAlgoSM->GetAlgo() )
+ faces.push_back( thePrism.myAlgoSM->GetSubShape() );
+ if ( myPrevBottomSM && myPrevBottomSM->GetAlgo() )
faces.push_back( myPrevBottomSM->GetSubShape() );
TopExp_Explorer faceIt( mesh->GetShapeToMesh(), TopAbs_FACE );
while ( smIt->more() && subOK )
{
SMESH_subMesh* sub = smIt->next();
- sub->ComputeStateEngine( SMESH_subMesh::COMPUTE );
+ sub->ComputeStateEngine( SMESH_subMesh::COMPUTE_SUBMESH );
subOK = sub->IsMeshComputed();
}
if ( !subOK )
}
try {
OCC_CATCH_SIGNALS;
+
+ Hypothesis_Status status;
+ algo->CheckHypothesis( *mesh, faces[i], status );
algo->InitComputeError();
- algo->Compute( *mesh, botSM->GetSubShape() );
+ if ( algo->Compute( *mesh, botSM->GetSubShape() ))
+ {
+ myPrevBottomSM = thePrism.myAlgoSM = mesh->GetSubMesh( faces[i] );
+ break;
+ }
}
catch (...) {
}
}
}
}
+ else
+ {
+ myPrevBottomSM = thePrism.myAlgoSM = botSM;
+ }
if ( botSM->IsEmpty() )
return error( COMPERR_BAD_INPUT_MESH,
TCom( "No mesher defined to compute the base face #")
<< shapeID( thePrism.myBottom ));
- if ( botSM->GetAlgo() )
- myPrevBottomSM = botSM;
-
return true;
}
mesh->GetSubMesh( v )->ComputeStateEngine( SMESH_subMesh::COMPUTE );
const SMDS_MeshNode* n = SMESH_Algo::VertexNode( v, meshDS );
newNodes[ is2ndV ? newNodes.size()-1 : 0 ] = (SMDS_MeshNode*) n;
+ if ( !n )
+ return toSM( error( TCom("No node on vertex #") << meshDS->ShapeToIndex( v )));
}
// compute nodes on target EDGEs
*/
//================================================================================
-bool StdMeshers_Prism_3D::setFaceAndEdgesXYZ( const int faceID, const gp_XYZ& params, int z )
+bool StdMeshers_Prism_3D::setFaceAndEdgesXYZ( const int faceID, const gp_XYZ& params, int /*z*/ )
{
// find base and top edges of the face
enum { BASE = 0, TOP, LEFT, RIGHT };
myBottomEdges.clear();
myNbEdgesInWires.clear();
myWallQuads.clear();
+ myAlgoSM = nullptr;
}
//================================================================================
<< n << ", " << n+1 << ", "
<< n+nb+2 << ", " << n+nb+1 << "]) " << endl;
}
-
+#else
+ (void)face; // unused in release mode
+ (void)nb; // unused in release mode
#endif
}
column = & ( myParamToColumnMap->rbegin()->second );
else
column = & ( myParamToColumnMap->begin()->second );
- if ( column->size() > 0 )
+ if ( column->size() > 1 )
edge = myHelper.GetSubShapeByNode( (*column)[ 1 ], meshDS );
if ( edge.IsNull() || edge.ShapeType() == TopAbs_VERTEX )
node = column->front();
TVerticalEdgeAdaptor* vSide1 = (TVerticalEdgeAdaptor*) VertiCurve(1);
cout << "Verti side 1: "; vSide1->dumpNodes(nbNodes); cout << endl;
delete hSize0; delete hSize1; delete vSide0; delete vSide1;
+#else
+ (void)nbNodes; // unused in release mode
#endif
}
cout << (*myNodeColumn)[i]->GetID() << " ";
if ( nbNodes < (int) myNodeColumn->size() )
cout << myNodeColumn->back()->GetID();
+#else
+ (void)nbNodes; // unused in release mode
#endif
}
side->GetColumns( u , col, col2 );
if ( n != col->second[ i ] )
cout << col->second[ i ]->GetID();
+#else
+ (void)nbNodes; // unused in release mode
#endif
}