]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Add ExtractShape() function V6_2_0a2
authorvsr <vsr@opencascade.com>
Thu, 16 Dec 2010 15:56:48 +0000 (15:56 +0000)
committervsr <vsr@opencascade.com>
Thu, 16 Dec 2010 15:56:48 +0000 (15:56 +0000)
src/GEOM_SWIG/geompyDC.py

index 4f0bafa3223c70dc3f551dfac8b336a6999ca569..7fd33ba850f7300e8036cd348eeda4f0c4052e24 100644 (file)
@@ -2237,6 +2237,21 @@ class geompyDC(GEOM._objref_GEOM_Gen):
             anObj = self.GetSubShape(aShape, ListOfIDs)
             return anObj
 
+        ## Extract shapes (main shape or sub-shape) of given type
+        # @param aShape shape
+        # @param aType  shape type
+        def ExtractShapes(self, aShape, aType, sorted = False):
+            ret = []
+            t = aShape.GetShapeType()._v
+            if hasattr(aType, "_v"): aType = aType._v
+            if t == aType:
+                ret.append(aShape )
+            elif sorted:
+                ret = self.SubShapeAllSortedCentres(aShape, aType)
+            else:
+                ret = self.SubShapeAll(aShape, aType)
+            return ret
+        
         # end of l4_decompose_d
         ## @}