1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_MultiTranslation.h
4 // Created: 09 Feb 2017
5 // Author: Clarisse Genrault (CEA)
7 #ifndef FEATURESAPI_MULTITRANSLATION_H_
8 #define FEATURESAPI_MULTITRANSLATION_H_
10 #include "FeaturesAPI.h"
12 #include <FeaturesPlugin_MultiTranslation.h>
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Dumper;
19 class ModelHighAPI_Integer;
20 class ModelHighAPI_Selection;
22 /// \class FeaturesAPI_MultiTranslation
23 /// \ingroup CPPHighAPI
24 /// \brief Interface for Translation feature.
25 class FeaturesAPI_MultiTranslation: public ModelHighAPI_Interface
28 /// Constructor without values.
30 explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
32 /// Constructor with values.
34 explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
35 const std::list<ModelHighAPI_Selection>& theMainObjects,
36 const ModelHighAPI_Selection& theAxisObject,
37 const ModelHighAPI_Double& theStep,
38 const ModelHighAPI_Integer& theNumber);
40 /// Constructor with values.
42 explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
43 const std::list<ModelHighAPI_Selection>& theMainObjects,
44 const ModelHighAPI_Selection& theFirstAxisObject,
45 const ModelHighAPI_Double& theFirstStep,
46 const ModelHighAPI_Integer& theFirstNumber,
47 const ModelHighAPI_Selection& theSecondAxisObject,
48 const ModelHighAPI_Double& theSecondStep,
49 const ModelHighAPI_Integer& theSecondNumber);
53 virtual ~FeaturesAPI_MultiTranslation();
55 INTERFACE_8(FeaturesPlugin_MultiTranslation::ID(),
56 mainObjects, FeaturesPlugin_MultiTranslation::OBJECTS_LIST_ID(),
57 ModelAPI_AttributeSelectionList, /** Main objects */,
58 firstAxisObject, FeaturesPlugin_MultiTranslation::AXIS_FIRST_DIR_ID(),
59 ModelAPI_AttributeSelection, /** First axis object */,
60 firstStep, FeaturesPlugin_MultiTranslation::STEP_FIRST_DIR_ID(),
61 ModelAPI_AttributeDouble, /** First step */,
62 firstNumber, FeaturesPlugin_MultiTranslation::NB_COPIES_FIRST_DIR_ID(),
63 ModelAPI_AttributeInteger, /** First number of copies */,
64 useSecondDir, FeaturesPlugin_MultiTranslation::USE_SECOND_DIR_ID(),
65 ModelAPI_AttributeString, /** Use the second dir */,
66 secondAxisObject, FeaturesPlugin_MultiTranslation::AXIS_SECOND_DIR_ID(),
67 ModelAPI_AttributeSelection, /** Second axis object */,
68 secondStep, FeaturesPlugin_MultiTranslation::STEP_SECOND_DIR_ID(),
69 ModelAPI_AttributeDouble, /** Second step */,
70 secondNumber, FeaturesPlugin_MultiTranslation::NB_COPIES_SECOND_DIR_ID(),
71 ModelAPI_AttributeInteger, /** Second number of copies */
76 void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
78 /// Modify CreationMethod, axis_first_dir, step_first_dir attributes of the feature.
80 void setFirstAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
81 const ModelHighAPI_Double& theDistance);
83 /// Modify CreationMethod, axis_second_dir, step_second_dir attributes of the feature.
85 void setSecondAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
86 const ModelHighAPI_Double& theDistance);
88 /// Modify CreationMethod, nb_first_dir attribute of the feature.
90 void setFirstNumber(const ModelHighAPI_Integer& theFirstNumber);
92 /// Modify CreationMethod, nb_second_dir attribute of the feature.
94 void setSecondNumber(const ModelHighAPI_Integer& theSecondNumber);
96 /// Dump wrapped feature
98 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
101 /// Pointer on Translation object.
102 typedef std::shared_ptr<FeaturesAPI_MultiTranslation> MultiTranslationPtr;
104 /// \ingroup CPPHighAPI
105 /// \brief Create MultiTranslation feature.
107 MultiTranslationPtr addMultiTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
108 const std::list<ModelHighAPI_Selection>& theMainObjects,
109 const ModelHighAPI_Selection& theAxisObject,
110 const ModelHighAPI_Double& theStep,
111 const ModelHighAPI_Integer& theNumber);
113 /// \ingroup CPPHighAPI
114 /// \brief Create MultiTranslation feature.
116 MultiTranslationPtr addMultiTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
117 const std::list<ModelHighAPI_Selection>& theMainObjects,
118 const ModelHighAPI_Selection& theFirstAxisObject,
119 const ModelHighAPI_Double& theFirstStep,
120 const ModelHighAPI_Integer& theFirstNumber,
121 const ModelHighAPI_Selection& theSecondAxisObject,
122 const ModelHighAPI_Double& theSecondStep,
123 const ModelHighAPI_Integer& theSecondNumber);
125 #endif // FEATURESAPI_MULTITRANSLATION_H_