1 // Copyright (C) 2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 // File: PartSet_ExternalPointsMgr.h
22 // Created: 26 April 2017
23 // Author: Vitaly SMETANNIKOV
25 #ifndef PartSet_ExternalPointsMgr_H
26 #define PartSet_ExternalPointsMgr_H
29 #include <ModelAPI_CompositeFeature.h>
30 #include <ModelAPI_Result.h>
31 #include <GeomAPI_Pln.h>
32 #include <GeomAPI_AISObject.h>
37 class ModuleBase_ViewerPrs;
38 class ModuleBase_IWorkshop;
43 * A class to manage display of presentations of center points of circular
44 * edges outside of a current sketcher
46 class PartSet_ExternalPointsMgr: public QObject
50 PartSet_ExternalPointsMgr(ModuleBase_IWorkshop* theWorkshop,
51 const CompositeFeaturePtr& theSketch);
53 virtual ~PartSet_ExternalPointsMgr();
57 * A slot which processes display of object
58 * \param theObj the displayed object
59 * \param theAIS its presentation
61 void onDisplayObject(ObjectPtr theObj, AISObjectPtr theAIS);
64 * A slot which processes erase of object
65 * \param theObj the displayed object
66 * \param theAIS its presentation
68 void onEraseObject(ObjectPtr theObj, AISObjectPtr theAIS);
70 // Called on selection changed
71 void onSelectionChanged();
75 * Returns list of presentations which have displayed shapes with circular edges
76 * (circles, arcs) which are in pane of of the given sketch
77 * \param theSketch - the sketch
79 QList<std::shared_ptr<ModuleBase_ViewerPrs>> findCircularEdgesInPlane();
81 /// Creates presentations of centers
82 void updateCenterPresentations();
84 /// Returns plane of the current sketch
85 GeomPlanePtr plane() const;
88 * Checks that the given object is an object of the current sketch
89 * \param theRes an object to check
90 * \return True if the given object is a sub-object of the current sketch
92 bool isSketchObject(const ObjectPtr& theRes) const;
96 ModuleBase_IWorkshop* myWorkshop;
99 CompositeFeaturePtr mySketch;
101 /// Type for list of created AIS objects
102 typedef QList<AISObjectPtr> ListOfAIS;
104 /// Map of created AIS objects
105 QMap<ObjectPtr, ListOfAIS> myPresentations;