Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom.git into Dev_1.1.0
[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   /// default color for a plane
31   inline static const std::string& DEFAULT_COLOR()
32   {
33     static const std::string CONSTRUCTION_PLANE_COLOR("#32FF32");
34     return CONSTRUCTION_PLANE_COLOR;
35   }
36
37   /// Plane kind
38   inline static const std::string& ID()
39   {
40     static const std::string CONSTRUCTION_PLANE_KIND("Plane");
41     return CONSTRUCTION_PLANE_KIND;
42   }
43   /// attribute name for base face
44   inline static const std::string& FACE()
45   {
46     static const std::string FACE_ATTR("planeFace");
47     return FACE_ATTR;
48   }
49   /// attribute name for distance
50   inline static const std::string& DISTANCE()
51   {
52     static const std::string DISTANCE_ATTR("distance");
53     return DISTANCE_ATTR;
54   }
55
56   /// the a parameter for the general equation of a plane (ax+by+cz+d=0)
57   inline static const std::string& A()
58   {
59     static const std::string PARAM_A_ATTR("A");
60     return PARAM_A_ATTR;
61   }
62   /// the b parameter for the general equation of a plane (ax+by+cz+d=0)
63   inline static const std::string& B()
64   {
65     static const std::string PARAM_B_ATTR("B");
66     return PARAM_B_ATTR;
67   }
68   /// the c parameter for the general equation of a plane (ax+by+cz+d=0)
69   inline static const std::string& C()
70   {
71     static const std::string PARAM_C_ATTR("C");
72     return PARAM_C_ATTR;
73   }
74   /// the d parameter for the general equation of a plane (ax+by+cz+d=0)
75   inline static const std::string& D()
76   {
77     static const std::string PARAM_D_ATTR("D");
78     return PARAM_D_ATTR;
79   }
80
81   /// Creates a new part document if needed
82   CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
83
84   /// Request for initialization of data model of the feature: adding all attributes
85   CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
86
87   /// Construction result is always recomputed on the fly
88   CONSTRUCTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
89
90   /// Use plugin manager for features creation
91   ConstructionPlugin_Plane();
92
93   /// Customize presentation of the feature
94   virtual void customisePresentation(AISObjectPtr thePrs);
95 };
96
97 #endif