From: jfa Date: Wed, 4 Nov 2009 09:05:42 +0000 (+0000) Subject: Mantis issue 20052: RemoveExtraEdges signature changed (integer parameter theOptimumN... X-Git-Tag: V4_1_0_maintainance_FINAL~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c660463776be95b2b4e1695ff4eb75cf017f1f7a;p=modules%2Fgeom.git Mantis issue 20052: RemoveExtraEdges signature changed (integer parameter theOptimumNbFaces replaced with boolean doUnionFaces). --- diff --git a/doc/salome/gui/GEOM/input/remove_extra_edges_operation.doc b/doc/salome/gui/GEOM/input/remove_extra_edges_operation.doc index 9b4a32d36..ef1b932bf 100644 --- a/doc/salome/gui/GEOM/input/remove_extra_edges_operation.doc +++ b/doc/salome/gui/GEOM/input/remove_extra_edges_operation.doc @@ -7,13 +7,13 @@ \n This operation removes all seam and degenerated edges from a given shape. Its main purpose is healing of solids and compounds to obtain hexahedral solids and compounds of hexahedral solids. -At the same time, it has an option to unite all faces, sharing one -surface. With this option not only hexahedral solids could be obtained. +However, there is an option to unite all faces sharing one +surface, which produces not only hexahedral solids. -\n TUI Command: geompy.RemoveExtraEdges(theShape,theOptimumNbFaces), -there theShape is a compound or a single solid to remove irregular edges from -and theOptimumNbFaces is an integer parameter, that regulates, -whether the faces, sharing common surface, should be united, or not. +\n TUI Command: geompy.RemoveExtraEdges(theShape,doUnionFaces), +where theShape is a compound or a single solid +and doUnionFaces is a boolean parameter, that regulates, +whether the faces, sharing a common surface, should be united. \n Arguments: Name + one shape + a flag. \n Advanced option: \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments". diff --git a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx index 6f7e86cd0..1bc6e3972 100644 --- a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx @@ -99,8 +99,6 @@ #include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC -using namespace std; - //============================================================================= /*! * constructor: @@ -1927,7 +1925,7 @@ Standard_Boolean HasAnyConnection (const Standard_Integer theBlockIndex, //============================================================================= Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocksOld (Handle(GEOM_Object) theCompound, - list& theErrors) + std::list& theErrors) { SetErrorCode(KO); @@ -2079,11 +2077,11 @@ Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocksOld //============================================================================= TCollection_AsciiString GEOMImpl_IBlocksOperations::PrintBCErrors (Handle(GEOM_Object) theCompound, - const list& theErrors) + const std::list& theErrors) { TCollection_AsciiString aDescr; - list::const_iterator errIt = theErrors.begin(); + std::list::const_iterator errIt = theErrors.begin(); int i = 0; for (; errIt != theErrors.end(); i++, errIt++) { BCError errStruct = *errIt; @@ -2108,8 +2106,8 @@ TCollection_AsciiString GEOMImpl_IBlocksOperations::PrintBCErrors break; } - list sshList = errStruct.incriminated; - list::iterator sshIt = sshList.begin(); + std::list sshList = errStruct.incriminated; + std::list::iterator sshIt = sshList.begin(); int jj = 0; for (; sshIt != sshList.end(); jj++, sshIt++) { if (jj > 0) @@ -2128,7 +2126,7 @@ TCollection_AsciiString GEOMImpl_IBlocksOperations::PrintBCErrors //============================================================================= Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocks (Handle(GEOM_Object) theCompound, - list& theErrors) + std::list& theErrors) { SetErrorCode(KO); @@ -2224,7 +2222,7 @@ Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocks } // 3. Find not glued blocks - GEOMAlgo_GlueAnalyser aGD; + GEOMAlgo_GlueAnalyser aGD; aGD.SetShape(aComp); aGD.SetTolerance(Precision::Confusion()); @@ -2352,9 +2350,9 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::RemoveExtraEdges } //Make a Python command - GEOM::TPythonDump(aFunction) << aCopy - << " = geompy.RemoveExtraEdges(" << theObject - << ", " << theOptimumNbFaces << ")"; + std::string doUnionFaces = (theOptimumNbFaces < 0) ? "False" : "True"; + GEOM::TPythonDump(aFunction) << aCopy << " = geompy.RemoveExtraEdges(" + << theObject << ", " << doUnionFaces.data() << ")"; SetErrorCode(OK); return aCopy; diff --git a/src/GEOM_SWIG/GEOM_TestOthers.py b/src/GEOM_SWIG/GEOM_TestOthers.py index f1da60701..53656b83c 100644 --- a/src/GEOM_SWIG/GEOM_TestOthers.py +++ b/src/GEOM_SWIG/GEOM_TestOthers.py @@ -448,13 +448,13 @@ def TestOtherOperations (geompy, math): Shell_1 = geompy.MakeShell([Face_1, Rotation_1, Rotation_2, Rotation_3, Rotation_4, Rotation_5]) Solid_1 = geompy.MakeSolid([Shell_1]) - NoExtraEdges_1 = geompy.RemoveExtraEdges(Solid_1, 0) + NoExtraEdges_1 = geompy.RemoveExtraEdges(Solid_1, True) # doUnionFaces = True geompy.addToStudy(Shell_1, "Shell_1") geompy.addToStudy(Solid_1, "Solid_1") geompy.addToStudy(NoExtraEdges_1, "NoExtraEdges_1") - # RemoveExtraEdges + # RemoveExtraEdges (by default, doUnionFaces = False) freeFacesWithoutExtra = geompy.RemoveExtraEdges(freeFaces) geompy.addToStudy(freeFacesWithoutExtra, "freeFacesWithoutExtra") @@ -521,7 +521,7 @@ def TestOtherOperations (geompy, math): v_y, Loc, geompy.GEOM.ST_ON) for edge_i in edges_on_pln: geompy.addToStudy(edge_i, "Edge on Plane (N = (0, -1, 0) & Location = (0, -50, 0)") - + # GetShapesOnPlaneWithLocationIDs edges_on_pln_ids = geompy.GetShapesOnPlaneWithLocationIDs( blocksComp, geompy.ShapeType["EDGE"], v_y, Loc, geompy.GEOM.ST_ON) diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index 76bdb024a..7a94c8e8d 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -320,7 +320,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter) RaiseIfFailed("MakeTangentOnCurve", self.BasicOp) return anObj - + ## Create a tangent plane to specified face in the point with specified parameters. # @param theFace - face for which tangent plane shuold be built. # @param theParameterU - value of parameter by U @@ -332,7 +332,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize) RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp) return anObj - + ## Create a vector with the given components. # @param theDX X component of the vector. @@ -2990,16 +2990,16 @@ class geompyDC(GEOM._objref_GEOM_Gen): # Unite faces and edges, sharing one surface. It means that # this faces must have references to one C++ surface object (handle). # @param theShape The compound or single solid to remove irregular edges from. - # @param theOptimumNbFaces If more than zero, unite faces only for those solids, - # that have more than theOptimumNbFaces faces. If zero, unite faces always, - # regardsless their quantity in the solid. If negative (the default value), - # do not unite faces at all. For blocks repairing recommended value is 6. + # @param doUnionFaces If True, then unite faces. If False (the default value), + # do not unite faces. # @return Improved shape. # # @ref swig_RemoveExtraEdges "Example" - def RemoveExtraEdges(self,theShape,theOptimumNbFaces=-1): + def RemoveExtraEdges(self, theShape, doUnionFaces=False): # Example: see GEOM_TestOthers.py - anObj = self.BlocksOp.RemoveExtraEdges(theShape,theOptimumNbFaces) + nbFacesOptimum = -1 # -1 means do not unite faces + if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces + anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum) RaiseIfFailed("RemoveExtraEdges", self.BlocksOp) return anObj