from salome.geom.geomBuilder import ParseParameters, RaiseIfFailed
anOp = GetCANRECOperations(self)
theMergeSurf, theMergeCurves, theTolerance, Parameters = ParseParameters(theMergeSurf, theMergeCurves, theTolerance)
- anObj = anOp.MakeCanonicalRecognition(theObj, theMergeSurf, theMergeCurves, theTolerance)
+ (anObj, aStat) = anOp.MakeCanonicalRecognition(theObj, theMergeSurf, theMergeCurves, theTolerance)
RaiseIfFailed("MakeCanonicalRecognition", anOp)
self._autoPublish(anObj, theName, "canonical")
anOp.UnRegister()
+ print "Total number of faces in the initial shape: %s" % aStat[0]
+ print "Number of canonical faces in the initial shape: %s" % aStat[1]
+ print "Number of faces converted to the canonical form: %s" % aStat[2]
+ if aStat[3] >= 0:
+ print "Number of merged surfaces: %s" % aStat[3]
+ if aStat[4] >= 0:
+ print "Number of merged curves: %s" % aStat[4]
+
return anObj
+
+## Get the number of canonical faces in the shape.
+# @param theObj the input object (solid, compound, compsolid).
+#
+# @return the number of canonical faces in the object.
+def GetNbCanonicalFaces(self, theObj):
+ """
+ Get the number of canonical faces in the shape.
+
+ Parameters:
+ theObj the input object (solid, compound, compsolid).
+
+ Returns:
+ the number of canonical faces in the object.
+ """
+ from salome.geom.geomBuilder import RaiseIfFailed
+ anOp = GetCANRECOperations(self)
+ aNbCanFaces = anOp.GetNbCanonicalFaces(theObj)
+ RaiseIfFailed("GetNbCanonicalFaces", anOp)
+ anOp.UnRegister()
+ return aNbCanFaces