+ /// \return true if the selection filter of the widget is activated in viewer context
+ bool activateFilters(const bool toActivate);
+
+ /// Block the model flush of update and intialization of attribute
+ /// \param theAttribute an attribute of blocking
+ /// \param theToBlock flag whether the model is blocked or unblocked
+ /// \param isFlushesActived out value if model is blocked, in value if model is unblocked
+ /// to be used to restore flush state when unblocked
+ /// \param isAttributeSetInitializedBlocked out value if model is blocked
+ /// in value if model is unblocked to be used to restore previous state when unblocked
+ virtual void blockAttribute(const AttributePtr& theAttribute, const bool& theToBlock,
+ bool& isFlushesActived, bool& isAttributeSetInitializedBlocked);
+
+private:
+ /// Checks the current attibute in all attribute validators
+ /// \param theAttribute an attribute to be validated
+ /// \return true if all validators return that the attribute is valid
+ bool isValidAttribute(const AttributePtr& theAttribute) const;
+
+protected:
+ /// Gets the validity state of the presentation in an internal map. Returns true if the valid state of value is stored
+ /// \param theValue a viewer presentation
+ /// \param theValid a valid state
+ bool getValidState(const std::shared_ptr<ModuleBase_ViewerPrs>& theValue, bool& theValid);
+
+ /// Store the validity state of the presentation in an internal map
+ /// \param theValue a viewer presentation
+ /// \param theValid a valid state
+ void storeValidState(const std::shared_ptr<ModuleBase_ViewerPrs>& theValue, const bool theValid);
+
+private:
+ /// Applies AIS context filters to the parameter list. The not approved presentations are
+ /// removed from the parameters.
+ /// \param theValues a list of presentations.
+ void filterPresentations(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues);
+
+ /// Remove subshapes of compsolids if whole compsolid is present.
+ /// \param theValues a list of presentations.
+ void filterCompSolids(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues);
+
+protected:
+ /// Reference to workshop
+ ModuleBase_IWorkshop* myWorkshop;
+ /// The widget is in validation mode: store is performed, restore is not
+ bool myIsInValidate;
+
+private:
+ ObjectPtr myPresentedObject; /// back up of the filtered object
+#ifdef LIST_OF_VALID_PRS
+ QList<std::shared_ptr<ModuleBase_ViewerPrs>> myValidPrs; /// cash of valid selection presentations
+ QList<std::shared_ptr<ModuleBase_ViewerPrs>> myInvalidPrs; /// cash of invalid selection presentations
+#else
+ // assume that one presentation selection presentation corresponds only one shape
+ NCollection_DataMap<TopoDS_Shape, std::shared_ptr<ModuleBase_ViewerPrs> > myValidPrs;
+ NCollection_DataMap<TopoDS_Shape, std::shared_ptr<ModuleBase_ViewerPrs> > myInvalidPrs;
+#endif
+
+ /// store to backup parameters of the model
+ ModuleBase_WidgetSelectorStore* myAttributeStore;