Salome HOME
updated copyright message
[modules/shaper.git] / src / SketchAPI / SketchAPI_Offset.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 SRC_SKETCHAPI_SKETCHAPI_OFFSET_H_
21 #define SRC_SKETCHAPI_SKETCHAPI_OFFSET_H_
22
23 //--------------------------------------------------------------------------------------
24 #include "SketchAPI.h"
25 #include "SketchAPI_SketchEntity.h"
26
27 #include <list>
28
29 #include <SketchPlugin_Offset.h>
30
31 #include <ModelHighAPI_Interface.h>
32 #include <ModelHighAPI_Macro.h>
33 //--------------------------------------------------------------------------------------
34 class ModelAPI_Object;
35 class ModelHighAPI_RefAttr;
36 class ModelHighAPI_Double;
37 //--------------------------------------------------------------------------------------
38 /**\class SketchAPI_Offset
39  * \ingroup CPPHighAPI
40  * \brief Interface for Offset feature
41  */
42 class SketchAPI_Offset : public ModelHighAPI_Interface
43 {
44 public:
45   /// Constructor without values
46   SKETCHAPI_EXPORT
47   explicit SketchAPI_Offset(const std::shared_ptr<ModelAPI_Feature> & theFeature);
48   /// Constructor with values
49   SKETCHAPI_EXPORT
50   SketchAPI_Offset(const std::shared_ptr<ModelAPI_Feature> & theFeature,
51                    const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
52                    const ModelHighAPI_Double & theOffsetValue,
53                    const bool theIsReversed = false,
54                    const std::string & theJointType = SketchPlugin_Offset::JOINT_KEEP_DISTANCE());
55   /// Destructor
56   SKETCHAPI_EXPORT
57   virtual ~SketchAPI_Offset();
58
59   INTERFACE_4(SketchPlugin_Offset::ID(),
60
61               edgesList, SketchPlugin_Offset::EDGES_ID(),
62               ModelAPI_AttributeRefList, /** Offset edges list */,
63
64               value, SketchPlugin_Offset::VALUE_ID(),
65               ModelAPI_AttributeDouble, /** Value */,
66
67               reversed, SketchPlugin_Offset::REVERSED_ID(),
68               ModelAPI_AttributeBoolean, /** Negative value */,
69
70               joint, SketchPlugin_Offset::JOINT_ID(),
71               ModelAPI_AttributeString, /** Joint type */
72               )
73
74   /// List of created objects
75   SKETCHAPI_EXPORT
76   std::list<std::shared_ptr<SketchAPI_SketchEntity> > offset() const;
77
78   /// Dump wrapped feature
79   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
80 };
81
82 //! Pointer on Offset object
83 typedef std::shared_ptr<SketchAPI_Offset> OffsetPtr;
84
85 //--------------------------------------------------------------------------------------
86 //--------------------------------------------------------------------------------------
87 #endif /* SRC_SKETCHAPI_SKETCHAPI_OFFSET_H_ */