]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Avoid solids to be a result of "In/On/Out a solid" filter (issue #2953)
authorazv <azv@opencascade.com>
Wed, 21 Aug 2019 12:22:32 +0000 (15:22 +0300)
committerazv <azv@opencascade.com>
Wed, 21 Aug 2019 12:23:08 +0000 (15:23 +0300)
14 files changed:
src/FiltersPlugin/FiltersPlugin_RelativeToSolid.cpp
src/FiltersPlugin/Test/TestFilter_RelativeToSolid_Exclude_In.py
src/FiltersPlugin/Test/TestFilter_RelativeToSolid_Exclude_InAndOn.py
src/FiltersPlugin/Test/TestFilter_RelativeToSolid_Exclude_NotOn.py
src/FiltersPlugin/Test/TestFilter_RelativeToSolid_Exclude_On.py
src/FiltersPlugin/Test/TestFilter_RelativeToSolid_Exclude_Out.py
src/FiltersPlugin/Test/TestFilter_RelativeToSolid_Exclude_OutAndOn.py
src/FiltersPlugin/Test/TestFilter_RelativeToSolid_In.py
src/FiltersPlugin/Test/TestFilter_RelativeToSolid_InAndOn.py
src/FiltersPlugin/Test/TestFilter_RelativeToSolid_NotOn.py
src/FiltersPlugin/Test/TestFilter_RelativeToSolid_On.py
src/FiltersPlugin/Test/TestFilter_RelativeToSolid_Out.py
src/FiltersPlugin/Test/TestFilter_RelativeToSolid_OutAndOn.py
src/FiltersPlugin/Test/TestFilters_Supported.py

index 3a0a76cd4fada9af9e74acade21d1ede801e6409..e3be677e26311fc6c3d96c2a6bdbeba3728ddb7c 100644 (file)
@@ -29,7 +29,7 @@
 
 bool FiltersPlugin_RelativeToSolid::isSupported(GeomAPI_Shape::ShapeType theType) const
 {
-  return true;
+  return theType >= GeomAPI_Shape::SHELL;
 }
 
 bool FiltersPlugin_RelativeToSolid::isOk(const GeomShapePtr& theShape, const ResultPtr&,
index 34ac97fc24fae4e08fa89400bbc2765450101fd3..6ca93c92a533e12c57229ce9fa44a13ee5cb48c6 100644 (file)
@@ -76,25 +76,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cyli
 Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", exclude = True, args = [model.selection("SOLID", "Extrusion_1_1"), "in"])])
 model.end()
 
-Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
-Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
-Solid3 = Extrusion_2.result().resultSubShapePair()[0]
-Solid4 = Extrusion_3.result().resultSubShapePair()[0]
-Solid5 = Extrusion_4.result().resultSubShapePair()[0]
-Solid6 = Translation_1.result().resultSubShapePair()[0]
-
-from GeomAPI import GeomAPI_Shape
-emptyShape = GeomAPI_Shape()
-
 Reference = {
-    # Solids
-    model.selection(Solid1, emptyShape): True,
-    model.selection(Solid2, emptyShape): True,
-    model.selection(Solid3, emptyShape): True,
-    model.selection(Solid4, emptyShape): True,
-    model.selection(Solid5, emptyShape): False,
-    model.selection(Solid6, emptyShape): True,
-
     # Faces of solid 1
     model.selection("FACE", "Extrusion_1_1/To_Face"): True,
     model.selection("FACE", "Extrusion_1_1/From_Face"): True,
index dd44bef5f07fa94ac2d40a5916823f97cc896de5..b1753228bb09b088847cb6a5e1ce5a1dd825da5a 100644 (file)
@@ -76,25 +76,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cyli
 Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", exclude = True, args = [model.selection("SOLID", "Extrusion_1_1"), "not_out"])])
 model.end()
 
-Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
-Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
-Solid3 = Extrusion_2.result().resultSubShapePair()[0]
-Solid4 = Extrusion_3.result().resultSubShapePair()[0]
-Solid5 = Extrusion_4.result().resultSubShapePair()[0]
-Solid6 = Translation_1.result().resultSubShapePair()[0]
-
-from GeomAPI import GeomAPI_Shape
-emptyShape = GeomAPI_Shape()
-
 Reference = {
-    # Solids
-    model.selection(Solid1, emptyShape): False,
-    model.selection(Solid2, emptyShape): True,
-    model.selection(Solid3, emptyShape): True,
-    model.selection(Solid4, emptyShape): False,
-    model.selection(Solid5, emptyShape): False,
-    model.selection(Solid6, emptyShape): True,
-
     # Faces of solid 1
     model.selection("FACE", "Extrusion_1_1/To_Face"): False,
     model.selection("FACE", "Extrusion_1_1/From_Face"): False,
index 63154f145f003c41f8dd214066a93fef68754f0f..7d66cf27e62d79933239850afc70203873d7847a 100644 (file)
@@ -76,25 +76,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cyli
 Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", exclude = True, args = [model.selection("SOLID", "Extrusion_1_1"), "not_on"])])
 model.end()
 
-Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
-Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
-Solid3 = Extrusion_2.result().resultSubShapePair()[0]
-Solid4 = Extrusion_3.result().resultSubShapePair()[0]
-Solid5 = Extrusion_4.result().resultSubShapePair()[0]
-Solid6 = Translation_1.result().resultSubShapePair()[0]
-
-from GeomAPI import GeomAPI_Shape
-emptyShape = GeomAPI_Shape()
-
 Reference = {
-    # Solids
-    model.selection(Solid1, emptyShape): True,
-    model.selection(Solid2, emptyShape): False,
-    model.selection(Solid3, emptyShape): True,
-    model.selection(Solid4, emptyShape): True,
-    model.selection(Solid5, emptyShape): False,
-    model.selection(Solid6, emptyShape): True,
-
     # Faces of solid 1
     model.selection("FACE", "Extrusion_1_1/To_Face"): True,
     model.selection("FACE", "Extrusion_1_1/From_Face"): True,
index 7dd9283acde299aa070fa4d584c33114f5d86774..841c693cc0567c5713c3b0aa8a8a8f313c97150e 100644 (file)
@@ -76,25 +76,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cyli
 Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", exclude = True, args = [model.selection("SOLID", "Extrusion_1_1"), "on"])])
 model.end()
 
-Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
-Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
-Solid3 = Extrusion_2.result().resultSubShapePair()[0]
-Solid4 = Extrusion_3.result().resultSubShapePair()[0]
-Solid5 = Extrusion_4.result().resultSubShapePair()[0]
-Solid6 = Translation_1.result().resultSubShapePair()[0]
-
-from GeomAPI import GeomAPI_Shape
-emptyShape = GeomAPI_Shape()
-
 Reference = {
-    # Solids
-    model.selection(Solid1, emptyShape): True,
-    model.selection(Solid2, emptyShape): True,
-    model.selection(Solid3, emptyShape): True,
-    model.selection(Solid4, emptyShape): True,
-    model.selection(Solid5, emptyShape): True,
-    model.selection(Solid6, emptyShape): True,
-
     # Faces of solid 1
     model.selection("FACE", "Extrusion_1_1/To_Face"): False,
     model.selection("FACE", "Extrusion_1_1/From_Face"): False,
index 66cc31f064b1452badc4cfccafbf8d2cc8c6f45b..ff2ae3001019d9d641054523ffd05aadce4c2237 100644 (file)
@@ -76,25 +76,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cyli
 Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", exclude = True, args = [model.selection("SOLID", "Extrusion_1_1"), "out"])])
 model.end()
 
-Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
-Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
-Solid3 = Extrusion_2.result().resultSubShapePair()[0]
-Solid4 = Extrusion_3.result().resultSubShapePair()[0]
-Solid5 = Extrusion_4.result().resultSubShapePair()[0]
-Solid6 = Translation_1.result().resultSubShapePair()[0]
-
-from GeomAPI import GeomAPI_Shape
-emptyShape = GeomAPI_Shape()
-
 Reference = {
-    # Solids
-    model.selection(Solid1, emptyShape): True,
-    model.selection(Solid2, emptyShape): False,
-    model.selection(Solid3, emptyShape): True,
-    model.selection(Solid4, emptyShape): True,
-    model.selection(Solid5, emptyShape): True,
-    model.selection(Solid6, emptyShape): True,
-
     # Faces of solid 1
     model.selection("FACE", "Extrusion_1_1/To_Face"): True,
     model.selection("FACE", "Extrusion_1_1/From_Face"): True,
index f63183c47bb809ee5c14b0155544290c3c6b50e5..81d78595a927f76fb46da71ca209d214b62688c9 100644 (file)
@@ -76,25 +76,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cyli
 Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", exclude = True, args = [model.selection("SOLID", "Extrusion_1_1"), "not_in"])])
 model.end()
 
-Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
-Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
-Solid3 = Extrusion_2.result().resultSubShapePair()[0]
-Solid4 = Extrusion_3.result().resultSubShapePair()[0]
-Solid5 = Extrusion_4.result().resultSubShapePair()[0]
-Solid6 = Translation_1.result().resultSubShapePair()[0]
-
-from GeomAPI import GeomAPI_Shape
-emptyShape = GeomAPI_Shape()
-
 Reference = {
-    # Solids
-    model.selection(Solid1, emptyShape): True,
-    model.selection(Solid2, emptyShape): False,
-    model.selection(Solid3, emptyShape): False,
-    model.selection(Solid4, emptyShape): True,
-    model.selection(Solid5, emptyShape): True,
-    model.selection(Solid6, emptyShape): True,
-
     # Faces of solid 1
     model.selection("FACE", "Extrusion_1_1/To_Face"): False,
     model.selection("FACE", "Extrusion_1_1/From_Face"): False,
index 69937f82ca175960a840266dde1b3c07642d73a6..9ff836284322b3bb9d09a5c88d068eb8cc78b0d8 100644 (file)
@@ -76,25 +76,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cyli
 Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", args = [model.selection("SOLID", "Extrusion_1_1"), "in"])])
 model.end()
 
-Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
-Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
-Solid3 = Extrusion_2.result().resultSubShapePair()[0]
-Solid4 = Extrusion_3.result().resultSubShapePair()[0]
-Solid5 = Extrusion_4.result().resultSubShapePair()[0]
-Solid6 = Translation_1.result().resultSubShapePair()[0]
-
-from GeomAPI import GeomAPI_Shape
-emptyShape = GeomAPI_Shape()
-
 Reference = {
-    # Solids
-    model.selection(Solid1, emptyShape): False,
-    model.selection(Solid2, emptyShape): False,
-    model.selection(Solid3, emptyShape): False,
-    model.selection(Solid4, emptyShape): False,
-    model.selection(Solid5, emptyShape): True,
-    model.selection(Solid6, emptyShape): False,
-
     # Faces of solid 1
     model.selection("FACE", "Extrusion_1_1/To_Face"): False,
     model.selection("FACE", "Extrusion_1_1/From_Face"): False,
index c3247dee69d5fbec9b9945501bd70f8e129ae1e2..09fafe4fe29a5ef74c76a319b834e4e8f2d533ba 100644 (file)
@@ -76,25 +76,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cyli
 Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", args = [model.selection("SOLID", "Extrusion_1_1"), "not_out"])])
 model.end()
 
-Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
-Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
-Solid3 = Extrusion_2.result().resultSubShapePair()[0]
-Solid4 = Extrusion_3.result().resultSubShapePair()[0]
-Solid5 = Extrusion_4.result().resultSubShapePair()[0]
-Solid6 = Translation_1.result().resultSubShapePair()[0]
-
-from GeomAPI import GeomAPI_Shape
-emptyShape = GeomAPI_Shape()
-
 Reference = {
-    # Solids
-    model.selection(Solid1, emptyShape): True,
-    model.selection(Solid2, emptyShape): False,
-    model.selection(Solid3, emptyShape): False,
-    model.selection(Solid4, emptyShape): True,
-    model.selection(Solid5, emptyShape): True,
-    model.selection(Solid6, emptyShape): False,
-
     # Faces of solid 1
     model.selection("FACE", "Extrusion_1_1/To_Face"): True,
     model.selection("FACE", "Extrusion_1_1/From_Face"): True,
index 4c82e357b9ddfa2c3fe3a963cb96253cabfc7ce8..276da9622850bce2ce7d8c0af5d3362f09f513e2 100644 (file)
@@ -76,25 +76,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cyli
 Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", args = [model.selection("SOLID", "Extrusion_1_1"), "not_on"])])
 model.end()
 
-Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
-Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
-Solid3 = Extrusion_2.result().resultSubShapePair()[0]
-Solid4 = Extrusion_3.result().resultSubShapePair()[0]
-Solid5 = Extrusion_4.result().resultSubShapePair()[0]
-Solid6 = Translation_1.result().resultSubShapePair()[0]
-
-from GeomAPI import GeomAPI_Shape
-emptyShape = GeomAPI_Shape()
-
 Reference = {
-    # Solids
-    model.selection(Solid1, emptyShape): False,
-    model.selection(Solid2, emptyShape): True,
-    model.selection(Solid3, emptyShape): False,
-    model.selection(Solid4, emptyShape): False,
-    model.selection(Solid5, emptyShape): True,
-    model.selection(Solid6, emptyShape): False,
-
     # Faces of solid 1
     model.selection("FACE", "Extrusion_1_1/To_Face"): False,
     model.selection("FACE", "Extrusion_1_1/From_Face"): False,
index aa57cfe4d3e506afe47a6834ff6de7e33b2d50d2..24cabe3a0d5237e953ea18f4c87c47477fdbffa7 100644 (file)
@@ -76,25 +76,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cyli
 Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", args = [model.selection("SOLID", "Extrusion_1_1"), "on"])])
 model.end()
 
-Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
-Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
-Solid3 = Extrusion_2.result().resultSubShapePair()[0]
-Solid4 = Extrusion_3.result().resultSubShapePair()[0]
-Solid5 = Extrusion_4.result().resultSubShapePair()[0]
-Solid6 = Translation_1.result().resultSubShapePair()[0]
-
-from GeomAPI import GeomAPI_Shape
-emptyShape = GeomAPI_Shape()
-
 Reference = {
-    # Solids
-    model.selection(Solid1, emptyShape): False,
-    model.selection(Solid2, emptyShape): False,
-    model.selection(Solid3, emptyShape): False,
-    model.selection(Solid4, emptyShape): False,
-    model.selection(Solid5, emptyShape): False,
-    model.selection(Solid6, emptyShape): False,
-
     # Faces of solid 1
     model.selection("FACE", "Extrusion_1_1/To_Face"): True,
     model.selection("FACE", "Extrusion_1_1/From_Face"): True,
index eeb33a2bd4ccd0583d318ed0a7ece96bac28ce56..480c4f8b7fd2d73035c1a4308c391265127bf833 100644 (file)
@@ -76,25 +76,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cyli
 Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", args = [model.selection("SOLID", "Extrusion_1_1"), "out"])])
 model.end()
 
-Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
-Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
-Solid3 = Extrusion_2.result().resultSubShapePair()[0]
-Solid4 = Extrusion_3.result().resultSubShapePair()[0]
-Solid5 = Extrusion_4.result().resultSubShapePair()[0]
-Solid6 = Translation_1.result().resultSubShapePair()[0]
-
-from GeomAPI import GeomAPI_Shape
-emptyShape = GeomAPI_Shape()
-
 Reference = {
-    # Solids
-    model.selection(Solid1, emptyShape): False,
-    model.selection(Solid2, emptyShape): True,
-    model.selection(Solid3, emptyShape): False,
-    model.selection(Solid4, emptyShape): False,
-    model.selection(Solid5, emptyShape): False,
-    model.selection(Solid6, emptyShape): False,
-
     # Faces of solid 1
     model.selection("FACE", "Extrusion_1_1/To_Face"): False,
     model.selection("FACE", "Extrusion_1_1/From_Face"): False,
index 6154daae8696631c93c8d55632aae4ae0af18ca7..f12d335d2c768f19ca2c88db888d12c94ed28e34 100644 (file)
@@ -76,25 +76,7 @@ Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cyli
 Filters = model.filters(Part_1_doc, [model.addFilter(name = "RelativeToSolid", args = [model.selection("SOLID", "Extrusion_1_1"), "not_in"])])
 model.end()
 
-Solid1 = Extrusion_1.results()[0].resultSubShapePair()[0]
-Solid2 = Extrusion_1.results()[1].resultSubShapePair()[0]
-Solid3 = Extrusion_2.result().resultSubShapePair()[0]
-Solid4 = Extrusion_3.result().resultSubShapePair()[0]
-Solid5 = Extrusion_4.result().resultSubShapePair()[0]
-Solid6 = Translation_1.result().resultSubShapePair()[0]
-
-from GeomAPI import GeomAPI_Shape
-emptyShape = GeomAPI_Shape()
-
 Reference = {
-    # Solids
-    model.selection(Solid1, emptyShape): False,
-    model.selection(Solid2, emptyShape): True,
-    model.selection(Solid3, emptyShape): True,
-    model.selection(Solid4, emptyShape): False,
-    model.selection(Solid5, emptyShape): False,
-    model.selection(Solid6, emptyShape): False,
-
     # Faces of solid 1
     model.selection("FACE", "Extrusion_1_1/To_Face"): True,
     model.selection("FACE", "Extrusion_1_1/From_Face"): True,
index 418a68707b0e9fda1b150ce661f5853979cbb065..2eb7ffb65ef094f797d37853449f5306abf3a435 100644 (file)
@@ -42,7 +42,7 @@ Reference = {
     GeomAPI_Shape.WIRE   : [FILTER_BELONGS_TO, FILTER_ON_PLANE, FILTER_ON_PLANE_SIDE, FILTER_RELATIVE_TO_SOLID],
     GeomAPI_Shape.FACE   : [FILTER_BELONGS_TO, FILTER_ON_PLANE, FILTER_ON_GEOMETRY, FILTER_ON_PLANE_SIDE, FILTER_RELATIVE_TO_SOLID, FILTER_EXTERNAL_FACES, FILTER_HORIZONTAL_FACES, FILTER_VERTICAL_FACES, FILTER_CONNECTED_FACES],
     GeomAPI_Shape.SHELL  : [FILTER_BELONGS_TO, FILTER_ON_PLANE, FILTER_ON_PLANE_SIDE, FILTER_RELATIVE_TO_SOLID],
-    GeomAPI_Shape.SOLID  : [FILTER_BELONGS_TO, FILTER_ON_PLANE_SIDE, FILTER_RELATIVE_TO_SOLID],
+    GeomAPI_Shape.SOLID  : [FILTER_BELONGS_TO, FILTER_ON_PLANE_SIDE],
 }
 
 model.begin()