1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_Extrusion.h
4 // Created: 09 June 2016
5 // Author: Dmitry Bobylev
7 #ifndef FeaturesAPI_Extrusion_H_
8 #define FeaturesAPI_Extrusion_H_
10 #include "FeaturesAPI.h"
12 #include <FeaturesPlugin_Extrusion.h>
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Reference;
19 class ModelHighAPI_Selection;
21 /// \class FeaturesAPI_Extrusion
22 /// \ingroup CPPHighAPI
23 /// \brief Interface for Extrusion feature.
24 class FeaturesAPI_Extrusion: public ModelHighAPI_Interface
27 /// Constructor without values.
29 explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature);
31 /// Constructor with values.
33 explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
34 const std::list<ModelHighAPI_Selection>& theBaseObjects,
35 const ModelHighAPI_Double& theSize);
37 /// Constructor with values.
39 explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
40 const std::list<ModelHighAPI_Selection>& theBaseObjects,
41 const ModelHighAPI_Selection& theDirection,
42 const ModelHighAPI_Double& theSize);
43 /// Constructor with values.
45 explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
46 const std::list<ModelHighAPI_Selection>& theBaseObjects,
47 const ModelHighAPI_Double& theToSize,
48 const ModelHighAPI_Double& theFromSize);
50 /// Constructor with values.
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& theToSize,
56 const ModelHighAPI_Double& theFromSize);
58 /// Constructor with values.
60 explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
61 const std::list<ModelHighAPI_Selection>& theBaseObjects,
62 const ModelHighAPI_Selection& theToObject,
63 const ModelHighAPI_Double& theToOffset,
64 const ModelHighAPI_Selection& theFromObject,
65 const ModelHighAPI_Double& theFromOffset);
67 /// Constructor with values.
69 explicit FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
70 const std::list<ModelHighAPI_Selection>& theBaseObjects,
71 const ModelHighAPI_Selection& theDirection,
72 const ModelHighAPI_Selection& theToObject,
73 const ModelHighAPI_Double& theToOffset,
74 const ModelHighAPI_Selection& theFromObject,
75 const ModelHighAPI_Double& theFromOffset);
79 virtual ~FeaturesAPI_Extrusion();
81 INTERFACE_10(FeaturesPlugin_Extrusion::ID(),
82 sketch, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */,
83 baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
84 direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), ModelAPI_AttributeSelection, /** Direction */,
85 creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
86 toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(), ModelAPI_AttributeDouble, /** To size */,
87 fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(), ModelAPI_AttributeDouble, /** From size */,
88 toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
89 toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
90 fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
91 fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */)
93 /// Modify base attribute of the feature.
95 void setNestedSketch(const ModelHighAPI_Reference& theSketch);
97 /// Modify base attribute of the feature.
99 void setBase(const std::list<ModelHighAPI_Selection>& theBaseObjects);
101 /// Modify direction_object attribute of the feature.
103 void setDirection(const ModelHighAPI_Selection& theDirection);
105 /// Modify CreationMethod, to_size, from_size attributes of the feature.
107 void setSizes(const ModelHighAPI_Double& theToSize, const ModelHighAPI_Double& theFromSize);
109 /// Modify creation_method, to_size, from_size attributes of the feature.
111 void setSize(const ModelHighAPI_Double& theSize);
113 /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
115 void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
116 const ModelHighAPI_Double& theToOffset,
117 const ModelHighAPI_Selection& theFromObject,
118 const ModelHighAPI_Double& theFromOffset);
120 /// Dump wrapped feature
122 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
125 void execIfBaseNotEmpty();
128 /// Pointer on Extrusion object.
129 typedef std::shared_ptr<FeaturesAPI_Extrusion> ExtrusionPtr;
131 /// \ingroup CPPHighAPI
132 /// \brief Create Extrusion feature.
134 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
135 const std::list<ModelHighAPI_Selection>& theBaseObjects,
136 const ModelHighAPI_Double& theSize);
138 /// \ingroup CPPHighAPI
139 /// \brief Create Extrusion feature.
141 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
142 const std::list<ModelHighAPI_Selection>& theBaseObjects,
143 const ModelHighAPI_Selection& theDirection,
144 const ModelHighAPI_Double& theSize);
146 /// \ingroup CPPHighAPI
147 /// \brief Create Extrusion feature.
149 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
150 const std::list<ModelHighAPI_Selection>& theBaseObjects,
151 const ModelHighAPI_Double& theToSize,
152 const ModelHighAPI_Double& theFromSize);
154 /// \ingroup CPPHighAPI
155 /// \brief Create Extrusion feature.
157 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
158 const std::list<ModelHighAPI_Selection>& theBaseObjects,
159 const ModelHighAPI_Selection& theDirection,
160 const ModelHighAPI_Double& theToSize,
161 const ModelHighAPI_Double& theFromSize);
163 /// \ingroup CPPHighAPI
164 /// \brief Create Extrusion feature.
166 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
167 const std::list<ModelHighAPI_Selection>& theBaseObjects,
168 const ModelHighAPI_Selection& theToObject,
169 const ModelHighAPI_Double& theToOffset,
170 const ModelHighAPI_Selection& theFromObject,
171 const ModelHighAPI_Double& theFromOffset);
173 /// \ingroup CPPHighAPI
174 /// \brief Create Extrusion feature.
176 ExtrusionPtr addExtrusion(const std::shared_ptr<ModelAPI_Document>& thePart,
177 const std::list<ModelHighAPI_Selection>& theBaseObjects,
178 const ModelHighAPI_Selection& theDirection,
179 const ModelHighAPI_Selection& theToObject,
180 const ModelHighAPI_Double& theToOffset,
181 const ModelHighAPI_Selection& theFromObject,
182 const ModelHighAPI_Double& theFromOffset);
184 #endif // FeaturesAPI_Extrusion_H_