Salome HOME
Updated copyright comment
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Translation.h
index 91f3e7e1444fb3fd31794e6554ff40a8431a9b51..7fc4aa6d43410714ab0fdb6fa6fbfd7c072d55f2 100644 (file)
@@ -1,8 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-// File:        FeaturesAPI_Translation.h
-// Created:     07 June 2016
-// Author:      Dmitry Bobylev
+// Copyright (C) 2014-2024  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 FeaturesAPI_Translation_H_
 #define FeaturesAPI_Translation_H_
 
 #include <FeaturesPlugin_Translation.h>
 
+#include <ModelHighAPI_Double.h>
 #include <ModelHighAPI_Interface.h>
 #include <ModelHighAPI_Macro.h>
+#include <ModelHighAPI_Selection.h>
 
-class ModelHighAPI_Double;
 class ModelHighAPI_Dumper;
-class ModelHighAPI_Selection;
 
 /// \class FeaturesAPI_Translation
 /// \ingroup CPPHighAPI
@@ -39,15 +52,22 @@ public:
   FEATURESAPI_EXPORT
   explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                                    const std::list<ModelHighAPI_Selection>& theMainObjects,
-                          const ModelHighAPI_Double& theDx,
-                          const ModelHighAPI_Double& theDy,
-                          const ModelHighAPI_Double& theDz);
+                                   const ModelHighAPI_Double& theDx,
+                                   const ModelHighAPI_Double& theDy,
+                                   const ModelHighAPI_Double& theDz);
+
+  /// Constructor with values.
+  FEATURESAPI_EXPORT
+  explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                   const std::list<ModelHighAPI_Selection>& theMainObjects,
+                                   const ModelHighAPI_Selection& theStartPoint,
+                                   const ModelHighAPI_Selection& theEndPoint);
 
   /// Destructor.
   FEATURESAPI_EXPORT
   virtual ~FeaturesAPI_Translation();
 
-  INTERFACE_7(FeaturesPlugin_Translation::ID(),
+  INTERFACE_9(FeaturesPlugin_Translation::ID(),
               creationMethod, FeaturesPlugin_Translation::CREATION_METHOD(),
               ModelAPI_AttributeString, /** Creation method */,
               mainObjects, FeaturesPlugin_Translation::OBJECTS_LIST_ID(),
@@ -61,7 +81,11 @@ public:
               dy, FeaturesPlugin_Translation::DY_ID(),
               ModelAPI_AttributeDouble, /** Dimension in Y */,
               dz, FeaturesPlugin_Translation::DZ_ID(),
-              ModelAPI_AttributeDouble, /** Dimension in Z */
+              ModelAPI_AttributeDouble, /** Dimension in Z */,
+              startPoint, FeaturesPlugin_Translation::START_POINT_ID(),
+              ModelAPI_AttributeSelection, /** Start point object */,
+              endPoint, FeaturesPlugin_Translation::END_POINT_ID(),
+              ModelAPI_AttributeSelection, /** End point object */
              )
 
   /// Set main objects.
@@ -79,6 +103,11 @@ public:
                      const ModelHighAPI_Double& theDy,
                      const ModelHighAPI_Double& theDz);
 
+  /// Modify CreationMethod, start_point, end_point attributes of the feature.
+  FEATURESAPI_EXPORT
+  void setPoints(const ModelHighAPI_Selection& theStartPoint,
+                 const ModelHighAPI_Selection& theEndPoint);
+
   /// Dump wrapped feature
   FEATURESAPI_EXPORT
   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
@@ -87,21 +116,21 @@ public:
 /// Pointer on Translation object.
 typedef std::shared_ptr<FeaturesAPI_Translation> TranslationPtr;
 
-/// \ingroup CPPHighAPI
-/// \brief Create Translation feature.
-FEATURESAPI_EXPORT
-TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
-                              const std::list<ModelHighAPI_Selection>& theMainObjects,
-                              const ModelHighAPI_Selection& theAxisObject,
-                              const ModelHighAPI_Double& theDistance);
+#define DUMMY std::pair<ModelHighAPI_Selection, ModelHighAPI_Double>()
 
 /// \ingroup CPPHighAPI
 /// \brief Create Translation feature.
-FEATURESAPI_EXPORT
-TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
-                              const std::list<ModelHighAPI_Selection>& theMainObjects,
-                              const ModelHighAPI_Double& theDx,
-                              const ModelHighAPI_Double& theDy,
-                              const ModelHighAPI_Double& theDz);
+FEATURESAPI_EXPORT TranslationPtr addTranslation(
+    const std::shared_ptr<ModelAPI_Document>& part,
+    const std::list<ModelHighAPI_Selection>& objects,
+    const std::pair<ModelHighAPI_Selection, ModelHighAPI_Double>& deprecated1 = DUMMY,
+    const std::pair<ModelHighAPI_Selection, ModelHighAPI_Double>& deprecated2 = DUMMY,
+    const std::pair<ModelHighAPI_Selection, ModelHighAPI_Double>& deprecated3 = DUMMY,
+    const ModelHighAPI_Selection& axis = ModelHighAPI_Selection(),
+    const ModelHighAPI_Double& distance = ModelHighAPI_Double(0.0),
+    const std::list<ModelHighAPI_Double>& vector = std::list<ModelHighAPI_Double>(),
+    const ModelHighAPI_Selection& startPoint = ModelHighAPI_Selection(),
+    const ModelHighAPI_Selection& endPoint = ModelHighAPI_Selection(),
+    const bool keepSubResults = false );
 
 #endif // FeaturesAPI_Translation_H_