Salome HOME
updated copyright message
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_MultiTranslation.h
index 876644239441c156c3864da8a0376f6ec5824aaf..1f1d311b8df4fd0b22c43aa89f75b1eb8ef92d08 100644 (file)
@@ -1,18 +1,31 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D
-
-// File:        FeaturesPlugin_MultiTranslation.h
-// Created:     30 Jan 2017
-// Author:      Clarisse Genrault (CEA)
+// Copyright (C) 2014-2023  CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #ifndef FEATURESPLUGIN_MULTITRANSLATION_H_
 #define FEATURESPLUGIN_MULTITRANSLATION_H_
 
 #include <FeaturesPlugin.h>
 
-#include <GeomAlgoAPI_Translation.h>
-
 #include <ModelAPI_Feature.h>
 
+class GeomAPI_Dir;
+
 /** \class FeaturesPlugin_MultiTranslation
  *  \ingroup Plugins
  *  \brief Feature for movement objects along one or two axes an arbitary number of times,
 class FeaturesPlugin_MultiTranslation : public ModelAPI_Feature
 {
   public:
-  /// Translation kind.
+  /// Multi-translation kind.
   inline static const std::string& ID()
   {
-    static const std::string MY_MULTITRANSLATION_ID("MultiTranslation");
+    static const std::string MY_MULTITRANSLATION_ID("LinearCopy");
     return MY_MULTITRANSLATION_ID;
   }
 
@@ -91,7 +104,7 @@ class FeaturesPlugin_MultiTranslation : 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.
@@ -101,15 +114,12 @@ class FeaturesPlugin_MultiTranslation : public ModelAPI_Feature
   FeaturesPlugin_MultiTranslation();
 
 private:
-  /// Perform the multi translation in one direction.
-  void performOneDirection();
-
-  /// Perform the multi translation in two directions.
-  void performTwoDirection();
-
-  void loadNamingDS(std::list<std::shared_ptr<GeomAlgoAPI_Translation> > theListOfTranslationAlgo,
-                    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                    std::shared_ptr<GeomAPI_Shape> theBaseShape);
+  /// Fill axis, number of copies and distance for the given direction.
+  /// \returns \c false in case of errors.
+  bool paramsAlongDirection(const int theIndex,
+                            std::shared_ptr<GeomAPI_Dir>& theDir,
+                            double& theDistance,
+                            int& theQuantity);
 };
 
 #endif // FEATURESPLUGIN_MULTITRANSLATION_H_
\ No newline at end of file