+ 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 result
+ MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultGroup> createGroup(
+ const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
+ /// Creates a field result
+ MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultField> createField(
+ const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
+ /// Creates a parameter result
+ MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultParameter> createParameter(
+ const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
+
+ //! Returns a feature by result (owner of result)
+ MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature>
+ feature(const std::shared_ptr<ModelAPI_Result>& theResult);
+
+ ///! Returns true if parametric updater need to execute feature on recomputartion
+ ///! On abort, undo or redo it is not necessary: results in document are updated automatically
+ bool& executeFeatures() {return myExecuteFeatures;}
+
+ //! Registers the name of the shape for the topological naming needs
+ void addNamingName(const TDF_Label theLabel, std::string theName);
+ //! Updates the name of some object
+ void changeNamingName(std::string theOldName, const std::string theNewName);
+ //! Returns the label, keeper of the name for the topological naming needs
+ TDF_Label findNamingName(std::string theName);
+ //! Returns the result by name of the result (names of results must be unique, used for naming
+ //! selection by name.
+ ResultPtr findByName(const std::string theName);
+
+ ///! 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.
+ MODEL_EXPORT virtual std::list<std::shared_ptr<ModelAPI_Feature> > allFeatures();
+
+ /// Returns the global identifier of the current transaction (needed for the update algo)
+ MODEL_EXPORT virtual int transactionID();
+ /// Increases the transaction ID
+ MODEL_EXPORT virtual void incrementTransactionID();
+ /// Decreases the transaction ID
+ MODEL_EXPORT virtual void decrementTransactionID();
+
+ /// 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();
+
+ /// Returns the feature that produced the given face of the given result.
+ MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature> producedByFeature(
+ std::shared_ptr<ModelAPI_Result> theResult,
+ const std::shared_ptr<GeomAPI_Shape>& theShape);
+
+ /// Returns true if theLater is in history of features creation later than theCurrent
+ MODEL_EXPORT virtual bool isLater(FeaturePtr theLater, FeaturePtr theCurrent) const;
+
+ /// Just removes all features without touching the document data (to be able undo)
+ MODEL_EXPORT virtual void eraseAllFeatures();
+
+
+ protected:
+ //! Returns (creates if needed) the general label
+ TDF_Label generalLabel() const;
+
+ //! Creates new document with binary file format
+ Model_Document(const int theID, const std::string theKind);