20 #ifndef SketchPlugin_Projection_H_
21 #define SketchPlugin_Projection_H_
23 #include "SketchPlugin_SketchEntity.h"
35 inline static const std::string&
ID()
37 static const std::string MY_PROJECTION_ID(
"SketchProjection");
38 return MY_PROJECTION_ID;
47 static const std::string& EXTERNAL_FEATURE_ID()
49 static std::string MY_EXT_FEATURE_ID(
"ExternalFeature");
50 return MY_EXT_FEATURE_ID;
53 static const std::string& PROJECTED_FEATURE_ID()
55 static std::string MY_PROJ_FEATURE_ID(
"ProjectedFeature");
56 return MY_PROJ_FEATURE_ID;
59 static const std::string& INCLUDE_INTO_RESULT()
61 static std::string MY_INCLUDE(
"IncludeToResult");
65 static const std::string& KEEP_REFERENCE_ID()
67 static std::string
ID(
"keep_reference");
71 static const std::string& MAKE_FIXED()
73 static std::string
ID(
"make_fixed");
77 static const std::string& FIXED_CONSTRAINT_ID()
79 static std::string
ID(
"fixed_constraint");
95 SKETCHPLUGIN_EXPORT
virtual void execute();
103 SKETCHPLUGIN_EXPORT
virtual bool isMacro()
const;
117 void computeProjection(
const std::string& theID);
120 bool projectPoint(FeaturePtr& theProjection,
const std::shared_ptr<GeomAPI_Pnt>& thePoint);
122 bool projectSegment(FeaturePtr& theProjection,
const std::shared_ptr<GeomAPI_Edge>& theEdge);
124 bool projectEdge(FeaturePtr& theProjection,
const std::shared_ptr<GeomAPI_Edge>& theEdge);
127 bool fillArc(FeaturePtr& theProjection,
128 const std::shared_ptr<GeomAPI_Curve>& theArc,
129 const std::shared_ptr<GeomAPI_Pln>& thePlane,
130 const std::shared_ptr<GeomAPI_Edge>& theOriginalEdge);
132 bool fillCircle(FeaturePtr& theProjection,
133 const std::shared_ptr<GeomAPI_Curve>& theCircle,
134 const std::shared_ptr<GeomAPI_Pln>& thePlane);
136 bool fillEllipse(FeaturePtr& theProjection,
137 const std::shared_ptr<GeomAPI_Curve>& theEllipse,
138 const std::shared_ptr<GeomAPI_Pln>& thePlane);
140 bool fillEllipticArc(FeaturePtr& theProjection,
141 const std::shared_ptr<GeomAPI_Curve>& theEllipticArc,
142 const std::shared_ptr<GeomAPI_Pln>& thePlane,
143 const std::shared_ptr<GeomAPI_Edge>& theOriginalEdge);
145 bool fillBSpline(FeaturePtr& theProjection,
146 const std::shared_ptr<GeomAPI_Curve>& theCurve,
147 const std::shared_ptr<GeomAPI_Pln>& thePlane);
155 bool rebuildProjectedFeature(FeaturePtr& theProjection,
156 const std::set<std::string>& theSupportedTypes,
157 const std::string& theRequestedFeature = std::string());
Interface to the generic curve object.
Definition: GeomAPI_Curve.h:34
Feature for creation of external feature as a projection onto the sketch plane.
Definition: SketchPlugin_Projection.h:32
virtual void initDerivedClassAttributes()
Initializes attributes of derived class.
Definition: SketchPlugin_Projection.cpp:77
virtual void attributeChanged(const std::string &theID)
Called on change of any argument-attribute of this object: for external point.
Definition: SketchPlugin_Projection.cpp:143
virtual const std::string & getKind()
Returns the kind of a feature.
Definition: SketchPlugin_Projection.h:41
virtual void initDerivedClassAttributes2()
Initializes attributes of keeping the reference to the original shape.
Definition: SketchPlugin_Projection.cpp:92
SketchPlugin_Projection()
Use plugin manager for features creation.
Definition: SketchPlugin_Projection.cpp:71
virtual void execute()
Creates a new part document if needed.
Definition: SketchPlugin_Projection.cpp:108
virtual bool isFixed()
Returns true because projected feature is always external.
Definition: SketchPlugin_Projection.h:84
virtual bool canBeDisplayed() const
Returns true if the feature and the feature results can be displayed.
Definition: SketchPlugin_Projection.h:89
static const std::string & ID()
Projection feature kind.
Definition: SketchPlugin_Projection.h:35
virtual bool isMacro() const
Returns true if this feature is used as macro: creates other features and then removed.
Definition: SketchPlugin_Projection.cpp:133
Sketch Entity for creation of the new feature in PartSet.
Definition: SketchPlugin_SketchEntity.h:45