]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2975: Do not select groups in all operations except operations on groups
authorvsv <vsv@opencascade.com>
Thu, 22 Aug 2019 07:29:29 +0000 (10:29 +0300)
committervsv <vsv@opencascade.com>
Thu, 22 Aug 2019 07:29:44 +0000 (10:29 +0300)
63 files changed:
src/BuildPlugin/compound_widget.xml
src/BuildPlugin/compsolid_widget.xml
src/BuildPlugin/edge_widget.xml
src/BuildPlugin/face_widget.xml
src/BuildPlugin/filling_widget.xml
src/BuildPlugin/interpolation_widget.xml
src/BuildPlugin/polyline_widget.xml
src/BuildPlugin/shell_widget.xml
src/BuildPlugin/solid_widget.xml
src/BuildPlugin/subshapes_widget.xml
src/BuildPlugin/vertex_widget.xml
src/BuildPlugin/wire_widget.xml
src/CollectionPlugin/CollectionPlugin_Validators.cpp
src/CollectionPlugin/group_addition_widget.xml
src/CollectionPlugin/group_intersection_widget.xml
src/CollectionPlugin/group_substraction_widget.xml
src/CollectionPlugin/group_widget.xml
src/ExchangePlugin/export_widget.xml
src/FeaturesPlugin/boolean_common_widget.xml
src/FeaturesPlugin/boolean_fuse_widget.xml
src/FeaturesPlugin/boolean_smash_widget.xml
src/FeaturesPlugin/boolean_split_widget.xml
src/FeaturesPlugin/boolean_widget.xml
src/FeaturesPlugin/extrusion_widget.xml
src/FeaturesPlugin/extrusioncut_widget.xml
src/FeaturesPlugin/extrusionfuse_widget.xml
src/FeaturesPlugin/fillet_widget.xml
src/FeaturesPlugin/intersection_widget.xml
src/FeaturesPlugin/multirotation_widget.xml
src/FeaturesPlugin/multitranslation_widget.xml
src/FeaturesPlugin/partition_widget.xml
src/FeaturesPlugin/pipe_widget.xml
src/FeaturesPlugin/placement_widget.xml
src/FeaturesPlugin/remove_subshapes_widget.xml
src/FeaturesPlugin/revolution_widget.xml
src/FeaturesPlugin/revolutioncut_widget.xml
src/FeaturesPlugin/revolutionfuse_widget.xml
src/FeaturesPlugin/rotation_widget.xml
src/FeaturesPlugin/scale_widget.xml
src/FeaturesPlugin/symmetry_widget.xml
src/FeaturesPlugin/translation_widget.xml
src/FeaturesPlugin/union_widget.xml
src/FiltersPlugin/filter-BelongsTo.xml
src/FiltersPlugin/filter-OnGeometry.xml
src/FiltersPlugin/filter-OnLine.xml
src/FiltersPlugin/filter-OnPlane.xml
src/ModuleBase/CMakeLists.txt
src/ModuleBase/ModuleBase_IModule.cpp
src/ModuleBase/ModuleBase_IModule.h
src/ModuleBase/ModuleBase_SelectionFilterType.h [new file with mode: 0644]
src/ModuleBase/ModuleBase_ViewerFilters.h
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp
src/ModuleBase/ModuleBase_WidgetMultiSelector.h
src/PartSet/PartSet_Filters.cpp
src/PartSet/PartSet_Filters.h
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_SketcherMgr.h
src/SketchPlugin/plugin-Sketch.xml
src/XGUI/CMakeLists.txt
src/XGUI/XGUI_FacesPanel.cpp
src/XGUI/XGUI_SelectionFilterType.h [deleted file]

index 5984821f952b9620316cd4baba85fe06e5b857dc..0a3f626fca5fbd06e9697095d1974ddc8ea4231f 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="base_objects"
                   label="Objects:"
                   tooltip="Select any kind of objects."
-                  type_choice="vertices edges wires faces shells solids compsolids compounds"
+                  shape_types="vertices edges wires faces shells solids compsolids compounds"
                   concealment="true">
   </multi_selector>
 </source>
index ccad859480a22f36d7ffade180236377b90dd3c6..28fab58baafbf21c9aec41a69aed33f1ed26e5cf 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="base_objects"
                   label="Solids and CompSolids:"
                   tooltip="Select solids or compsolids."
-                  type_choice="faces shells solids compsolids"
+                  shape_types="faces shells solids compsolids"
                   concealment="true">
     <validator id="BuildPlugin_ValidatorBaseForBuild" parameters="face,shell,solid,compsolid"/>
   </multi_selector>
index be088557818ee0d083ec375f0d348ab196f459a9..f7ff1144731a23fb064600ec8dc04b8d9e7a32b3 100644 (file)
@@ -4,7 +4,7 @@
       <multi_selector id="base_objects"
                       label="Edges:"
                       tooltip="Select edges on sketch or edges objects."
-                      type_choice="edges"
+                      shape_types="edges"
                       concealment="true">
         <validator id="BuildPlugin_ValidatorBaseForBuild" parameters="edge"/>
       </multi_selector>
index a23c7cf073d40c56f26904bfde30aa9a89eeba98..e61ce59d10aec18995e763c482cba998b6eb7049 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="base_objects"
                   label="Objects:"
                   tooltip="Select edges, wires or faces."
-                  type_choice="edges wires faces"
+                  shape_types="edges wires faces"
                   concealment="true">
     <validator id="BuildPlugin_ValidatorBaseForBuild" parameters="edge,wire,face"/>
   </multi_selector>
index da22fc0d7e730bcf9a71c57db38d1a0722260b77..5cd076931638b9f73374d7263eabd28c30fe4960 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="base_objects"
                   label="Segments and wires:"
                   tooltip="Select edges or wires."
-                  type_choice="edges wires"
+                  shape_types="edges wires"
                   concealment="false">
     <validator id="PartSet_DifferentObjects"/>
     <validator id="BuildPlugin_ValidatorFillingSelection"/>
index 0922732438ef65d4a8d512541e0b3e125e29b744..5a0acee2fed3d086753912d7314983c60f264d3d 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="base_objects"
                   label="Points and vertices:"
                   tooltip="Select points or vertices objects."
-                  type_choice="vertices"
+                  shape_types="vertices"
                   concealment="true">
     <validator id="GeomValidators_DifferentShapes"/>
   </multi_selector>
index 3760b4ede9ef4553f3ef708d6986f08dd3d807e8..2c283b8b1c309e415d3068b1610001d42f6b5698 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="base_objects"
                   label="Points and vertices:"
                   tooltip="Select points or vertices objects."
-                  type_choice="vertices"
+                  shape_types="vertices"
                   concealment="true">
     <validator id="GeomValidators_DifferentShapes"/>
   </multi_selector>
index 27b8e3971b7d716b5053cca6e5466bc721943d4e..50575ff1e55873270f40079f3eb92f6496f76404 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="base_objects"
                   label="Faces and shells:"
                   tooltip="Select faces or shells objects."
-                  type_choice="faces shells"
+                  shape_types="faces shells"
                   concealment="true">
     <validator id="BuildPlugin_ValidatorBaseForBuild" parameters="face,shell"/>
   </multi_selector>
