1 // Copyright (C) 2017-2019 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: PartSet_ExternalPointsMgr.h
21 // Created: 26 April 2017
22 // Author: Vitaly SMETANNIKOV
24 #ifndef PartSet_ExternalPointsMgr_H
25 #define PartSet_ExternalPointsMgr_H
28 #include <ModelAPI_CompositeFeature.h>
29 #include <ModelAPI_Result.h>
30 #include <GeomAPI_Pln.h>
31 #include <GeomAPI_AISObject.h>
36 class ModuleBase_ViewerPrs;
37 class ModuleBase_IWorkshop;
42 * A class to manage display of presentations of center points of circular
43 * edges outside of a current sketcher
45 class PartSet_ExternalPointsMgr: public QObject
49 PartSet_ExternalPointsMgr(ModuleBase_IWorkshop* theWorkshop,
50 const CompositeFeaturePtr& theSketch);
52 virtual ~PartSet_ExternalPointsMgr();
56 * A slot which processes display of object
57 * \param theObj the displayed object
58 * \param theAIS its presentation
60 void onDisplayObject(ObjectPtr theObj, AISObjectPtr theAIS);
63 * A slot which processes erase of object
64 * \param theObj the displayed object
65 * \param theAIS its presentation
67 void onEraseObject(ObjectPtr theObj, AISObjectPtr theAIS);
69 // Called on selection changed
70 void onSelectionChanged();
74 * Returns list of presentations which have displayed shapes with circular edges
75 * (circles, arcs) which are in pane of of the given sketch
76 * \param theSketch - the sketch
78 QList<std::shared_ptr<ModuleBase_ViewerPrs>> findCircularEdgesInPlane();
80 /// Creates presentations of centers
81 void updateCenterPresentations();
83 /// Returns plane of the current sketch
84 GeomPlanePtr plane() const;
87 * Checks that the given object is an object of the current sketch
88 * \param theRes an object to check
89 * \return True if the given object is a sub-object of the current sketch
91 bool isSketchObject(const ObjectPtr& theRes) const;
95 ModuleBase_IWorkshop* myWorkshop;
98 CompositeFeaturePtr mySketch;
100 /// Type for list of created AIS objects
101 typedef QList<AISObjectPtr> ListOfAIS;
103 /// Map of created AIS objects
104 QMap<ObjectPtr, ListOfAIS> myPresentations;