--- /dev/null
+// 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, 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
+//
+
+#include "HYDROData_LandCoverMap.h"
+#include <TDataStd_ExtStringArray.hxx>
+#include <QString>
+
+QString HYDROData_LandCoverMap::GetStricklerType( int theIndex ) const
+{
+ Handle(TDataStd_ExtStringArray) aTypesArray;
+ if( !myLab.FindChild( DataTag_Types ).FindAttribute( TDataStd_ExtStringArray::GetID(), aTypesArray ) )
+ return "";
+
+ TCollection_ExtendedString aType = aTypesArray->Value( theIndex );
+ TCollection_AsciiString anAscii = aType;
+ return anAscii.ToCString();
+}
+
+void HYDROData_LandCoverMap::SetStricklerType( int theIndex, const QString& theType )
+{
+ Handle(TDataStd_ExtStringArray) aTypesArray;
+ if( !myLab.FindChild( DataTag_Types ).FindAttribute( TDataStd_ExtStringArray::GetID(), aTypesArray ) )
+ return;
+
+ std::string aType = theType.toStdString();
+ aTypesArray->SetValue( theIndex, aType.c_str() );
+}
+
--- /dev/null
+// 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, 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
+//
+
+#ifndef HYDROData_LANDCOVER_MAP_HeaderFile
+#define HYDROData_LANDCOVER_MAP_HeaderFile
+
+#include <HYDROData_Entity.h>
+
+DEFINE_STANDARD_HANDLE( HYDROData_LandCoverMap, HYDROData_Entity )
+
+class TopoDS_Face;
+class TopoDS_Shell;
+class Handle( HYDROData_Polyline );
+class Handle( HYDROData_Object );
+
+class HYDROData_LandCoverMap : public HYDROData_Entity
+{
+protected:
+ friend class HYDROData_Iterator;
+
+ enum DataTag
+ {
+ DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
+ DataTag_Shape, ///< the shape presentation of the land cover map
+ DataTag_Types,
+ };
+
+ HYDROData_LandCoverMap();
+ ~HYDROData_LandCoverMap();
+
+ int GetNbFaces() const;
+ TopoDS_Face GetFace( int theIndex ) const;
+
+ QString GetStricklerType( int theIndex ) const;
+ void SetStricklerType( int theIndex, const QString& theType );
+
+ bool ImportQGIS( const QString& theFileName );
+ bool ExportQGIS( const QString& theFileName ) const;
+ bool ExportTelemac( const QString& theFileName ) const;
+
+ bool Add( const Handle( HYDROData_Object )&, const QString& theType );
+ bool Add( const Handle( HYDROData_Polyline )&, const QString& theType );
+
+ bool Remove( int theIndex );
+
+ bool Split( const Handle( HYDROData_Polyline )& );
+ bool Merge( const QList<int>&, const QString& theType );
+
+protected:
+ TopoDS_Shell GetShape() const;
+ void SetShape( const TopoDS_Shell& );
+
+public:
+ DEFINE_STANDARD_RTTI( HYDROData_LandCoverMap );
+};
+
+#endif