X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_WidgetSubShapeSelector.h;h=b20cf882d50f55abe7a2e7951a2b9e38426810be;hb=07889bdf129940bf25021b91aa58902e634a64ce;hp=86ac40a9df59f551cabd5eb5b585f2b8591812ad;hpb=656b2b25f58ce91c661437af3b35cb7e8da09f6a;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_WidgetSubShapeSelector.h b/src/PartSet/PartSet_WidgetSubShapeSelector.h index 86ac40a9d..b20cf882d 100644 --- a/src/PartSet/PartSet_WidgetSubShapeSelector.h +++ b/src/PartSet/PartSet_WidgetSubShapeSelector.h @@ -9,9 +9,9 @@ #define PartSet_WidgetSubShapeSelector_H #include "PartSet.h" +#include "PartSet_MouseProcessor.h" #include -#include #include @@ -25,6 +25,9 @@ class Config_WidgetAPI; class ModuleBase_IViewWindow; class ModuleBase_ViewerPrs; +class GeomAPI_Pnt; +class GeomDataAPI_Point2D; + class QWidget; class QMouseEvent; @@ -67,9 +70,14 @@ Q_OBJECT /// \param theValues a list of presentations virtual void getHighlighted(QList>& theValues); - /// Fills the attribute with the value of the selected owner - /// \param thePrs a selected owner - virtual bool setSelectionCustom(const std::shared_ptr& thePrs); + /// Set the given wrapped value to the current widget + /// This value should be processed in the widget according to the needs + /// The method is called by the current operation to process the operation preselection. + /// It is redefined to fill attributes responsible for the sub selection + /// \param theValues the wrapped selection values + /// \param theToValidate a flag on validation of the values + virtual bool setSelection(QList>& theValues, + const bool theToValidate); protected: /// Checks the widget validity. By default, it returns true. @@ -86,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& 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> getAttributeSelection() const; + protected: /// The methiod called when widget is activated virtual void activateCustom(); @@ -94,6 +115,10 @@ protected: std::shared_ptr myCurrentSubShape; std::map > myCashedShapes; + typedef std::map, + std::shared_ptr > PntToAttributesMap; + std::map myCashedReferences; + /// Pointer to a sketch CompositeFeaturePtr mySketch; };