X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Measurement.h;h=e84668d7dbe5790b559907a85abba107205bbb1f;hb=ea593bc59e7e9461f6c4e2afd3f24d621edb1011;hp=27eefc4d55f25dcee09624fb5cdb5f93f0e48c51;hpb=1050654afdb823cd8e3a6e03f129dfe65fea9d3f;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Measurement.h b/src/FeaturesPlugin/FeaturesPlugin_Measurement.h index 27eefc4d5..e84668d7d 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Measurement.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Measurement.h @@ -1,4 +1,4 @@ -// Copyright (C) 2018-20xx CEA/DEN, EDF R&D +// Copyright (C) 2018-2019 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef FeaturesPlugin_Measurement_H_ @@ -24,6 +23,9 @@ #include "FeaturesPlugin.h" #include +#include +#include + /// \class FeaturesPlugin_Measurement /// \ingroup Plugins /// \brief Feature for calculation metrics. @@ -33,7 +35,9 @@ /// * distance between shapes, /// * radius of arc or cylindrical faces, /// * angle between edges. -class FeaturesPlugin_Measurement : public ModelAPI_Feature +class FeaturesPlugin_Measurement : public ModelAPI_Feature, + public GeomAPI_IPresentable, + public GeomAPI_IScreenParams { public: /// Feature kind. @@ -182,6 +186,23 @@ public: /// Reimplemented from ModelAPI_Feature::isMacro(). Returns true. virtual bool isMacro() const { return true; } + /** Returns the AIS preview + * \param thePrevious - defines a presentation if it was created previously + */ + FEATURESPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious); + + /// Set current screen plane + /// \param theScreenPlane the screen plane + virtual void setScreenPlane(GeomPlanePtr theScreenPlane) { + myScreenPlane = theScreenPlane; + } + + /// Set current view scale + /// \param theScale the view scale + virtual void setViewScale(double theScale) { + mySceenScale = theScale; + } + /// Use plugin manager for features creation FeaturesPlugin_Measurement(); @@ -190,12 +211,38 @@ private: void computeLength(); /// Compute minimal distance between pair of shapes void computeDistance(); - /// Compute radius of circular edge or cylindrical face + /// Compute radius of circular edge, cylindrical surface or sphere. void computeRadius(); /// Compute angle(s) between pair of edges if they are intersected void computeAngle(); /// Compute angle by three points void computeAngleByPoints(); + + /// Create length dimension presentation + /// \param thePrevious previous version of presentation + AISObjectPtr lengthDimension(AISObjectPtr thePrevious); + + /// Create distance dimension presentation + /// \param thePrevious previous version of presentation + AISObjectPtr distanceDimension(AISObjectPtr thePrevious); + + /// Create radius dimension presentation + /// \param thePrevious previous version of presentation + AISObjectPtr radiusDimension(AISObjectPtr thePrevious); + + /// Create angle dimension presentation + /// \param thePrevious previous version of presentation + AISObjectPtr angleDimension(AISObjectPtr thePrevious); + + /// Create angle by points dimension presentation + /// \param thePrevious previous version of presentation + AISObjectPtr angleByPointsDimension(AISObjectPtr thePrevious); + + /// Set dimension presentation parameters + void setupDimension(AISObjectPtr theDim); + + GeomPlanePtr myScreenPlane; //< a plane of current screen + double mySceenScale; //< a scale of current view }; #endif