SHAPER  9.12.0
FeaturesPlugin_MultiTranslation.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef FEATURESPLUGIN_MULTITRANSLATION_H_
21 #define FEATURESPLUGIN_MULTITRANSLATION_H_
22 
23 #include <FeaturesPlugin.h>
24 
25 #include <ModelAPI_Feature.h>
26 
27 class GeomAPI_Dir;
28 
35 {
36  public:
38  inline static const std::string& ID()
39  {
40  static const std::string MY_MULTITRANSLATION_ID("LinearCopy");
41  return MY_MULTITRANSLATION_ID;
42  }
43 
45  inline static const std::string& OBJECTS_LIST_ID()
46  {
47  static const std::string MY_OBJECTS_LIST_ID("main_objects");
48  return MY_OBJECTS_LIST_ID;
49  }
50 
52  inline static const std::string& AXIS_FIRST_DIR_ID()
53  {
54  static const std::string MY_AXIS_FIRST_DIR_ID("axis_first_dir");
55  return MY_AXIS_FIRST_DIR_ID;
56  }
57 
59  inline static const std::string& STEP_FIRST_DIR_ID()
60  {
61  static const std::string MY_STEP_FIRST_DIR_ID("step_first_dir");
62  return MY_STEP_FIRST_DIR_ID;
63  }
64 
66  inline static const std::string& NB_COPIES_FIRST_DIR_ID()
67  {
68  static const std::string MY_NB_COPIES_FIRST_DIR_ID("nb_first_dir");
69  return MY_NB_COPIES_FIRST_DIR_ID;
70  }
71 
73  inline static const std::string& USE_SECOND_DIR_ID()
74  {
75  static const std::string MY_USE_SECOND_DIR_ID("use_second_dir");
76  return MY_USE_SECOND_DIR_ID;
77  }
78 
80  inline static const std::string& AXIS_SECOND_DIR_ID()
81  {
82  static const std::string MY_AXIS_SECOND_DIR_ID("axis_second_dir");
83  return MY_AXIS_SECOND_DIR_ID;
84  }
85 
87  inline static const std::string& STEP_SECOND_DIR_ID()
88  {
89  static const std::string MY_STEP_SECOND_DIR_ID("step_second_dir");
90  return MY_STEP_SECOND_DIR_ID;
91  }
92 
94  inline static const std::string& NB_COPIES_SECOND_DIR_ID()
95  {
96  static const std::string MY_NB_COPIES_SECOND_DIR_ID("nb_second_dir");
97  return MY_NB_COPIES_SECOND_DIR_ID;
98  }
99 
101  FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
102  {
103  static std::string MY_KIND = FeaturesPlugin_MultiTranslation::ID();
104  return MY_KIND;
105  }
106 
108  FEATURESPLUGIN_EXPORT virtual void execute();
109 
111  FEATURESPLUGIN_EXPORT virtual void initAttributes();
112 
115 
116 private:
119  bool paramsAlongDirection(const int theIndex,
120  std::shared_ptr<GeomAPI_Dir>& theDir,
121  double& theDistance,
122  int& theQuantity);
123 };
124 
125 #endif // FEATURESPLUGIN_MULTITRANSLATION_H_
Feature for movement objects along one or two axes an arbitary number of times, making a copy every t...
Definition: FeaturesPlugin_MultiTranslation.h:35
virtual FEATURESPLUGIN_EXPORT const std::string & getKind()
Definition: FeaturesPlugin_MultiTranslation.h:101
static const std::string & AXIS_SECOND_DIR_ID()
Attribute name of a second direction.
Definition: FeaturesPlugin_MultiTranslation.h:80
static const std::string & AXIS_FIRST_DIR_ID()
Attribute name of a first direction.
Definition: FeaturesPlugin_MultiTranslation.h:52
static const std::string & OBJECTS_LIST_ID()
Attribute name of referenced objects.
Definition: FeaturesPlugin_MultiTranslation.h:45
static const std::string & STEP_FIRST_DIR_ID()
Attribute name of step for the first direction.
Definition: FeaturesPlugin_MultiTranslation.h:59
FeaturesPlugin_MultiTranslation()
Use plugin manager for features creation.
Definition: FeaturesPlugin_MultiTranslation.cpp:47
static const std::string & NB_COPIES_FIRST_DIR_ID()
Attribute name of number of copies for the first direction.
Definition: FeaturesPlugin_MultiTranslation.h:66
virtual FEATURESPLUGIN_EXPORT void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: FeaturesPlugin_MultiTranslation.cpp:52
static const std::string & NB_COPIES_SECOND_DIR_ID()
Attribute name of number of copies for the second direction.
Definition: FeaturesPlugin_MultiTranslation.h:94
static const std::string & STEP_SECOND_DIR_ID()
Attribute name of step for the second direction.
Definition: FeaturesPlugin_MultiTranslation.h:87
virtual FEATURESPLUGIN_EXPORT void execute()
Performs the algorithm and stores results it in the data structure.
Definition: FeaturesPlugin_MultiTranslation.cpp:82
static const std::string & ID()
Multi-translation kind.
Definition: FeaturesPlugin_MultiTranslation.h:38
static const std::string & USE_SECOND_DIR_ID()
Attribute name for use second dir.
Definition: FeaturesPlugin_MultiTranslation.h:73
3D direction defined by three normalized coordinates
Definition: GeomAPI_Dir.h:34
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:39