SHAPER  9.12.0
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;
37 //--------------------------------------------------------------------------------------
43 {
44 public:
46  SKETCHAPI_EXPORT
47  explicit SketchAPI_Offset(const std::shared_ptr<ModelAPI_Feature> & theFeature);
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  const bool theIsApprox = false);
57  SKETCHAPI_EXPORT
58  virtual ~SketchAPI_Offset();
59 
60  INTERFACE_5(SketchPlugin_Offset::ID(),
61 
64 
67 
70 
73 
76  )
77 
78 
79  SKETCHAPI_EXPORT
80  std::list<std::shared_ptr<SketchAPI_SketchEntity> > offset() const;
81 
83  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
84 };
85 
87 typedef std::shared_ptr<SketchAPI_Offset> OffsetPtr;
88 
89 //--------------------------------------------------------------------------------------
90 //--------------------------------------------------------------------------------------
91 #endif /* SRC_SKETCHAPI_SKETCHAPI_OFFSET_H_ */
Attribute that contains boolean value.
Definition: ModelAPI_AttributeBoolean.h:31
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
Attribute that contains list of references to features (located in the same document).
Definition: ModelAPI_AttributeRefList.h:33
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Represents any object in the data model and in the object browser.
Definition: ModelAPI_Object.h:45
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_AttributeRefAttr.
Definition: ModelHighAPI_RefAttr.h:41
Interface for Offset feature.
Definition: SketchAPI_Offset.h:43
virtual std::shared_ptr< ModelAPI_AttributeRefList > edgesList() const
Offset edges list.
Definition: SketchAPI_Offset.h:76
std::list< std::shared_ptr< SketchAPI_SketchEntity > > offset() const
List of created objects.
Definition: SketchAPI_Offset.cpp:57
virtual std::shared_ptr< ModelAPI_AttributeDouble > value() const
Value.
Definition: SketchAPI_Offset.h:76
virtual std::shared_ptr< ModelAPI_AttributeBoolean > reversed() const
Negative value.
Definition: SketchAPI_Offset.h:76
virtual std::shared_ptr< ModelAPI_AttributeString > joint() const
Joint type.
Definition: SketchAPI_Offset.h:76
SketchAPI_Offset(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: SketchAPI_Offset.cpp:28
virtual std::shared_ptr< ModelAPI_AttributeBoolean > approx() const
Negative value.
Definition: SketchAPI_Offset.h:76
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: SketchAPI_Offset.cpp:71
virtual ~SketchAPI_Offset()
Destructor.
Definition: SketchAPI_Offset.cpp:53
Base class for Sketch feature interfaces.
Definition: SketchAPI_SketchEntity.h:38
static const std::string & APPROX_ID()
attribute to approx by segments and arcs
Definition: SketchPlugin_Offset.h:105
static const std::string & EDGES_ID()
list of offset edges
Definition: SketchPlugin_Offset.h:84
static const std::string & VALUE_ID()
attribute to store the offset value
Definition: SketchPlugin_Offset.h:91
static const std::string & JOINT_ID()
Type of joint.
Definition: SketchPlugin_Offset.h:56
static const std::string & REVERSED_ID()
attribute to store the reversed offset direction
Definition: SketchPlugin_Offset.h:98
static const std::string & ID()
Offset macro feature kind.
Definition: SketchPlugin_Offset.h:42
static const std::string & JOINT_KEEP_DISTANCE()
Keep distance joint (add arcs where needed)
Definition: SketchPlugin_Offset.h:63