]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/FeaturesPlugin/FeaturesPlugin_MultiRotation.h
Salome HOME
updated copyright message
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_MultiRotation.h
index b39d4b4412f0461a6f26599df3bfb90f9eb2e729..757e59f9ac8ad9669d5eaf93ee075ef1d7360c95 100644 (file)
@@ -1,4 +1,21 @@
-// Copyright (C) 2014-201x CEA/DEN, EDF R&D
+// Copyright (C) 2017-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
+//
 
 // File:        FeaturesPlugin_MultiRotation.h
 // Created:     30 Jan 2017
@@ -16,8 +33,9 @@
 
 /** \class FeaturesPlugin_MultiRotation
  *  \ingroup Plugins
- *  \brief Feature for movement objects along one or two axes an arbitary number of times,
- *         making a copy every time.
+ *  \brief Feature that rotaes object around an axis an number of times.
+ *         The 2D version also makes translated copies of the object and performs the rotation
+ *         on these as well.
  */
 class FeaturesPlugin_MultiRotation : public ModelAPI_Feature
 {
@@ -25,7 +43,7 @@ class FeaturesPlugin_MultiRotation : public ModelAPI_Feature
   /// Multi-rotation kind.
   inline static const std::string& ID()
   {
-    static const std::string MY_MULTIROTATION_ID("MultiRotation");
+    static const std::string MY_MULTIROTATION_ID("AngularCopy");
     return MY_MULTIROTATION_ID;
   }
 
@@ -50,35 +68,35 @@ class FeaturesPlugin_MultiRotation : public ModelAPI_Feature
     return MY_USE_ANGULAR_STEP_ID;
   }
 
-  /// Attribute name of step for the first direction.
+  /// Attribute name of step for the angular.
   inline static const std::string& STEP_ANGULAR_ID()
   {
     static const std::string MY_STEP_ANGULAR_ID("step_angular");
     return MY_STEP_ANGULAR_ID;
   }
 
-  /// Attribute name of number of copies for the first direction.
+  /// Attribute name of number of copies for angular.
   inline static const std::string& NB_COPIES_ANGULAR_ID()
   {
     static const std::string MY_NB_COPIES_ANGULAR_ID("nb_angular");
     return MY_NB_COPIES_ANGULAR_ID;
   }
 
-  /// Attribute name for use second dir.
+  /// Attribute name for use radial dir.
   inline static const std::string& USE_RADIAL_DIR_ID()
   {
     static const std::string MY_USE_RADIAL_DIR_ID("use_radial_dir");
     return MY_USE_RADIAL_DIR_ID;
   }
 
-  /// Attribute name of step for the second direction.
+  /// Attribute name of radial step.
   inline static const std::string& STEP_RADIAL_ID()
   {
     static const std::string MY_STEP_RADIAL_ID("step_radial");
     return MY_STEP_RADIAL_ID;
   }
 
-  /// Attribute name of number of copies for the second direction.
+  /// Attribute name of number of copies for radial.
   inline static const std::string& NB_COPIES_RADIAL_ID()
   {
     static const std::string MY_NB_COPIES_RADIAL_ID("nb_radial");
@@ -92,7 +110,7 @@ class FeaturesPlugin_MultiRotation : 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.
@@ -102,10 +120,15 @@ class FeaturesPlugin_MultiRotation : public ModelAPI_Feature
   FeaturesPlugin_MultiRotation();
 
 private:
-  /// Perform the multi translation in one direction.
+  /// Fill axis, number of copies and angle of the rotation.
+  /// \returns \c false in case of errors.
+  bool paramsOfRotation(std::shared_ptr<GeomAPI_Ax1>& theAxis, double& theAngle, int& theQuantity);
+
+  /// Perform the multi rotation in one direction.
   void performRotation1D();
 
-  /// Perform the multi translation in two directions.
+#ifdef FEATURE_MULTIROTATION_TWO_DIRECTIONS
+  /// Perform the multi rotation in two directions.
   void performRotation2D();
 
   void loadNamingDS2(std::list<std::shared_ptr<GeomAlgoAPI_Translation> > theListOfTranslationAlgo,
@@ -115,10 +138,7 @@ private:
   void loadNamingDS3(std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > theListOfRotationAlgo,
                     std::shared_ptr<ModelAPI_ResultBody> theResultBody,
                     std::shared_ptr<GeomAPI_Shape> theBaseShape, int nb);
-
-  void loadNamingDS(std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > theListOfRotationAlgo,
-                    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-                    std::shared_ptr<GeomAPI_Shape> theBaseShape);
+#endif
 };
 
-#endif // FEATURESPLUGIN_MULTIROTATION_H_
\ No newline at end of file
+#endif // FEATURESPLUGIN_MULTIROTATION_H_