20 #ifndef SketchPlugin_Offset_H_
21 #define SketchPlugin_Offset_H_
23 #include <SketchPlugin.h>
24 #include <SketchPlugin_ConstraintBase.h>
26 #include <GeomDataAPI_Point2D.h>
28 #include <GeomAPI_Edge.h>
42 inline static const std::string&
ID()
44 static const std::string
ID(
"SketchOffset");
49 SKETCHPLUGIN_EXPORT
virtual const std::string&
getKind()
58 static const std::string
ID(
"offset_joint");
65 static const std::string
ID(
"KeepDistance");
72 static const std::string
ID(
"Arcs");
79 static const std::string
ID(
"Lines");
86 static const std::string
ID(
"segments");
93 static const std::string
ID(
"offset_value");
100 static const std::string
ID(
"reversed");
107 static const std::string
ID(
"approx");
114 static const std::string
ID(
"add_wire");
119 SKETCHPLUGIN_EXPORT
virtual void attributeChanged(
const std::string& theID);
122 SKETCHPLUGIN_EXPORT
virtual void execute();
131 SKETCHPLUGIN_EXPORT
virtual bool customAction(
const std::string& theActionId);
134 SKETCHPLUGIN_EXPORT
virtual AISObjectPtr
getAISObject(AISObjectPtr thePrevious);
150 void addToSketch (
const std::list< std::shared_ptr<GeomAlgoAPI_MakeShape> >& theOffsetAlgos);
153 void mkBSpline (FeaturePtr& theResult,
const GeomEdgePtr& theEdge,
154 std::list<ObjectPtr>& thePoolOfFeatures);
160 void updateExistentOrCreateNew (
const GeomShapePtr& theShape, FeaturePtr& theFeature,
161 std::list<ObjectPtr>& thePoolOfFeatures);
173 bool findWireOneWay (
const FeaturePtr& theFirstEdge,
174 const FeaturePtr& theEdge,
175 const std::shared_ptr<GeomDataAPI_Point2D>& theEndPoint,
176 std::set<FeaturePtr>& theEdgesSet,
177 std::set<FeaturePtr>& theProcessedEdgesSet,
178 std::list<FeaturePtr>& theChain,
179 const bool isPrepend =
false);
181 void makeFillet (
const double theValue,
182 const std::shared_ptr<GeomAlgoAPI_WireBuilder>&,
183 const std::shared_ptr<GeomAlgoAPI_Offset>&,
184 std::list< std::shared_ptr<GeomAlgoAPI_MakeShape> >& theOffsetAlgos);
Interface to the root class of all topological shapes constructions.
Definition: GeomAlgoAPI_MakeShape.h:35
Perform 3D offset for the shape.
Definition: GeomAlgoAPI_Offset.h:42
Allows to create wire-shapes by different parameters.
Definition: GeomAlgoAPI_WireBuilder.h:32
Feature for creation of a new constraint between other features.
Definition: SketchPlugin_ConstraintBase.h:56
Builds offset curves in the sketch.
Definition: SketchPlugin_Offset.h:39
virtual SKETCHPLUGIN_EXPORT bool customAction(const std::string &theActionId)
Find edges connected by coincident boundary constraint and composing a wire with the already selected...
Definition: SketchPlugin_Offset.cpp:767
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 & JOINT_ARCS()
Arcs joint (make fillets on all straight lines intersections)
Definition: SketchPlugin_Offset.h:70
static const std::string & VALUE_ID()
attribute to store the offset value
Definition: SketchPlugin_Offset.h:91
virtual void initAttributes()
Initializes attributes of derived class.
Definition: SketchPlugin_Offset.cpp:76
SketchPlugin_Offset()
Use plugin manager for features creation.
Definition: SketchPlugin_Offset.cpp:72
virtual SKETCHPLUGIN_EXPORT AISObjectPtr getAISObject(AISObjectPtr thePrevious)
Returns the AIS preview.
Definition: SketchPlugin_Offset.cpp:839
static const std::string & JOINT_ID()
Type of joint.
Definition: SketchPlugin_Offset.h:56
static const std::string & JOINT_LINES()
Lines joint (do not add new arcs, prolongate and intersect adjacent lines)
Definition: SketchPlugin_Offset.h:77
static const std::string & REVERSED_ID()
attribute to store the reversed offset direction
Definition: SketchPlugin_Offset.h:98
static const std::string & ADD_WIRE_ACTION_ID()
name for add wire action
Definition: SketchPlugin_Offset.h:112
virtual SKETCHPLUGIN_EXPORT const std::string & getKind()
Returns the kind of a feature.
Definition: SketchPlugin_Offset.h:49
static const std::string & ID()
Offset macro feature kind.
Definition: SketchPlugin_Offset.h:42
virtual SKETCHPLUGIN_EXPORT bool isPreviewNeeded() const
Returns true if preview update during the edition needed.
Definition: SketchPlugin_Offset.h:124
virtual SKETCHPLUGIN_EXPORT void execute()
Creates a new part document if needed.
Definition: SketchPlugin_Offset.cpp:140
virtual SKETCHPLUGIN_EXPORT void attributeChanged(const std::string &theID)
Called on change of any argument-attribute of this object.
Definition: SketchPlugin_Offset.cpp:742
static const std::string & JOINT_KEEP_DISTANCE()
Keep distance joint (add arcs where needed)
Definition: SketchPlugin_Offset.h:63