Salome HOME
Open document problem is corrected: after opening a document, all default filters...
[modules/shaper.git] / src / PartSet / PartSet_PreviewSketchPlane.h
index b2d32c84362b2933508d5914fe4aec6c019e43ae..11eabebd69e25b4f1cc49d5615e386120a56ad4e 100644 (file)
 #ifndef PartSet_PreviewSketchPlane_H
 #define PartSet_PreviewSketchPlane_H
 
-#include <GeomAPI_AISObject.h>
-
-#include <GeomAPI_Pnt.h>
-#include <GeomAPI_Dir.h>
-#include <GeomAPI_AISObject.h>
+class GeomAPI_AISObject;
+class GeomAPI_Shape;
 
 class ModuleBase_IWorkshop;
 class ModelAPI_CompositeFeature;
 
+#include <memory>
+
 /**
 * \class PartSet_PreviewSketchPlane
 * \ingroup Modules
@@ -43,14 +42,6 @@ public:
 
   ~PartSet_PreviewSketchPlane() {};
 
-  /// Returns if the sketch plane was displayed
-  /// \return boolean value
-  bool isSketchDisplayed() const { return mySketchDisplayed; }
-
-  /// Sets parameters of another sketch to be used in createSketchPlane().
-  /// \param theOtherSketchFace a shape of other selected sketch. It is a planar face.
-  void setOtherSketchParameters(const std::shared_ptr<GeomAPI_Shape>& theOtherSketchFace);
-
   /// Erase preview planes
   /// \param theWorkshop the application workshop
   /// \param isClearPlane flag whether the plane, origin and normal should be nullified
@@ -62,40 +53,14 @@ public:
   void createSketchPlane(const std::shared_ptr<ModelAPI_CompositeFeature>& theSketch,
                          ModuleBase_IWorkshop* theWorkshop);
 
-  /// Resize plane size by sketch content
-  /// \param theSketch source sketch to build sketch sub features bounding box
-  /// \param theWorkshop the application workshop
-  void updatePlaneSize(const std::shared_ptr<ModelAPI_CompositeFeature>& theSketch,
-                       ModuleBase_IWorkshop* theWorkshop);
-
 private:
   /// Create a square face by parameters
-  /// \param theSize a size of created square
-  AISObjectPtr createPreviewPlane(double theSize);
-
-  /// Finds origin and maximum size of the shape
-  /// \param theShape source shape
-  /// \param theOrigin a shape center of mass
-  /// \param theSize maximum of delta X, Y or Z
-  void getShapeParameters(const std::shared_ptr<GeomAPI_Shape>& theShape,
-                          std::shared_ptr<GeomAPI_Pnt>& theOrigin,
-                          double& theSize);
-
-  /// Calculate maximum bounding box size of sketch sub features
-  /// \param theSketch source sketch to build sketch sub features bounding box
-  /// \param theCentralPoint central point of the sketch sub features
-  /// \return double value
-  double getSketchBoundingBoxSize(const std::shared_ptr<ModelAPI_CompositeFeature>& theSketch,
-                                  std::shared_ptr<GeomAPI_Pnt>& theCentralPnt);
+  std::shared_ptr<GeomAPI_AISObject> createPreviewPlane();
 
 private:
-  bool mySketchDisplayed;
-  AISObjectPtr myPlane;
-  std::shared_ptr<GeomAPI_Pnt> myOrigin; //! an origin of the plane
-  std::shared_ptr<GeomAPI_Dir> myNormal; //! a normal vector of the plane
-
-  std::shared_ptr<GeomAPI_Pnt> myOtherSketchOrigin;
-  double myOtherSketchSize;
+  bool myPreviewIsDisplayed;
+  std::shared_ptr<GeomAPI_AISObject> myPlane; //! visualized presentation
+  std::shared_ptr<GeomAPI_Shape> myShape; //! current shape to be displayed
 };
 
 #endif
\ No newline at end of file