X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_PreviewSketchPlane.h;h=cc1fbebffaaded85896a3f3694fdc6e57aa832d7;hb=21bf48561caff37cdfe6d875c690a51d81458f30;hp=b797b2dd4fbc04c13c2460aa40c8e80f31105c71;hpb=ac536f818ec04b3a89d770acca8cbb4788ec2646;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_PreviewSketchPlane.h b/src/PartSet/PartSet_PreviewSketchPlane.h index b797b2dd4..cc1fbebff 100644 --- a/src/PartSet/PartSet_PreviewSketchPlane.h +++ b/src/PartSet/PartSet_PreviewSketchPlane.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-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,15 +12,16 @@ // // 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 PartSet_PreviewSketchPlane_H #define PartSet_PreviewSketchPlane_H +#include + class GeomAPI_AISObject; class GeomAPI_Shape; @@ -53,6 +54,16 @@ public: void createSketchPlane(const std::shared_ptr& theSketch, ModuleBase_IWorkshop* theWorkshop); + /// Returns bounding box size covered the sketch sub-elements. + /// If the sketch uses extenal face, it will not have default size and returns false. + /// \param theSketch sources sketch + /// \param [out] theSizeOfView maximum value in X, Y or Z direction + /// \param theCentralPoint central point of the sketch sub features + /// \return boolean value + bool getDefaultSizeOfView(const std::shared_ptr& theSketch, + double& theSizeOfView, + std::shared_ptr& theCentralPnt); + /// Returns whether custom size of view is set /// \return boolean value bool isUseSizeOfView() const { return myIsUseSizeOfView; } @@ -60,7 +71,8 @@ public: /// Sets the size of default created face /// \param theSizeOfView value /// \param isUseSizeOfView state whether the size should be used - void setSizeOfView(double theSizeOfView, bool isUseSizeOfView); + void setSizeOfView(double theSizeOfView, bool isUseSizeOfView, + const std::shared_ptr& theCentralPoint = std::shared_ptr()); private: /// Create a square face by parameters @@ -70,9 +82,11 @@ private: bool myPreviewIsDisplayed; std::shared_ptr myPlane; //! visualized presentation std::shared_ptr myShape; //! current shape to be displayed + std::shared_ptr myViewCentralPoint; //! central point of the default view double mySizeOfView; //! size that should be used by creating a default face bool myIsUseSizeOfView; //! state if the size is custom or from preferences + std::shared_ptr myViewOrigin; //! origin point of sketch if default view is used }; #endif \ No newline at end of file