SHAPER  9.12.0
FeaturesAPI_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 FEATURESAPI_MULTITRANSLATION_H_
21 #define FEATURESAPI_MULTITRANSLATION_H_
22 
23 #include "FeaturesAPI.h"
24 
25 #include <FeaturesPlugin_MultiTranslation.h>
26 
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>
32 
34 
39 {
40 public:
42  FEATURESAPI_EXPORT
43  explicit FeaturesAPI_MultiTranslation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
44 
46  FEATURESAPI_EXPORT
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);
52 
54  FEATURESAPI_EXPORT
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);
63 
65  FEATURESAPI_EXPORT
67 
85  )
86 
87 
88  FEATURESAPI_EXPORT
89  void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
90 
92  FEATURESAPI_EXPORT
93  void setFirstAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
94  const ModelHighAPI_Double& theDistance);
95 
97  FEATURESAPI_EXPORT
98  void setSecondAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
99  const ModelHighAPI_Double& theDistance);
100 
102  FEATURESAPI_EXPORT
103  void setFirstNumber(const ModelHighAPI_Integer& theFirstNumber);
104 
106  FEATURESAPI_EXPORT
107  void setSecondNumber(const ModelHighAPI_Integer& theSecondNumber);
108 
110  FEATURESAPI_EXPORT
111  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
112 };
113 
115 typedef std::shared_ptr<FeaturesAPI_MultiTranslation> MultiTranslationPtr;
116 
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);
129 
130 #endif // FEATURESAPI_MULTITRANSLATION_H_
Interface for Translation feature.
Definition: FeaturesAPI_MultiTranslation.h:39
void setFirstNumber(const ModelHighAPI_Integer &theFirstNumber)
Modify CreationMethod, nb_first_dir attribute of the feature.
Definition: FeaturesAPI_MultiTranslation.cpp:112
void setFirstAxisAndDistance(const ModelHighAPI_Selection &theAxisObject, const ModelHighAPI_Double &theDistance)
Modify CreationMethod, axis_first_dir, step_first_dir attributes of the feature.
Definition: FeaturesAPI_MultiTranslation.cpp:90
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: FeaturesAPI_MultiTranslation.cpp:128
virtual std::shared_ptr< ModelAPI_AttributeInteger > firstNumber() const
First number of copies.
Definition: FeaturesAPI_MultiTranslation.h:85
void setSecondAxisAndDistance(const ModelHighAPI_Selection &theAxisObject, const ModelHighAPI_Double &theDistance)
Modify CreationMethod, axis_second_dir, step_second_dir attributes of the feature.
Definition: FeaturesAPI_MultiTranslation.cpp:101
void setMainObjects(const std::list< ModelHighAPI_Selection > &theMainObjects)
Set main objects.
Definition: FeaturesAPI_MultiTranslation.cpp:81
virtual std::shared_ptr< ModelAPI_AttributeDouble > secondStep() const
Second step.
Definition: FeaturesAPI_MultiTranslation.h:85
virtual std::shared_ptr< ModelAPI_AttributeString > useSecondDir() const
Use the second dir.
Definition: FeaturesAPI_MultiTranslation.h:85
virtual ~FeaturesAPI_MultiTranslation()
Destructor.
Definition: FeaturesAPI_MultiTranslation.cpp:76
virtual std::shared_ptr< ModelAPI_AttributeDouble > firstStep() const
First step.
Definition: FeaturesAPI_MultiTranslation.h:85
virtual std::shared_ptr< ModelAPI_AttributeSelection > secondAxisObject() const
Second axis object.
Definition: FeaturesAPI_MultiTranslation.h:85
void setSecondNumber(const ModelHighAPI_Integer &theSecondNumber)
Modify CreationMethod, nb_second_dir attribute of the feature.
Definition: FeaturesAPI_MultiTranslation.cpp:120
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > mainObjects() const
Main objects.
Definition: FeaturesAPI_MultiTranslation.h:85
virtual std::shared_ptr< ModelAPI_AttributeInteger > secondNumber() const
Second number of copies.
Definition: FeaturesAPI_MultiTranslation.h:85
FeaturesAPI_MultiTranslation(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: FeaturesAPI_MultiTranslation.cpp:26
virtual std::shared_ptr< ModelAPI_AttributeSelection > firstAxisObject() const
First axis object.
Definition: FeaturesAPI_MultiTranslation.h:85
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
static const std::string & NB_COPIES_FIRST_DIR_ID()
Attribute name of number of copies for the first direction.
Definition: FeaturesPlugin_MultiTranslation.h:66
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
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
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
API for the attribute that contains integer (int).
Definition: ModelAPI_AttributeInteger.h:34
Attribute that contains list of references to the sub-shapes with possibility to manage them.
Definition: ModelAPI_AttributeSelectionList.h:37
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Document for internal data structure of any object storage.
Definition: ModelAPI_Document.h:52
Class for filling ModelAPI_AttributeDouble.
Definition: ModelHighAPI_Double.h:37
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Class for filling ModelAPI_AttributeInteger.
Definition: ModelHighAPI_Integer.h:36
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:42
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
MultiTranslationPtr addMultiTranslation(const std::shared_ptr< ModelAPI_Document > &thePart, const std::list< ModelHighAPI_Selection > &theMainObjects, const ModelHighAPI_Selection &theFirstAxisObject, const ModelHighAPI_Double &theFirstStep, const ModelHighAPI_Integer &theFirstNumber, const ModelHighAPI_Selection &theSecondAxisObject=ModelHighAPI_Selection(), const ModelHighAPI_Double &theSecondStep=ModelHighAPI_Double(), const ModelHighAPI_Integer &theSecondNumber=ModelHighAPI_Integer(), const bool keepSubResults=false)
Create MultiTranslation feature.
Definition: FeaturesAPI_MultiTranslation.cpp:165