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 /// Returns true if the feature and the feature results can be displayed.
50 SKETCHPLUGIN_EXPORT virtual bool canBeDisplayed() const
55 /// Creates a new part document if needed
56 SKETCHPLUGIN_EXPORT virtual void execute();
59 /// \param theDeltaX the delta for X coordinate is moved
60 /// \param theDeltaY the delta for Y coordinate is moved
61 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
63 /// Called on change of any argument-attribute of this object: for external point
64 SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
66 /// Use plugin manager for features creation
67 SketchPlugin_Projection();
70 /// \brief Initializes attributes of derived class.
71 virtual void initDerivedClassAttributes();
74 /// \brief Find projection of a feature onto sketch plane
75 void computeProjection(const std::string& theID);