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 <ModelAPI_Result.h>
13 #include <GeomAPI_ICustomPrs.h>
17 /**\class ConstructionPlugin_Plane
19 * \brief Feature for creation of the new planar surface in PartSet.
21 class ConstructionPlugin_Plane : public ModelAPI_Feature, public GeomAPI_ICustomPrs
24 /// Returns the kind of a feature
25 CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getKind()
27 static std::string MY_KIND = ConstructionPlugin_Plane::ID();
31 /// default color for a plane
32 inline static const std::string& DEFAULT_COLOR()
34 static const std::string CONSTRUCTION_PLANE_COLOR("#32FF32");
35 return CONSTRUCTION_PLANE_COLOR;
39 inline static const std::string& ID()
41 static const std::string CONSTRUCTION_PLANE_KIND("Plane");
42 return CONSTRUCTION_PLANE_KIND;
44 /// attribute name for base face
45 inline static const std::string& FACE()
47 static const std::string FACE_ATTR("planeFace");
50 /// attribute name for distance
51 inline static const std::string& DISTANCE()
53 static const std::string DISTANCE_ATTR("distance");
57 /// the a parameter for the general equation of a plane (ax+by+cz+d=0)
58 inline static const std::string& A()
60 static const std::string PARAM_A_ATTR("A");
63 /// the b parameter for the general equation of a plane (ax+by+cz+d=0)
64 inline static const std::string& B()
66 static const std::string PARAM_B_ATTR("B");
69 /// the c parameter for the general equation of a plane (ax+by+cz+d=0)
70 inline static const std::string& C()
72 static const std::string PARAM_C_ATTR("C");
75 /// the d parameter for the general equation of a plane (ax+by+cz+d=0)
76 inline static const std::string& D()
78 static const std::string PARAM_D_ATTR("D");
82 /// Creates a new part document if needed
83 CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
85 /// Request for initialization of data model of the feature: adding all attributes
86 CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
88 /// Construction result is always recomputed on the fly
89 CONSTRUCTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
91 /// Use plugin manager for features creation
92 ConstructionPlugin_Plane();
94 /// Customize presentation of the feature
95 virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
96 std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs);