X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FCANRECPLUGIN_PY%2FCANRECPluginBuilder.py;fp=src%2FCANRECPLUGIN_PY%2FCANRECPluginBuilder.py;h=8dfda9a17c449e11c8bbfbf55f4a3814994863ad;hb=6b4b2b09efa11c7596b665771c90490c13fb4a9a;hp=e4c9c01f4367b578257ad2aca3d523083a8b97ac;hpb=a5b0f7c4589f2883a4d8bb4ce1ea6ed48f0b0acc;p=plugins%2Fcanrecplugin.git diff --git a/src/CANRECPLUGIN_PY/CANRECPluginBuilder.py b/src/CANRECPLUGIN_PY/CANRECPluginBuilder.py index e4c9c01..8dfda9a 100644 --- a/src/CANRECPLUGIN_PY/CANRECPluginBuilder.py +++ b/src/CANRECPLUGIN_PY/CANRECPluginBuilder.py @@ -69,8 +69,37 @@ def MakeCanonicalRecognition(self, theObj, theMergeSurf, theMergeCurves, 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