1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef FEATURESAPI_MULTITRANSLATION_H_
22 #define FEATURESAPI_MULTITRANSLATION_H_
24 #include "FeaturesAPI.h"
26 #include <FeaturesPlugin_MultiTranslation.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
31 class ModelHighAPI_Double;
32 class ModelHighAPI_Dumper;
33 class ModelHighAPI_Integer;
34 class ModelHighAPI_Selection;
36 /// \class FeaturesAPI_MultiTranslation
37 /// \ingroup CPPHighAPI
38 /// \brief Interface for Translation feature.
39 class FeaturesAPI_MultiTranslation: public ModelHighAPI_Interface
42 /// Constructor without values.
44 explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
46 /// Constructor with values.
48 explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
49 const std::list<ModelHighAPI_Selection>& theMainObjects,
50 const ModelHighAPI_Selection& theAxisObject,
51 const ModelHighAPI_Double& theStep,
52 const ModelHighAPI_Integer& theNumber);
54 /// Constructor with values.
56 explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
57 const std::list<ModelHighAPI_Selection>& theMainObjects,
58 const ModelHighAPI_Selection& theFirstAxisObject,
59 const ModelHighAPI_Double& theFirstStep,
60 const ModelHighAPI_Integer& theFirstNumber,
61 const ModelHighAPI_Selection& theSecondAxisObject,
62 const ModelHighAPI_Double& theSecondStep,
63 const ModelHighAPI_Integer& theSecondNumber);
67 virtual ~FeaturesAPI_MultiTranslation();
69 INTERFACE_8(FeaturesPlugin_MultiTranslation::ID(),
70 mainObjects, FeaturesPlugin_MultiTranslation::OBJECTS_LIST_ID(),
71 ModelAPI_AttributeSelectionList, /** Main objects */,
72 firstAxisObject, FeaturesPlugin_MultiTranslation::AXIS_FIRST_DIR_ID(),
73 ModelAPI_AttributeSelection, /** First axis object */,
74 firstStep, FeaturesPlugin_MultiTranslation::STEP_FIRST_DIR_ID(),
75 ModelAPI_AttributeDouble, /** First step */,
76 firstNumber, FeaturesPlugin_MultiTranslation::NB_COPIES_FIRST_DIR_ID(),
77 ModelAPI_AttributeInteger, /** First number of copies */,
78 useSecondDir, FeaturesPlugin_MultiTranslation::USE_SECOND_DIR_ID(),
79 ModelAPI_AttributeString, /** Use the second dir */,
80 secondAxisObject, FeaturesPlugin_MultiTranslation::AXIS_SECOND_DIR_ID(),
81 ModelAPI_AttributeSelection, /** Second axis object */,
82 secondStep, FeaturesPlugin_MultiTranslation::STEP_SECOND_DIR_ID(),
83 ModelAPI_AttributeDouble, /** Second step */,
84 secondNumber, FeaturesPlugin_MultiTranslation::NB_COPIES_SECOND_DIR_ID(),
85 ModelAPI_AttributeInteger, /** Second number of copies */
90 void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
92 /// Modify CreationMethod, axis_first_dir, step_first_dir attributes of the feature.
94 void setFirstAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
95 const ModelHighAPI_Double& theDistance);
97 /// Modify CreationMethod, axis_second_dir, step_second_dir attributes of the feature.
99 void setSecondAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
100 const ModelHighAPI_Double& theDistance);
102 /// Modify CreationMethod, nb_first_dir attribute of the feature.
104 void setFirstNumber(const ModelHighAPI_Integer& theFirstNumber);
106 /// Modify CreationMethod, nb_second_dir attribute of the feature.
108 void setSecondNumber(const ModelHighAPI_Integer& theSecondNumber);
110 /// Dump wrapped feature
112 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
115 /// Pointer on MultiTranslation object.
116 typedef std::shared_ptr<FeaturesAPI_MultiTranslation> MultiTranslationPtr;
118 /// \ingroup CPPHighAPI
119 /// \brief Create MultiTranslation feature.
121 MultiTranslationPtr addMultiTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
122 const std::list<ModelHighAPI_Selection>& theMainObjects,
123 const ModelHighAPI_Selection& theAxisObject,
124 const ModelHighAPI_Double& theStep,
125 const ModelHighAPI_Integer& theNumber);
127 /// \ingroup CPPHighAPI
128 /// \brief Create MultiTranslation feature.
130 MultiTranslationPtr addMultiTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
131 const std::list<ModelHighAPI_Selection>& theMainObjects,
132 const ModelHighAPI_Selection& theFirstAxisObject,
133 const ModelHighAPI_Double& theFirstStep,
134 const ModelHighAPI_Integer& theFirstNumber,
135 const ModelHighAPI_Selection& theSecondAxisObject,
136 const ModelHighAPI_Double& theSecondStep,
137 const ModelHighAPI_Integer& theSecondNumber);
139 #endif // FEATURESAPI_MULTITRANSLATION_H_