1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: SketchPlugin_Projection.h
4 // Created: 20 April 2016
5 // Author: Artem ZHIDKOV
7 #ifndef SketchPlugin_Projection_H_
8 #define SketchPlugin_Projection_H_
10 #include "SketchPlugin_SketchEntity.h"
12 /** \class SketchPlugin_Projection
14 * \brief Feature for creation of external feature as a projection onto the sketch plane.
16 class SketchPlugin_Projection : public SketchPlugin_SketchEntity
19 /// Projection feature kind
20 inline static const std::string& ID()
22 static const std::string MY_PROJECTION_ID("SketchProjection");
23 return MY_PROJECTION_ID;
25 /// Returns the kind of a feature
26 virtual const std::string& getKind()
28 static std::string MY_KIND = SketchPlugin_Projection::ID();
32 static const std::string& EXTERNAL_FEATURE_ID()
34 static std::string MY_EXT_FEATURE_ID("ExternalFeature");
35 return MY_EXT_FEATURE_ID;
38 static const std::string& PROJECTED_FEATURE_ID()
40 static std::string MY_PROJ_FEATURE_ID("ProjectedFeature");
41 return MY_PROJ_FEATURE_ID;
44 /// Returns true because projected feature is always external
45 virtual bool isFixed()
48 /// Creates a new part document if needed
49 SKETCHPLUGIN_EXPORT virtual void execute();
52 /// \param theDeltaX the delta for X coordinate is moved
53 /// \param theDeltaY the delta for Y coordinate is moved
54 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
56 /// Called on change of any argument-attribute of this object: for external point
57 SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
59 /// Use plugin manager for features creation
60 SketchPlugin_Projection();
63 /// \brief Initializes attributes of derived class.
64 virtual void initDerivedClassAttributes();
67 /// \brief Find projection of a feature onto sketch plane
68 void computeProjection(const std::string& theID);