X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Symmetry.h;h=b0756ec56db352af0f19b38b0620c5fa27228eb1;hb=7551606a6acc65c7ee1bc474ae36f118526c4ca6;hp=aa67bd79b72580d9c245a18f0bb0bfbf8e38c668;hpb=87b6a30a3afb8fb32e7e43ade8d9c947d9eb1684;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.h b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.h index aa67bd79b..b0756ec56 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2020 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 @@ -12,10 +12,9 @@ // // 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 +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef FEATURESPLUGIN_SYMMETRY_H_ @@ -25,7 +24,8 @@ #include -#include +class GeomAPI_Trsf; +class GeomAlgoAPI_MakeShapeList; /** \class FeaturesPlugin_Symmetry * \ingroup Plugins @@ -97,6 +97,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() { @@ -104,7 +111,7 @@ class FeaturesPlugin_Symmetry : public ModelAPI_Feature return MY_KIND; } - /// Creates a new part document if needed. + /// Performs the algorithm and stores results it in the data structure. FEATURESPLUGIN_EXPORT virtual void execute(); /// Request for initialization of data model of the feature: adding all attributes. @@ -114,19 +121,28 @@ class FeaturesPlugin_Symmetry : public ModelAPI_Feature FeaturesPlugin_Symmetry(); private: - /// Perform symmetry with respect to a point. - void performSymmetryByPoint(); + /// Calculate symmetry with respect to a point. + std::shared_ptr symmetryByPoint(); + + /// Calculate symmetry with respect to an axis. + std::shared_ptr symmetryByAxis(); + + /// Calculate symmetry with respect to a plane. + std::shared_ptr symmetryByPlane(); - /// Perform symmetry with respect to an axis. - void performSymmetryByAxis(); + /// Perform the transformation + void performSymmetry(std::shared_ptr theTrsf); - /// Perform symmetry with respect to a plane. - void performSymmetryByPlane(); + /// Create new result on given shapes and the index of result + void buildResult(const std::shared_ptr& theAlgo, + const std::list >& theOriginalShapes, + std::shared_ptr theTargetShape, + int& theResultIndex); - /// Perform the naming - void loadNamingDS(GeomAlgoAPI_Symmetry& theSymmetryAlgo, - std::shared_ptr theResultBody, - std::shared_ptr theBaseShape); + /// Create new result for the given part and transformation + void buildResult(std::shared_ptr theOriginal, + std::shared_ptr theTrsf, + int& theResultIndex); }; #endif // FEATURESPLUGIN_SYMMETRY_H_