index 4eb1ce88f4a5baad96eb0b30a9746bc13e94caa5..8c9234f57a7a7228f3341475d00a02be8b9f69c3 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="base_objects"
                   label="Faces and shells:"
                   tooltip="Select faces or shells."
-                  type_choice="faces shells"
+                  shape_types="faces shells"
                   concealment="true">
     <validator id="BuildPlugin_ValidatorBaseForBuild" parameters="face,shell"/>
   </multi_selector>
index 7d74c0c9adb10ab2e7dc112c8b179763f106e6ca..5f42c96a9b818639f5041bfeab89539038a32e73 100644 (file)
@@ -10,7 +10,7 @@
   <multi_selector id="subshapes"
                   label="Sub-Shapes:"
                   tooltip="Select shapes on sketch to add."
-                  type_choice="vertices edges"
+                  shape_types="vertices edges"
                   concealment="true"
                   clear_in_neutral_point="false">
     <validator id="BuildPlugin_ValidatorSubShapesSelection" parameters="Sketch"/>
index 446ed1a454937c22e96ce2c2fcad9f6fcad8ff92..77af0a18f5aeec634dc2270fd1abfd3fdace7e04 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="base_objects"
                   label="Vertices:"
                   tooltip="Select vertices on sketch or vertex objects."
-                  type_choice="vertices"
+                  shape_types="vertices"
                   concealment="true">
   </multi_selector>
 </source>
index 87f03df669d4cec1dff81c0e1ba1ef9fda2f40ad..96067ebe6d9917d26bfda0e59bbfe7d2ddea87bc 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="base_objects"
                   label="Segments and wires:"
                   tooltip="Select edges on sketch, edges or wires objects."
-                  type_choice="edges wires"
+                  shape_types="edges wires"
                   concealment="true">
     <validator id="BuildPlugin_ValidatorBaseForBuild" parameters="edge,wire"/>
   </multi_selector>
