-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015 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.
+// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef HYDROGUI_DATAMODEL_H
#define HYDROGUI_DATAMODEL_H
HYDROGUI_DataModel( CAM_Module* theModule );
virtual ~HYDROGUI_DataModel();
+ /**
+ * Creates the document into the data model. Reimplemented.
+ */
+ virtual bool create( CAM_Study* );
+
/**
* Open the document into the data model. Reimplemented.
* \param theURL opened study path
/**
* Create a new region in the given calculation case containing given zones.
*/
- bool createNewRegion( Handle(HYDROData_CalculationCase) theCase, const QList<HYDROGUI_Zone*>& theZonesList );
+ bool createNewRegion( Handle(HYDROData_CalculationCase) theCase,
+ const QList<HYDROGUI_Zone*>& theZonesList );
/**
* Correct an internal model object according to the current document mode
* Creates the Calculation Case subtree for usage within an operation dialog.
* \param theParent a created object will be appended as a child of this GUI object
* \param theCase the calculation case model object
+ * \param theLandCover if true - land cover regions will be represented in the tree
*/
void buildCaseTree( SUIT_DataObject* theParent,
Handle(HYDROData_CalculationCase) theCase );
*/
static QString partitionName( const ObjectKind theObjectKind );
+ /**
+ * Creates the default Strickler table object: both GUI data object and corresponding model object
+ * \param theDocument a document into which created object will be added
+ * \param theParent a created object will be appended as a child of this GUI object
+ */
+ void createDefaultStricklerTable( const Handle(HYDROData_Document)& theDocument,
+ LightApp_DataObject* theParent );
+
protected:
/**
* Returns the document for the current study
const QString& theParentEntry,
const bool theIsBuildTree ,
const bool theIsInOperation = false );
+ /**
+ * Build partition for object.
+ * \param theObject gui object for which the partition will be build
+ * \param theObjects sequence of builded objects
+ * \param thePartName name of created partition
+ * \param theIsCreateEmpty if true then partition will be created in any case
+ */
+ void buildObjectPartition( SUIT_DataObject* theObject,
+ const HYDROData_SequenceOfObjects& theObjects,
+ const QString& thePartName,
+ const bool theIsCreateEmpty );
+
/**
* Build tree of a model object.
* \param theParent a created object will be appended as a child of this object
static SUIT_DataObject* findChildByName( const SUIT_DataObject* theFather,
const QString& theName );
+ void updateDocument();
+
+ /**
+ * Set object visibility state.
+ * \param theModelObject the data model object
+ * \param theDataObject the GUI object
+ */
+ void setObjectVisibilityState( Handle(HYDROData_Entity) theModelObject,
+ HYDROGUI_DataObject* theObject );
+
+
protected:
QString myStudyURL; ///< the saved/opened document URL
+ QByteArray myStates;
};
#endif