]> SALOME platform Git repositories - modules/shaper.git/blob - src/PartSet/PartSet_ExternalPointsMgr.h
Salome HOME
718902afb71f95ad002764696baefc6f64cc9d4f
[modules/shaper.git] / src / PartSet / PartSet_ExternalPointsMgr.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSet_ExternalPointsMgr.h
4 // Created:     26 April 2017
5 // Author:      Vitaly SMETANNIKOV
6
7 #ifndef PartSet_ExternalPointsMgr_H
8 #define PartSet_ExternalPointsMgr_H
9
10
11 #include <ModelAPI_CompositeFeature.h>
12 #include <ModelAPI_Result.h>
13 #include <GeomAPI_Pln.h>
14 #include <GeomAPI_AISObject.h>
15
16 #include <QObject>
17 #include <QMap>
18
19 class ModuleBase_ViewerPrs;
20 class ModuleBase_IWorkshop;
21
22
23 /**
24 * \ingroup Modules
25 * A class to manage display of presentations of center points of circular
26 * edges outside of a current sketcher
27 */
28 class PartSet_ExternalPointsMgr: public QObject
29 {
30   Q_OBJECT
31 public:
32   PartSet_ExternalPointsMgr(ModuleBase_IWorkshop* theWorkshop, const CompositeFeaturePtr& theSketch);
33
34   virtual ~PartSet_ExternalPointsMgr();
35
36 private slots:
37   /**
38   * A slot which processes display of object
39   * \param theObj the displayed object
40   * \param theAIS its presentation
41   */
42   void onDisplayObject(ObjectPtr theObj, AISObjectPtr theAIS);
43
44   /**
45   * A slot which processes erase of object
46   * \param theObj the displayed object
47   * \param theAIS its presentation
48   */
49   void onEraseObject(ObjectPtr theObj, AISObjectPtr theAIS);
50
51 private:
52   /**
53   * Returns list of presentations which have displayed shapes with circular edges
54   * (circles, arcs) which are in pane of of the given sketch
55   * \param theSketch - the sketch
56   */
57   QList<std::shared_ptr<ModuleBase_ViewerPrs>> findCircularEdgesInPlane();
58
59   /// Creates presentations of centers
60   void updateCenterPresentations();
61
62   /// Returns plane of the current sketch
63   GeomPlanePtr plane() const;
64
65   bool isSketchObject(const ObjectPtr& theRes) const;
66
67 private:
68   ModuleBase_IWorkshop* myWorkshop;
69   CompositeFeaturePtr mySketch;
70
71   typedef QList<AISObjectPtr> ListOfAIS;
72
73   QMap<ObjectPtr, ListOfAIS> myPresentations;
74 };
75
76 #endif