+//================================================================================
+/*!
+ * \brief Return true if the algorithm can mesh this shape
+ * \param [in] aShape - shape to check
+ * \param [in] toCheckAll - if true, this check returns OK if all shapes are OK,
+ * else, returns OK if all at least one shape is OK
+ */
+//================================================================================
+
+bool StdMeshers_Hexa_3D::IsApplicable( const TopoDS_Shape & aShape, bool toCheckAll )
+{
+ TopoDS_Vertex theVertex0, theVertex1;
+ TopTools_IndexedMapOfOrientedShape theShapeIDMap;
+ bool isCurShellApp;
+ int nbFoundShells = 0;
+ TopExp_Explorer exp0( aShape, TopAbs_SOLID );
+ if ( !exp0.More() ) return false;
+ for ( ; exp0.More(); exp0.Next() )
+ {
+ nbFoundShells = 0;
+ isCurShellApp = false;
+ TopExp_Explorer exp1( exp0.Current(), TopAbs_SHELL );
+ for ( ; exp1.More(); exp1.Next(), ++nbFoundShells)
+ if ( nbFoundShells == 2 ) break;
+ if ( nbFoundShells == 2){
+ if ( toCheckAll ) return false;
+ continue;
+ }
+ exp1.Init( exp0.Current(), TopAbs_SHELL );
+ const TopoDS_Shell& shell = TopoDS::Shell(exp1.Current());
+ isCurShellApp = SMESH_Block::FindBlockShapes(shell, theVertex0, theVertex1, theShapeIDMap );
+ if ( toCheckAll && !isCurShellApp ) return false;
+ if ( !toCheckAll && isCurShellApp ) return true;
+ }
+ return toCheckAll;
+};
+