X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConstructionPlugin%2FConstructionPlugin_Axis.h;h=1775300ebda82e65cbdd043fdc84073e78d6eb35;hb=13d3f0d8b46a06931cbe8620b8563049eff4a9f6;hp=81e1b02b3749144fa9cea3a76c977110708efa4a;hpb=0887f6ca0aa6d2f2d5e2e31e175b1aed470c02e9;p=modules%2Fshaper.git diff --git a/src/ConstructionPlugin/ConstructionPlugin_Axis.h b/src/ConstructionPlugin/ConstructionPlugin_Axis.h index 81e1b02b3..1775300eb 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Axis.h +++ b/src/ConstructionPlugin/ConstructionPlugin_Axis.h @@ -9,20 +9,9 @@ #include "ConstructionPlugin.h" #include +#include #include - -/// Point kind -const std::string CONSTRUCTION_AXIS_KIND("Axis"); - -/// attribute name for first point -const std::string POINT_ATTR_FIRST = "firstPoint"; - -/// attribute name for second point -const std::string POINT_ATTR_SECOND = "secondPoint"; - -#define CONSTRUCTION_AXIS_COLOR "#000000" - /**\class ConstructionPlugin_Axis * \ingroup Plugins * \brief Feature for creation of the new axis in PartSet. @@ -33,10 +22,44 @@ class ConstructionPlugin_Axis : public ModelAPI_Feature, public GeomAPI_ICustomP /// Returns the kind of a feature CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getKind() { - static std::string MY_KIND = CONSTRUCTION_AXIS_KIND; + static std::string MY_KIND = ConstructionPlugin_Axis::ID(); return MY_KIND; } + /// Axis kind + inline static const std::string& ID() + { + static const std::string CONSTRUCTION_AXIS_KIND("Axis"); + return CONSTRUCTION_AXIS_KIND; + } + + /// attribute name for first point + inline static const std::string& METHOD() + { + static const std::string METHOD_ATTR("CreationMethod"); + return METHOD_ATTR; + } + /// attribute name for first point + inline static const std::string& POINT_FIRST() + { + static const std::string POINT_ATTR_FIRST("FirstPoint"); + return POINT_ATTR_FIRST; + } + /// attribute name for second point + inline static const std::string& POINT_SECOND() + { + static const std::string POINT_ATTR_SECOND("SecondPoint"); + return POINT_ATTR_SECOND; + } + /// attribute name for second point + inline static const std::string& CYLINDRICAL_FACE() + { + static const std::string CYLINDRICAL_FACE_ATTR("CylindricalFace"); + return CYLINDRICAL_FACE_ATTR; + } + + inline static const double MINIMAL_LENGTH() { return 1.e-5; } + /// Creates a new part document if needed CONSTRUCTIONPLUGIN_EXPORT virtual void execute(); @@ -50,8 +73,13 @@ class ConstructionPlugin_Axis : public ModelAPI_Feature, public GeomAPI_ICustomP ConstructionPlugin_Axis(); /// Customize presentation of the feature - virtual void customisePresentation(AISObjectPtr thePrs); + virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs, + std::shared_ptr theDefaultPrs); + + protected: + void createAxisByTwoPoints(); + void createAxisByCylindricalFace(); }; -#endif \ No newline at end of file +#endif