Salome HOME
"Initialization" plugin: plugin and it's features stubs created
[modules/shaper.git] / src / ConstructionPlugin / ConstructionPlugin_Plane.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ConstructionPlugin_Plane.h
4 // Created:     12 Dec 2014
5 // Author:      Vitaly Smetannikov
6
7 #ifndef ConstructionPlugin_Plane_H
8 #define ConstructionPlugin_Plane_H
9
10 #include "ConstructionPlugin.h"
11 #include <ModelAPI_Feature.h>
12 #include <GeomAPI_ICustomPrs.h>
13
14
15
16 /**\class ConstructionPlugin_Plane
17  * \ingroup Plugins
18  * \brief Feature for creation of the new planar surface in PartSet.
19  */
20 class ConstructionPlugin_Plane : public ModelAPI_Feature, public GeomAPI_ICustomPrs
21 {
22  public:
23   /// Returns the kind of a feature
24   CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getKind()
25   {
26     static std::string MY_KIND = ConstructionPlugin_Plane::ID();
27     return MY_KIND;
28   }
29
30   /// Plane kind
31   inline static const std::string& ID()
32   {
33     static const std::string CONSTRUCTION_PLANE_KIND("Plane");
34     return CONSTRUCTION_PLANE_KIND;
35   }
36   /// attribute name for base face
37   inline static const std::string& FACE()
38   {
39     static const std::string FACE_ATTR("planeFace");
40     return FACE_ATTR;
41   }
42   /// attribute name for distance
43   inline static const std::string& DISTANCE()
44   {
45     static const std::string DISTANCE_ATTR("distance");
46     return DISTANCE_ATTR;
47   }
48
49   /// the a parameter for the general equation of a plane (ax+by+cz+d=0)
50   inline static const std::string& A()
51   {
52     static const std::string PARAM_A_ATTR("A");
53     return PARAM_A_ATTR;
54   }
55   /// the b parameter for the general equation of a plane (ax+by+cz+d=0)
56   inline static const std::string& B()
57   {
58     static const std::string PARAM_B_ATTR("B");
59     return PARAM_B_ATTR;
60   }
61   /// the c parameter for the general equation of a plane (ax+by+cz+d=0)
62   inline static const std::string& C()
63   {
64     static const std::string PARAM_C_ATTR("C");
65     return PARAM_C_ATTR;
66   }
67   /// the d parameter for the general equation of a plane (ax+by+cz+d=0)
68   inline static const std::string& D()
69   {
70     static const std::string PARAM_D_ATTR("D");
71     return PARAM_D_ATTR;
72   }
73
74   /// Creates a new part document if needed
75   CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
76
77   /// Request for initialization of data model of the feature: adding all attributes
78   CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
79
80   /// Construction result is always recomputed on the fly
81   CONSTRUCTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
82
83   /// Use plugin manager for features creation
84   ConstructionPlugin_Plane();
85
86   /// Customize presentation of the feature
87   virtual void customisePresentation(AISObjectPtr thePrs);
88 };
89
90 #endif