#include <HYDROData_Tool.h>
#include <HYDROData_InterpolatorsFactory.h>
+#include <TDataStd_Real.hxx>
#include <TDataStd_Integer.hxx>
#include <TDataXtd_Position.hxx>
static const int TAG_OBJECTS = 2; // tag of the objects sub-tree
static const int TAG_HISTORY = 3; // tag of the history sub-tree (Root for History)
static const int TAG_LOCAL_CS = 4; // tag of local coordinate system information
+static const int TAG_DEF_STRICKLER_COEFF = 5; // tag of default strickler coefficient
static const gp_Pnt2d DEFAULT_LOCAL_CS( 0, 0 );
using namespace std;
HYDROData_Application::GetApplication()->RemoveDocument(this);
}
+double HYDROData_Document::GetDefaultStricklerCoefficient() const
+{
+ double aRes = 0;
+ TDF_Label aLabel = myDoc->Main().FindChild(TAG_DEF_STRICKLER_COEFF, Standard_False);
+ if ( !aLabel.IsNull() )
+ {
+ Handle(TDataStd_Real) anAttr;
+ if ( aLabel.FindAttribute( TDataStd_Real::GetID(), anAttr ) )
+ aRes = anAttr->Get();
+ }
+
+ return aRes;
+}
+
+void HYDROData_Document::SetDefaultStricklerCoefficient( double theCoeff ) const
+{
+ TDF_Label aLabel = myDoc->Main().FindChild(TAG_DEF_STRICKLER_COEFF);
+ if ( !aLabel.IsNull() )
+ {
+ Handle(TDataStd_Real) anAttr;
+ if ( !aLabel.FindAttribute( TDataStd_Real::GetID(), anAttr ) )
+ aLabel.AddAttribute( anAttr = new TDataStd_Real() );
+ anAttr->Set( theCoeff );
+ }
+}
+
bool HYDROData_Document::DumpToPython( const QString& theFileName,
const bool theIsMultiFile ) const
{
// Dump all model objects to Python script
aRes = aRes && dumpPartitionToPython( aFile, theIsMultiFile, aTreatedObjects, KIND_IMAGE );
+ aRes = aRes && dumpPartitionToPython( aFile, theIsMultiFile, aTreatedObjects, KIND_STRICKLER_TABLE );
aRes = aRes && dumpPartitionToPython( aFile, theIsMultiFile, aTreatedObjects, KIND_POLYLINEXY );
aRes = aRes && dumpPartitionToPython( aFile, theIsMultiFile, aTreatedObjects, KIND_BATHYMETRY );
aRes = aRes && dumpPartitionToPython( aFile, theIsMultiFile, aTreatedObjects, KIND_PROFILE );