Salome HOME
Make the movement, placement and rotation 3D features may be applied to the Part...
[modules/shaper.git] / src / Model / Model_Objects.h
index 148c1c22a4e29a13f79ce1579de1bc2cbc5a5ed2..ec81a9f6ad1cbfaf9352fa7df0ba4957065bb2a1 100644 (file)
@@ -51,6 +51,9 @@ class Model_Objects
   //! \param theFeature a removed feature
   void removeFeature(FeaturePtr theFeature);
 
+  //! Moves the feature to make it after the given one in the history.
+  void moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis);
+
   //! Returns the existing feature by the label
   //! \param theLabel base label of the feature
   FeaturePtr feature(TDF_Label theLabel) const;
@@ -67,7 +70,7 @@ class Model_Objects
     const std::string& theGroupID, const std::string& theName);
 
   //! Returns the result by the result name
-  ResultPtr Model_Objects::findByName(const std::string theName);
+  ResultPtr findByName(const std::string theName);
 
 
   //! Returns the object index in the group. Object must be visible. Otherwise returns -1.
@@ -86,6 +89,11 @@ class Model_Objects
   ///! Returns all (and disabled) results of the given type. Not fast method (iterates all features).
   void allResults(const std::string& theGroupID, std::list<ResultPtr>& theResults);
 
+  //! Returns the number of all features: in the history or not
+  int numInternalFeatures();
+  //! 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 cresults
   std::shared_ptr<ModelAPI_ResultConstruction> createConstruction(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
@@ -95,6 +103,10 @@ class Model_Objects
   /// Creates a part results
   std::shared_ptr<ModelAPI_ResultPart> createPart(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
+  /// Copies a part results, keeping the same data
+  std::shared_ptr<ModelAPI_ResultPart> copyPart(
+      const std::shared_ptr<ModelAPI_Result>& theOldPart, 
+      const std::shared_ptr<ModelAPI_ResultPart>& theOrigin, const int theIndex = 0);
   /// Creates a group results
   std::shared_ptr<ModelAPI_ResultGroup> createGroup(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
@@ -170,6 +182,15 @@ class Model_Objects
   /// Returns to the last (from the history point of view) feature, any: invisible or disabled
   FeaturePtr lastFeature();
 
+  /// 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.
+  std::list<std::shared_ptr<ModelAPI_Feature> > allFeatures();
+
+
  private:
   TDF_Label myMain; ///< main label of the data storage