#include <TDocStd_Document.hxx>
#include <NCollection_DataMap.hxx>
#include <TDF_Label.hxx>
+#include <TDF_LabelList.hxx>
#include <map>
#include <set>
#include <vector>
//! Returns the number of features in the group
int size(const std::string& theGroupID);
- ///! Returns all (and disabled) results of the given type. Not fast method (iterates all features).
+ //! 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
//! 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 same data
+ /// Copies a part result, keeping the reference to origin
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
+ const std::shared_ptr<ModelAPI_ResultPart>& theOrigin,
+ const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
+ /// 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);
void setUniqueName(FeaturePtr theFeature);
//! Synchronizes myFeatures list with the updated document
- //! \param theMarkUpdated causes the "update" event for all features
+ //! \param theUpdated list of labels that are marked as modified, so featrues must be also
//! \param theUpdateReferences causes the update of back-references
+ //! \param theOpen - on open nothing must be reexecuted, except not persistent results
//! \param theFlush makes flush all events in the end of all modifications of this method
- void synchronizeFeatures(const bool theMarkUpdated, const bool theUpdateReferences,
- const bool theFlush);
+ void synchronizeFeatures(const TDF_LabelList& theUpdated, const bool theUpdateReferences,
+ const bool theOpen, const bool theFlush);
//! Synchronizes the BackReferences list in Data of Features and Results
void synchronizeBackRefs();
//! Initializes the data fields of the feature
void initData(ObjectPtr theObj, TDF_Label theLab, const int theTag);
- //! Allows to store the result in the data tree of the document (attaches 'data' of result to tree)
+ //! Allows to store the result in the data tree of the document
+ //! (attaches 'data' of result to tree)
void storeResult(std::shared_ptr<ModelAPI_Data> theFeatureData,
std::shared_ptr<ModelAPI_Result> theResult,
const int theResultIndex = 0);
//! returns the label of result by index; creates this label if it was not created before
- TDF_Label resultLabel(const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theResultIndex);
+ TDF_Label resultLabel(const std::shared_ptr<ModelAPI_Data>& theFeatureData,
+ const int theResultIndex);
//! Updates the results list of the feature basing on the current data tree
void updateResults(FeaturePtr theFeature);
/// 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
friend class Model_AttributeReference;
friend class Model_AttributeRefAttr;
friend class Model_AttributeRefList;
+ friend class Model_AttributeSelection;
+ friend class Model_SelectionNaming;
};
#endif