Salome HOME
Creation of producedByFeature initial implementation neede for the issue #1306
[modules/shaper.git] / src / Model / Model_Objects.h
index 114be09dffe82d11715af1eb4670fcad791cbf7f..740a3d54250c758b248f352e96a6021ea12dda80 100644 (file)
@@ -95,23 +95,27 @@ class Model_Objects
   //! Returns the feature by zero-based index: features in the history or not
   std::shared_ptr<ModelAPI_Feature> internalFeature(const int theIndex);
 
-  /// Creates a construction results
+  //! Returns feature by the id of the feature (produced by the Data "featureId" method)
+  std::shared_ptr<ModelAPI_Feature> featureById(const int theId);
+
+
+  /// Creates a construction result
   std::shared_ptr<ModelAPI_ResultConstruction> createConstruction(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
-  /// Creates a body results
+  /// Creates a body result
   std::shared_ptr<ModelAPI_ResultBody> createBody(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
-  /// Creates a part results
+  /// Creates a part result
   std::shared_ptr<ModelAPI_ResultPart> createPart(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
-  /// Copies a part results, keeping the reference to origin
+  /// Copies a part result, keeping the reference to origin
   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
+  /// Creates a group result
   std::shared_ptr<ModelAPI_ResultGroup> createGroup(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
-
+  /// Creates a parameter result
   std::shared_ptr<ModelAPI_ResultParameter> createParameter(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
 
@@ -175,22 +179,28 @@ class Model_Objects
   /// Creates the history: up to date with the current state
   void createHistory(const std::string& theGroupID);
 
-  /// Returns to the next (from the history point of view) feature, any: invisible or disabled
+  /// Returns the next (from the history point of view) feature, any: invisible or disabled
+  /// \param theCurrent previous to the resulting feature
   /// \param theReverse if it is true, iterates in reverced order (next becomes previous)
   FeaturePtr nextFeature(FeaturePtr theCurrent, const bool theReverse = false);
   /// Returns to the first (from the history point of view) feature, any: invisible or disabled
   FeaturePtr firstFeature();
   /// Returns to the last (from the history point of view) feature, any: invisible or disabled
   FeaturePtr lastFeature();
+  /// Returns true if theLater is in history of features creation later than theCurrent
+  bool isLater(FeaturePtr theLater, FeaturePtr theCurrent) const;
 
   /// Returns the result group identifier of the given feature (for this at least one result must 
   /// be created before)
   std::string featureResultGroup(FeaturePtr theFeature);
 
-  ///! Returns all features of the document including the hidden features which are not in
-  ///! history. Not very fast method, for calling once, not in big cycles.
+  //! Returns all features of the document including the hidden features which are not in
+  //! history. Not very fast method, for calling once, not in big cycles.
   std::list<std::shared_ptr<ModelAPI_Feature> > allFeatures();
 
+  //! synchronises back references for the given object basing on the collected data
+  void synchronizeBackRefsForObject(
+    const std::set<std::shared_ptr<ModelAPI_Attribute>>& theNewRefs, ObjectPtr theObject);
 
  private:
   TDF_Label myMain; ///< main label of the data storage