index 7ef185389a1e2cb071ed5c88c8f659c62e61f5b7..7620506cf3d0b57e97c7e45efb1bf55d3cf7af50 100644 (file)
@@ -51,7 +51,7 @@ static bool isGroupTypeCorrect(const AttributeSelectionPtr& theSelection,
 {
   // applicable the groups only
   ResultPtr aGroupResult = theSelection->context();
-  if (aGroupResult->groupName() != ModelAPI_ResultGroup::group()) {
+  if (!aGroupResult.get() || aGroupResult->groupName() != ModelAPI_ResultGroup::group()) {
     theError = "Error: Groups can be selected only.";
     return false;
   }
index 04eccb1f1dbf7378efffded1df595feba172b4d1..98f21d97e4c092f32d0039f3b6b28c84ce420253 100644 (file)
@@ -6,7 +6,8 @@
   <multi_selector id="group_list"
                   label="Base groups:"
                   tooltip="Select a set of groups"
-                  type_choice="objects">
+                  shape_types="objects"
+                  allow_objects="Group">
     <validator id="CollectionPlugin_OperationAttribute"/>
   </multi_selector>
 </source>
index 04eccb1f1dbf7378efffded1df595feba172b4d1..35cbf714f22d00691b172d211e3ff187bb304bb6 100644 (file)
@@ -6,7 +6,7 @@
   <multi_selector id="group_list"
                   label="Base groups:"
                   tooltip="Select a set of groups"
-                  type_choice="objects">
+                  shape_types="objects">
     <validator id="CollectionPlugin_OperationAttribute"/>
   </multi_selector>
 </source>
index 21e692192b65b90161388c2bf87662ce6894170f..ebd76f0ebdc57595c0590ad6f73f614165153874 100644 (file)
@@ -6,13 +6,13 @@
   <multi_selector id="group_list"
                   label="Main groups:"
                   tooltip="Select a set of groups"
-                  type_choice="objects">
+                  shape_types="objects">
     <validator id="CollectionPlugin_OperationAttribute" parameters="tools_list"/>
   </multi_selector>
   <multi_selector id="tools_list"
                   label="Tool groups:"
                   tooltip="Select a set of groups"
-                  type_choice="objects">
+                  shape_types="objects">
     <validator id="CollectionPlugin_OperationAttribute" parameters="group_list"/>
   </multi_selector>
 </source>
index 59bd93fb4001e414434bddd767e2434b445473ce..6c304ade6eb852943c7dfe8d0ccbcaf2362ed787 100644 (file)
@@ -5,7 +5,7 @@
   </namevalue>
   <multi_selector id="group_list"
     tooltip="Select a set of objects"
-    type_choice="Vertices Edges Faces Solids"
+    shape_types="Vertices Edges Faces Solids"
     use_choice="true"
     use_filters="FiltersSelection"
     clear_in_neutral_point="false"
index 6c60d9f569c4c4f84ffa3ff3b11584e7e1064528..9e134b805c32601d268fc1ce6e73a25e165e2a50 100644 (file)
@@ -10,7 +10,7 @@
       </export_file_selector>
       <multi_selector id="selection_list"
                       tooltip="Select a set of objects"
-                      type_choice="Vertices Edges Faces Solids Compsolids Objects">
+                      shape_types="Vertices Edges Faces Solids Compsolids Objects">
         <validator id="GeomValidators_Finite"/>
       </multi_selector>
     </case>
index 987dadc3a7b5b85850edfd23d795a17500f9e853..9198588ce6e52e1984601736e259c76d2334942c 100644 (file)
@@ -7,7 +7,7 @@
         label="Objects"
         icon=""
         tooltip="Select objects"
-        type_choice="vertices edges wires faces shells solids compsolids compounds"
+        shape_types="vertices edges wires faces shells solids compsolids compounds"
         use_choice="false"
         concealment="true">
         <validator id="FeaturesPlugin_ValidatorBooleanCommonSelection"/>
@@ -20,7 +20,7 @@
         label="Main objects"
         icon=""
         tooltip="Select objects"
-        type_choice="vertices edges wires faces shells solids compsolids compounds"
+        shape_types="vertices edges wires faces shells solids compsolids compounds"
         use_choice="false"
         concealment="true">
         <validator id="PartSet_DifferentObjects"/>
@@ -30,7 +30,7 @@
         label="Tool objects"
         icon=""
         tooltip="Select tools"
-        type_choice="vertices edges wires faces shells solids compsolids compounds"
+        shape_types="vertices edges wires faces shells solids compsolids compounds"
         use_choice="false"
         concealment="true" >
         <validator id="PartSet_DifferentObjects"/>
index cf622baf62ce668b36b2bed244554ebb8cbda7e2..8617460db436c417b70d714f97e6c2ee231be99a 100644 (file)
@@ -7,7 +7,7 @@
         label="Objects"
         icon=""
         tooltip="Select objects"
-        type_choice="vertices edges wires faces shells solids compsolids compounds"
+        shape_types="vertices edges wires faces shells solids compsolids compounds"
         use_choice="false"
         concealment="true">
         <validator id="FeaturesPlugin_ValidatorBooleanFuseSelection"/>
@@ -20,7 +20,7 @@
         label="Main objects"
         icon=""
         tooltip="Select objects"
-        type_choice="vertices edges wires faces shells solids compsolids compounds"
+        shape_types="vertices edges wires faces shells solids compsolids compounds"
         use_choice="false"
         concealment="true">
         <validator id="PartSet_DifferentObjects"/>
@@ -30,7 +30,7 @@
         label="Tool objects"
         icon=""
         tooltip="Select tools"
-        type_choice="vertices edges wires faces shells solids compsolids compounds"
+        shape_types="vertices edges wires faces shells solids compsolids compounds"
         use_choice="false"
         concealment="true" >
         <validator id="PartSet_DifferentObjects"/>
index 227fd02d87c4c95b1cf0ed6afd7cb34d2ef38ced..07abf751d819cab11ba71ce0276c778be356793e 100644 (file)
@@ -3,7 +3,7 @@
     label="Main objects"
     icon=""
     tooltip="Select objects"
-    type_choice="faces solids compsolids"
+    shape_types="faces solids compsolids"
     use_choice="false"
     concealment="true">
     <validator id="PartSet_DifferentObjects"/>
@@ -13,7 +13,7 @@
     label="Tool objects"
     icon=""
     tooltip="Select tools"
-    type_choice="faces solids compsolids"
+    shape_types="faces solids compsolids"
     use_choice="false"
     concealment="true" >
     <validator id="PartSet_DifferentObjects"/>
index 0b0281098a7c2f4e9999ed5772dad72c3ead9424..2131c8dda7e2e6ed0f978be6b6771082decae8f9 100644 (file)
@@ -3,7 +3,7 @@
     label="Main objects"
     icon=""
     tooltip="Select objects"
-    type_choice="vertices edges wires faces shells solids compsolids compounds"
+    shape_types="vertices edges wires faces shells solids compsolids compounds"
     use_choice="false"
     concealment="true">
     <validator id="PartSet_DifferentObjects"/>
@@ -13,7 +13,7 @@
     label="Tool objects"
     icon=""
     tooltip="Select tools"
-    type_choice="vertices edges wires faces shells solids compsolids compounds"
+    shape_types="vertices edges wires faces shells solids compsolids compounds"
     use_choice="false"
     concealment="true" >
     <validator id="PartSet_DifferentObjects"/>
index 9ea5db5d13a5081b944b3fde8d73f46bbc25b2e8..dca9d22a906ef1ca8133c66aba4441940638d82a 100644 (file)
@@ -3,7 +3,7 @@
     label="Main objects"
     icon=""
     tooltip="Select objects"
-    type_choice="vertices edges wires faces shells solids compsolids compounds"
+    shape_types="vertices edges wires faces shells solids compsolids compounds"
     use_choice="false"
     concealment="true">
     <validator id="PartSet_DifferentObjects"/>
@@ -13,7 +13,7 @@
     label="Tool objects"
     icon=""
     tooltip="Select tools"
-    type_choice="vertices edges wires faces shells solids compsolids compounds"
+    shape_types="vertices edges wires faces shells solids compsolids compounds"
     use_choice="false"
     concealment="true" >
     <validator id="PartSet_DifferentObjects"/>
index 77e543915373c4d303ddaa44148bc339ade4304f..9ea0416c129bde364bfbfe83da2669b62beabb9a 100644 (file)
@@ -11,7 +11,7 @@
   <multi_selector id="base"
                   label="Base objects:"
                   tooltip="Select a base objects"
-                  type_choice="vertices edges wires faces shells compounds"
+                  shape_types="vertices edges wires faces shells compounds"
                   concealment="true">
     <validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell,compound"/>
   </multi_selector>
index e0c30ab3e43dee8fe1d53bbedd02117d05a6d367..96079ccbd281a6b1de39bc7de8417fa733c58224 100644 (file)
@@ -13,7 +13,7 @@
       label="Select a sketch face"
       icon="icons/Features/sketch.png"
       tooltip="Select a sketch face"
-      type_choice="wires faces shells"
+      shape_types="wires faces shells"
       concealment="true">
       <validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="face,shell"/>
     </multi_selector>
@@ -89,7 +89,7 @@
     label="Cut from:"
     icon="icons/Features/cut_shape.png"
     tooltip="Objects to Cut"
-    type_choice="Objects"
+    shape_types="Objects"
     use_choice="false"
     concealment="true"
     main_argument="true">
index 932f7d8a1a3077d20947ea2dac580f9997acfb00..80082d14ec637dc2c0b1ccebc6d0c205ef33dea1 100644 (file)
@@ -13,7 +13,7 @@
       label="Select a sketch face"
       icon="icons/Features/sketch.png"
       tooltip="Select a sketch face"
-      type_choice="vertices edges wires faces shells compounds"
+      shape_types="vertices edges wires faces shells compounds"
       concealment="true">
       <validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell,compound"/>
     </multi_selector>
@@ -89,7 +89,7 @@
     label="Fuse with:"
     icon="icons/Features/cut_shape.png"
     tooltip="Objects to Fuse"
-    type_choice="Objects"
+    shape_types="Objects"
     use_choice="false"
     concealment="true"
     main_argument="true">
index 898173efb0e273c43c1de1c60c895b8ca5d4c6e0..7abb4a5dfab0e5ebe2363695ad3f13707ddc9c36 100644 (file)
@@ -8,7 +8,7 @@
                       label="Faces or/and edges"
                       icon=""
                       tooltip="Select objects"
-                      type_choice="edges faces"
+                      shape_types="edges faces"
                       use_choice="false"
                       concealment="true">
         <validator id="PartSet_DifferentObjects"/>
@@ -30,7 +30,7 @@
                       label="Faces or/and edges"
                       icon=""
                       tooltip="Select objects"
-                      type_choice="edges faces"
+                      shape_types="edges faces"
                       use_choice="false"
                       concealment="true">
         <validator id="PartSet_DifferentObjects"/>
index 167080c6efe9d481d23a18e8b095054e1402e24d..5f09fb238a73758d5fa9c8f5981f0038351fd435 100644 (file)
@@ -3,7 +3,7 @@
     label="Objects"
     icon="icons/Features/cut_shape.png"
     tooltip="Select objects(compounds, compsolids, solids, shells, faces or edges)"
-    type_choice="edges faces shells solids compsolids compounds"
+    shape_types="edges faces shells solids compsolids compounds"
     use_choice="false"
     concealment="true">
     <validator id="PartSet_DifferentObjects"/>
index a14b35035d8a4ae6c74e5b159c772c4fa67ff43d..8fce3fb33eb620316064e33386edb7c1594f38ae 100644 (file)
@@ -3,7 +3,7 @@
                   label="Main objects"
                   icon=""
                   tooltip="Select objects"
-                  type_choice="objects"
+                  shape_types="objects"
                   concealment="true">
     <validator id="FeaturesPlugin_ValidatorTransform"/>
   </multi_selector>
index b7cf37cb0059e40a91d4aed1d07e1951d53f41ed..6589394089fef32c524943d7216587e19d30df5a 100644 (file)
@@ -3,7 +3,7 @@
                   label="Main objects"
                   icon=""
                   tooltip="Select objects"
-                  type_choice="objects"
+                  shape_types="objects"
                   concealment="true">
     <validator id="FeaturesPlugin_ValidatorTransform"/>
   </multi_selector>
index a0d358bd187b2eb09b24f62baaabdfe9dd048fa0..ad5e97ef545f4fdd06c5ec8c5a428ca1f2992a03 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="base_objects"
     label="Base objects:"
     tooltip="Select objects for partitioning."
-    type_choice="objects"
+    shape_types="objects"
     concealment="true"
     clear_in_neutral_point="false">
     <validator id="FeaturesPlugin_ValidatorPartitionSelection" parameters="Plane"/>
index 11a967d03fc33b59e4ae85c5dd602cc3e704e15b..6211dbc25a09b5c6472494c8c89f30dfa49f49cb 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="base_objects"
                   label="Base objects:"
                   tooltip="Select a base objects"
-                  type_choice="vertices edges wires faces shells compsolids"
+                  shape_types="vertices edges wires faces shells compsolids"
                   use_choice="false"
                   concealment="true">
     <validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell,compound"/>
@@ -27,7 +27,7 @@
       <multi_selector id="locations_objects"
                       label="Locations:"
                       tooltip="Select one or more vertices to specify the locations"
-                      type_choice="vertex">
+                      shape_types="vertex">
         <validator id="FeaturesPlugin_ValidatorPipeLocations"/>
       </multi_selector>
     </box>
index b62c06dba3bc48c0098fd721aab5f937e96b3403..5f277ff3691c04e68b773b660bf99245b89fc960 100644 (file)
@@ -3,7 +3,7 @@
     label="Select objects to move"
     icon="icons/Features/cut_shape.png"
     tooltip="Select objects"
-    type_choice="objects"
+    shape_types="objects"
     concealment="true" >
     <validator id="FeaturesPlugin_ValidatorTransform"/>
   </multi_selector>
index c880f816d233c32e553460f0d863a26e4ac723dd..28a13de3bc9ce04121622209ed2f7c683b7abac4 100644 (file)
@@ -15,7 +15,7 @@
       <multi_selector id="subshapes_to_remove"
                 label="Sub-Shapes to remove:"
                 tooltip="Select shapes to remove."
-                type_choice="vertices edges wires faces shells solids compsolids compounds"
+                shape_types="vertices edges wires faces shells solids compsolids compounds"
                 clear_in_neutral_point="false">
         <validator id="FeaturesPlugin_ValidatorRemoveSubShapesSelection"/>
       </multi_selector>
@@ -26,7 +26,7 @@
       <multi_selector id="subshapes_to_keep"
                 label="Sub-Shapes to keep:"
                 tooltip="Select shapes to keep."
-                type_choice="vertices edges wires faces shells solids compsolids compounds"
+                shape_types="vertices edges wires faces shells solids compsolids compounds"
                 clear_in_neutral_point="false">
         <validator id="FeaturesPlugin_ValidatorRemoveSubShapesSelection"/>
       </multi_selector>
index e5a28b89f50745a5f8d0da40d9c0d8ee45be6e4c..3a641befbb6c73cf46031437a8dcd25caf138169 100644 (file)
@@ -11,7 +11,7 @@
   <multi_selector id="base"
                   label="Base objects:"
                   tooltip="Select a base objects"
-                  type_choice="vertices edges wires faces shells compounds"
+                  shape_types="vertices edges wires faces shells compounds"
                   concealment="true">
     <validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell,compound"/>
   </multi_selector>
index fc2b822436ece70a48478d90f01e68bd68659a89..217f4fb60896860f2a7ee5aab24059ec9143e19b 100644 (file)
@@ -13,7 +13,7 @@
       label="Select a sketch face"
       icon="icons/Features/sketch.png"
       tooltip="Select a sketch face"
-      type_choice="wires faces shells"
+      shape_types="wires faces shells"
       concealment="true">
       <validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="face,shell"/>
     </multi_selector>
@@ -89,7 +89,7 @@
     label="Cut from:"
     icon="icons/Features/cut_shape.png"
     tooltip="Objects to Cut"
-    type_choice="Objects"
+    shape_types="Objects"
     use_choice="false"
     concealment="true"
     main_argument="true">
index 575c6c4bf37718d97e5db09cd64328184b3505d8..26c0de8ffec76c7048b3c67048efb259a20b2c8d 100644 (file)
@@ -13,7 +13,7 @@
       label="Select a sketch face"
       icon="icons/Features/sketch.png"
       tooltip="Select a sketch face"
-      type_choice="vertices edges wires faces shells compounds"
+      shape_types="vertices edges wires faces shells compounds"
       concealment="true">
       <validator id="FeaturesPlugin_ValidatorBaseForGeneration" parameters="vertex,edge,wire,face,shell,compound"/>
     </multi_selector>
@@ -89,7 +89,7 @@
     label="Fuse with:"
     icon="icons/Features/cut_shape.png"
     tooltip="Objects to Fuse"
-    type_choice="Objects"
+    shape_types="Objects"
     use_choice="false"
     concealment="true"
     main_argument="true">
index def2c3fa9dc57b9eeb882020214a6aad00d49ed1..52b945ebb100126beb0aeb681ae6504ab0188239 100644 (file)
@@ -7,7 +7,7 @@
                       label="Main objects"
                       icon=""
                       tooltip="Select solid objects"
-                      type_choice="objects"
+                      shape_types="objects"
                       concealment="true">
         <validator id="FeaturesPlugin_ValidatorTransform"/>
       </multi_selector>
@@ -35,7 +35,7 @@
                       label="Main objects"
                       icon=""
                       tooltip="Select solid objects"
-                      type_choice="objects"
+                      shape_types="objects"
                       concealment="true">
         <validator id="FeaturesPlugin_ValidatorTransform"/>
       </multi_selector>
index 6dc4303c15b479f99015454eda0010ec39603c8d..c9ade559a0273913c4f34e9dd0fb10f303fea602 100644 (file)
@@ -7,7 +7,7 @@
                       label="Main objects"
                       icon=""
                       tooltip="Select objects"
-                      type_choice="objects"
+                      shape_types="objects"
                       concealment="true">
         <validator id="FeaturesPlugin_ValidatorTransform"/>
       </multi_selector>
@@ -35,7 +35,7 @@
                       label="Main objects"
                       icon=""
                       tooltip="Select objects"
-                      type_choice="objects"
+                      shape_types="objects"
                       concealment="true">
         <validator id="FeaturesPlugin_ValidatorTransform"/>
       </multi_selector>
index bda3367eaf34269f9c92bed42afd06d365afbe8c..91133e99c5c5a000e087b9eff6e259a1dfc0202b 100644 (file)
@@ -5,7 +5,7 @@
                       label="Main objects"
                       icon="icons/Features/cut_shape.png"
                       tooltip="Select solid objects"
-                      type_choice="solid objects"
+                      shape_types="solid objects"
                       concealment="true">
         <validator id="FeaturesPlugin_ValidatorTransform"/>
       </multi_selector>
@@ -23,7 +23,7 @@
                       label="Main objects"
                       icon="icons/Features/cut_shape.png"
                       tooltip="Select solid objects"
-                      type_choice="solid objects"
+                      shape_types="solid objects"
                       concealment="true">
         <validator id="FeaturesPlugin_ValidatorTransform"/>
       </multi_selector>
@@ -42,7 +42,7 @@
                       label="Main objects"
                       icon="icons/Features/cut_shape.png"
                       tooltip="Select solid objects"
-                      type_choice="solid objects"
+                      shape_types="solid objects"
                       concealment="true">
         <validator id="FeaturesPlugin_ValidatorTransform"/>
       </multi_selector>
index ca02649513c9debeafe44ae95b7921ff7ce22edb..eb4d5636a14bdb08fae75d314b0b4c41e84c9046 100644 (file)
@@ -7,7 +7,7 @@
                       label="Main objects"
                       icon=""
                       tooltip="Select solid objects"
-                      type_choice="objects"
+                      shape_types="objects"
                       concealment="true">
         <validator id="FeaturesPlugin_ValidatorTransform"/>
       </multi_selector>
@@ -35,7 +35,7 @@
                       label="Main objects"
                       icon=""
                       tooltip="Select solid objects"
-                      type_choice="objects"
+                      shape_types="objects"
                       concealment="true">
         <validator id="FeaturesPlugin_ValidatorTransform"/>
       </multi_selector>
@@ -68,7 +68,7 @@
                       label="Main objects"
                       icon=""
                       tooltip="Select solid objects"
-                      type_choice="objects"
+                      shape_types="objects"
                       concealment="true">
         <validator id="FeaturesPlugin_ValidatorTransform"/>
       </multi_selector>
index 966068352604118bbc8cab10fe4edf772a2bcb86..6bbc3239554fb3474ea8809f4a886c5ed2e23858 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="base_objects"
     label="Base objects:"
     tooltip="Select solids for union."
-    type_choice="faces solids compsolids"
+    shape_types="faces solids compsolids"
     use_choice="false"
     concealment="true">
     <validator id="FeaturesPlugin_ValidatorUnionSelection"/>
index 217645b3a3ca71659dce9ba983142548d633e7ec..7500646c043affc0d520360217837cc8bab22e2d 100644 (file)
@@ -2,6 +2,6 @@
   <multi_selector id="BelongsTo__BelongsTo"
                   label="Objects:"
                   tooltip="Select objects to limit selection."
-                  type_choice="objects">
+                  shape_types="objects">
   </multi_selector>
 </filter>
index 80053d57ecaf236b4fe714ddefb7b62643b5b26e..6af2e9d5ea955a273795cf4ff0c4714a55586bf2 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="OnGeometry__OnGeometry"
                   label="Shapes:"
                   tooltip="Select objects to limit selection."
-                  type_choice="edges faces">
+                  shape_types="edges faces">
     <validator id="FiltersPlugin_ShapeType"/>
   </multi_selector>
 </filter>
index 8f8f5270270e2afb7976c5d30d659858ac188849..0a7eeccfc239f0db0069990540b12fd2ef33e1e4 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="OnLine__OnLine"
                   label="Lines:"
                   tooltip="Select vertices or segments."
-                  type_choice="edges">
+                  shape_types="edges">
     <validator id="GeomValidators_ShapeType" parameters="line"/>
   </multi_selector>
 </filter>
index fa65cc0a446a071bc344f557a1a3638b0356fb2e..dceb874e71e42daa117d048e6f535ecc583d7f8c 100644 (file)
@@ -2,7 +2,7 @@
   <multi_selector id="OnPlane__OnPlane"
                   label="Planes:"
                   tooltip="Select planes or planar faces."
-                  type_choice="faces">
+                  shape_types="faces">
     <validator id="GeomValidators_ShapeType" parameters="plane"/>
   </multi_selector>
 </filter>
index f8a1ff2c4d66fb68cb814c3c6e1a9296db2ba35a..a7ce541f2aa7a71e7bce714288104a660dbedfc3 100644 (file)
@@ -105,6 +105,7 @@ SET(PROJECT_HEADERS
   ModuleBase_ITreeNode.h
   ModuleBase_WidgetSelectionFilter.h
   ModuleBase_IStepPrs.h
+  ModuleBase_SelectionFilterType.h
 )
 
 SET(PROJECT_MOC_HEADERS
index 05d1f93ef2dbbcb1c0632000046c682d318135a0..03abb8233950ce89c26d887b94dd8c5206dc5b36 100644 (file)
@@ -71,6 +71,18 @@ ModuleBase_IModule::ModuleBase_IModule(ModuleBase_IWorkshop* theParent)
   //        SLOT(onMouseDoubleClick(QMouseEvent*)));
 }
 
+ModuleBase_IModule::~ModuleBase_IModule()
+{
+  std::map<ModuleBase_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
+    mySelectionFilters.begin();
+  for (; aFiltersIt != mySelectionFilters.end(); aFiltersIt++) {
+    Handle(SelectMgr_Filter) aFilter = aFiltersIt->second;
+    if (!aFilter.IsNull())
+      aFilter.Nullify();
+  }
+}
+
+
 void ModuleBase_IModule::launchModal(const QString& theCmdId)
 {
   bool isCommitted;
@@ -323,3 +335,35 @@ void ModuleBase_IModule::getXMLRepresentation(const std::string& theFeatureId,
   theXmlCfg = aWdgReader.featureWidgetCfg(theFeatureId);
   theDescription = aWdgReader.featureDescription(theFeatureId);
 }
+
+
+//******************************************************
+QIntList ModuleBase_IModule::selectionFilters()
+{
+  QIntList aTypes;
+
+  std::map<ModuleBase_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
+    mySelectionFilters.begin();
+  for (; aFiltersIt != mySelectionFilters.end(); aFiltersIt++)
+    aTypes.append(aFiltersIt->first);
+
+  return aTypes;
+}
+
+//******************************************************
+void ModuleBase_IModule::registerSelectionFilter(const ModuleBase_SelectionFilterType theFilterType,
+  const Handle(SelectMgr_Filter)& theFilter)
+{
+  mySelectionFilters[theFilterType] = theFilter;
+}
+
+//******************************************************
+Handle(SelectMgr_Filter) ModuleBase_IModule::selectionFilter(const int theType)
+{
+  ModuleBase_SelectionFilterType aType = (ModuleBase_SelectionFilterType)theType;
+
+  if (mySelectionFilters.find(aType) != mySelectionFilters.end())
+    return mySelectionFilters[aType];
+  else
+    return Handle(SelectMgr_Filter)();
+}
index 529c1f1531e94a02876c2d182f049c769fa4bf15..b748d6a148c2721b89fd659551cc38cf50f11c82 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "ModuleBase.h"
 #include "ModuleBase_IWorkshop.h"
+#include <ModuleBase_SelectionFilterType.h>
 
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Attribute.h>
@@ -76,7 +77,7 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
    /// \param theParent instance of workshop interface
    ModuleBase_IModule(ModuleBase_IWorkshop* theParent);
 
-  virtual ~ModuleBase_IModule() {}
+   virtual ~ModuleBase_IModule();
 
   /// Stores the current selection
   virtual void storeSelection() {}
@@ -242,12 +243,18 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
 
   /// Returns types of registered module selection filters
   /// \param theSelectionFilters [out] container of type value
-  virtual QIntList selectionFilters() { return QIntList(); }
+  virtual QIntList selectionFilters();
 
   /// Returns selection filter
   /// \param theType selection filter type
   /// \param theFilter instance of filter
-  virtual Handle(SelectMgr_Filter) selectionFilter(const int theType) = 0;
+  virtual Handle(SelectMgr_Filter) selectionFilter(const int theType);
+
+  /// Append selection filter into the module and type of the filter in internal container
+  /// \param theFilterType selection filter type
+  /// \param theFilter added filter
+  void registerSelectionFilter(const ModuleBase_SelectionFilterType theFilterType,
+    const Handle(SelectMgr_Filter)& theFilter);
 
   /// Return true if the custom presentation is activated
   /// \param theFlag a flag of level of customization, which means that only part of sub-elements
@@ -424,6 +431,9 @@ protected:
 
   /// Map of features in XML
   std::map<std::string, std::string> myFeaturesInFiles;
+
+  std::map<ModuleBase_SelectionFilterType, Handle(SelectMgr_Filter)> mySelectionFilters;
+
 };
 
 
diff --git a/src/ModuleBase/ModuleBase_SelectionFilterType.h b/src/ModuleBase/ModuleBase_SelectionFilterType.h
new file mode 100644 (file)
index 0000000..8b494f6
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef ModuleBase_SelectionFilterType_H
+#define ModuleBase_SelectionFilterType_H
+
+#include "ModuleBase.h"
+
+/// Enumeration to specify module selection filters
+enum MODULEBASE_EXPORT ModuleBase_SelectionFilterType {
+  SF_GlobalFilter, /// filter for different documents, group results
+  SF_FilterInfinite, /// filter for infinite construction results
+  SF_ResultGroupNameFilter, /// filter for selection some kind of results
+  SF_SketchCirclePointFilter, /// filter for selection circle points on current sketch
+  SF_SketchPlaneFilter /// filter for selection in the current sketch plane only
+};
+
+#endif
index 7481d9f5d0a29f4ec0641d359431fd32404fb70b..1eb0232228c4e4b7eda7911f3718876da9981545 100644 (file)
@@ -53,11 +53,35 @@ public:
   Standard_EXPORT virtual
     Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
 
+  /// Add an object type name to list of non selectable objects
+  /// \param theType - a name of an object type
+  Standard_EXPORT void addNonSelectableType(const QString& theType)
+  {
+    if (!myNonSelectableTypes.contains(theType))
+      myNonSelectableTypes.append(theType);
+  }
+
+  /// Removes an object type name from list of non selectable objects
+  /// \param theType - a name of an object type
+  Standard_EXPORT void removeNonSelectableType(const QString& theType)
+  {
+    if (myNonSelectableTypes.contains(theType))
+      myNonSelectableTypes.removeAll(theType);
+  }
+
+  /// Returns list of non-selectable an object type names
+  Standard_EXPORT QStringList nonSelectableTypes() const
+  {
+    return myNonSelectableTypes;
+  }
+
   DEFINE_STANDARD_RTTIEXT(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter)
 
 protected:
   /// Reference to workshop
   ModuleBase_IWorkshop* myWorkshop;
+
+  QStringList myNonSelectableTypes;
 };
 
 /**
index 349b61502e0921878fd37ddd801bddfe93520e27..511c9313fc721dbe75f724ed013f126ffe843199 100644 (file)
@@ -116,11 +116,15 @@ ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParen
   myIsSetSelectionBlocked(false), myCurrentHistoryIndex(-1),
   myIsFirst(true), myFiltersWgt(0)
 {
-  std::string aPropertyTypes = theData->getProperty("type_choice");
+  std::string aPropertyTypes = theData->getProperty("shape_types");
   QString aTypesStr = aPropertyTypes.c_str();
   myShapeTypes = aTypesStr.split(' ', QString::SkipEmptyParts);
   myIsUseChoice = theData->getBooleanAttribute("use_choice", false);
 
+  QString aAllowedList(theData->getProperty("allow_objects").c_str());
+  if (!aAllowedList.isEmpty())
+    myAllowedObjects = aAllowedList.split(' ', QString::SkipEmptyParts);
+
   QVBoxLayout* aMainLay = new QVBoxLayout(this);
   ModuleBase_Tools::adjustMargins(aMainLay);
 
@@ -215,9 +219,26 @@ void ModuleBase_WidgetMultiSelector::activateCustom()
 {
   ModuleBase_WidgetSelector::activateCustom();
 
-  myWorkshop->module()->activateCustomPrs(myFeature,
+  ModuleBase_IModule* aModule = myWorkshop->module();
+  aModule->activateCustomPrs(myFeature,
                             ModuleBase_IModule::CustomizeHighlightedObjects, true);
   clearSelectedHistory();
+  if (myAllowedObjects.length() > 0) {
+    Handle(SelectMgr_Filter) aFilter = aModule->selectionFilter(SF_GlobalFilter);
+    if (!aFilter.IsNull()) {
+      Handle(ModuleBase_ShapeDocumentFilter) aDocFilter =
+        Handle(ModuleBase_ShapeDocumentFilter)::DownCast(aFilter);
+      if (!aDocFilter.IsNull()) {
+        QStringList aSelFilters = aDocFilter->nonSelectableTypes();
+        foreach(QString aType, aSelFilters) {
+          if (aSelFilters.contains(aType)) {
+            aDocFilter->removeNonSelectableType(aType);
+            myTmpAllowed.append(aType);
+          }
+        }
+      }
+    }
+  }
 }
 
 //********************************************************************
@@ -231,6 +252,20 @@ void ModuleBase_WidgetMultiSelector::deactivate()
 
   myWorkshop->module()->deactivateCustomPrs(ModuleBase_IModule::CustomizeHighlightedObjects, true);
   clearSelectedHistory();
+  if (myTmpAllowed.length() > 0) {
+    ModuleBase_IModule* aModule = myWorkshop->module();
+    Handle(SelectMgr_Filter) aFilter = aModule->selectionFilter(SF_GlobalFilter);
+    if (!aFilter.IsNull()) {
+      Handle(ModuleBase_ShapeDocumentFilter) aDocFilter =
+        Handle(ModuleBase_ShapeDocumentFilter)::DownCast(aFilter);
+      if (!aDocFilter.IsNull()) {
+        foreach(QString aType, myTmpAllowed) {
+          aDocFilter->addNonSelectableType(aType);
+        }
+      }
+    }
+    myTmpAllowed.clear();
+  }
 }
 
 //********************************************************************
index 1dec34d90856dd41359d592c55bb0f7201b350cf..f34e18ef568e40ffacf0ad776ebf6a952e3d7111 100644 (file)
@@ -50,12 +50,12 @@ class ModuleBase_FilterStarter;
 * \code
 * <multi_selector id="group_list" 
 *    tooltip="Select a set of objects" 
-*    type_choice="Vertices Edges Faces Solids" /> 
+*    shape_types="Vertices Edges Faces Solids" />
 * \endcode
 * It uses following parameters:
 * - id - is a name of corresponded attribute
 * - tooltip - a tooltip for the widget
-* - type_choice - list of expected shape types.
+* - shape_types - list of expected shape types.
 */
 class MODULEBASE_EXPORT ModuleBase_WidgetMultiSelector : public ModuleBase_WidgetSelector
 {
@@ -257,6 +257,8 @@ protected:
   ModuleBase_FilterStarter* myFiltersWgt;
 
   QObjectPtrList myVisibleObjects;
+  QStringList myAllowedObjects;
+  QStringList myTmpAllowed;
 };
 
 #endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */
index 582161acee01d363bff427842edf2005bd48d2e5..88ba16c9ad36518e8722fbb5326eea378693d354 100644 (file)
 
 IMPLEMENT_STANDARD_RTTIEXT(PartSet_GlobalFilter, ModuleBase_ShapeDocumentFilter);
 
+PartSet_GlobalFilter::PartSet_GlobalFilter(ModuleBase_IWorkshop* theWorkshop)
+  : ModuleBase_ShapeDocumentFilter(theWorkshop)
+{
+  addNonSelectableType(ModelAPI_ResultField::group().c_str());
+  addNonSelectableType(ModelAPI_ResultGroup::group().c_str());
+}
+
+
 Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const
 {
   bool aValid = true;
@@ -63,7 +71,7 @@ Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)&
           if (aResultGroupName == ModelAPI_ResultPart::group()) {
             SessionPtr aMgr = ModelAPI_Session::get();
             aValid = aMgr->activeDocument() == aMgr->moduleDocument();
-          } else if (aResultGroupName == ModelAPI_ResultField::group()) {
+          } else if (myNonSelectableTypes.contains(aResultGroupName.c_str())) {
             aValid = Standard_False;
           } else
             aValid = Standard_True;
@@ -72,7 +80,7 @@ Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)&
           // only and there can not be Group feature
           FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
           if (aFeature) {
-            aValid = aFeature->getKind() != "Group";
+            aValid = !myNonSelectableTypes.contains(aFeature->getKind().c_str());
           } else
             aValid = Standard_True;
         }
