1 // Copyright (C) 2014-2020 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef FEATURESAPI_MULTITRANSLATION_H_
21 #define FEATURESAPI_MULTITRANSLATION_H_
23 #include "FeaturesAPI.h"
25 #include <FeaturesPlugin_MultiTranslation.h>
27 #include <ModelHighAPI_Double.h>
28 #include <ModelHighAPI_Integer.h>
29 #include <ModelHighAPI_Interface.h>
30 #include <ModelHighAPI_Macro.h>
31 #include <ModelHighAPI_Selection.h>
33 class ModelHighAPI_Dumper;
35 /// \class FeaturesAPI_MultiTranslation
36 /// \ingroup CPPHighAPI
37 /// \brief Interface for Translation feature.
38 class FeaturesAPI_MultiTranslation: public ModelHighAPI_Interface
41 /// Constructor without values.
43 explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
45 /// Constructor with values.
47 explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48 const std::list<ModelHighAPI_Selection>& theMainObjects,
49 const ModelHighAPI_Selection& theAxisObject,
50 const ModelHighAPI_Double& theStep,
51 const ModelHighAPI_Integer& theNumber);
53 /// Constructor with values.
55 explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
56 const std::list<ModelHighAPI_Selection>& theMainObjects,
57 const ModelHighAPI_Selection& theFirstAxisObject,
58 const ModelHighAPI_Double& theFirstStep,
59 const ModelHighAPI_Integer& theFirstNumber,
60 const ModelHighAPI_Selection& theSecondAxisObject,
61 const ModelHighAPI_Double& theSecondStep,
62 const ModelHighAPI_Integer& theSecondNumber);
66 virtual ~FeaturesAPI_MultiTranslation();
68 INTERFACE_8(FeaturesPlugin_MultiTranslation::ID(),
69 mainObjects, FeaturesPlugin_MultiTranslation::OBJECTS_LIST_ID(),
70 ModelAPI_AttributeSelectionList, /** Main objects */,
71 firstAxisObject, FeaturesPlugin_MultiTranslation::AXIS_FIRST_DIR_ID(),
72 ModelAPI_AttributeSelection, /** First axis object */,
73 firstStep, FeaturesPlugin_MultiTranslation::STEP_FIRST_DIR_ID(),
74 ModelAPI_AttributeDouble, /** First step */,
75 firstNumber, FeaturesPlugin_MultiTranslation::NB_COPIES_FIRST_DIR_ID(),
76 ModelAPI_AttributeInteger, /** First number of copies */,
77 useSecondDir, FeaturesPlugin_MultiTranslation::USE_SECOND_DIR_ID(),
78 ModelAPI_AttributeString, /** Use the second dir */,
79 secondAxisObject, FeaturesPlugin_MultiTranslation::AXIS_SECOND_DIR_ID(),
80 ModelAPI_AttributeSelection, /** Second axis object */,
81 secondStep, FeaturesPlugin_MultiTranslation::STEP_SECOND_DIR_ID(),
82 ModelAPI_AttributeDouble, /** Second step */,
83 secondNumber, FeaturesPlugin_MultiTranslation::NB_COPIES_SECOND_DIR_ID(),
84 ModelAPI_AttributeInteger, /** Second number of copies */
89 void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
91 /// Modify CreationMethod, axis_first_dir, step_first_dir attributes of the feature.
93 void setFirstAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
94 const ModelHighAPI_Double& theDistance);
96 /// Modify CreationMethod, axis_second_dir, step_second_dir attributes of the feature.
98 void setSecondAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
99 const ModelHighAPI_Double& theDistance);
101 /// Modify CreationMethod, nb_first_dir attribute of the feature.
103 void setFirstNumber(const ModelHighAPI_Integer& theFirstNumber);
105 /// Modify CreationMethod, nb_second_dir attribute of the feature.
107 void setSecondNumber(const ModelHighAPI_Integer& theSecondNumber);
109 /// Dump wrapped feature
111 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
114 /// Pointer on MultiTranslation object.
115 typedef std::shared_ptr<FeaturesAPI_MultiTranslation> MultiTranslationPtr;
117 /// \ingroup CPPHighAPI
118 /// \brief Create MultiTranslation feature.
119 FEATURESAPI_EXPORT MultiTranslationPtr addMultiTranslation(
120 const std::shared_ptr<ModelAPI_Document>& thePart,
121 const std::list<ModelHighAPI_Selection>& theMainObjects,
122 const ModelHighAPI_Selection& theFirstAxisObject,
123 const ModelHighAPI_Double& theFirstStep,
124 const ModelHighAPI_Integer& theFirstNumber,
125 const ModelHighAPI_Selection& theSecondAxisObject = ModelHighAPI_Selection(),
126 const ModelHighAPI_Double& theSecondStep = ModelHighAPI_Double(),
127 const ModelHighAPI_Integer& theSecondNumber = ModelHighAPI_Integer(),
128 const bool keepSubResults = false);
130 #endif // FEATURESAPI_MULTITRANSLATION_H_