Salome HOME
Update documentation (image for the perpendicular arc mode)
[modules/shaper.git] / src / ModelAPI / ModelAPI_AttributeSelectionList.h
index 5c304db25f06e91d437020d30bee03cc958da748..a88017e3412403701017112c1a31277e6e17f0f8 100644 (file)
@@ -35,6 +35,10 @@ class GeomAPI_Shape;
 
 class ModelAPI_AttributeSelectionList : public ModelAPI_Attribute
 {
+  /// Flag that indicates that the whole result selection is allowed while the selection type
+  /// may be sub-objects, so, it is the same as all sub-shapes are selected (#3005). It is "false"
+  /// by default.
+  bool myIsWholeResultAllowed;
  public:
   /// Adds the new reference to the end of the list
   /// \param theContext object where the sub-shape was selected
@@ -115,15 +119,27 @@ class ModelAPI_AttributeSelectionList : public ModelAPI_Attribute
   /// To virtually destroy the fields of successors
   MODELAPI_EXPORT virtual ~ModelAPI_AttributeSelectionList();
 
-  MODELAPI_EXPORT FiltersFeaturePtr filters() const { return myFilters; }
-  MODELAPI_EXPORT void setFilters(FiltersFeaturePtr theFeature) { myFilters = theFeature; }
+  /// Returns a selection filters feature if it is defined for this selection list
+  MODELAPI_EXPORT virtual FiltersFeaturePtr filters() const = 0;
 
-protected:
-  /// Objects are created for features automatically
-  MODELAPI_EXPORT ModelAPI_AttributeSelectionList();
+  /// Sets a selection filters feature if it is defined for this selection list
+  MODELAPI_EXPORT virtual void setFilters(FiltersFeaturePtr theFeature) = 0;
+
+  /// Returns true if the whole result selection corresponds to selection of all sub-shapes.
+  MODELAPI_EXPORT virtual const bool isWholeResultAllowed() const {
+    return myIsWholeResultAllowed;
+  }
+
+  /// Sets whether the whole result selection corresponds to selection of all sub-shapes.
+  MODELAPI_EXPORT virtual void setWholeResultAllowed(const bool theFlag)  {
+    myIsWholeResultAllowed = theFlag;
+  }
 
 protected:
-  FiltersFeaturePtr myFilters;
+  /// Default constructor
+  MODELAPI_EXPORT ModelAPI_AttributeSelectionList() : ModelAPI_Attribute()
+  {myIsWholeResultAllowed = false;}
+
 };
 
 //! Pointer on double attribute