Salome HOME
Issue #1540: Added attribute for array of double.
[modules/shaper.git] / src / Model / Model_BodyBuilder.h
index 7548439b1e396051447e4cfbffba6bb0d7628f37..0941d38b2aaf990b7709af4fb8442a5264808b3c 100755 (executable)
@@ -18,7 +18,7 @@ class TNaming_Builder;
 
 /**\class Model_BodyBuilder
  * \ingroup DataModel
- * \brief The body (shape) result of a feature.
+ * \brief Extra API for the ResultBody that allows to work with naming.
  */
 class Model_BodyBuilder : public ModelAPI_BodyBuilder
 {
@@ -27,7 +27,8 @@ class Model_BodyBuilder : public ModelAPI_BodyBuilder
   std::vector<TNaming_Builder*> myBuilders;
 public:
   /// Stores the shape (called by the execution method).
-  MODEL_EXPORT virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape);
+  MODEL_EXPORT virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape,
+                                  const bool theIsStoreSameShapes = true);
 
   /// Stores the generated shape (called by the execution method).
   MODEL_EXPORT virtual void storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
@@ -41,6 +42,14 @@ public:
   MODEL_EXPORT virtual void storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
                                                const std::shared_ptr<GeomAPI_Shape>& theNewShape,
                                           const int theDecomposeSolidsTag = 0);
+
+  /// Stores the shape without naming support
+  /// \param theShape shape to store
+  MODEL_EXPORT virtual void storeWithoutNaming(const std::shared_ptr<GeomAPI_Shape>& theShape);
+
+  /// Returns the shape-result produced by this feature
+  MODEL_EXPORT virtual std::shared_ptr<GeomAPI_Shape> shape();
+
   /// Records the subshape newShape which was generated during a topological construction.
   /// As an example, consider the case of a face generated in construction of a box.
   MODEL_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theNewShape, 
@@ -75,7 +84,8 @@ public:
                                                const int  theKindOfShape,
                                                const int  theTag,
                                                                                           const std::string& theName,
-                                               GeomAPI_DataMapOfShapeShape& theSubShapes);
+                                               GeomAPI_DataMapOfShapeShape& theSubShapes,
+                                               const bool theIsStoreSeparate = false);
    /// load and orient generated shapes
   MODEL_EXPORT virtual void loadAndOrientGeneratedShapes (
                                                   GeomAlgoAPI_MakeShape* theMS,
@@ -97,7 +107,16 @@ public:
   /// Removes the stored builders
   MODEL_EXPORT virtual ~Model_BodyBuilder();
 
+  /// Converts evolution of sub-shapes stored in naming structure to selection 
+  /// (theFlag = true) and back (theFlag = false)
+  MODEL_EXPORT virtual void evolutionToSelection(const bool theFlag);
+
+  /// Returns true if the latest modification of this body in the naming history
+  // is equal to the given shape
+  MODEL_EXPORT virtual bool isLatestEqual(const std::shared_ptr<GeomAPI_Shape>& theShape);
+
 protected:
+  /// Default constructor accessible only by Model_Objects
   Model_BodyBuilder(ModelAPI_Object* theOwner);
 
   /// Removes the stored builders