Salome HOME
Issue #1774: Can't select edge for tangent constraint creation
[modules/shaper.git] / src / PartSet / PartSet_WidgetSubShapeSelector.h
index 5797683bba080dd31a5ba9e84d7f45dc6f1ffc7e..b20cf882d50f55abe7a2e7951a2b9e38426810be 100644 (file)
@@ -9,12 +9,11 @@
 #define PartSet_WidgetSubShapeSelector_H
 
 #include "PartSet.h"
+#include "PartSet_MouseProcessor.h"
 
 #include <ModuleBase_WidgetShapeSelector.h>
-#include <PartSet_MouseProcessor.h>
 
 #include <ModelAPI_CompositeFeature.h>
-#include <GeomDataAPI_Point2D.h>
 
 #include <QObject>
 
@@ -26,6 +25,9 @@ class Config_WidgetAPI;
 class ModuleBase_IViewWindow;
 class ModuleBase_ViewerPrs;
 
+class GeomAPI_Pnt;
+class GeomDataAPI_Point2D;
+
 class QWidget;
 class QMouseEvent;
 
@@ -92,6 +94,19 @@ protected:
   //                              GeomShapePtr& theShape);
   void fillObjectShapes(const ObjectPtr& theObject);
 
+  /// Return an object and geom shape by the viewer presentation
+  /// \param thePrs a selection
+  /// \param theObject an output object
+  /// \param theShape a shape of the selection
+  virtual void getGeomSelection(const std::shared_ptr<ModuleBase_ViewerPrs>& thePrs,
+                                ObjectPtr& theObject,
+                                GeomShapePtr& theShape);
+
+  /// Return the attribute values wrapped in a list of viewer presentations
+  /// \return a list of viewer presentations, which contains an attribute result and
+  /// a shape. If the attribute do not uses the shape, it is empty
+  virtual QList<std::shared_ptr<ModuleBase_ViewerPrs>> getAttributeSelection() const;
+
 protected:
   /// The methiod called when widget is activated
   virtual void activateCustom();
@@ -99,7 +114,10 @@ protected:
 protected:
   std::shared_ptr<ModuleBase_ViewerPrs> myCurrentSubShape;
   std::map<ObjectPtr, std::set<GeomShapePtr> > myCashedShapes;
-  std::map<ObjectPtr, std::set<AttributePoint2DPtr> > myCashedReferences;
+
+  typedef std::map<std::shared_ptr<GeomDataAPI_Point2D>,
+                   std::shared_ptr<GeomAPI_Pnt> > PntToAttributesMap;
+  std::map<ObjectPtr, PntToAttributesMap> myCashedReferences;
 
   /// Pointer to a sketch 
   CompositeFeaturePtr mySketch;