-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File: Model_Document.h
-// Created: 28 Feb 2014
-// Author: Mikhail PONIKAROV
+// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
#ifndef Model_Document_H_
#define Model_Document_H_
//! Sets the current feature: all features below will be disabled, new features
//! will be appended after this one.
- //! \param theCurrent the selected feature as current: blow it everythin become disabled
+ //! \param theCurrent the selected feature as current: below it everything becomes disabled
//! \param theVisible use visible features only: flag is true for Object Browser functionality
MODEL_EXPORT virtual void setCurrentFeature(std::shared_ptr<ModelAPI_Feature> theCurrent,
const bool theVisible);
/// 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 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;
//! for calculation of selection externally from the document
std::shared_ptr<ModelAPI_AttributeSelectionList> selectionInPartFeature();
+ /// Stores in the document boolean flags: states of the nodes in the object browser.
+ /// Normally is called outside of the transaction, just before "save".
+ virtual void storeNodesState(const std::list<bool>& theStates);
+
+ /// Returns the stored nodes states. Normally it is calles just after "open".
+ /// Appends the values to theStates list.
+ virtual void restoreNodesState(std::list<bool>& theStates) const;
+
+ /// Label that constains structures for selection of constructions of another document
+ TDF_Label extConstructionsLabel() const;
+
friend class Model_Application;
friend class Model_Session;
friend class Model_Update;
friend class Model_AttributeSelection;
friend class Model_ResultPart;
friend class Model_ResultCompSolid;
+ friend class Model_ResultConstruction;
friend class Model_SelectionNaming;
friend class DFBrowser;