index 55cde03bbdb4e31d62e86dc54db11125d63bbf7c..f4ea76ddf5acb5131bf739b7f2f7f244ff111809 100644 (file)
@@ -36,8 +36,7 @@ class PartSet_GlobalFilter: public ModuleBase_ShapeDocumentFilter
 public:
   /// Constructor
   /// \param theWorkshop a pointer to workshop
-  PartSet_GlobalFilter(ModuleBase_IWorkshop* theWorkshop)
-    : ModuleBase_ShapeDocumentFilter(theWorkshop) {}
+  PartSet_GlobalFilter(ModuleBase_IWorkshop* theWorkshop);
 
   /// Returns True if selected presentation can be selected
   /// \param theOwner an owner of the persentation
index e9dbb6a38ace075ebd901aeec175cc17aa78e3f9..7859a701c54d767aa784f40617a6538a50141bf4 100644 (file)
@@ -233,13 +233,6 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
 //******************************************************
 PartSet_Module::~PartSet_Module()
 {
-  std::map<XGUI_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
-    mySelectionFilters.begin();
-  for (; aFiltersIt != mySelectionFilters.end(); aFiltersIt++) {
-    Handle(SelectMgr_Filter) aFilter = aFiltersIt->second;
-    if (!aFilter.IsNull())
-      aFilter.Nullify();
-  }
   delete myCustomPrs;
   delete myOverconstraintListener;
   delete myRoot;
@@ -659,7 +652,7 @@ void PartSet_Module::moduleSelectionFilters(const QIntList& theFilterTypes,
 {
   bool isSketchActive = mySketchMgr->activeSketch().get();
 
-  std::map<XGUI_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
+  std::map<ModuleBase_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
     mySelectionFilters.begin();
   for (; aFiltersIt != mySelectionFilters.end(); aFiltersIt++) {
     int aFilterType = aFiltersIt->first;
@@ -669,7 +662,7 @@ void PartSet_Module::moduleSelectionFilters(const QIntList& theFilterTypes,
 
     // using sketch filters only if sketch operation is active
     if (!isSketchActive &&
-        mySketchMgr->sketchSelectionFilter((XGUI_SelectionFilterType)aFilterType))
+        mySketchMgr->sketchSelectionFilter((ModuleBase_SelectionFilterType)aFilterType))
       continue;
 
     // using filtering of construction results only from faces panel
@@ -680,37 +673,6 @@ void PartSet_Module::moduleSelectionFilters(const QIntList& theFilterTypes,
   }
 }
 
-//******************************************************
-QIntList PartSet_Module::selectionFilters()
-{
-  QIntList aTypes;
-
-  std::map<XGUI_SelectionFilterType, Handle(SelectMgr_Filter)>::const_iterator aFiltersIt =
-    mySelectionFilters.begin();
-  for (; aFiltersIt != mySelectionFilters.end(); aFiltersIt++)
-    aTypes.append(aFiltersIt->first);
-
-  return aTypes;
-}
-
-//******************************************************
-void PartSet_Module::registerSelectionFilter(const XGUI_SelectionFilterType theFilterType,
-                                             const Handle(SelectMgr_Filter)& theFilter)
-{
-  mySelectionFilters[theFilterType] = theFilter;
-}
-
-//******************************************************
-Handle(SelectMgr_Filter) PartSet_Module::selectionFilter(const int theType)
-{
-  XGUI_SelectionFilterType aType = (XGUI_SelectionFilterType)theType;
-
-  if (mySelectionFilters.find(aType) != mySelectionFilters.end())
-    return mySelectionFilters[aType];
-  else
-    return Handle(SelectMgr_Filter)();
-}
-
 //******************************************************
 void PartSet_Module::customSubShapesSelectionModes(QIntList& theModes)
 {
index 66264e3ec54691a8e0c44e4c9a098f164e95a1eb..bcd16ee1771476c5a5cfd3854f611d087bcfb479 100644 (file)
@@ -23,7 +23,6 @@
 #include "PartSet.h"
 #include "PartSet_Tools.h"
 #include "PartSet_OverconstraintListener.h"
-#include "XGUI_SelectionFilterType.h"
 #include "PartSet_SketcherMgr.h"
 
 #include <ModuleBase_IModule.h>
@@ -230,20 +229,6 @@ public:
   virtual void moduleSelectionFilters(const QIntList& theFilterTypes,
                                       SelectMgr_ListOfFilter& theSelectionFilters);
 
-  /// Returns types of registered module selection filters
-  /// \param theSelectionFilters [out] container of type value
-  virtual QIntList selectionFilters();
-
-  /// Append selection filter into the module and type of the filter in internal container
-  /// \param theFilterType selection filter type
-  /// \param theFilter added filter
-  void registerSelectionFilter(const XGUI_SelectionFilterType theFilterType,
-                               const Handle(SelectMgr_Filter)& theFilter);
-
-  /// Returns selection filter
-  /// \param theType selection filter type
-  /// \param theFilter instance of filter
-  virtual Handle(SelectMgr_Filter) selectionFilter(const int theType);
 
   /// Returns whether the mouse enter the viewer's window
   /// \return true if items are added and there is no necessity to provide standard menu
@@ -485,7 +470,6 @@ protected:
 
 private:
   bool myIsOperationIsLaunched; /// state of application between launch and stop operation
-  std::map<XGUI_SelectionFilterType, Handle(SelectMgr_Filter)> mySelectionFilters;
 
   PartSet_SketcherMgr* mySketchMgr;
   PartSet_SketcherReentrantMgr* mySketchReentrantMgr;
index 004bdaf88e0e8e3261ee559589867fcbafd65589..b4c6203c5eb2a5c598c22eb41aedfa88fbd84dfe 100644 (file)
@@ -1198,12 +1198,12 @@ void PartSet_SketcherMgr::commitNestedSketch(ModuleBase_Operation* theOperation)
   }
 }
 
-bool PartSet_SketcherMgr::sketchSelectionFilter(const XGUI_SelectionFilterType theFilterType)
+bool PartSet_SketcherMgr::sketchSelectionFilter(const ModuleBase_SelectionFilterType theFilterType)
 {
   return mySelectionFilterTypes.find(theFilterType) != mySelectionFilterTypes.end();
 }
 
-void PartSet_SketcherMgr::registerSelectionFilter(const XGUI_SelectionFilterType theFilterType,
+void PartSet_SketcherMgr::registerSelectionFilter(const ModuleBase_SelectionFilterType theFilterType,
                                                   const Handle(SelectMgr_Filter)& theFilter)
 {
   mySelectionFilterTypes.insert(theFilterType);
index 07c3160e6b226cdee4c875af93cdc460881f359c..c036615b5ee29855a4495cceedd625903b47b521 100644 (file)
 #include "PartSet.h"
 
 #include "PartSet_PreviewSketchPlane.h"
-#include "XGUI_SelectionFilterType.h"
 #include "PartSet_Tools.h"
 
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Attribute.h>
 #include <ModelAPI_CompositeFeature.h>
 #include <ModelAPI_Result.h>
+#include <ModuleBase_SelectionFilterType.h>
 
 #include <ModuleBase_Definitions.h>
 #include <ModuleBase_ModelWidget.h>
@@ -201,12 +201,12 @@ public:
   /// Returns true if the filter is created by the sketch manager
   /// \param theFilterType a checked type
   /// \return boolean value
-  bool sketchSelectionFilter(const XGUI_SelectionFilterType theFilterType);
+  bool sketchSelectionFilter(const ModuleBase_SelectionFilterType theFilterType);
 
   /// Append selection filter into the module and type of the filter in internal container
   /// \param theFilterType selection filter type
   /// \param theFilter added filter
-  void registerSelectionFilter(const XGUI_SelectionFilterType theFilterType,
+  void registerSelectionFilter(const ModuleBase_SelectionFilterType theFilterType,
                                const Handle(SelectMgr_Filter)& theFilter);
 
   /// Commit the operation if it is possible. If the operation is dimention constraint,
@@ -451,7 +451,7 @@ private:
 
   CompositeFeaturePtr myCurrentSketch;
 
-  std::set<XGUI_SelectionFilterType> mySelectionFilterTypes;
+  std::set<ModuleBase_SelectionFilterType> mySelectionFilterTypes;
 
   FeatureToSelectionMap myCurrentSelection;
   bool myPreviousUpdateViewerEnabled;
index 336d8af5f1ea18c3d490624646f84c232bfe312f..a2e09b0f57ea0316a4572c0effd0b4e5d91e9719 100644 (file)
         <sketch_multi_selector id="ConstraintMirrorList"
             label="Segments:"
             tooltip="Select list of objects to be mirrored"
-            type_choice="Edges"
+            shape_types="Edges"
             use_external="true"
             greed ="true">
           <validator id="SketchPlugin_MirrorAttr" />
         <sketch_multi_selector id="MultiTranslationList"
             label="Segments:"
             tooltip="Select list of objects to be translated"
-            type_choice="Edges"
+            shape_types="Edges"
             use_external="true"
             greed ="true">
           <validator id="SketchPlugin_CopyValidator" />
         <sketch_multi_selector id="MultiRotationList"
             label="Segments:"
             tooltip="Select list of objects to be rotated"
-            type_choice="Edges"
+            shape_types="Edges"
             use_external="true"
             greed ="true">
           <validator id="SketchPlugin_CopyValidator" />
index d9178afe1674ec1a03558eba3672fa07903239fc..891551b9b63261f24dbc19ed03df3fb18817c84b 100644 (file)
@@ -54,7 +54,6 @@ SET(PROJECT_HEADERS
     XGUI_SalomeConnector.h
     XGUI_Selection.h
     XGUI_SelectionActivate.h
-    XGUI_SelectionFilterType.h
     XGUI_SelectionMgr.h
     XGUI_Tools.h
     XGUI_TransparencyWidget.h
index ba5e5f82a87eeb2442f8656db1d934e708747b2b..50d56ab37fef35f1b665ddad23fa268c105c178c 100644 (file)
 //
 
 #include "XGUI_FacesPanel.h"
+#include "XGUI_ObjectsBrowser.h"
+#include "XGUI_SelectionMgr.h"
+#include "XGUI_Tools.h"
+#include "XGUI_Workshop.h"
+
+#include <ModuleBase_IModule.h>
+#include <ModuleBase_ISelection.h>
+#include <ModuleBase_IWorkshop.h>
+#include <ModuleBase_ListView.h>
+#include <ModuleBase_ResultPrs.h>
+#include <ModuleBase_Tools.h>
+#include <ModuleBase_ViewerPrs.h>
+#include <ModuleBase_SelectionFilterType.h>
 
 #include <Config_PropManager.h>
 #include <Events_Loop.h>
 
 #include <ModelAPI_Events.h>
 
-#include <ModuleBase_IModule.h>
-#include <ModuleBase_ISelection.h>
-#include "ModuleBase_IWorkshop.h"
-#include "ModuleBase_ListView.h"
-#include "ModuleBase_ResultPrs.h"
-#include "ModuleBase_Tools.h"
-#include "ModuleBase_ViewerPrs.h"
-
-#include "XGUI_ObjectsBrowser.h"
-#include "XGUI_SelectionMgr.h"
-#include "XGUI_SelectionFilterType.h"
-#include "XGUI_Tools.h"
-#include "XGUI_Workshop.h"
-
 #include <QAction>
 #include <QCheckBox>
 #include <QFocusEvent>
diff --git a/src/XGUI/XGUI_SelectionFilterType.h b/src/XGUI/XGUI_SelectionFilterType.h
deleted file mode 100644 (file)
index 8bc9f81..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef XGUI_SelectionFilterType_H
-#define XGUI_SelectionFilterType_H
-
-#include "XGUI.h"
-
-/// Enumeration to specify module selection filters
-enum XGUI_EXPORT XGUI_SelectionFilterType {
-  SF_GlobalFilter, /// filter for different documents, group results
-  SF_FilterInfinite, /// filter for infinite construction results
-  SF_ResultGroupNameFilter, /// filter for selection some kind of results
-  SF_SketchCirclePointFilter, /// filter for selection circle points on current sketch
-  SF_SketchPlaneFilter /// filter for selection in the current sketch plane only
-};
-
-#endif