1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PartSet_ExternalPointsMgr.h
4 // Created: 26 April 2017
5 // Author: Vitaly SMETANNIKOV
7 #ifndef PartSet_ExternalPointsMgr_H
8 #define PartSet_ExternalPointsMgr_H
11 #include <ModelAPI_CompositeFeature.h>
12 #include <ModelAPI_Result.h>
13 #include <GeomAPI_Pln.h>
14 #include <GeomAPI_AISObject.h>
19 class ModuleBase_ViewerPrs;
20 class ModuleBase_IWorkshop;
25 * A class to manage display of presentations of center points of circular
26 * edges outside of a current sketcher
28 class PartSet_ExternalPointsMgr: public QObject
32 PartSet_ExternalPointsMgr(ModuleBase_IWorkshop* theWorkshop,
33 const CompositeFeaturePtr& theSketch);
35 virtual ~PartSet_ExternalPointsMgr();
39 * A slot which processes display of object
40 * \param theObj the displayed object
41 * \param theAIS its presentation
43 void onDisplayObject(ObjectPtr theObj, AISObjectPtr theAIS);
46 * A slot which processes erase of object
47 * \param theObj the displayed object
48 * \param theAIS its presentation
50 void onEraseObject(ObjectPtr theObj, AISObjectPtr theAIS);
52 // Called on selection changed
53 void onSelectionChanged();
57 * Returns list of presentations which have displayed shapes with circular edges
58 * (circles, arcs) which are in pane of of the given sketch
59 * \param theSketch - the sketch
61 QList<std::shared_ptr<ModuleBase_ViewerPrs>> findCircularEdgesInPlane();
63 /// Creates presentations of centers
64 void updateCenterPresentations();
66 /// Returns plane of the current sketch
67 GeomPlanePtr plane() const;
70 * Checks that the given object is an object of the current sketch
71 * \param theRes an object to check
72 * \return True if the given object is a sub-object of the current sketch
74 bool isSketchObject(const ObjectPtr& theRes) const;
78 ModuleBase_IWorkshop* myWorkshop;
81 CompositeFeaturePtr mySketch;
83 /// Type for list of created AIS objects
84 typedef QList<AISObjectPtr> ListOfAIS;
86 /// Map of created AIS objects
87 QMap<ObjectPtr, ListOfAIS> myPresentations;