1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ConstructionPlugin_Plane.h
4 // Created: 12 Dec 2014
5 // Author: Vitaly Smetannikov
7 #ifndef ConstructionPlugin_Plane_H
8 #define ConstructionPlugin_Plane_H
10 #include "ConstructionPlugin.h"
11 #include <ModelAPI_Feature.h>
12 #include <GeomAPI_ICustomPrs.h>
16 /**\class ConstructionPlugin_Plane
18 * \brief Feature for creation of the new planar surface in PartSet.
20 class ConstructionPlugin_Plane : public ModelAPI_Feature, public GeomAPI_ICustomPrs
23 /// Returns the kind of a feature
24 CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getKind()
26 static std::string MY_KIND = ConstructionPlugin_Plane::ID();
30 /// default color for a plane
31 inline static const std::string& DEFAULT_COLOR()
33 static const std::string CONSTRUCTION_PLANE_COLOR("#32FF32");
34 return CONSTRUCTION_PLANE_COLOR;
38 inline static const std::string& ID()
40 static const std::string CONSTRUCTION_PLANE_KIND("Plane");
41 return CONSTRUCTION_PLANE_KIND;
43 /// attribute name for base face
44 inline static const std::string& FACE()
46 static const std::string FACE_ATTR("planeFace");
49 /// attribute name for distance
50 inline static const std::string& DISTANCE()
52 static const std::string DISTANCE_ATTR("distance");
56 /// the a parameter for the general equation of a plane (ax+by+cz+d=0)
57 inline static const std::string& A()
59 static const std::string PARAM_A_ATTR("A");
62 /// the b parameter for the general equation of a plane (ax+by+cz+d=0)
63 inline static const std::string& B()
65 static const std::string PARAM_B_ATTR("B");
68 /// the c parameter for the general equation of a plane (ax+by+cz+d=0)
69 inline static const std::string& C()
71 static const std::string PARAM_C_ATTR("C");
74 /// the d parameter for the general equation of a plane (ax+by+cz+d=0)
75 inline static const std::string& D()
77 static const std::string PARAM_D_ATTR("D");
81 /// Creates a new part document if needed
82 CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
84 /// Request for initialization of data model of the feature: adding all attributes
85 CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
87 /// Construction result is always recomputed on the fly
88 CONSTRUCTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
90 /// Use plugin manager for features creation
91 ConstructionPlugin_Plane();
93 /// Customize presentation of the feature
94 virtual void customisePresentation(AISObjectPtr thePrs);