Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Symmetry.h
index a487e66cb72926ecb2e70923fc8f40edd3eb6ea9..d03cc141bcc3c9b447c566a5d60efcff3723e1de 100644 (file)
@@ -14,7 +14,8 @@
 // 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<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
 //
 
 #ifndef FEATURESPLUGIN_SYMMETRY_H_
@@ -25,6 +26,9 @@
 #include <ModelAPI_Feature.h>
 
 #include <GeomAlgoAPI_Symmetry.h>
+#include <GeomAlgoAPI_MakeShapeList.h>
+
+class GeomAPI_Trsf;
 
 /** \class FeaturesPlugin_Symmetry
  *  \ingroup Plugins
@@ -96,6 +100,13 @@ class FeaturesPlugin_Symmetry : public ModelAPI_Feature
     return MY_PLANE_OBJECT_ID;
   }
 
+  /// Attribute name of keeping original shape.
+  inline static const std::string& KEEP_ORIGINAL_RESULT()
+  {
+    static const std::string MY_KEEP_ORIGINAL_RESULT_ID("keep_original");
+    return MY_KEEP_ORIGINAL_RESULT_ID;
+  }
+
   /// \return the kind of a feature.
   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
   {
@@ -113,6 +124,10 @@ class FeaturesPlugin_Symmetry : public ModelAPI_Feature
   FeaturesPlugin_Symmetry();
 
 private:
+  /// Obtain list of source objects of the mirror
+  bool collectSourceObjects(ListOfShape& theSourceShapes,
+                            std::list<std::shared_ptr<ModelAPI_Result>>& theSourceResults);
+
   /// Perform symmetry with respect to a point.
   void performSymmetryByPoint();
 
@@ -122,10 +137,15 @@ private:
   /// Perform symmetry with respect to a plane.
   void performSymmetryByPlane();
 
-  /// Perform the naming
-  void loadNamingDS(GeomAlgoAPI_Symmetry& theSymmetryAlgo,
-                    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                    std::shared_ptr<GeomAPI_Shape> theBaseShape);
+  /// Create new result on given shapes and the index of result
+  void buildResult(std::shared_ptr<GeomAlgoAPI_Symmetry>& theSymmetryAlgo,
+                   std::shared_ptr<GeomAPI_Shape> theBaseShape,
+                   int theResultIndex);
+
+  /// Create new result for the given part and transformation
+  void buildResult(std::shared_ptr<ModelAPI_ResultPart> theOriginal,
+                   std::shared_ptr<GeomAPI_Trsf> theTrsf,
+                   int& theResultIndex);
 };
 
 #endif // FEATURESPLUGIN_SYMMETRY_H_