Salome HOME
Merge remote-tracking branch 'remotes/origin/Operations_on_Groups'
authorazv <azv@opencascade.com>
Mon, 12 Aug 2019 05:36:58 +0000 (08:36 +0300)
committerazv <azv@opencascade.com>
Mon, 12 Aug 2019 05:36:58 +0000 (08:36 +0300)
70 files changed:
CMakeLists.txt
doc/tui/CMakeLists.txt
doc/tui/Modules.doc
doc/tui/OpenParts/general_architecture.doc
src/CollectionPlugin/doc/fieldFeature.rst
src/CollectionPlugin/doc/groupFeature.rst
src/CollectionPlugin/doc/images/add.png [new file with mode: 0644]
src/CollectionPlugin/doc/images/delete.png [new file with mode: 0644]
src/CollectionPlugin/doc/images/field_steps_tree.png [new file with mode: 0644]
src/CollectionPlugin/doc/images/group_property_panel.png
src/CollectionPlugin/doc/images/reverce.png [new file with mode: 0644]
src/CollectionPlugin/doc/images/selection_by_filters.png [new file with mode: 0644]
src/CollectionPlugin/doc/images/selection_by_filters_added.png [new file with mode: 0644]
src/CollectionPlugin/doc/images/step_faces_double.png [new file with mode: 0644]
src/Config/Config_XMLReader.cpp
src/ConnectorAPI/Test/TestExportToGEOMPartSet.py
src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp
src/ExchangePlugin/doc/exportFeature.rst
src/FiltersPlugin/CMakeLists.txt
src/FiltersPlugin/FiltersPlugin_ExternalFaces.cpp
src/FiltersPlugin/FiltersPlugin_OnGeometry.cpp
src/FiltersPlugin/FiltersPlugin_Selection.cpp
src/FiltersPlugin/FiltersPlugin_VerticalFace.cpp
src/FiltersPlugin/Test/TestFilter_ExternalFaces.py [deleted file]
src/FiltersPlugin/Test/TestFilter_ExternalFaces1.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_ExternalFaces2.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_ExternalFaces_Exclude.py [deleted file]
src/FiltersPlugin/Test/TestFilter_ExternalFaces_Exclude1.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_ExternalFaces_Exclude2.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Edge.py [deleted file]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Edge1.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Edge2.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Edge.py [deleted file]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Edge1.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Edge2.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Face.py [deleted file]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Face1.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Face2.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Face3.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Face.py [deleted file]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Face1.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Face2.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_OnGeometry_Face3.py [new file with mode: 0644]
src/FiltersPlugin/Test/TestFilter_VerticalFaces.py
src/FiltersPlugin/Test/TestFilter_VerticalFaces_Exclude.py
src/GeomAPI/GeomAPI_Cylinder.cpp
src/GeomAPI/GeomAPI_Cylinder.h
src/GeomAPI/GeomAPI_Edge.cpp
src/GeomAPI/GeomAPI_Face.cpp
src/Model/Model_Session.cpp
src/ModelHighAPI/ModelHighAPI_Interface.cpp
src/ModuleBase/ModuleBase_IModule.h
src/ModuleBase/ModuleBase_IViewer.cpp
src/ModuleBase/ModuleBase_IViewer.h
src/ModuleBase/ModuleBase_Tools.cpp
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp
src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp
src/PartSet/PartSet_CustomPrs.cpp
src/PartSet/PartSet_CustomPrs.h
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h
src/PartSet/PartSet_OperationPrs.cpp
src/SketchPlugin/doc/SketchPlugin.rst
src/SketchPlugin/doc/images/SketchPanel.png
src/SketcherPrs/SketcherPrs_SymbolPrs.cpp
src/XGUI/XGUI_OperationMgr.cpp
src/XGUI/XGUI_ViewerProxy.cpp
src/XGUI/XGUI_ViewerProxy.h
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_Workshop.h

index ed5ca2bfbbe504d14e95a007662686540c5d183b..dfc3a0edbd7580f71b5eed7faa7b2a195bf5e74c 100644 (file)
@@ -30,9 +30,9 @@ SET (SHAPER_Version 9.3.0)
 
 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeCommon" ${CMAKE_MODULE_PATH})
 
-IF (NOT OPENPARTS_BUILD_DOC)
+IF (NOT CADBUILDER_BUILD_DOC)
   OPTION(SHAPER_BUILD_DOC "Generate SHAPER documentation" ON)
-ENDIF(OPENPARTS_BUILD_DOC)
+ENDIF(NOT CADBUILDER_BUILD_DOC)
 
 INCLUDE(SalomeMacros)
 
index ef4995e03dbb409042e19ec069628fab0d106513..6b4d118a0d9203f57743de437297bcce82a5515f 100644 (file)
@@ -24,7 +24,7 @@ ELSE (WIN32)
 ENDIF(WIN32)
 
 IF(HAVE_SALOME)
-  SET(EXCLUDE_DOC_DIR "*/AppElements/* */OpenParts/*")
+  SET(EXCLUDE_DOC_DIR "*/AppElements/* */CADBuilder/*")
 ELSE(HAVE_SALOME)
   SET(EXCLUDE_DOC_DIR "*/Shaper/*")
 ENDIF(HAVE_SALOME)
index 4c6f43c2c71b9c4c1f8c45b52d8b355410ef2119..451a13f4c8482afb263616a97d4e28b51892f8a7 100644 (file)
@@ -68,7 +68,7 @@
  * \defgroup Salome A Salome connector
  * 
  * \brief A set of classes which provide wrapping of 
