SHAPER  9.12.0
FeaturesAPI_Extrusion.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_Extrusion_H_
21 #define FeaturesAPI_Extrusion_H_
22 
23 #include "FeaturesAPI.h"
24 
25 #include <FeaturesPlugin_Extrusion.h>
26 
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
29 
33 
38 {
39 public:
41  FEATURESAPI_EXPORT
42  explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 
45  FEATURESAPI_EXPORT
46  explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47  const std::list<ModelHighAPI_Selection>& theBaseObjects,
48  const ModelHighAPI_Double& theSize);
49 
51  FEATURESAPI_EXPORT
52  explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
53  const std::list<ModelHighAPI_Selection>& theBaseObjects,
54  const ModelHighAPI_Selection& theDirection,
55  const ModelHighAPI_Double& theSize);
57  FEATURESAPI_EXPORT
58  explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
59  const std::list<ModelHighAPI_Selection>& theBaseObjects,
60  const ModelHighAPI_Double& theToSize,
61  const ModelHighAPI_Double& theFromSize);
62 
64  FEATURESAPI_EXPORT
65  explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
66  const std::list<ModelHighAPI_Selection>& theBaseObjects,
67  const ModelHighAPI_Selection& theDirection,
68  const ModelHighAPI_Double& theToSize,
69  const ModelHighAPI_Double& theFromSize,
70  const std::string& theSelectionType = std::string());
71 
73  FEATURESAPI_EXPORT
74  explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
75  const std::list<ModelHighAPI_Selection>& theBaseObjects,
76  const ModelHighAPI_Selection& theToObject,
77  const ModelHighAPI_Double& theToOffset,
78  const ModelHighAPI_Selection& theFromObject,
79  const ModelHighAPI_Double& theFromOffset);
80 
82  FEATURESAPI_EXPORT
83  explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
84  const std::list<ModelHighAPI_Selection>& theBaseObjects,
85  const ModelHighAPI_Selection& theDirection,
86  const ModelHighAPI_Selection& theToObject,
87  const ModelHighAPI_Double& theToOffset,
88  const ModelHighAPI_Selection& theFromObject,
89  const ModelHighAPI_Double& theFromOffset,
90  const std::string& theSelectionType = std::string());
91 
93  FEATURESAPI_EXPORT
94  virtual ~FeaturesAPI_Extrusion();
95 
96  INTERFACE_10(FeaturesPlugin_Extrusion::ID(),
117 
118 
119  FEATURESAPI_EXPORT
120  void setNestedSketch(const ModelHighAPI_Reference& theSketch);
121 
123  FEATURESAPI_EXPORT
124  void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
125 
127  FEATURESAPI_EXPORT
128  void setDirection(const ModelHighAPI_Selection& theDirection);
129 
131  FEATURESAPI_EXPORT
132  void setSizes(const ModelHighAPI_Double& theToSize,
133  const ModelHighAPI_Double& theFromSize);
134 
136  FEATURESAPI_EXPORT
137  void setSize(const ModelHighAPI_Double& theSize);
138 
141  FEATURESAPI_EXPORT
142  void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
143  const ModelHighAPI_Double& theToOffset,
144  const ModelHighAPI_Selection& theFromObject,
145  const ModelHighAPI_Double& theFromOffset);
146 
148  FEATURESAPI_EXPORT
149  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
150 
151 private:
152  void execIfBaseNotEmpty();
153 };
154 
156 typedef std::shared_ptr<FeaturesAPI_Extrusion> ExtrusionPtr;
157 
160 FEATURESAPI_EXPORT
161 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
162  const std::list<ModelHighAPI_Selection>& theBaseObjects,
163  const ModelHighAPI_Double& theSize);
164 
167 FEATURESAPI_EXPORT
168 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
169  const std::list<ModelHighAPI_Selection>& theBaseObjects,
170  const ModelHighAPI_Selection& theDirection,
171  const ModelHighAPI_Double& theSize);
172 
175 FEATURESAPI_EXPORT
176 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
177  const std::list<ModelHighAPI_Selection>& theBaseObjects,
178  const ModelHighAPI_Double& theToSize,
179  const ModelHighAPI_Double& theFromSize);
180 
183 FEATURESAPI_EXPORT
184 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
185  const std::list<ModelHighAPI_Selection>& theBaseObjects,
186  const ModelHighAPI_Selection& theDirection,
187  const ModelHighAPI_Double& theToSize,
188  const ModelHighAPI_Double& theFromSize,
189  const std::string& theSelectionType = std::string());
190 
193 FEATURESAPI_EXPORT
194 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
195  const std::list<ModelHighAPI_Selection>& theBaseObjects,
196  const ModelHighAPI_Selection& theToObject,
197  const ModelHighAPI_Double& theToOffset,
198  const ModelHighAPI_Selection& theFromObject,
199  const ModelHighAPI_Double& theFromOffset);
200 
203 FEATURESAPI_EXPORT
204 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
205  const std::list<ModelHighAPI_Selection>& theBaseObjects,
206  const ModelHighAPI_Selection& theDirection,
207  const ModelHighAPI_Selection& theToObject,
208  const ModelHighAPI_Double& theToOffset,
209  const ModelHighAPI_Selection& theFromObject,
210  const ModelHighAPI_Double& theFromOffset,
211  const std::string& theSelectionType = std::string());
212 
213 #endif // FeaturesAPI_Extrusion_H_
Interface for Extrusion feature.
Definition: FeaturesAPI_Extrusion.h:38
void setSizes(const ModelHighAPI_Double &theToSize, const ModelHighAPI_Double &theFromSize)
Modify CreationMethod, to_size, from_size attributes of the feature.
Definition: FeaturesAPI_Extrusion.cpp:170
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > baseObjects() const
Base objects.
Definition: FeaturesAPI_Extrusion.h:116
virtual ~FeaturesAPI_Extrusion()
Destructor.
Definition: FeaturesAPI_Extrusion.cpp:127
virtual std::shared_ptr< ModelAPI_AttributeDouble > toOffset() const
To offset.
Definition: FeaturesAPI_Extrusion.h:116
virtual std::shared_ptr< ModelAPI_AttributeSelection > direction() const
Direction.
Definition: FeaturesAPI_Extrusion.h:116
virtual std::shared_ptr< ModelAPI_AttributeDouble > toSize() const
To size.
Definition: FeaturesAPI_Extrusion.h:116
virtual std::shared_ptr< ModelAPI_AttributeReference > sketch() const
Sketch launcher.
Definition: FeaturesAPI_Extrusion.h:116
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: FeaturesAPI_Extrusion.cpp:202
virtual std::shared_ptr< ModelAPI_AttributeDouble > fromOffset() const
From offset.
Definition: FeaturesAPI_Extrusion.h:116
void setNestedSketch(const ModelHighAPI_Reference &theSketch)
Modify base attribute of the feature.
Definition: FeaturesAPI_Extrusion.cpp:132
void setDirection(const ModelHighAPI_Selection &theDirection)
Modify direction_object attribute of the feature.
Definition: FeaturesAPI_Extrusion.cpp:162
virtual std::shared_ptr< ModelAPI_AttributeSelection > toObject() const
To object.
Definition: FeaturesAPI_Extrusion.h:116
virtual std::shared_ptr< ModelAPI_AttributeSelection > fromObject() const
From object.
Definition: FeaturesAPI_Extrusion.h:116
void setBase(const std::list< ModelHighAPI_Selection > &theBaseObjects)
Modify base attribute of the feature.
Definition: FeaturesAPI_Extrusion.cpp:152
void setPlanesAndOffsets(const ModelHighAPI_Selection &theToObject, const ModelHighAPI_Double &theToOffset, const ModelHighAPI_Selection &theFromObject, const ModelHighAPI_Double &theFromOffset)
Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
Definition: FeaturesAPI_Extrusion.cpp:187
void setSize(const ModelHighAPI_Double &theSize)
Modify creation_method, to_size, from_size attributes of the feature.
Definition: FeaturesAPI_Extrusion.cpp:181
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethod() const
Creation method.
Definition: FeaturesAPI_Extrusion.h:116
virtual std::shared_ptr< ModelAPI_AttributeDouble > fromSize() const
From size.
Definition: FeaturesAPI_Extrusion.h:116
FeaturesAPI_Extrusion(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: FeaturesAPI_Extrusion.cpp:28
static const std::string & BASE_OBJECTS_ID()
Attribute name of base objects.
Definition: FeaturesPlugin_CompositeSketch.h:43
static const std::string & SKETCH_ID()
Attribute name of sketch feature.
Definition: FeaturesPlugin_CompositeSketch.h:36
static const std::string & CREATION_METHOD()
Attribute name for creation method.
Definition: FeaturesPlugin_Extrusion.h:50
static const std::string & FROM_SIZE_ID()
Attribute name of extrusion from size.
Definition: FeaturesPlugin_Extrusion.h:92
static const std::string & TO_SIZE_ID()
Attribute name of extrusion to size.
Definition: FeaturesPlugin_Extrusion.h:85
static const std::string & TO_OBJECT_ID()
Attribute name of an object to which the extrusion grows.
Definition: FeaturesPlugin_Extrusion.h:99
static const std::string & FROM_OBJECT_ID()
Attribute name of an object from which the extrusion grows.
Definition: FeaturesPlugin_Extrusion.h:113
static const std::string & DIRECTION_OBJECT_ID()
Attribute name of an object to which the extrusion grows.
Definition: FeaturesPlugin_Extrusion.h:78
static const std::string & ID()
Feature kind.
Definition: FeaturesPlugin_Extrusion.h:43
static const std::string & TO_OFFSET_ID()
Attribute name of extrusion offset.
Definition: FeaturesPlugin_Extrusion.h:106
static const std::string & FROM_OFFSET_ID()
Attribute name of extrusion offset.
Definition: FeaturesPlugin_Extrusion.h:120
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
Attribute that contains reference to feature (located in the same document).
Definition: ModelAPI_AttributeReference.h:32
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
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:42
Class for filling ModelAPI_AttributeReference.
Definition: ModelHighAPI_Reference.h:41
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
ExtrusionPtr addExtrusion(const std::shared_ptr< ModelAPI_Document > &thePart, const std::list< ModelHighAPI_Selection > &theBaseObjects, const ModelHighAPI_Double &theSize)
Create Extrusion feature.
Definition: FeaturesAPI_Extrusion.cpp:265