Salome HOME
Support of attributes located in the same switch in several cases
[modules/shaper.git] / src / Model / Model_Document.h
index 70cfcf6189ab71e0d46ec3fd81be246e29f7e66a..d82b853f65131b7c4bdb7a7c2a338e6fd50deb81 100644 (file)
@@ -19,6 +19,7 @@
 
 class Handle_Model_Document;
 class Model_Objects;
+class ModelAPI_AttributeSelectionList;
 
 /**\class Model_Document
  * \ingroup DataModel
@@ -109,7 +110,7 @@ class Model_Document : public ModelAPI_Document
   //! Internal sub-document by ID
   MODEL_EXPORT virtual std::shared_ptr<Model_Document> subDoc(std::string theDocID);
 
-  ///! Returns the id of hte document
+  ///! Returns the id of the document
   MODEL_EXPORT virtual const std::string& id() const
   {
     return myID;
@@ -153,6 +154,10 @@ class Model_Document : public ModelAPI_Document
   /// Creates a part results
   MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultPart> createPart(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
+  //! Copies a part result, keeping the reference to origin
+  MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultPart> copyPart(
+    const std::shared_ptr<ModelAPI_ResultPart>& theOrigin,
+    const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
   /// Creates a group results
   MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultGroup> createGroup(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
@@ -190,6 +195,10 @@ class Model_Document : public ModelAPI_Document
   /// Returns true if document is opened and valid
   MODEL_EXPORT virtual bool isOpened();
 
+  /// Returns the last feature in the document (even not visible or disabled)
+  /// \returns null if there is no features
+  FeaturePtr lastFeature();
+
  protected:
   //! Returns (creates if needed) the general label
   TDF_Label generalLabel() const;
@@ -241,6 +250,9 @@ class Model_Document : public ModelAPI_Document
   //! Returns true if this document is currently active
   virtual bool isActive() const;
 
+  //! Returns the selection attribute that is used for calculation of selection externally from the document
+  std::shared_ptr<ModelAPI_AttributeSelectionList> selectionInPartFeature();
+
   friend class Model_Application;
   friend class Model_Session;
   friend class Model_Update;
@@ -248,6 +260,7 @@ class Model_Document : public ModelAPI_Document
   friend class Model_AttributeRefAttr;
   friend class Model_AttributeRefList;
   friend class Model_ResultPart;
+  friend class Model_ResultCompSolid;
   friend class DFBrowser;
 
  private:
@@ -283,6 +296,9 @@ class Model_Document : public ModelAPI_Document
   bool myExecuteFeatures;
 
   bool myIsActive; ///< flag that stores the active/not active state
+
+  //! The selection feature, if needed
+  FeaturePtr mySelectionFeature;
 };
 
 #endif