X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Feature.h;h=b8437dcbcaf7c3674d2399bc47ac87a5d4171668;hb=2e9c8b6bbbc29447cd5c68e9ca9f341d022bdd1b;hp=2f4c3aaf17fd94aba30aaf0180fa38cfe00a25f2;hpb=c58d52e4c1562a78b91e222190b2fd6e5bba0ef0;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Feature.h b/src/SketchPlugin/SketchPlugin_Feature.h index 2f4c3aaf1..b8437dcbc 100644 --- a/src/SketchPlugin/SketchPlugin_Feature.h +++ b/src/SketchPlugin/SketchPlugin_Feature.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> + // File: SketchPlugin_Feature.h // Created: 27 Mar 2014 // Author: Mikhail PONIKAROV @@ -10,32 +12,31 @@ #include #include #include +#include +#include + +#include class SketchPlugin_Sketch; class GeomAPI_Pnt2d; class Handle_AIS_InteractiveObject; /**\class SketchPlugin_Feature - * \ingroup DataModel + * \ingroup Plugins * \brief Feature for creation of the new feature in PartSet. This is an abstract class to give * an interface to create the sketch feature preview. */ class SketchPlugin_Feature : public ModelAPI_Feature { public: - /// Simple creation of interactive object by the result of the object - static AISObjectPtr simpleAISObject(boost::shared_ptr theRes, - AISObjectPtr thePrevious); - - /// Reference to the external edge or vertex as a AttributeSelection - inline static const std::string& EXTERNAL_ID() + /// Returns true if this feature must be displayed in the history (top level of Part tree) + SKETCHPLUGIN_EXPORT virtual bool isInHistory() { - static const std::string MY_EXTERNAL_ID("External"); - return MY_EXTERNAL_ID; + return false; } - /// Returns true if this feature must be displayed in the history (top level of Part tree) - SKETCHPLUGIN_EXPORT virtual bool isInHistory() + /// Returns true of the feature is created basing on the external shape of not-this-sketch object + SKETCHPLUGIN_EXPORT virtual bool isExternal() const { return false; } @@ -47,7 +48,7 @@ class SketchPlugin_Feature : public ModelAPI_Feature /// Return the distance between the feature and the point /// \param thePoint the point - virtual double distanceToPoint(const boost::shared_ptr& thePoint) = 0; + virtual double distanceToPoint(const std::shared_ptr& thePoint) = 0; /// Construction result is allways recomuted on the fly SKETCHPLUGIN_EXPORT virtual bool isPersistentResult() {return false;} @@ -55,14 +56,6 @@ class SketchPlugin_Feature : public ModelAPI_Feature /// Returns true is sketch element is under the rigid constraint SKETCHPLUGIN_EXPORT virtual bool isFixed() {return false;} - bool isExternal() const - { - AttributeSelectionPtr aAttr = data()->selection(EXTERNAL_ID()); - if (aAttr) - return aAttr->context(); - return false; - } - /// Returns the sketch of this feature SketchPlugin_Sketch* sketch(); protected: @@ -77,7 +70,7 @@ protected: friend class SketchPlugin_Sketch; private: - boost::shared_ptr myPreview; ///< the preview shape + std::shared_ptr myPreview; ///< the preview shape SketchPlugin_Sketch* mySketch; /// sketch that contains this feature };