Salome HOME
Prevent crash of small arcs presentations
[modules/shaper.git] / src / PartSet / PartSet_SketcherMgr.h
index 119764273f5168c1eb3a2b396c744aff27693eb6..634916b7814fb3019823ab6dea15a4305e24547a 100644 (file)
 
 #include "PartSet.h"
 
-#include "PartSet_Filters.h"
-#include "PartSet_Tools.h"
 #include "PartSet_PreviewSketchPlane.h"
+#include "XGUI_SelectionFilterType.h"
+#include "PartSet_Tools.h"
 
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Attribute.h>
 #include <ModelAPI_CompositeFeature.h>
 #include <ModelAPI_Result.h>
 
-#include <ModuleBase_ViewerFilters.h>
 #include <ModuleBase_Definitions.h>
 #include <ModuleBase_ModelWidget.h>
 
 #include <GeomAPI_Pln.h>
+
 #include <SelectMgr_IndexedMapOfOwner.hxx>
+#include <SelectMgr_ListOfFilter.hxx>
+
 #include <TopoDS_Shape.hxx>
 #include <TopTools_MapOfShape.hxx>
 
@@ -45,6 +47,8 @@
 #include <QList>
 #include <QMap>
 
+#include <set>
+
 class PartSet_Module;
 class ModuleBase_IViewWindow;
 class ModuleBase_ModelWidget;
@@ -194,15 +198,16 @@ public:
   /// \param theOperation a committed operation
   void commitNestedSketch(ModuleBase_Operation* theOperation);
 
-  /// Append the sketch selection filters in 3D viewer (plane and circle pointer)
-  void activateSelectionFilters();
-
-  // Remove sketch selection filter from the current viewer
-  virtual void deactivateSelectionFilters();
+  /// Returns true if the filter is created by the sketch manager
+  /// \param theFilterType a checked type
+  /// \return boolean value
+  bool sketchSelectionFilter(const XGUI_SelectionFilterType theFilterType);
 
-  /// Append the sketch plane filter into the current viewer
-  /// \param toActivate state whether the filter should be activated/deactivated
-  void activatePlaneFilter(const bool& toActivate);
+  /// Append selection filter into the module and type of the filter in internal container
+  /// \param theFilterType selection filter type
+  /// \param theFilter added filter
+  void registerSelectionFilter(const XGUI_SelectionFilterType theFilterType,
+                               const Handle(SelectMgr_Filter)& theFilter);
 
   /// Commit the operation if it is possible. If the operation is dimention constraint,
   /// it gives widget editor to input dimention value
@@ -302,8 +307,9 @@ public:
   static const QStringList& constraintsIdList();
 
   /// Returns a list of modes, where the AIS objects should be activated
+  /// \param theSketch a sketch object, modes are empty if sketch plane is not defined yet
   /// \param theModes a list of modes
-  static void sketchSelectionModes(QIntList& theModes);
+  static void sketchSelectionModes(const CompositeFeaturePtr& theSketch, QIntList& theModes);
 
   /// Create specific for the module presentation
   /// \param theResult an object for presentation
@@ -439,8 +445,8 @@ private:
 
   CompositeFeaturePtr myCurrentSketch;
 
-  Handle(PartSet_CirclePointFilter) myCirclePointFilter;
-  Handle(ModuleBase_ShapeInPlaneFilter) myPlaneFilter;
+  std::set<XGUI_SelectionFilterType> mySelectionFilterTypes;
+
   FeatureToSelectionMap myCurrentSelection;
   bool myPreviousUpdateViewerEnabled;