HYDROData_SplitToZonesTool.h
HYDROData_Stream.h
HYDROData_StreamAltitude.h
+ HYDROData_StricklerTable.h
HYDROData_Tool.h
HYDROData_Transform.h
HYDROData_VisualState.h
HYDROData_SplitToZonesTool.cxx
HYDROData_Stream.cxx
HYDROData_StreamAltitude.cxx
+ HYDROData_StricklerTable.cxx
HYDROData_Tool.cxx
HYDROData_Transform.cxx
HYDROData_VisualState.cxx
test_HYDROData_Iterator.h
test_HYDROData_OperationsFactory.h
test_HYDROData_PolylineXY.h
+ test_HYDROData_StricklerTable.h
)
set(TEST_SOURCES
test_HYDROData_Iterator.cxx
test_HYDROData_OperationsFactory.cxx
test_HYDROData_PolylineXY.cxx
+ test_HYDROData_StricklerTable.cxx
)
set(TEST_EXE test_HYDROData)
const ObjectKind KIND_SPLITTED_GROUP = 23;
const ObjectKind KIND_STREAM_ALTITUDE = 24;
const ObjectKind KIND_OBSTACLE_ALTITUDE = 25;
+const ObjectKind KIND_STRICKLER_TABLE = 26;
const ObjectKind KIND_LAST = KIND_OBSTACLE_ALTITUDE;
DEFINE_STANDARD_HANDLE(HYDROData_Entity, MMgt_TShared)
--- /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_StricklerTable.h>
+#include <TDataStd_NamedData.hxx>
+
+IMPLEMENT_STANDARD_HANDLE( HYDROData_StricklerTable, HYDROData_Entity )
+IMPLEMENT_STANDARD_RTTIEXT( HYDROData_StricklerTable, HYDROData_Entity )
+
+HYDROData_StricklerTable::HYDROData_StricklerTable()
+{
+}
+
+HYDROData_StricklerTable::~HYDROData_StricklerTable()
+{
+}
+
+const ObjectKind HYDROData_StricklerTable::GetKind() const
+{
+ return KIND_STRICKLER_TABLE;
+}
+
+bool HYDROData_StricklerTable::Import( const TCollection_AsciiString& theFileName )
+{
+ FILE* aFile = fopen( theFileName.ToCString(), "r" );
+ if( !aFile )
+ return false;
+
+ const int aBufLen = 256;
+ char aBuf[aBufLen];
+ while( !feof( aFile ) )
+ {
+ fgets( aBuf, aBufLen, aFile );
+ std::string aStr = aBuf;
+ }
+ return false;
+}
+
+bool HYDROData_StricklerTable::Export( const TCollection_AsciiString& theFileName )
+{
+ //TODO
+ return false;
+}
+
+double HYDROData_StricklerTable::Get( const TCollection_ExtendedString& theType, double theDefault ) const
+{
+ Handle( TDataStd_NamedData ) aMap = Map();
+ if( aMap->HasReal( theType ) )
+ return aMap->GetReal( theType );
+ else
+ return theDefault;
+}
+
+void HYDROData_StricklerTable::Set( const TCollection_ExtendedString& theType, double theCoefficient )
+{
+ Handle( TDataStd_NamedData ) aMap = Map();
+ aMap->SetReal( theType, theCoefficient );
+}
+
+Handle( TDataStd_NamedData ) HYDROData_StricklerTable::Map() const
+{
+ TDF_Label aLabel = myLab.FindChild( DataTag_Table );
+ Handle( TDataStd_NamedData ) aMap;
+ if( !aLabel.FindAttribute( TDataStd_NamedData::GetID(), aMap ) )
+ aMap = TDataStd_NamedData::Set( aLabel );
+ return aMap;
+}
--- /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_STRICKLERTABLE_HeaderFile
+#define HYDROData_STRICKLERTABLE_HeaderFile
+
+#include <HYDROData_Entity.h>
+
+class Handle( TDataStd_NamedData );
+
+DEFINE_STANDARD_HANDLE( HYDROData_StricklerTable, HYDROData_Entity )
+
+class HYDROData_StricklerTable : public HYDROData_Entity
+{
+protected:
+ enum DataTag
+ {
+ DataTag_Table = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
+ };
+
+ HYDRODATA_EXPORT HYDROData_StricklerTable();
+ HYDRODATA_EXPORT ~HYDROData_StricklerTable();
+
+public:
+ DEFINE_STANDARD_RTTI( HYDROData_StricklerTable );
+
+ HYDRODATA_EXPORT virtual const ObjectKind GetKind() const;
+
+ bool Import( const TCollection_AsciiString& theFileName );
+ bool Export( const TCollection_AsciiString& theFileName );
+
+ double Get( const TCollection_ExtendedString& theType, double theDefault ) const;
+ void Set( const TCollection_ExtendedString& theType, double theCoefficient );
+
+private:
+ Handle( TDataStd_NamedData ) Map() const;
+};
+
+#endif
--- /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 <test_HYDROData_StricklerTable.h>
+#include <HYDROData_Document.h>
+
+void test_HYDROData_StricklerTable::testImport()
+{
+ Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
+
+ Handle(HYDROData_Entity) anObj = aDoc->CreateObject( KIND_STRICKLER_TABLE );
+ TCollection_AsciiString aFileName = "test_name";
+
+ aDoc->Close();
+}
--- /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
+//
+
+#ifdef WIN32
+ #pragma warning( disable: 4251 )
+#endif
+
+#include <cppunit/extensions/HelperMacros.h>
+
+class test_HYDROData_StricklerTable : public CppUnit::TestFixture
+{
+ CPPUNIT_TEST_SUITE( test_HYDROData_StricklerTable );
+ CPPUNIT_TEST( testImport );
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ void testImport();
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION( test_HYDROData_StricklerTable );
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( test_HYDROData_StricklerTable, "HYDROData_StricklerTable" );
+
+#ifdef WIN32
+ #pragma warning( default: 4251 )
+#endif
--- /dev/null
+"Zones de champs, prairies, sans cultures" 20.0
+"Zones de champs cultivé à végétation basse" 17.5
+"Zones de champs cultivé à végétation haute" 12.5
+"Zones d'arbustes, de sous-bois" 10.0
+"Zones à faible urbanization (bourg)" 9.0
+"Zones à forte urbanization (agglomération)" 9.0
+"Canaux naturels" 35.0
+"Canaux artificiels en béton" 65.0