Salome HOME
Make features history working. Optimization of features and results management and...
[modules/shaper.git] / src / Model / Model_ResultConstruction.h
index 8292e09bc12b12f9d8492199dac11d759b57e142..9c7ccd57d557dd565f3feb89d5aceee0c3822f65 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "Model.h"
 #include <ModelAPI_ResultConstruction.h>
+#include <vector>
 
 /**\class Model_ResultConstruction
  * \ingroup DataModel
@@ -21,6 +22,8 @@ class Model_ResultConstruction : public ModelAPI_ResultConstruction
 {
   std::shared_ptr<ModelAPI_Feature> myOwner;  ///< owner of this result
   std::shared_ptr<GeomAPI_Shape> myShape;  ///< shape of this result created "on the fly"
+  bool myFacesUpToDate; ///< is true if faces in myuFaces are computed and up to date
+  std::vector<std::shared_ptr<GeomAPI_Face> > myFaces; ///< stores the up to date faces if they exist
   bool myIsInHistory;
  public:
   /// default color for a result construction
@@ -51,11 +54,16 @@ class Model_ResultConstruction : public ModelAPI_ResultConstruction
   /// Sets the flag that it must be displayed in history (default is true)
   MODEL_EXPORT virtual void setIsInHistory(const bool myIsInHistory);
 
+  /// if the construction result may be used as faces, this method returns not zero number of faces
+  MODEL_EXPORT virtual int facesNum();
+  /// if the construction result may be used as faces, this method returns face by zero based index
+  MODEL_EXPORT virtual std::shared_ptr<GeomAPI_Face> face(const int theIndex);
+
  protected:
   /// Makes a body on the given feature
   Model_ResultConstruction();
 
-  friend class Model_Document;
+  friend class Model_Objects;
 };
 
 #endif