#include "utilities.h"
-#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; }
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+
+#define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
#define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z())
#define SHOWYXZ(msg, xyz) // {\
// gp_Pnt p (xyz); \
SMESH_Hypothesis::Hypothesis_Status& aStatus)
{
// check aShape that must be a 6 faces block
+/* PAL16229
if ( TAssocTool::Count( aShape, TopAbs_SHELL, 1 ) != 1 ||
TAssocTool::Count( aShape, TopAbs_FACE , 1 ) != 6 ||
TAssocTool::Count( aShape, TopAbs_EDGE , 1 ) != 12 ||
aStatus = HYP_BAD_GEOMETRY;
return false;
}
-
+*/
list <const SMESHDS_Hypothesis * >::const_iterator itl;
const list <const SMESHDS_Hypothesis * >&hyps = GetUsedHypothesis(aMesh, aShape);
srcShell = TopoDS::Shell( exp.Current() );
if ( nbShell != 1 )
return error(COMPERR_BAD_SHAPE,
- SMESH_Comment("Shape must have 1 shell but not") << nbShell);
+ SMESH_Comment("Source shape must have 1 shell but not ") << nbShell);
exp.Init( aShape, TopAbs_SHELL );
for ( nbShell = 0; exp.More(); exp.Next(), ++nbShell )
tgtShell = TopoDS::Shell( exp.Current() );
if ( nbShell != 1 )
return error(COMPERR_BAD_SHAPE,
- SMESH_Comment("Shape must have 1 shell but not") << nbShell);
+ SMESH_Comment("Target shape must have 1 shell but not ") << nbShell);
+
+ // Check that shapes are blocks
+ if ( TAssocTool::Count( tgtShell, TopAbs_FACE , 1 ) != 6 ||
+ TAssocTool::Count( tgtShell, TopAbs_EDGE , 1 ) != 12 ||
+ TAssocTool::Count( tgtShell, TopAbs_WIRE , 1 ) != 6 )
+ return error(COMPERR_BAD_SHAPE, "Target shape is not a block");
+ if ( TAssocTool::Count( srcShell, TopAbs_FACE , 1 ) != 6 ||
+ TAssocTool::Count( srcShell, TopAbs_EDGE , 1 ) != 12 ||
+ TAssocTool::Count( srcShell, TopAbs_WIRE , 1 ) != 6 )
+ return error(COMPERR_BAD_SHAPE, "Source shape is not a block");
// Assure that mesh on a source shape is computed