- * OpenParts application as SALOME module
+ * CAD Builder application as SALOME module
  */
 
 /** 
index cdd68f362290820f76664a9ee356dd96d7a86e52..940f920aa126e80edec8423ed94c60f6b31bab64 100644 (file)
@@ -1,22 +1,22 @@
 /*!
 \page general_architecture General Architecture
 
-OpenPARTS is made of Workshop (see XGUI_Workshop) which loads a Module (see ModuleBase_IModule), connecting its features with GUI, providing it with services for launching of operations, tools for user inputs and visualisation of results. The Module can consist of one or several plug-ins which provide implementation of Module features. Each plug-in can implement one or several features. These features can be structured by Workbenches within Workshop. Workshop provides introducing of these Workbenches within main window in form of menus or/and tool bars.
+CAD Builder is made of Workshop (see XGUI_Workshop) which loads a Module (see ModuleBase_IModule), connecting its features with GUI, providing it with services for launching of operations, tools for user inputs and visualisation of results. The Module can consist of one or several plug-ins which provide implementation of Module features. Each plug-in can implement one or several features. These features can be structured by Workbenches within Workshop. Workshop provides introducing of these Workbenches within main window in form of menus or/and tool bars.
 \n
-Workshop interacts with a Module with help of specific interface defined in ModuleBase package. Each module for OpenPARTS application has to implement ModuleBase_IModile interface.
+Workshop interacts with a Module with help of specific interface defined in ModuleBase package. Each module for CAD Builder application has to implement ModuleBase_IModile interface.
 \n
 A Module manages a one document (ModelAPI_Document). This document consists of a one root document and several, loaded by request, sub-documents. Each sub-document can be stored in a single file. 
 \n
 
-<b>Main features of the general architecture of OpenPARTS:</b>
+<b>Main features of the general architecture of CAD Builder:</b>
 <ul>
-<li> OpenPARTS consists of a one Module running within a Workshop.</li>
+<li> CAD Builder consists of a one Module running within a Workshop.</li>
 <li> This Module produces one type of Document only.</li>
 <li> This Document consists of a main document and several sub-documents which can be stored and loaded as separated files.</li>
 <li> A Module is made of one or several Plug-ins implementing Features supported of the Module.</li>
 <li> These Features are structured by Workbenches.</li>
 <li> The Module communicates with the Workshop through Interfaces.</li>
-<li> The API of OpenPARTS consists of the Interface of the Workshop and of Modules.</li>
+<li> The API of CAD Builder consists of the Interface of the Workshop and of Modules.</li>
 <li> A configuration file describes the composition of the Workshop where the Module and Plug-ins are referenced by their unique names.</li>
 </ul>
 \n\n
@@ -24,8 +24,8 @@ A Module manages a one document (ModelAPI_Document). This document consists of a
 \n\n
 Feature is a peace of code which performs an operation. The Feature is a main component of a plug-in. It consists of input attributes, operation functionality and result objects (one or several). All features are defined in plug-ins by the specific feature developer (in C++ or python).
 \n
-For today there is a one implementation of OpenPARTS application which implements Part Set functionality (PartSet_Module).
-The geometric model (i.e. the whole geometry produce by PartSet) is created through operations, or features (ModelAPI_Feature), which define a meaningful piece of design (see \ref Plugins group). In order to easily create dedicated variants of the modeler, also to gradually develop OpenPARTS, each feature is implemented in a <i>Plug-in</i> (ModelAPI_Plugin, a piece of application including its own GUI, built separately from the application. It is loaded dynamically to the application). In other words, a Module is made of a collection of Plug-ins.
+For today there is a one implementation of CAD Builder application which implements Part Set functionality (PartSet_Module).
+The geometric model (i.e. the whole geometry produce by PartSet) is created through operations, or features (ModelAPI_Feature), which define a meaningful piece of design (see \ref Plugins group). In order to easily create dedicated variants of the modeler, also to gradually develop CAD Builder, each feature is implemented in a <i>Plug-in</i> (ModelAPI_Plugin, a piece of application including its own GUI, built separately from the application. It is loaded dynamically to the application). In other words, a Module is made of a collection of Plug-ins.
 Each sub-document contains a data of a one Part. When the user saves its session, all documents are saved: the PartSet and each Part.
 \n
 
index 97c555ee4e6e12993a78f449d512dddc98d66a06..c0aa1b2792974dce364356d7349ec59369eadcda 100644 (file)
@@ -53,6 +53,23 @@ Input fields:
 - **Add Step** button adds a new time step;
 - **Remove Step** button deletes the current time step.
 
+**Visualization of field**
+
+When a field is created then its result in data tree looks like following.
+
+.. image:: images/field_steps_tree.png
+  :align: center
+
+.. centered::
+  Result of created field with two steps.
+  
+It consists of a Field result object and steps as sub-objects. Only one object can be displayed at one moment: field or one of its step. Field result presentation repersents entities used for the Field definition.
+Step presentation shows field entities and values defined on them. For example a step defined on faces with double values looks like following.
+
+.. image:: images/step_faces_double.png
+  :align: center
+
+Color bar for displayed step is shown only if the setep is selected in **Object Browser**. Desirable parameters of the Color bar (position, number of intervals, text color) can be defined in **Preferences** dialog box.
  
 **TUI Commands**:
 
index 5944cdadc70ec425166212e0cb2c724a2ec314fd..1522bf7e0fe059036628439fb0bfdd13fb616c0a 100644 (file)
@@ -1,4 +1,7 @@
 .. |shape_group.icon|    image:: images/shape_group.png
+.. |plus.icon|  image:: images/add.png
+.. |minus.icon|  image:: images/reverce.png
+.. |delete.icon|  image:: images/delete.png
 
 Group
 =====
@@ -40,8 +43,46 @@ Input fields:
  
 - The list of selected entities of the given type.  Multiple selection can be done manually in OCC 3D Viewer by mouse click with Shift button pressed or by rectangle selection. To delete entities from the list, select them and call pop-up menu *Delete* item.
 
+- **Selection by filters** button opens "selection by filters" property panel and allows to select entities by set of selected filters.
+
+- **Show only** button allows to hide all other objects and shapes and show only selected ones.
+
 - Control **Add elements that share the same topology** allows to add automatically all elements laying on the same topology that was selected and remove these elements if they have disappeared due to the parametrical update. They will be represented as one line in the list of selection and managed in the viewer as one object if this flag is enabled. If flag becomes disabled when such elements are already in the list, they will become divided in one line per one shape.
 
+**Selection by filters**
+
+If user presses this button then following property panel appears.
+
+.. image:: images/selection_by_filters.png
+  :align: center
+
+.. centered::
+  Selection by filters property panel
+
+In this panel:
+
+- **Filters** a panel for added filters.
+
+- **Add new filter** combo box. It contains accessible filters according to the selection mode defined in **Group** property panel. When user selects an item from this combo box a filter item appears in **Filters** panel like in the following example:
+
+.. image:: images/selection_by_filters_added.png
+  :align: center
+
+.. centered::
+  Filters **Horizontal faces** and **On plane** added to the property panel.
+  
+Each filter item can be deleted with help of |delete.icon| button. A filter can be reverced with help of toggle button |plus.icon|/|minus.icon|. Also a filter could have input fields in case
+if the filter has arguments.
+
+- **Select** button traverces all objects of a current document and selects entities acceptable by currently defined set of filters. All selected entities will be shown in viewer 3d with
+blue semi-transparent color. Any modification in filters clears current selection.
+
+- **Number of selected objects** shows number currently selected entities.
+
+- **Show only** check box lets to hide all non-selected objects.
+
+**Accept** button in the **Selection by filters** property panel reopens **Group** property panel again and transfers all selected entities to the corresponded list.
+
 **TUI Command**:
 
 .. py:function:: model.addGroup(Part_1_doc, [model.selection("EDGE", "Cone_1_1/Face_1&Cone_1_1/Face_2"), model.selection("EDGE", "Cone_1_1/Face_1")])
diff --git a/src/CollectionPlugin/doc/images/add.png b/src/CollectionPlugin/doc/images/add.png
new file mode 100644 (file)
index 0000000..388f8ff
Binary files /dev/null and b/src/CollectionPlugin/doc/images/add.png differ
diff --git a/src/CollectionPlugin/doc/images/delete.png b/src/CollectionPlugin/doc/images/delete.png
new file mode 100644 (file)
index 0000000..6d2aea8
Binary files /dev/null and b/src/CollectionPlugin/doc/images/delete.png differ
diff --git a/src/CollectionPlugin/doc/images/field_steps_tree.png b/src/CollectionPlugin/doc/images/field_steps_tree.png
new file mode 100644 (file)
index 0000000..1c3f3a8
Binary files /dev/null and b/src/CollectionPlugin/doc/images/field_steps_tree.png differ
index 1ae6dea67d541640fe0c36936b3704154f7957a7..bdc6edb15a9e01e59126ae65d2b4cd28d93926d2 100644 (file)
Binary files a/src/CollectionPlugin/doc/images/group_property_panel.png and b/src/CollectionPlugin/doc/images/group_property_panel.png differ
diff --git a/src/CollectionPlugin/doc/images/reverce.png b/src/CollectionPlugin/doc/images/reverce.png
new file mode 100644 (file)
index 0000000..40239ad
Binary files /dev/null and b/src/CollectionPlugin/doc/images/reverce.png differ
diff --git a/src/CollectionPlugin/doc/images/selection_by_filters.png b/src/CollectionPlugin/doc/images/selection_by_filters.png
new file mode 100644 (file)
index 0000000..c4ac7ee
Binary files /dev/null and b/src/CollectionPlugin/doc/images/selection_by_filters.png differ
diff --git a/src/CollectionPlugin/doc/images/selection_by_filters_added.png b/src/CollectionPlugin/doc/images/selection_by_filters_added.png
new file mode 100644 (file)
index 0000000..a3e0a25
Binary files /dev/null and b/src/CollectionPlugin/doc/images/selection_by_filters_added.png differ
diff --git a/src/CollectionPlugin/doc/images/step_faces_double.png b/src/CollectionPlugin/doc/images/step_faces_double.png
new file mode 100644 (file)
index 0000000..5b8a708
Binary files /dev/null and b/src/CollectionPlugin/doc/images/step_faces_double.png differ
index a47496eb88c690c7d3f3ebcfefb292cfb61c0a4b..b98f072502d64574c09aae8ab4437e61387ac9a8 100644 (file)
@@ -71,7 +71,7 @@ std::string Config_XMLReader::resourcesConfigFile()
     aValue = std::string(anEnv) +
       FSEP + "share" + FSEP + "salome" + FSEP + "resources" + FSEP + "shaper";
   } else {
-    anEnv = getenv("OPENPARTS_ROOT_DIR");
+    anEnv = getenv("CADBUILDER_ROOT_DIR");
     if (anEnv) {
       aValue = std::string(anEnv) + FSEP + "resources";
     }
@@ -87,7 +87,7 @@ std::string Config_XMLReader::pluginConfigFile()
     aValue = std::string(anEnv) +
       FSEP + "share" + FSEP + "salome" + FSEP + "resources" + FSEP + "shaper";
   } else {
-    anEnv = getenv("OPENPARTS_ROOT_DIR");
+    anEnv = getenv("CADBUILDER_ROOT_DIR");
     if (anEnv) {
       aValue = std::string(anEnv) + FSEP + "plugins";
     }
@@ -111,9 +111,9 @@ std::string Config_XMLReader::findConfigFile(const std::string theFileName, cons
       if (aSolution == 1)
         anEnvName<<"SHAPER_ROOT_DIR";
       else if (aSolution == 2)
-        anEnvName<<"OPENPARTS_ROOT_DIR";
+        anEnvName<<"CADBUILDER_ROOT_DIR";
       else
-        anEnvName<<"OPENPARTS_PLUGINS_DIR";
+        anEnvName<<"CADBUILDER_ROOT_DIR";
 
       char* anEnv = getenv(anEnvName.str().c_str());
       if (!anEnv)
@@ -151,7 +151,7 @@ std::string Config_XMLReader::findConfigFile(const std::string theFileName, cons
       if (aResultIndex == theFindIndex)
         return aFileName;
       aResultIndex++;
-      if (aSolution == 1) // don't allow SHAPER and OpenParts paths treated simultaneously
+      if (aSolution == 1) // don't allow SHAPER and CADBuilder paths treated simultaneously
         aSolution++;
     }
   }
index 1fa41b8f5b77c5939eaa843521efe9e3d4cbb574..a3d4d7223abd3f658284ab63d0c2cb11712d6766 100644 (file)
@@ -141,7 +141,7 @@ assert(geompy.NumberOfSubShapes(shape3, geompy.ShapeType["VERTEX"]) == 3)
 field = salome.ObjectToSObject(shape3).FindSubObject(1)[1].GetObject()
 assert(field)
 assert(field.GetName() == "Field_1")
-assert(field.GetSteps() == [0, 1])
+assert(field.GetSteps() == [1, 2])
 
 shape4 = getGEOMShape(3)
 assert(not shape4)
index 96d10441c6698de60bf23cea44debbce7186261f..da17f46b8eed32edd06fa86f6f000ed72f2276f2 100644 (file)
@@ -446,8 +446,8 @@ void ExchangePlugin_ExportFeature::exportXAO(const std::string& theFileName)
 
         AttributeIntArrayPtr aStamps = aFieldFeature->intArray("stamps");
         for (int aStepIndex = 0; aStepIndex < aTables->tables(); aStepIndex++) {
-          XAO::Step* aStep = aXaoField->addNewStep(aStepIndex);
-          aStep->setStep(aStepIndex);
+          XAO::Step* aStep = aXaoField->addNewStep(aStepIndex + 1);
+          aStep->setStep(aStepIndex + 1);
           int aStampIndex = aStamps->value(aStepIndex);
           aStep->setStamp(aStampIndex);
           int aNumElements = isWholePart ? aXaoField->countElements() : aTables->rows();
index 41c4c34cc9929c12842a6605dac7c7422c02fef0..55799e4e97830624c594b2b74e440436e853bd18 100644 (file)
@@ -34,7 +34,7 @@ Selection list in the property panel contains a list of exported objects which c
 
 **TUI Command**:
 
-.. py:function:: model.exportToFile(Part_doc, FileNameString, ObjectsList)*
+.. py:function:: model.exportToFile(Part_doc, FileNameString, ObjectsList)
 
     :param part: The current part object
     :param string: The file name
index 62482f88e1991fa410e9a9c8890e2d52d9eb4f1e..8cebbbaa6dfa7a832898b15b276da0506c57d5e7 100644 (file)
@@ -114,10 +114,16 @@ ADD_UNIT_TESTS(
   TestFilter_OnPlane_Exclude.py
   TestFilter_OnLine.py
   TestFilter_OnLine_Exclude.py
-  TestFilter_OnGeometry_Edge.py
-  TestFilter_OnGeometry_Face.py
-  TestFilter_OnGeometry_Exclude_Edge.py
-  TestFilter_OnGeometry_Exclude_Face.py
+  TestFilter_OnGeometry_Edge1.py
+  TestFilter_OnGeometry_Edge2.py
+  TestFilter_OnGeometry_Face1.py
+  TestFilter_OnGeometry_Face2.py
+  TestFilter_OnGeometry_Face3.py
+  TestFilter_OnGeometry_Exclude_Edge1.py
+  TestFilter_OnGeometry_Exclude_Edge2.py
+  TestFilter_OnGeometry_Exclude_Face1.py
+  TestFilter_OnGeometry_Exclude_Face2.py
+  TestFilter_OnGeometry_Exclude_Face3.py
   TestFilter_OnPlaneSide_Face.py
   TestFilter_OnPlaneSide_Plane.py
   TestFilter_OnPlaneSide_Exclude_Face.py
@@ -136,8 +142,10 @@ ADD_UNIT_TESTS(
   TestFilter_RelativeToSolid_Exclude_NotOn.py
   TestFilter_RelativeToSolid_Exclude_InAndOn.py
   TestFilter_RelativeToSolid_Exclude_OutAndOn.py
-  TestFilter_ExternalFaces.py
-  TestFilter_ExternalFaces_Exclude.py
+  TestFilter_ExternalFaces1.py
+  TestFilter_ExternalFaces2.py
+  TestFilter_ExternalFaces_Exclude1.py
+  TestFilter_ExternalFaces_Exclude2.py
   TestFilter_HorizontalFaces.py
   TestFilter_HorizontalFaces_Exclude.py
   TestFilter_VerticalFaces.py
index 1ad322537f1817e6f6d3a84f7f6130f90b96fa6c..93fea41c60fce395bf4f49c8cb4dfae272b255b0 100644 (file)
@@ -36,6 +36,12 @@ bool FiltersPlugin_ExternalFaces::isOk(const GeomShapePtr& theShape,
   if (!theShape->isFace())
     return false;
 
+  // verify INTERNAL flag
+  TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
+  if (aShape.Orientation() == TopAbs_INTERNAL)
+    return false;
+
+  // check number of solids containing the face
   ResultBodyPtr anOwner = ModelAPI_Tools::bodyOwner(theResult, true);
   if (!anOwner) {
     anOwner = std::dynamic_pointer_cast<ModelAPI_ResultBody>(theResult);
@@ -47,6 +53,6 @@ bool FiltersPlugin_ExternalFaces::isOk(const GeomShapePtr& theShape,
   TopTools_IndexedDataMapOfShapeListOfShape aMapFS;
   TopExp::MapShapesAndUniqueAncestors(anOwnerShape->impl<TopoDS_Shape>(),
                                       TopAbs_FACE, TopAbs_SOLID, aMapFS);
-  const TopTools_ListOfShape& aSolids = aMapFS.FindFromKey(theShape->impl<TopoDS_Shape>());
+  const TopTools_ListOfShape& aSolids = aMapFS.FindFromKey(aShape);
   return aSolids.Extent() <= 1;
 }
index c7fa73d32aa2516a475566fe54ffa27a892928af..aeeb676504db8f944fb90adeb9342a6cee0dcb7d 100644 (file)
@@ -37,7 +37,9 @@ bool FiltersPlugin_OnGeometry::isOk(const GeomShapePtr& theShape, const ResultPt
   for (int i = 0; i < aList->size(); i++) {
     AttributeSelectionPtr aAttr = aList->value(i);
     GeomShapePtr aGeom = aAttr->value();
-    if (aGeom->isSameGeometry(theShape))
+    if (!aGeom)
+      aGeom = aAttr->context()->shape();
+    if (aGeom && aGeom->isSameGeometry(theShape))
       return true;
   }
   return false;
index fde5dda2903d91fc21f514193a4e61054edbb096..7fe056aba5aee9fadbf2b5d2f65023ac9b21a4e8 100644 (file)
@@ -123,7 +123,8 @@ void FiltersPlugin_Selection::initAttributes()
       std::shared_ptr<ModelAPI_AttributeBoolean> aBool =
         std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(data()->addFloatingAttribute(
           kReverseAttrID, ModelAPI_AttributeBoolean::typeId(), *aFIt));
-      aBool->setValue(false); // not reversed by default
+      if (!aBool->isInitialized())
+        aBool->setValue(false); // not reversed by default
       ModelAPI_FiltersArgs anArgs;
       anArgs.setFeature(std::dynamic_pointer_cast<ModelAPI_FiltersFeature>(data()->owner()));
       anArgs.setFilter(*aFIt);
index 9d1883126d501924c7a2b3dcaa086018bc924c39..38bbab5b7dd82c975fe2a428c7668333833ccd91 100644 (file)
@@ -35,12 +35,25 @@ bool FiltersPlugin_VerticalFace::isSupported(GeomAPI_Shape::ShapeType theType) c
 bool FiltersPlugin_VerticalFace::isOk(const GeomShapePtr& theShape, const ResultPtr&,
                                       const ModelAPI_FiltersArgs& theArgs) const
 {
-  if (!theShape->isFace() || !theShape->isPlanar())
-    return false;
+  static const double THE_TOLERANCE = 1.e-7;
+
+  bool isVertical = false;
+  if (!theShape->isFace())
+    return isVertical;
 
   GeomFacePtr aFace(new GeomAPI_Face(theShape));
 
   GeomPlanePtr aPlane = aFace->getPlane();
-  GeomDirPtr aDir = aPlane->direction();
-  return fabs(aDir->z()) <= 1.e-7;
+  if (aPlane) {
+    GeomDirPtr aDir = aPlane->direction();
+    isVertical = fabs(aDir->z()) <= THE_TOLERANCE;
+  }
+  else {
+    GeomCylinderPtr aCylinder = aFace->getCylinder();
+    if (aCylinder) {
+      GeomDirPtr aDir = aCylinder->axis();
+      isVertical = fabs(fabs(aDir->z()) - 1.0) <= THE_TOLERANCE;
+    }
+  }
+  return isVertical;
 }
diff --git a/src/FiltersPlugin/Test/TestFilter_ExternalFaces.py b/src/FiltersPlugin/Test/TestFilter_ExternalFaces.py
deleted file mode 100644 (file)
index 58f2145..0000000
+++ /dev/null
@@ -1,76 +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
-#
-
-from salome.shaper import model
-from GeomAPI import *
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")], 20190506)
-Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OX"), 20)
-Filters = model.filters(Part_1_doc, [model.addFilter(name = "ExternalFaces")])
-model.end()
-
-Reference = {}
-# Faces of the box
-ResultBox_1 = Partition_1.result().resultSubShapePair()[0]
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.FACE)
-Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
-# Faces of the cylinder
-ResultCylinder_1 = Translation_1.result().resultSubShapePair()[0]
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.FACE)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = True
-  exp.next()
-model.checkFilter(Part_1_doc, model, Filters, Reference)
-
-Reference = {
-    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Back"): True,
-    model.selection("FACE", "Partition_1_1_2/Modified_Face&Plane_1/Plane_1"): True,
-    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Bottom"): True,
-    model.selection("FACE", "Box_1_1/Right"): True,
-    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Top"): True,
-    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Front"): True,
-    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Back"): True,
-    model.selection("FACE", "Box_1_1/Left"): True,
-    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Bottom"): True,
-    model.selection("FACE", "Partition_1_1_1/Modified_Face&Plane_1/Plane_1"): True,
-    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Top"): True,
-    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Front"): True,
-    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): True,
-    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"): True,
-    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_3"): True,
-}
-model.checkFilter(Part_1_doc, model, Filters, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_ExternalFaces1.py b/src/FiltersPlugin/Test/TestFilter_ExternalFaces1.py
new file mode 100644 (file)
index 0000000..58f2145
--- /dev/null
@@ -0,0 +1,76 @@
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")], 20190506)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OX"), 20)
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "ExternalFaces")])
+model.end()
+
+Reference = {}
+# Faces of the box
+ResultBox_1 = Partition_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.FACE)
+Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True; exp.next()
+# Faces of the cylinder
+ResultCylinder_1 = Translation_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.FACE)
+while exp.more():
+  Reference[model.selection(ResultCylinder_1, exp.current())] = True
+  exp.next()
+model.checkFilter(Part_1_doc, model, Filters, Reference)
+
+Reference = {
+    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Back"): True,
+    model.selection("FACE", "Partition_1_1_2/Modified_Face&Plane_1/Plane_1"): True,
+    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Bottom"): True,
+    model.selection("FACE", "Box_1_1/Right"): True,
+    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Top"): True,
+    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Front"): True,
+    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Back"): True,
+    model.selection("FACE", "Box_1_1/Left"): True,
+    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Bottom"): True,
+    model.selection("FACE", "Partition_1_1_1/Modified_Face&Plane_1/Plane_1"): True,
+    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Top"): True,
+    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Front"): True,
+    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): True,
+    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"): True,
+    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_3"): True,
+}
+model.checkFilter(Part_1_doc, model, Filters, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_ExternalFaces2.py b/src/FiltersPlugin/Test/TestFilter_ExternalFaces2.py
new file mode 100644 (file)
index 0000000..5e3121c
--- /dev/null
@@ -0,0 +1,69 @@
+# 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
+#
+
+from salome.shaper import model
+from SketchAPI import *
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
+SketchLine_1 = Sketch_1.addLine(15, 2, 5, 2)
+SketchLine_2 = Sketch_1.addLine(5, 2, 5, 8)
+SketchLine_3 = Sketch_1.addLine(5, 8, 15, 8)
+SketchLine_4 = Sketch_1.addLine(15, 8, 15, 2)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_2.result(), 5, True)
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_4.result(), 15, True)
+SketchConstraintDistance_3 = Sketch_1.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_1.result(), 2, True)
+SketchConstraintDistance_4 = Sketch_1.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_3.result(), 8, True)
+model.do()
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")])
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Face_1_1")], 20190506)
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "ExternalFaces")])
+model.end()
+
+Reference = {}
+
+ResultPartition = Partition_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultPartition.shape(), GeomAPI_Shape.FACE)
+Reference[model.selection(ResultPartition, exp.current())] = True; exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = True; exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = True; exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = True; exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = True; exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = True; exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = False; exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = True; exp.next()
+assert(not exp.more())
+
+model.checkFilter(Part_1_doc, model, Filters, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_ExternalFaces_Exclude.py b/src/FiltersPlugin/Test/TestFilter_ExternalFaces_Exclude.py
deleted file mode 100644 (file)
index 4a5e962..0000000
+++ /dev/null
@@ -1,76 +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
-#
-
-from salome.shaper import model
-from GeomAPI import *
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")], 20190506)
-Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OX"), 20)
-Filters = model.filters(Part_1_doc, [model.addFilter(name = "ExternalFaces", exclude = True)])
-model.end()
-
-Reference = {}
-# Faces of the box
-ResultBox_1 = Partition_1.result().resultSubShapePair()[0]
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.FACE)
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-# Faces of the cylinder
-ResultCylinder_1 = Translation_1.result().resultSubShapePair()[0]
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.FACE)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = False
-  exp.next()
-model.checkFilter(Part_1_doc, model, Filters, Reference)
-
-Reference = {
-    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Back"): False,
-    model.selection("FACE", "Partition_1_1_2/Modified_Face&Plane_1/Plane_1"): False,
-    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Bottom"): False,
-    model.selection("FACE", "Box_1_1/Right"): False,
-    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Top"): False,
-    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Front"): False,
-    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Back"): False,
-    model.selection("FACE", "Box_1_1/Left"): False,
-    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Bottom"): False,
-    model.selection("FACE", "Partition_1_1_1/Modified_Face&Plane_1/Plane_1"): False,
-    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Top"): False,
-    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Front"): False,
-    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): False,
-    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"): False,
-    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_3"): False,
-}
-model.checkFilter(Part_1_doc, model, Filters, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_ExternalFaces_Exclude1.py b/src/FiltersPlugin/Test/TestFilter_ExternalFaces_Exclude1.py
new file mode 100644 (file)
index 0000000..4a5e962
--- /dev/null
@@ -0,0 +1,76 @@
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")], 20190506)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OX"), 20)
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "ExternalFaces", exclude = True)])
+model.end()
+
+Reference = {}
+# Faces of the box
+ResultBox_1 = Partition_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.FACE)
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+# Faces of the cylinder
+ResultCylinder_1 = Translation_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.FACE)
+while exp.more():
+  Reference[model.selection(ResultCylinder_1, exp.current())] = False
+  exp.next()
+model.checkFilter(Part_1_doc, model, Filters, Reference)
+
+Reference = {
+    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Back"): False,
+    model.selection("FACE", "Partition_1_1_2/Modified_Face&Plane_1/Plane_1"): False,
+    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Bottom"): False,
+    model.selection("FACE", "Box_1_1/Right"): False,
+    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Top"): False,
+    model.selection("FACE", "Partition_1_1_2/Modified_Face&Box_1_1/Front"): False,
+    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Back"): False,
+    model.selection("FACE", "Box_1_1/Left"): False,
+    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Bottom"): False,
+    model.selection("FACE", "Partition_1_1_1/Modified_Face&Plane_1/Plane_1"): False,
+    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Top"): False,
+    model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Front"): False,
+    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): False,
+    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"): False,
+    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_3"): False,
+}
+model.checkFilter(Part_1_doc, model, Filters, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_ExternalFaces_Exclude2.py b/src/FiltersPlugin/Test/TestFilter_ExternalFaces_Exclude2.py
new file mode 100644 (file)
index 0000000..9148ba3
--- /dev/null
@@ -0,0 +1,69 @@
+# 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
+#
+
+from salome.shaper import model
+from SketchAPI import *
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
+Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1"))
+SketchLine_1 = Sketch_1.addLine(15, 2, 5, 2)
+SketchLine_2 = Sketch_1.addLine(5, 2, 5, 8)
+SketchLine_3 = Sketch_1.addLine(5, 8, 15, 8)
+SketchLine_4 = Sketch_1.addLine(15, 8, 15, 2)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintDistance_1 = Sketch_1.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_2.result(), 5, True)
+SketchConstraintDistance_2 = Sketch_1.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_4.result(), 15, True)
+SketchConstraintDistance_3 = Sketch_1.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_1.result(), 2, True)
+SketchConstraintDistance_4 = Sketch_1.setDistance(SketchAPI_Point(SketchPoint_1).coordinates(), SketchLine_3.result(), 8, True)
+model.do()
+Face_1 = model.addFace(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")])
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Face_1_1")], 20190506)
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "ExternalFaces", exclude = True)])
+model.end()
+
+Reference = {}
+
+ResultPartition = Partition_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultPartition.shape(), GeomAPI_Shape.FACE)
+Reference[model.selection(ResultPartition, exp.current())] = False; exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = False; exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = False; exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = False; exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = False; exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = False; exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultPartition, exp.current())] = False; exp.next()
+assert(not exp.more())
+
+model.checkFilter(Part_1_doc, model, Filters, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Edge.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Edge.py
deleted file mode 100644 (file)
index 7a14e68..0000000
+++ /dev/null
@@ -1,115 +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
-#
-
-from salome.shaper import model
-from GeomAPI import *
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")], 20190506)
-Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OX"), 20)
-FilterFace = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", args = [model.selection("EDGE", "Partition_1_1_2/Generated_Edge&Plane_1/Plane_1&Box_1_1/Front"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Top][Partition_1_1_1/Modified_Face&Box_1_1/Front]")])])
-model.end()
-
-Reference = {}
-# Faces of the box
-ResultBox_1 = Partition_1.result().resultSubShapePair()[0]
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.FACE)
-while exp.more():
-  Reference[model.selection(ResultBox_1, exp.current())] = False
-  exp.next()
-# Faces of the cylinder
-ResultCylinder_1 = Translation_1.result().resultSubShapePair()[0]
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.FACE)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = False
-  exp.next()
-# Edges of the original box (selected as a sub-shapes of the result to keep original surface).
-# Note: the expected values have to be updated if ShapeExplorer will return another order of sub-shapes.
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.EDGE)
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-# Edges of the cylinder
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.EDGE)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = False
-  exp.next()
-# Vertices of the original box
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.VERTEX)
-while exp.more():
-  Reference[model.selection(ResultBox_1, exp.current())] = False
-  exp.next()
-# Vertices of the cylinder
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.VERTEX)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = False
-  exp.next()
-
-model.checkFilter(Part_1_doc, model, FilterFace, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Edge1.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Edge1.py
new file mode 100644 (file)
index 0000000..368a579
--- /dev/null
@@ -0,0 +1,116 @@
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")], 20190506)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OX"), 20)
+FilterFace = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", args = [model.selection("EDGE", "Partition_1_1_2/Generated_Edge&Plane_1/Plane_1&Box_1_1/Front"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Top][Partition_1_1_1/Modified_Face&Box_1_1/Front]")])])
+model.end()
+
+Reference = {}
+# Faces of the box
+ResultBox_1 = Partition_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.FACE)
+while exp.more():
+  Reference[model.selection(ResultBox_1, exp.current())] = False
+  exp.next()
+# Faces of the cylinder
+ResultCylinder_1 = Translation_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.FACE)
+while exp.more():
+  Reference[model.selection(ResultCylinder_1, exp.current())] = False
+  exp.next()
+# Edges of the original box (selected as a sub-shapes of the result to keep original surface).
+# Note: the expected values have to be updated if ShapeExplorer will return another order of sub-shapes.
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.EDGE)
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+assert(not exp.more())
+# Edges of the cylinder
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.EDGE)
+while exp.more():
+  Reference[model.selection(ResultCylinder_1, exp.current())] = False
+  exp.next()
+# Vertices of the original box
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.VERTEX)
+while exp.more():
+  Reference[model.selection(ResultBox_1, exp.current())] = False
+  exp.next()
+# Vertices of the cylinder
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.VERTEX)
+while exp.more():
+  Reference[model.selection(ResultCylinder_1, exp.current())] = False
+  exp.next()
+
+model.checkFilter(Part_1_doc, model, FilterFace, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Edge2.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Edge2.py
new file mode 100644 (file)
index 0000000..36cf0b6
--- /dev/null
@@ -0,0 +1,166 @@
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+from SketchAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [], model.selection(), 100, 0)
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(0, 0, 80)
+SketchLine_1 = Sketch_1.addLine(-70.03988514133886, -38.65765757761403, 65.03214823048954, -46.59205615260649)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchCircle_1.results()[1])
+SketchLine_2 = Sketch_1.addLine(6.89273184263731, -79.70251092497334, 48.24895637932232, 63.81252391424628)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchCircle_1.results()[1])
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchAPI_Point(SketchPoint_1).coordinates())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 80)
+Extrusion_1.setNestedSketch(Sketch_1)
+model.do()
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", args = [model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_3/To_Face]")])])
+model.end()
+
+Reference = {}
+# Extrusion Solid 1
+ResultExtrusion = Extrusion_1.result().subResult(0).resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultExtrusion.shape(), GeomAPI_Shape.EDGE)
+# edges of face 1
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 2
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 3
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 4
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 5
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 6
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+assert(not exp.more())
+
+# Extrusion Solid 2
+ResultExtrusion = Extrusion_1.result().subResult(1).resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultExtrusion.shape(), GeomAPI_Shape.EDGE)
+# edges of face 1
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 2
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 3
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 4
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 5
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+assert(not exp.more())
+
+# Extrusion Solid 3
+ResultExtrusion = Extrusion_1.result().subResult(2).resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultExtrusion.shape(), GeomAPI_Shape.EDGE)
+# edges of face 1
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 2
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 3
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 4
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 5
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+assert(not exp.more())
+
+# Extrusion Solid 4
+ResultExtrusion = Extrusion_1.result().subResult(3).resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultExtrusion.shape(), GeomAPI_Shape.EDGE)
+# edges of face 1
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 2
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 3
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 4
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 5
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+assert(not exp.more())
+
+model.checkFilter(Part_1_doc, model, Filters, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Edge.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Edge.py
deleted file mode 100644 (file)
index a06b537..0000000
+++ /dev/null
@@ -1,115 +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
-#
-
-from salome.shaper import model
-from GeomAPI import *
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")], 20190506)
-Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OX"), 20)
-FilterFace = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", exclude = True, args = [model.selection("EDGE", "Partition_1_1_2/Generated_Edge&Plane_1/Plane_1&Box_1_1/Front"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Top][Partition_1_1_1/Modified_Face&Box_1_1/Front]")])])
-model.end()
-
-Reference = {}
-# Faces of the box
-ResultBox_1 = Partition_1.result().resultSubShapePair()[0]
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.FACE)
-while exp.more():
-  Reference[model.selection(ResultBox_1, exp.current())] = True
-  exp.next()
-# Faces of the cylinder
-ResultCylinder_1 = Translation_1.result().resultSubShapePair()[0]
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.FACE)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = True
-  exp.next()
-# Edges of the original box (selected as a sub-shapes of the result to keep original surface).
-# Note: the expected values have to be updated if ShapeExplorer will return another order of sub-shapes.
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.EDGE)
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-# Edges of the cylinder
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.EDGE)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = True
-  exp.next()
-# Vertices of the original box
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.VERTEX)
-while exp.more():
-  Reference[model.selection(ResultBox_1, exp.current())] = True
-  exp.next()
-# Vertices of the cylinder
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.VERTEX)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = True
-  exp.next()
-
-model.checkFilter(Part_1_doc, model, FilterFace, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Edge1.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Edge1.py
new file mode 100644 (file)
index 0000000..287317a
--- /dev/null
@@ -0,0 +1,116 @@
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")], 20190506)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OX"), 20)
+FilterFace = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", exclude = True, args = [model.selection("EDGE", "Partition_1_1_2/Generated_Edge&Plane_1/Plane_1&Box_1_1/Front"), model.selection("EDGE", "[Partition_1_1_1/Modified_Face&Box_1_1/Top][Partition_1_1_1/Modified_Face&Box_1_1/Front]")])])
+model.end()
+
+Reference = {}
+# Faces of the box
+ResultBox_1 = Partition_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.FACE)
+while exp.more():
+  Reference[model.selection(ResultBox_1, exp.current())] = True
+  exp.next()
+# Faces of the cylinder
+ResultCylinder_1 = Translation_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.FACE)
+while exp.more():
+  Reference[model.selection(ResultCylinder_1, exp.current())] = True
+  exp.next()
+# Edges of the original box (selected as a sub-shapes of the result to keep original surface).
+# Note: the expected values have to be updated if ShapeExplorer will return another order of sub-shapes.
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.EDGE)
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+assert(not exp.more())
+# Edges of the cylinder
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.EDGE)
+while exp.more():
+  Reference[model.selection(ResultCylinder_1, exp.current())] = True
+  exp.next()
+# Vertices of the original box
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.VERTEX)
+while exp.more():
+  Reference[model.selection(ResultBox_1, exp.current())] = True
+  exp.next()
+# Vertices of the cylinder
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.VERTEX)
+while exp.more():
+  Reference[model.selection(ResultCylinder_1, exp.current())] = True
+  exp.next()
+
+model.checkFilter(Part_1_doc, model, FilterFace, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Edge2.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Edge2.py
new file mode 100644 (file)
index 0000000..1bb20d9
--- /dev/null
@@ -0,0 +1,166 @@
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+from SketchAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [], model.selection(), 100, 0)
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(0, 0, 80)
+SketchLine_1 = Sketch_1.addLine(-70.03988514133886, -38.65765757761403, 65.03214823048954, -46.59205615260649)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchCircle_1.results()[1])
+SketchLine_2 = Sketch_1.addLine(6.89273184263731, -79.70251092497334, 48.24895637932232, 63.81252391424628)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchCircle_1.results()[1])
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchAPI_Point(SketchPoint_1).coordinates())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 80)
+Extrusion_1.setNestedSketch(Sketch_1)
+model.do()
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", exclude = True, args = [model.selection("EDGE", "[Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1_3/To_Face]")])])
+model.end()
+
+Reference = {}
+# Extrusion Solid 1
+ResultExtrusion = Extrusion_1.result().subResult(0).resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultExtrusion.shape(), GeomAPI_Shape.EDGE)
+# edges of face 1
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 2
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 3
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 4
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 5
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 6
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+assert(not exp.more())
+
+# Extrusion Solid 2
+ResultExtrusion = Extrusion_1.result().subResult(1).resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultExtrusion.shape(), GeomAPI_Shape.EDGE)
+# edges of face 1
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 2
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 3
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 4
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 5
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+assert(not exp.more())
+
+# Extrusion Solid 3
+ResultExtrusion = Extrusion_1.result().subResult(2).resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultExtrusion.shape(), GeomAPI_Shape.EDGE)
+# edges of face 1
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 2
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 3
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 4
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 5
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+assert(not exp.more())
+
+# Extrusion Solid 4
+ResultExtrusion = Extrusion_1.result().subResult(3).resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultExtrusion.shape(), GeomAPI_Shape.EDGE)
+# edges of face 1
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# edges of face 2
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 3
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 4
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# edges of face 5
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+assert(not exp.more())
+
+model.checkFilter(Part_1_doc, model, Filters, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Face.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Face.py
deleted file mode 100644 (file)
index d4a5b62..0000000
+++ /dev/null
@@ -1,79 +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
-#
-
-from salome.shaper import model
-from GeomAPI import *
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")], 20190506)
-Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OX"), 20)
-FilterFace = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", exclude = True, args = [model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Top")])])
-model.end()
-
-Reference = {}
-# Faces of the box (selected as a sub-shapes of the result to keep original surface).
-# Note: the expected values have to be updated if ShapeExplorer will return another order of sub-shapes.
-ResultBox_1 = Partition_1.result().resultSubShapePair()[0]
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.FACE)
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-# Faces of the cylinder
-ResultCylinder_1 = Translation_1.result().resultSubShapePair()[0]
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.FACE)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = True
-  exp.next()
-# Edges of the original box
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.EDGE)
-while exp.more():
-  Reference[model.selection(ResultBox_1, exp.current())] = True
-  exp.next()
-# Edges of the cylinder
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.EDGE)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = True
-  exp.next()
-# Vertices of the original box
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.VERTEX)
-while exp.more():
-  Reference[model.selection(ResultBox_1, exp.current())] = True
-  exp.next()
-# Vertices of the cylinder
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.VERTEX)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = True
-  exp.next()
-
-model.checkFilter(Part_1_doc, model, FilterFace, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Face1.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Face1.py
new file mode 100644 (file)
index 0000000..5f519a0
--- /dev/null
@@ -0,0 +1,81 @@
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")], 20190506)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OX"), 20)
+FilterFace = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", exclude = True, args = [model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Top")])])
+model.end()
+
+Reference = {}
+# Faces of the box (selected as a sub-shapes of the result to keep original surface).
+# Note: the expected values have to be updated if ShapeExplorer will return another order of sub-shapes.
+ResultBox_1 = Partition_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.FACE)
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+assert(not exp.more())
+# Faces of the cylinder
+ResultCylinder_1 = Translation_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.FACE)
+Reference[model.selection(ResultCylinder_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultCylinder_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultCylinder_1, exp.current())] = True;  exp.next()
+assert(not exp.more())
+# Edges of the original box
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.EDGE)
+while exp.more():
+  Reference[model.selection(ResultBox_1, exp.current())] = True
+  exp.next()
+# Edges of the cylinder
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.EDGE)
+while exp.more():
+  Reference[model.selection(ResultCylinder_1, exp.current())] = True
+  exp.next()
+# Vertices of the original box
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.VERTEX)
+while exp.more():
+  Reference[model.selection(ResultBox_1, exp.current())] = True
+  exp.next()
+# Vertices of the cylinder
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.VERTEX)
+while exp.more():
+  Reference[model.selection(ResultCylinder_1, exp.current())] = True
+  exp.next()
+
+model.checkFilter(Part_1_doc, model, FilterFace, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Face2.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Face2.py
new file mode 100644 (file)
index 0000000..5f1eff7
--- /dev/null
@@ -0,0 +1,106 @@
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+from SketchAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [], model.selection(), 100, 0)
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(0, 0, 80)
+SketchLine_1 = Sketch_1.addLine(-70.03988514133886, -38.65765757761403, 65.03214823048954, -46.59205615260649)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchCircle_1.results()[1])
+SketchLine_2 = Sketch_1.addLine(6.89273184263731, -79.70251092497334, 48.24895637932232, 63.81252391424628)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchCircle_1.results()[1])
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchAPI_Point(SketchPoint_1).coordinates())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 80)
+Extrusion_1.setNestedSketch(Sketch_1)
+Revolution_1 = model.addRevolution(Part_1_doc, [], model.selection("EDGE", "PartSet/OZ"), 270, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_3 = Sketch_2.addLine(80, -20, 20, -20)
+SketchLine_4 = Sketch_2.addLine(20, -20, 20, -100)
+SketchLine_5 = Sketch_2.addLine(20, -100, 80, -100)
+SketchLine_6 = Sketch_2.addLine(80, -100, 80, -20)
+SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_4.result())
+SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_5.result())
+SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_6.result())
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_2 = SketchProjection_2.createdFeature()
+SketchConstraintDistance_1 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_6.result(), 80, True)
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_4.result(), 20, True)
+SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_3.result(), 20, True)
+SketchConstraintDistance_4 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_5.result(), 100, True)
+Revolution_1.setNestedSketch(Sketch_2)
+model.do()
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", exclude = True, args = [model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2")])])
+model.end()
+
+Reference = {}
+# Extrusion
+ResultExtrusion = Extrusion_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultExtrusion.shape(), GeomAPI_Shape.FACE)
+# faces of solid 1
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# faces of solid 2
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# faces of solid 3
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# faces of solid 4
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# Revolution
+ResultRevolution = Revolution_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultRevolution.shape(), GeomAPI_Shape.FACE)
+Reference[model.selection(ResultRevolution, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = False; exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = True;  exp.next()
+
+model.checkFilter(Part_1_doc, model, Filters, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Face3.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Exclude_Face3.py
new file mode 100644 (file)
index 0000000..8c73804
--- /dev/null
@@ -0,0 +1,106 @@
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+from SketchAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [], model.selection(), 100, 0)
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(0, 0, 80)
+SketchLine_1 = Sketch_1.addLine(-70.03988514133886, -38.65765757761403, 65.03214823048954, -46.59205615260649)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchCircle_1.results()[1])
+SketchLine_2 = Sketch_1.addLine(6.89273184263731, -79.70251092497334, 48.24895637932232, 63.81252391424628)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchCircle_1.results()[1])
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchAPI_Point(SketchPoint_1).coordinates())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 80)
+Extrusion_1.setNestedSketch(Sketch_1)
+Revolution_1 = model.addRevolution(Part_1_doc, [], model.selection("EDGE", "PartSet/OZ"), 270, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_3 = Sketch_2.addLine(80, -20, 20, -20)
+SketchLine_4 = Sketch_2.addLine(20, -20, 20, -100)
+SketchLine_5 = Sketch_2.addLine(20, -100, 80, -100)
+SketchLine_6 = Sketch_2.addLine(80, -100, 80, -20)
+SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_4.result())
+SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_5.result())
+SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_6.result())
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_2 = SketchProjection_2.createdFeature()
+SketchConstraintDistance_1 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_6.result(), 80, True)
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_4.result(), 20, True)
+SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_3.result(), 20, True)
+SketchConstraintDistance_4 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_5.result(), 100, True)
+Revolution_1.setNestedSketch(Sketch_2)
+model.do()
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", exclude = True, args = [model.selection("FACE", "Extrusion_1_1_3/To_Face")])])
+model.end()
+
+Reference = {}
+# Extrusion
+ResultExtrusion = Extrusion_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultExtrusion.shape(), GeomAPI_Shape.FACE)
+# faces of solid 1
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# faces of solid 2
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# faces of solid 3
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# faces of solid 4
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# Revolution
+ResultRevolution = Revolution_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultRevolution.shape(), GeomAPI_Shape.FACE)
+Reference[model.selection(ResultRevolution, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = True;  exp.next()
+
+model.checkFilter(Part_1_doc, model, Filters, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Face.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Face.py
deleted file mode 100644 (file)
index 1638b0b..0000000
+++ /dev/null
@@ -1,79 +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
-#
-
-from salome.shaper import model
-from GeomAPI import *
-
-model.begin()
-partSet = model.moduleDocument()
-Part_1 = model.addPart(partSet)
-Part_1_doc = Part_1.document()
-Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
-Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
-Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")], 20190506)
-Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
-Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OX"), 20)
-FilterFace = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", args = [model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Top")])])
-model.end()
-
-Reference = {}
-# Faces of the box (selected as a sub-shapes of the result to keep original surface).
-# Note: the expected values have to be updated if ShapeExplorer will return another order of sub-shapes.
-ResultBox_1 = Partition_1.result().resultSubShapePair()[0]
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.FACE)
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
-# Faces of the cylinder
-ResultCylinder_1 = Translation_1.result().resultSubShapePair()[0]
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.FACE)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = False
-  exp.next()
-# Edges of the original box
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.EDGE)
-while exp.more():
-  Reference[model.selection(ResultBox_1, exp.current())] = False
-  exp.next()
-# Edges of the cylinder
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.EDGE)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = False
-  exp.next()
-# Vertices of the original box
-exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.VERTEX)
-while exp.more():
-  Reference[model.selection(ResultBox_1, exp.current())] = False
-  exp.next()
-# Vertices of the cylinder
-exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.VERTEX)
-while exp.more():
-  Reference[model.selection(ResultCylinder_1, exp.current())] = False
-  exp.next()
-
-model.checkFilter(Part_1_doc, model, FilterFace, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Face1.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Face1.py
new file mode 100644 (file)
index 0000000..6e6cb32
--- /dev/null
@@ -0,0 +1,81 @@
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
+Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Box_1_1/Left"), model.selection("FACE", "Box_1_1/Right"))
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("FACE", "Plane_1")], 20190506)
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1")], model.selection("EDGE", "PartSet/OX"), 20)
+FilterFace = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", args = [model.selection("FACE", "Partition_1_1_1/Modified_Face&Box_1_1/Top")])])
+model.end()
+
+Reference = {}
+# Faces of the box (selected as a sub-shapes of the result to keep original surface).
+# Note: the expected values have to be updated if ShapeExplorer will return another order of sub-shapes.
+ResultBox_1 = Partition_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.FACE)
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultBox_1, exp.current())] = False; exp.next()
+assert(not exp.more())
+# Faces of the cylinder
+ResultCylinder_1 = Translation_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.FACE)
+Reference[model.selection(ResultCylinder_1, exp.current())] = False; exp.next()
+Reference[model.selection(ResultCylinder_1, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultCylinder_1, exp.current())] = False; exp.next()
+assert(not exp.more())
+# Edges of the original box
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.EDGE)
+while exp.more():
+  Reference[model.selection(ResultBox_1, exp.current())] = False
+  exp.next()
+# Edges of the cylinder
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.EDGE)
+while exp.more():
+  Reference[model.selection(ResultCylinder_1, exp.current())] = False
+  exp.next()
+# Vertices of the original box
+exp = GeomAPI_ShapeExplorer(ResultBox_1.shape(), GeomAPI_Shape.VERTEX)
+while exp.more():
+  Reference[model.selection(ResultBox_1, exp.current())] = False
+  exp.next()
+# Vertices of the cylinder
+exp = GeomAPI_ShapeExplorer(ResultCylinder_1.shape(), GeomAPI_Shape.VERTEX)
+while exp.more():
+  Reference[model.selection(ResultCylinder_1, exp.current())] = False
+  exp.next()
+
+model.checkFilter(Part_1_doc, model, FilterFace, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Face2.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Face2.py
new file mode 100644 (file)
index 0000000..56ba0b4
--- /dev/null
@@ -0,0 +1,106 @@
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+from SketchAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [], model.selection(), 100, 0)
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(0, 0, 80)
+SketchLine_1 = Sketch_1.addLine(-70.03988514133886, -38.65765757761403, 65.03214823048954, -46.59205615260649)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchCircle_1.results()[1])
+SketchLine_2 = Sketch_1.addLine(6.89273184263731, -79.70251092497334, 48.24895637932232, 63.81252391424628)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchCircle_1.results()[1])
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchAPI_Point(SketchPoint_1).coordinates())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 80)
+Extrusion_1.setNestedSketch(Sketch_1)
+Revolution_1 = model.addRevolution(Part_1_doc, [], model.selection("EDGE", "PartSet/OZ"), 270, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_3 = Sketch_2.addLine(80, -20, 20, -20)
+SketchLine_4 = Sketch_2.addLine(20, -20, 20, -100)
+SketchLine_5 = Sketch_2.addLine(20, -100, 80, -100)
+SketchLine_6 = Sketch_2.addLine(80, -100, 80, -20)
+SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_4.result())
+SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_5.result())
+SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_6.result())
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_2 = SketchProjection_2.createdFeature()
+SketchConstraintDistance_1 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_6.result(), 80, True)
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_4.result(), 20, True)
+SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_3.result(), 20, True)
+SketchConstraintDistance_4 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_5.result(), 100, True)
+Revolution_1.setNestedSketch(Sketch_2)
+model.do()
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", args = [model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchCircle_1_2")])])
+model.end()
+
+Reference = {}
+# Extrusion
+ResultExtrusion = Extrusion_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultExtrusion.shape(), GeomAPI_Shape.FACE)
+# faces of solid 1
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# faces of solid 2
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# faces of solid 3
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# faces of solid 4
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+# Revolution
+ResultRevolution = Revolution_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultRevolution.shape(), GeomAPI_Shape.FACE)
+Reference[model.selection(ResultRevolution, exp.current())] = False; exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = False; exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = False; exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = True;  exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = False; exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = False; exp.next()
+
+model.checkFilter(Part_1_doc, model, Filters, Reference)
diff --git a/src/FiltersPlugin/Test/TestFilter_OnGeometry_Face3.py b/src/FiltersPlugin/Test/TestFilter_OnGeometry_Face3.py
new file mode 100644 (file)
index 0000000..d002114
--- /dev/null
@@ -0,0 +1,106 @@
+# 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
+#
+
+from salome.shaper import model
+from GeomAPI import *
+from SketchAPI import *
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [], model.selection(), 100, 0)
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchCircle_1 = Sketch_1.addCircle(0, 0, 80)
+SketchLine_1 = Sketch_1.addLine(-70.03988514133886, -38.65765757761403, 65.03214823048954, -46.59205615260649)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchCircle_1.results()[1])
+SketchLine_2 = Sketch_1.addLine(6.89273184263731, -79.70251092497334, 48.24895637932232, 63.81252391424628)
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.startPoint(), SketchCircle_1.results()[1])
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchCircle_1.results()[1])
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchAPI_Point(SketchPoint_1).coordinates())
+SketchConstraintRadius_1 = Sketch_1.setRadius(SketchCircle_1.results()[1], 80)
+Extrusion_1.setNestedSketch(Sketch_1)
+Revolution_1 = model.addRevolution(Part_1_doc, [], model.selection("EDGE", "PartSet/OZ"), 270, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
+SketchLine_3 = Sketch_2.addLine(80, -20, 20, -20)
+SketchLine_4 = Sketch_2.addLine(20, -20, 20, -100)
+SketchLine_5 = Sketch_2.addLine(20, -100, 80, -100)
+SketchLine_6 = Sketch_2.addLine(80, -100, 80, -20)
+SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_4.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_9 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintHorizontal_1 = Sketch_2.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_1 = Sketch_2.setVertical(SketchLine_4.result())
+SketchConstraintHorizontal_2 = Sketch_2.setHorizontal(SketchLine_5.result())
+SketchConstraintVertical_2 = Sketch_2.setVertical(SketchLine_6.result())
+SketchProjection_2 = Sketch_2.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_2 = SketchProjection_2.createdFeature()
+SketchConstraintDistance_1 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_6.result(), 80, True)
+SketchConstraintDistance_2 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_4.result(), 20, True)
+SketchConstraintDistance_3 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_3.result(), 20, True)
+SketchConstraintDistance_4 = Sketch_2.setDistance(SketchAPI_Point(SketchPoint_2).coordinates(), SketchLine_5.result(), 100, True)
+Revolution_1.setNestedSketch(Sketch_2)
+model.do()
+Filters = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", args = [model.selection("FACE", "Extrusion_1_1_3/To_Face")])])
+model.end()
+
+Reference = {}
+# Extrusion
+ResultExtrusion = Extrusion_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultExtrusion.shape(), GeomAPI_Shape.FACE)
+# faces of solid 1
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# faces of solid 2
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# faces of solid 3
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# faces of solid 4
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = False; exp.next()
+Reference[model.selection(ResultExtrusion, exp.current())] = True;  exp.next()
+# Revolution
+ResultRevolution = Revolution_1.result().resultSubShapePair()[0]
+exp = GeomAPI_ShapeExplorer(ResultRevolution.shape(), GeomAPI_Shape.FACE)
+Reference[model.selection(ResultRevolution, exp.current())] = False; exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = False; exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = False; exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = False; exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = False; exp.next()
+Reference[model.selection(ResultRevolution, exp.current())] = False; exp.next()
+
+model.checkFilter(Part_1_doc, model, Filters, Reference)
index b60dfdbc268de8b5a1d01f0c327455afe8613607..1f754c20a3e4da2682c080dff61536753e9b6c91 100644 (file)
@@ -53,7 +53,7 @@ Reference = {
     model.selection("FACE", "LinearCopy_1_1_3/MF:Translated&Box_1_1/Right"): True,
     model.selection("FACE", "LinearCopy_1_1_3/MF:Translated&Box_1_1/Left"): True,
     # Faces of the cylinder
-    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): False,
+    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): True,
     model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"): False,
     model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_3"): False,
     # Edges and vertices are not applicable
index 655d10295190966223d65d487f8f97bbdd5421a6..da6057cd997671aed221e38d96f4912735880f89 100644 (file)
@@ -53,7 +53,7 @@ Reference = {
     model.selection("FACE", "LinearCopy_1_1_3/MF:Translated&Box_1_1/Right"): False,
     model.selection("FACE", "LinearCopy_1_1_3/MF:Translated&Box_1_1/Left"): False,
     # Faces of the cylinder
-    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): True,
+    model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_1"): False,
     model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_2"): True,
     model.selection("FACE", "Translation_1_1/MF:Translated&Cylinder_1_1/Face_3"): True,
     # Edges and vertices are not applicable
index 35b23e73bf922061f6f45107cd16cec9bb337242..87fab54e588871c98307e582e3ce87b7679b02fa 100644 (file)
@@ -81,3 +81,26 @@ bool GeomAPI_Cylinder::isInfinite() const
 {
   return Precision::IsInfinite(myHeight);
 }
+
+//=================================================================================================
+bool GeomAPI_Cylinder::isCoincident(const GeomCylinderPtr theCylinder, const double theTolerance)
+{
+  if (!theCylinder)
+    return false;
+
+  gp_Cylinder* anOther = theCylinder->implPtr<gp_Cylinder>();
+  if (fabs(MY_CYL->Radius() - anOther->Radius()) < theTolerance) {
+    gp_Dir aDir1 = MY_CYL->Position().Direction();
+    gp_Dir aDir2 = anOther->Position().Direction();
+    if (aDir1.IsParallel(aDir2, Precision::Angular())) {
+      gp_Pnt aLoc1 = MY_CYL->Location();
+      gp_Pnt aLoc2 = anOther->Location();
+      gp_Vec aVec12(aLoc1, aLoc2);
+      if (aVec12.SquareMagnitude() < theTolerance * theTolerance ||
+          aVec12.IsParallel(aDir1, Precision::Angular())) {
+        return true;
+      }
+    }
+  }
+  return false;
+}
index da78aeb36a87e889be33b5e10a84d2b4baec434a..0bb627ef6206a4da912c8f75c6df7f9f9b085176 100644 (file)
@@ -59,6 +59,10 @@ public:
   /// Return \c true is the cylinder is infinite
   GEOMAPI_EXPORT bool isInfinite() const;
 
+  /// Returns true if cylinders have same axis and radii.
+  GEOMAPI_EXPORT bool isCoincident(const std::shared_ptr<GeomAPI_Cylinder> theCylinder,
+                                   const double theTolerance = 1.e-7);
+
 private:
   double myHeight;
 };
index f939e6559e4c3e7b722326e95c7e71aa6b22e2cb..830fbb1b1ceac2fa867ea85ac0b3011820cc7814 100644 (file)
@@ -41,6 +41,7 @@
 #include <Geom_TrimmedCurve.hxx>
 #include <Geom_Ellipse.hxx>
 #include <Geom_Plane.hxx>
+#include <GeomAPI_ExtremaCurveCurve.hxx>
 #include <GeomAPI_ExtremaCurveSurface.hxx>
 #include <GeomAPI_IntCS.hxx>
 #include <GeomAdaptor_Curve.hxx>
@@ -68,17 +69,34 @@ GeomAPI_Edge::GeomAPI_Edge(const std::shared_ptr<GeomAPI_Shape>& theShape)
   }
 }
 
+static Handle(Geom_Curve) baseCurve(const TopoDS_Edge& theEdge)
+{
+  double aFirst, aLast;
+  Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, aFirst, aLast);
+  while (aCurve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
+    Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(aCurve);
+    aCurve = tc->BasisCurve();
+  }
+  return aCurve;
+}
+
 bool GeomAPI_Edge::isSameGeometry(const std::shared_ptr<GeomAPI_Shape> theShape) const
 {
   if (!theShape->isEdge())
     return false;
+  if (isSame(theShape))
+    return true;
+
   TopoDS_Edge anOwnEdge = TopoDS::Edge(impl<TopoDS_Shape>());
   TopoDS_Edge anOtherEdge = TopoDS::Edge(theShape->impl<TopoDS_Shape>());
 
-  double aFirst, aLast;
-  Handle(Geom_Curve) anOwnCurve = BRep_Tool::Curve(anOwnEdge, aFirst, aLast);
-  Handle(Geom_Curve) anOtherCurve = BRep_Tool::Curve(anOtherEdge, aFirst, aLast);
-  return anOwnCurve == anOtherCurve;
+  Handle(Geom_Curve) anOwnCurve = baseCurve(anOwnEdge);
+  Handle(Geom_Curve) anOtherCurve = baseCurve(anOtherEdge);
+  GeomAPI_ExtremaCurveCurve anExtrema(anOwnCurve, anOtherCurve);
+
+  bool isSame = anExtrema.Extrema().IsParallel() &&
+                anExtrema.TotalLowerDistance() < Precision::Confusion();
+  return isSame;
 }
 
 bool GeomAPI_Edge::isLine() const
index c03ec7f23313092e4c01a181333a6ffab1492ca2..bb907330c08eb1fd1b2ccea4d2451a8ad2865d99 100644 (file)
 #include <BRepAdaptor_Surface.hxx>
 #include <BRepGProp_Face.hxx>
 #include <BRepTools.hxx>
+#include <BRepTopAdaptor_TopolTool.hxx>
 #include <Geom_Surface.hxx>
 #include <Geom_SphericalSurface.hxx>
 #include <Geom_ConicalSurface.hxx>
 #include <Geom_CylindricalSurface.hxx>
 #include <Geom_RectangularTrimmedSurface.hxx>
+#include <Geom_SweptSurface.hxx>
 #include <Geom_ToroidalSurface.hxx>
+#include <GeomAdaptor_HSurface.hxx>
 #include <GeomLib_IsPlanarSurface.hxx>
+#include <IntPatch_ImpImpIntersection.hxx>
 #include <IntTools_Context.hxx>
 #include <Standard_Type.hxx>
 #include <TopoDS.hxx>
@@ -104,16 +108,74 @@ bool GeomAPI_Face::isEqual(std::shared_ptr<GeomAPI_Shape> theFace) const
   return aRes == Standard_True;
 }
 
+static Handle(Geom_Surface) baseSurface(const TopoDS_Face& theFace)
+{
+  Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theFace);
+  while (aSurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
+    Handle(Geom_RectangularTrimmedSurface) rts =
+        Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurf);
+    aSurf = rts->BasisSurface();
+  }
+  return aSurf;
+}
+
 bool GeomAPI_Face::isSameGeometry(const std::shared_ptr<GeomAPI_Shape> theShape) const
 {
   if (!theShape->isFace())
     return false;
+  if (isSame(theShape))
+    return true;
+
+  GeomFacePtr anOther = theShape->face();
+  if (isPlanar() && anOther->isPlanar()) {
+    GeomPlanePtr anOwnPlane = getPlane();
+    GeomPlanePtr anOtherPlane = anOther->getPlane();
+    return anOwnPlane->isCoincident(anOtherPlane);
+  }
+
   TopoDS_Face anOwnFace = TopoDS::Face(impl<TopoDS_Shape>());
   TopoDS_Face anOtherFace = TopoDS::Face(theShape->impl<TopoDS_Shape>());
 
-  Handle(Geom_Surface) anOwnSurf = BRep_Tool::Surface(anOwnFace);
-  Handle(Geom_Surface) anOtherSurf = BRep_Tool::Surface(anOtherFace);
-  return anOwnSurf == anOtherSurf;
+  Handle(Geom_Surface) anOwnSurf = baseSurface(anOwnFace);
+  Handle(Geom_Surface) anOtherSurf = baseSurface(anOtherFace);
+
+  // case of two elementary surfaces
+  if (anOwnSurf->IsKind(STANDARD_TYPE(Geom_ElementarySurface)) &&
+      anOtherSurf->IsKind(STANDARD_TYPE(Geom_ElementarySurface)))
+  {
+    Handle(GeomAdaptor_HSurface) aGA1 = new GeomAdaptor_HSurface(anOwnSurf);
+    Handle(GeomAdaptor_HSurface) aGA2 = new GeomAdaptor_HSurface(anOtherSurf);
+
+    Handle(BRepTopAdaptor_TopolTool) aTT1 = new BRepTopAdaptor_TopolTool();
+    Handle(BRepTopAdaptor_TopolTool) aTT2 = new BRepTopAdaptor_TopolTool();
+
+    try {
+      IntPatch_ImpImpIntersection anIIInt(aGA1, aTT1, aGA2, aTT2,
+                                          Precision::Confusion(),
+                                          Precision::Confusion());
+      if (!anIIInt.IsDone() || anIIInt.IsEmpty())
+        return false;
+
+      return anIIInt.TangentFaces();
+    }
+    catch (Standard_Failure const&) {
+      return false;
+    }
+  }
+
+  // case of two cylindrical surfaces, at least one of which is a swept surface
+  // swept surfaces: SurfaceOfLinearExtrusion, SurfaceOfRevolution
+  if ((anOwnSurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface)) ||
+       anOwnSurf->IsKind(STANDARD_TYPE(Geom_SweptSurface))) &&
+      (anOtherSurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface)) ||
+       anOtherSurf->IsKind(STANDARD_TYPE(Geom_SweptSurface))))
+  {
+    GeomCylinderPtr anOwnCyl = getCylinder();
+    GeomCylinderPtr anOtherCyl = anOther->getCylinder();
+    return anOwnCyl && anOtherCyl && anOwnCyl->isCoincident(anOtherCyl);
+  }
+
+  return false;
 }
 
 bool GeomAPI_Face::isCylindrical() const
index aed8b486a860344541266fa8cb085bff37487bf0..89f90ee4aff07fa7f3799e7dc193dab01b471437 100644 (file)
@@ -511,9 +511,33 @@ void Model_Session::processEvent(const std::shared_ptr<Events_Message>& theMessa
       }
     }
   } else {  // create/update/delete
-    if (myCheckTransactions && !isOperation())
-      Events_InfoMessage("Model_Session",
-        "Modification of data structure outside of the transaction").send();
+    if (myCheckTransactions && !isOperation()) {
+      // check it is done in real opened document: 2958
+      bool aIsActual = true;
+      static const Events_ID kDeletedEvent = Events_Loop::eventByName(EVENT_OBJECT_DELETED);
+      if (theMessage->eventID() == kDeletedEvent) {
+        aIsActual = false;
+        std::shared_ptr<ModelAPI_ObjectDeletedMessage> aDeleted =
+          std::dynamic_pointer_cast<ModelAPI_ObjectDeletedMessage>(theMessage);
+        std::list<std::shared_ptr<ModelAPI_Document> > allOpened =
+          Model_Session::allOpenedDocuments();
+        std::list<std::pair<std::shared_ptr<ModelAPI_Document>, std::string>>::const_iterator
+          aGIter = aDeleted->groups().cbegin();
+        for (; !aIsActual && aGIter != aDeleted->groups().cend(); aGIter++) {
+          std::list<std::shared_ptr<ModelAPI_Document> >::iterator anOpened = allOpened.begin();
+          for(; anOpened != allOpened.end(); anOpened++) {
+            if (aGIter->first == *anOpened) {
+              aIsActual = true;
+              break;
+            }
+          }
+        }
+      }
+
+      if (aIsActual)
+        Events_InfoMessage("Model_Session",
+          "Modification of data structure outside of the transaction").send();
+    }
     // if part is deleted, make the root as the current document (on undo of Parts creations)
     static const Events_ID kDeletedEvent = Events_Loop::eventByName(EVENT_OBJECT_DELETED);
     if (theMessage->eventID() == kDeletedEvent) {
index cb0373bfa4c2ef4582f6851a6d308bb151dcc143..b75b0f59e4087bddd9ba4b96a046c29774bd52c5 100644 (file)
@@ -107,7 +107,7 @@ ModelHighAPI_Selection ModelHighAPI_Interface::result() const
 
 std::list<ModelHighAPI_Selection> ModelHighAPI_Interface::results() const
 {
-  const_cast<ModelHighAPI_Interface*>(this)->execute();
+  const_cast<ModelHighAPI_Interface*>(this)->execute(true);
 
   std::list<ModelHighAPI_Selection> aSelectionList;
 
index 165828fd0806ce6bb2a7cebfedfe88eeb452f80d..529c1f1531e94a02876c2d182f049c769fa4bf15 100644 (file)
@@ -290,6 +290,13 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   virtual bool customizeObject(ObjectPtr theObject, const ModuleBase_CustomizeFlag& theFlag,
                                const bool theUpdateViewer);
 
+  /// Disable displaying of custom mode
+  /// \param theMode a mode to disable
+  virtual void disableCustomMode(ModuleBase_CustomizeFlag theMode) {}
+
+  /// Enables disabled custom mode
+  virtual void enableCustomModes() {}
+
   /// This method is called on object browser creation for customization of module specific features
   /// \param theObjectBrowser a pinter on Object Browser widget
   virtual void customizeObjectBrowser(QWidget* theObjectBrowser) {}
index ef7b0b7c336084503a06e2b79df01da0006c340b..cd743d93f0e3f26294ce53c019001d7dc8a24962 100644 (file)
@@ -22,7 +22,7 @@
 Handle(Prs3d_Drawer) ModuleBase_IViewer::DefaultHighlightDrawer;
 
 ModuleBase_IViewer::ModuleBase_IViewer(QObject* theParent)
-  : QObject(theParent), myIs2dMode(false)
+  : QObject(theParent), myIs2dMode(false), myShowHighlight(false)
 {
 
 }
index 77c10a45c230c8979cf5615156aa9ba47a1b8af3..c52c0d952907c43ee2e4a674413165f5714e3f51 100644 (file)
@@ -181,6 +181,16 @@ Q_OBJECT
   // \param theText is a title
   virtual void setColorScaleTitle(const QString& theText) = 0;
 
+  /// Switches On additional highlight for objects preselection
+  void showSelectionHighlight() {
+    myShowHighlight = true;
+  }
+
+  /// Switches Off additional highlight for objects preselection
+  void hideSelectionHighlight() {
+    myShowHighlight = false;
+  }
+
   static Handle(Prs3d_Drawer) DefaultHighlightDrawer;
 
 signals:
@@ -235,6 +245,8 @@ signals:
     QMap<Handle(V3d_View), double> myWindowScale;
 
     bool myIs2dMode;
+
+    bool myShowHighlight;
 };
 
 #endif
index e8124f80fda6de2309e64c8c7242eaed50035e7d..40d74c1d20629effe4ebecb36d940559cc91d6ef 100644 (file)
@@ -1130,7 +1130,7 @@ void setPointBallHighlighting(AIS_Shape* theAIS)
       aFile = std::string(anEnv) +
         FSEP + "share" + FSEP + "salome" + FSEP + "resources" + FSEP + "shaper";
     } else {
-      anEnv = getenv("OPENPARTS_ROOT_DIR");
+      anEnv = getenv("CADBUILDER_ROOT_DIR");
       if (anEnv)
         aFile = std::string(anEnv) + FSEP + "resources";
     }
index c403a878039e777797e6050a7468cad8ac4aecd5..349b61502e0921878fd37ddd801bddfe93520e27 100644 (file)
@@ -223,6 +223,8 @@ void ModuleBase_WidgetMultiSelector::activateCustom()
 //********************************************************************
 void ModuleBase_WidgetMultiSelector::deactivate()
 {
+  myWorkshop->module()->enableCustomModes();
+
   ModuleBase_WidgetSelector::deactivate();
   if (myVisibleObjects.size())
     onShowOnly(false);
@@ -1102,7 +1104,11 @@ void ModuleBase_WidgetMultiSelector::onShowOnly(bool theChecked)
     for (aIt = aResults.cbegin(); aIt != aResults.cend(); aIt++) {
       myVisibleObjects.removeAll(*aIt);
     }
+    myWorkshop->module()->disableCustomMode(ModuleBase_IModule::CustomizeArguments);
   }
+  else
+    myWorkshop->module()->enableCustomModes();
+
   foreach(ObjectPtr aObj, myVisibleObjects) {
     aObj->setDisplayed(!theChecked);
   }
index d7e3d15de55f4ac2c4ae05977f78a62c77a9d51e..7f1a8a599ba8788c1480359033351033e43968a0 100644 (file)
@@ -469,6 +469,7 @@ void ModuleBase_WidgetSelectionFilter::onSelect()
     updatePreview(aComp);
   updateNumberSelected();
   updateObject(myFeature);
+  onShowOnly(myShowBtn->isChecked());
 }
 
 void ModuleBase_WidgetSelectionFilter::updatePreview(const TopoDS_Shape& theShape)
@@ -507,9 +508,11 @@ void ModuleBase_WidgetSelectionFilter::onShowOnly(bool theShow)
   Handle(AIS_InteractiveContext) aCtx = myWorkshop->viewer()->AISContext();
 
   if (theShow) {
-    myListIO.Clear();
-    aCtx->DisplayedObjects(AIS_KOI_Shape, -1, myListIO);
-    myListIO.Remove(myPreview);
+    AIS_ListOfInteractive aList;
+    aCtx->DisplayedObjects(AIS_KOI_Shape, -1, aList);
+    aList.Remove(myPreview);
+    if (aList.Size() > 0)
+      myListIO = aList;
   }
   AIS_ListOfInteractive::const_iterator aIt;
   Handle(AIS_Shape) aShapeIO;
@@ -630,5 +633,20 @@ void ModuleBase_WidgetSelectionFilter::onObjectUpdated()
   myShowBtn->setChecked(false);
   clearCurrentSelection(true);
   updateNumberSelected();
+
+  QList<ModuleBase_FilterItem*> aItemsList = myFiltersWgt->findChildren<ModuleBase_FilterItem*>();
+  foreach(ModuleBase_FilterItem* aItem, aItemsList) {
+    QList<ModuleBase_ModelWidget*> aWidgetsList = aItem->widgets();
+    foreach(ModuleBase_ModelWidget* aWidget, aWidgetsList) {
+      if (!aWidget->feature().get())
+        aWidget->setFeature(myFeature);
+      aWidget->restoreValue();
+    }
+  }
   updateObject(myFeature);
+
+  // Redisplay the feature on order to Customize presentations from filters with selectors
+  static Events_ID EVENT_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+  ModelAPI_EventCreator::get()->sendUpdated(myFeature, EVENT_DISP);
+  Events_Loop::loop()->flush(EVENT_DISP);
 }
index 7b4ab82a290d555e4557e58159807d81eaf29a4c..549a5395e4be6ad7c3409a029218c7126b5a097c 100644 (file)
@@ -41,7 +41,8 @@
 //#define DO_NOT_VISUALIZE_CUSTOM_PRESENTATION
 
 PartSet_CustomPrs::PartSet_CustomPrs(ModuleBase_IWorkshop* theWorkshop)
-  : myWorkshop(theWorkshop), myFeature(FeaturePtr()), myPresentationIsEmpty(false)
+  : myWorkshop(theWorkshop), myFeature(FeaturePtr()), myPresentationIsEmpty(false),
+  myDisabledMode(-1)
 {
   Events_Loop* aLoop = Events_Loop::loop();
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_EMPTY_OPERATION_PRESENTATION));
@@ -93,6 +94,9 @@ bool PartSet_CustomPrs::displayPresentation(
 {
   bool isModified = false;
 
+  if (myDisabledMode == theFlag)
+    return isModified;
+
   // update the AIS objects content
   AISObjectPtr aPresentation = getPresentation(theFlag, true);
   Handle(AIS_InteractiveObject) anAISIO = aPresentation->impl<Handle(AIS_InteractiveObject)>();
@@ -243,7 +247,7 @@ void PartSet_CustomPrs::initPresentation(
   if (theFlag == ModuleBase_IModule::CustomizeArguments ||
       theFlag == ModuleBase_IModule::CustomizeResults) {
     anOperationPrs->setPointMarker(5, 2.);
-    anOperationPrs->setWidth(1);
+    anOperationPrs->setWidth((theFlag == ModuleBase_IModule::CustomizeHighlightedObjects)? 2 : 1);
   }
   else if (theFlag == ModuleBase_IModule::CustomizeHighlightedObjects)
     anAISPrs->useAISWidth();
index 6b31fdabe9a700e2f8fcd6f4a3177837b54834dd..75638bc5b9dd2b039585fa23743c84506442b68d 100644 (file)
@@ -98,6 +98,16 @@ public:
   /// it caused erroneus case because the presentation has linkage to the previous context.
   void clearPrs();
 
+  /// Disable displaying of custom mode
+  /// \param theMode a mode to disable
+  void disableCustomMode(ModuleBase_IModule::ModuleBase_CustomizeFlag theMode) {
+    myDisabledMode = theMode;
+    erasePresentation(theMode, false);
+  }
+
+  /// Enables disabled custom mode
+  void enableCustomModes() { myDisabledMode = -1; }
+
   //! Redefinition of Events_Listener method to listen a moment that the presentation becomes empty
   virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
 
@@ -149,6 +159,8 @@ private:
   QMap<ModuleBase_IModule::ModuleBase_CustomizeFlag, AISObjectPtr> myPresentations;
   /// State whether the presentation is activated/deactivated
   QMap<ModuleBase_IModule::ModuleBase_CustomizeFlag, bool> myIsActive;
+
+  int myDisabledMode;
 };
 
 #endif
index 62987b49715b11db131581a1f2eafe51a9ac5aac..e9dbb6a38ace075ebd901aeec175cc17aa78e3f9 100644 (file)
@@ -1711,3 +1711,13 @@ ModuleBase_ITreeNode* PartSet_Module::rootNode() const
 {
   return myRoot;
 }
+
+//******************************************************
+void PartSet_Module::disableCustomMode(ModuleBase_CustomizeFlag theMode) {
+  myCustomPrs->disableCustomMode(theMode);
+}
+
+//******************************************************
+void PartSet_Module::enableCustomModes() {
+  myCustomPrs->enableCustomModes();
+}
index 25c269059e2712d098ed8c7182e0fe63fa16289f..66264e3ec54691a8e0c44e4c9a098f164e95a1eb 100644 (file)
@@ -325,6 +325,13 @@ public:
   virtual bool customizeObject(ObjectPtr theObject, const ModuleBase_CustomizeFlag& theFlag,
                                const bool theUpdateViewer);
 
+  /// Disable displaying of custom mode
+  /// \param theMode a mode to disable
+  virtual void disableCustomMode(ModuleBase_CustomizeFlag theMode);
+
+  /// Enables disabled custom mode
+  virtual void enableCustomModes();
+
   /// This method is called on object browser creation for customisation of module specific features
   /// \param theObjectBrowser a pinter on Object Browser widget
   virtual void customizeObjectBrowser(QWidget* theObjectBrowser);
index f31b1b404d2ce5f525f32cab93986fdf2ca2c04b..f9d91312c53ca0bcbceb0afb742d854fe38dff0d 100644 (file)
@@ -235,7 +235,8 @@ void PartSet_OperationPrs::appendShapeIfVisible(ModuleBase_IWorkshop* theWorksho
                               QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes)
 {
   XGUI_Displayer* aDisplayer = XGUI_Tools::workshop(theWorkshop)->displayer();
-  if (XGUI_Displayer::isVisible(aDisplayer, theObject)) {
+  // VSV: Do not use isVisible checking because it can be used when state "Show Only" is ON
+  //if (XGUI_Displayer::isVisible(aDisplayer, theObject)) {
     if (theGeomShape.get()) {
       if (theObjectShapes.contains(theObject))
         theObjectShapes[theObject].append(theGeomShape);
@@ -250,7 +251,7 @@ void PartSet_OperationPrs::appendShapeIfVisible(ModuleBase_IWorkshop* theWorksho
               .arg(ModuleBase_Tools::objectInfo(theObject)).toStdString().c_str());
   #endif
     }
-  }
+  //}
 }
 
 void PartSet_OperationPrs::getFeatureShapes(const FeaturePtr& theFeature,
index ce7b6fd1920467a943cc0457e7826acf463c0bfe..f60148a465d1272a4823c3c24dca2cf1a41827cc 100644 (file)
@@ -48,6 +48,8 @@ After the plane for sketch is selected, the following property panel will be ope
 - **Show geometrical constraints** check box - displays/hides geometrical constraints:
 - **Show dimensional constraints** check box - displays/hides dimensional constraints; 
 - **Show existing expressions** check box - displays/hides expressions.
+- **Show free points** check box - highlights free points in the current sketch if it is checked.
+- **Change sketch plane** button - allows to change working plane of the current sketch.
 
 Now it is possible to:
 
index c22a957b922ca0cd4d302d14c7367ce6311ccc2d..b2ac3f362794b1185f623727d95c91aa9fbefa73 100644 (file)
Binary files a/src/SketchPlugin/doc/images/SketchPanel.png and b/src/SketchPlugin/doc/images/SketchPanel.png differ
index 48f851972d0438e6b72ad6c28201b8e2b8a32e8d..d23827aa7f745111e1cf1edda79b1b2e1bfad6a3 100644 (file)
@@ -168,7 +168,7 @@ Handle(Image_AlienPixMap) SketcherPrs_SymbolPrs::icon()
     aFile = std::string(anEnv) +
       FSEP + "share" + FSEP + "salome" + FSEP + "resources" + FSEP + "shaper";
   } else {
-    anEnv = getenv("OPENPARTS_ROOT_DIR");
+    anEnv = getenv("CADBUILDER_ROOT_DIR");
     if (anEnv)
       aFile = std::string(anEnv) + FSEP + "resources";
   }
index 6a16390326fd0c6fcd3e8bcaaf05ee32936fab01..3146a923c7689a119960e1027790039593b4e25a 100644 (file)
@@ -94,13 +94,7 @@ public:
       else if (theEvent->type() == QEvent::KeyPress) {
         QKeyEvent* aKeyEvent = dynamic_cast<QKeyEvent*>(theEvent);
         myOperationMgr->setSHIFTPressed(aKeyEvent->modifiers() & Qt::ShiftModifier);
-        switch (aKeyEvent->key()) {
-          case Qt::Key_Escape:
-            isAccepted = myOperationMgr->onKeyPressed(theObject, aKeyEvent);
-          break;
-          default:
-            break;
-        }
+        isAccepted = myOperationMgr->onKeyPressed(theObject, aKeyEvent);
       }
     }
     if (!isAccepted)
@@ -688,10 +682,13 @@ bool XGUI_OperationMgr::onKeyReleased(QObject *theObject, QKeyEvent* theEvent)
           isAccepted = true;
         }
       }
-    }
-    break;
-    break;
-    default:
+      }
+      break;
+   case Qt::Key_H:
+     if ((theEvent->modifiers() == Qt::NoModifier))
+      myWorkshop->viewer()->hideSelectionHighlight();
+     break;
+   default:
       isAccepted = false;
       break;
   }
@@ -744,6 +741,10 @@ bool XGUI_OperationMgr::onKeyPressed(QObject *theObject, QKeyEvent* theEvent)
       }
     }
     break;
+    case Qt::Key_H:
+      if ((theEvent->modifiers() == Qt::NoModifier))
+        myWorkshop->viewer()->showSelectionHighlight();
+      break;
   }
   return isAccepted;
 }
index 7d86a013fefc6fa2082110c1198e7d209700f5f1..175ed87790b880f08b2aa83415bac3c2c7e2c19d 100644 (file)
@@ -48,7 +48,7 @@
 
 XGUI_ViewerProxy::XGUI_ViewerProxy(XGUI_Workshop* theParent)
     : ModuleBase_IViewer(theParent),
-      myWorkshop(theParent), myShowHighlight(false)
+      myWorkshop(theParent)
 {
 }
 
index 3f86889606fe9ceea2b3b84dea3f802c1054e826..bb3a445d5ddc6f6fa97a81e6232221c8bcc3bc35 100644 (file)
@@ -210,7 +210,6 @@ private slots:
   ResultPtr myResult;
   AIS_ListOfInteractive myHighlights;
 
-  bool myShowHighlight;
 };
 
 #endif
index c3378cb70e33aaa41d6f91d3bf3735e7f0f15c16..d10ccc61278a39e8c73840d8c2e5ddcfcf1d578a 100644 (file)
@@ -178,8 +178,8 @@ static QString MyFilter(QObject::tr("SHAPER files (*.shaper *.opp)"));
 static QString MyFilter2(QObject::tr("SHAPER files (*.shaper)"));
 static QString MyExtension(".shaper");
 #else
-static QString MyFilter(QObject::tr("OpenParts files (*.opp);;All files (*.*)"));
-static QString MyFilter2(QObject::tr("OpenParts files (*.opp)"));
+static QString MyFilter(QObject::tr("CAD Builder files (*.opp);;All files (*.*)"));
+static QString MyFilter2(QObject::tr("CAD Builder files (*.opp)"));
 static QString MyExtension(".opp");
 #endif
 
@@ -624,7 +624,7 @@ void XGUI_Workshop::onHelpActionClicked()
             "salome" + aSep + "gui" + aSep + "SHAPER";
         }
 #else
-        QString aDir(getenv("OPENPARTS_ROOT_DIR"));
+        QString aDir(getenv("CADBUILDER_ROOT_DIR"));
         aDocDir = aDir + aSep + "doc" + aSep + "gui";
 #endif
         QString aFileName = aDocDir + aSep + aHelpPage;
index e24c7d59900b09271717f7e26347f2a83f091d0b..982758244fa3eecb338fcb879d0e8d3b037573fc 100644 (file)
@@ -504,7 +504,7 @@ private:
   void createDockWidgets();
 
   /// Extends undo/redo toolbutton's with history menu
-  /// \param theObject - in the OpenParts it is a QToolButton by itself,
+  /// \param theObject - in the CADBuilder it is a QToolButton by itself,
   /// in salome mode - QAction that creates a button.
   /// \param theSignal - void "updateUndoHistory" or "updateRedoHistory" SIGNAL;
   /// \param theSlot - onUndo(int) or onRedo(int) SLOT