class Handle_Model_Document;
class Model_Objects;
+class ModelAPI_AttributeSelectionList;
/**\class Model_Document
* \ingroup DataModel
//! \param theFeature a removed feature
MODEL_EXPORT virtual void removeFeature(FeaturePtr theFeature);
+ //! Moves the feature to make it after the given one in the history.
+ MODEL_EXPORT virtual void moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis);
+
//! Returns the first found object in the group by the object name
//! \param theGroupID group that contains an object
//! \param theName name of the object to search
//! Internal sub-document by ID
MODEL_EXPORT virtual std::shared_ptr<Model_Document> subDoc(std::string theDocID);
- ///! Returns the id of hte document
+ ///! Returns the id of the document
MODEL_EXPORT virtual const std::string& id() const
{
return myID;
//! Makes the current feature one feature upper
MODEL_EXPORT virtual void setCurrentFeatureUp();
+ //! Returns the number of all features: in the history or not
+ MODEL_EXPORT virtual int numInternalFeatures();
+ //! Returns the feature by zero-based index: features in the history or not
+ MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature> internalFeature(const int theIndex);
+
/// Creates a construction cresults
MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultConstruction> createConstruction(
const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
/// Creates a part results
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 results
MODEL_EXPORT virtual std::shared_ptr<ModelAPI_ResultGroup> createGroup(
const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
/// 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();
+
protected:
//! Returns (creates if needed) the general label
TDF_Label generalLabel() const;
//! Returns true if this document is currently active
virtual bool isActive() const;
+ //! Returns the selection attribute that is used for calculation of selection externally from the document
+ std::shared_ptr<ModelAPI_AttributeSelectionList> selectionInPartFeature();
+
friend class Model_Application;
friend class Model_Session;
friend class Model_Update;
friend class Model_AttributeRefAttr;
friend class Model_AttributeRefList;
friend class Model_ResultPart;
+ friend class Model_ResultCompSolid;
friend class DFBrowser;
private:
bool myExecuteFeatures;
bool myIsActive; ///< flag that stores the active/not active state
+
+ //! The selection feature, if needed
+ FeaturePtr mySelectionFeature;
};
#endif