1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ConstructionPlugin_Axis.h
4 // Created: 12 Dec 2014
5 // Author: Vitaly Smetannikov
7 #ifndef ConstructionPlugin_Axis_H
8 #define ConstructionPlugin_Axis_H
10 #include "ConstructionPlugin.h"
11 #include <ModelAPI_Feature.h>
12 #include <GeomAPI_ICustomPrs.h>
14 /**\class ConstructionPlugin_Axis
16 * \brief Feature for creation of the new axis in PartSet.
18 class ConstructionPlugin_Axis : public ModelAPI_Feature, public GeomAPI_ICustomPrs
21 /// Returns the kind of a feature
22 CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getKind()
24 static std::string MY_KIND = ConstructionPlugin_Axis::ID();
29 inline static const std::string& ID()
31 static const std::string CONSTRUCTION_AXIS_KIND("Axis");
32 return CONSTRUCTION_AXIS_KIND;
35 /// attribute name for first point
36 inline static const std::string& METHOD()
38 static const std::string METHOD_ATTR("creationMethod");
41 /// attribute name for first point
42 inline static const std::string& POINT_FIRST()
44 static const std::string POINT_ATTR_FIRST("firstPoint");
45 return POINT_ATTR_FIRST;
47 /// attribute name for second point
48 inline static const std::string& POINT_SECOND()
50 static const std::string POINT_ATTR_SECOND("secondPoint");
51 return POINT_ATTR_SECOND;
53 /// attribute name for second point
54 inline static const std::string& CYLINDRICAL_FACE()
56 static const std::string CYLINDRICAL_FACE_ATTR("cylindricalFace");
57 return CYLINDRICAL_FACE_ATTR;
59 /// default color for an axis
60 inline static const std::string& DEFAULT_COLOR()
62 static const std::string CONSTRUCTION_AXIS_COLOR("#000000");
63 return CONSTRUCTION_AXIS_COLOR;
66 inline static const double MINIMAL_LENGTH() { return 1.e-5; }
68 /// Creates a new part document if needed
69 CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
71 /// Request for initialization of data model of the feature: adding all attributes
72 CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
74 /// Construction result is allways recomuted on the fly
75 CONSTRUCTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
77 /// Use plugin manager for features creation
78 ConstructionPlugin_Axis();
80 /// Customize presentation of the feature
81 virtual void customisePresentation(AISObjectPtr thePrs);