1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PartSet_PreviewPlanes.h
4 // Created: 22 Mar 2016
5 // Author: Natalia ERMOLAEVA
7 #ifndef PartSet_PreviewPlanes_H
8 #define PartSet_PreviewPlanes_H
10 #include <GeomAPI_AISObject.h>
12 #include <GeomAPI_Pnt.h>
13 #include <GeomAPI_Dir.h>
14 #include <GeomAPI_AISObject.h>
16 class ModuleBase_IWorkshop;
18 /// the plane edge width
19 #define SKETCH_WIDTH "4"
20 /// face of the square-face displayed for selection of general plane
21 #define PLANE_SIZE "200"
24 * \class PartSet_PreviewPlanes
26 * A class to show/hide sketch preview planes
28 class PartSet_PreviewPlanes
32 PartSet_PreviewPlanes();
34 ~PartSet_PreviewPlanes() {};
36 /// Returns true if there is body visualized in the viewer
37 /// \param theWorkshop the application workshop
38 /// \return boolean value
39 static bool hasVisualizedBodies(ModuleBase_IWorkshop* theWorkshop);
41 /// Returns if the preview was displayed
42 /// \param theWorkshop the application workshop
43 /// \return boolean value
44 bool isPreviewDisplayed() const { return myPreviewDisplayed; }
46 /// Erase preview planes
47 /// \param theWorkshop the application workshop
48 void erasePreviewPlanes(ModuleBase_IWorkshop* theWorkshop);
50 /// Show preview planes
51 /// \param theWorkshop the application workshop
52 void showPreviewPlanes(ModuleBase_IWorkshop* theWorkshop);
55 /// Create preview of planes for sketch plane selection
56 /// \param theOrigin an origin of the plane
57 /// \param theNorm a normal vector of the plane
58 /// \param theRGB a color of plane presentation [r, g, b] array
59 AISObjectPtr createPreviewPlane(std::shared_ptr<GeomAPI_Pnt> theOrigin,
60 std::shared_ptr<GeomAPI_Dir> theNorm,
64 bool myPreviewDisplayed;
66 AISObjectPtr myYZPlane;
67 AISObjectPtr myXZPlane;
68 AISObjectPtr myXYPlane;