Salome HOME
b4d9ca9a2cb26800a233985320b9a6f3a2d52c2d
[modules/shaper.git] / src / SketchAPI / SketchAPI_Offset.h
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
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                    bool theIsReversed);
54   /// Destructor
55   SKETCHAPI_EXPORT
56   virtual ~SketchAPI_Offset();
57
58   INTERFACE_3(SketchPlugin_Offset::ID(),
59
60               edgesList, SketchPlugin_Offset::EDGES_ID(),
61               ModelAPI_AttributeRefList, /** Offset edges list */,
62
63               value, SketchPlugin_Offset::VALUE_ID(),
64               ModelAPI_AttributeDouble, /** Value */,
65
66               reversed, SketchPlugin_Offset::REVERSED_ID(),
67               ModelAPI_AttributeBoolean, /** Negative value */
68               )
69
70   /// List of created objects
71   SKETCHAPI_EXPORT
72   std::list<std::shared_ptr<SketchAPI_SketchEntity> > offset() const;
73
74   /// Dump wrapped feature
75   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
76 };
77
78 //! Pointer on Offset object
79 typedef std::shared_ptr<SketchAPI_Offset> OffsetPtr;
80
81 //--------------------------------------------------------------------------------------
82 //--------------------------------------------------------------------------------------
83 #endif /* SRC_SKETCHAPI_SKETCHAPI_OFFSET_H_ */