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;
34 /// attribute name for first point
35 inline static const std::string& POINT_FIRST()
37 static const std::string POINT_ATTR_FIRST("firstPoint");
38 return POINT_ATTR_FIRST;
40 /// attribute name for second point
41 inline static const std::string& POINT_SECOND()
43 static const std::string POINT_ATTR_SECOND("secondPoint");
44 return POINT_ATTR_SECOND;
46 /// default color for an axis
47 inline static const std::string& DEFAULT_COLOR()
49 static const std::string CONSTRUCTION_AXIS_COLOR("#000000");
50 return CONSTRUCTION_AXIS_COLOR;
53 inline static const double MINIMAL_LENGTH() { return 1.e-5; }
55 /// Creates a new part document if needed
56 CONSTRUCTIONPLUGIN_EXPORT virtual void execute();
58 /// Request for initialization of data model of the feature: adding all attributes
59 CONSTRUCTIONPLUGIN_EXPORT virtual void initAttributes();
61 /// Construction result is allways recomuted on the fly
62 CONSTRUCTIONPLUGIN_EXPORT virtual bool isPersistentResult() {return false;}
64 /// Use plugin manager for features creation
65 ConstructionPlugin_Axis();
67 /// Customize presentation of the feature
68 virtual void customisePresentation(AISObjectPtr thePrs);