From ddb6d9ecc62b008c5dac90ceb2d4d60f04d9b9e4 Mon Sep 17 00:00:00 2001 From: isn Date: Thu, 13 Oct 2016 14:40:28 +0300 Subject: [PATCH] some bug fixes --- src/HYDROData/HYDROData_CalculationCase.cxx | 30 ++++++++++++--------- src/HYDROData/HYDROData_GeomTool.h | 2 +- src/HYDROGUI/HYDROGUI_StreamDlg.cxx | 2 +- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index a66a0212..9323fe6c 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -1076,7 +1076,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, bool isAllNotSubmersible = true; HYDROData_SequenceOfObjects aCaseRegions = GetRegions(); HYDROData_SequenceOfObjects::Iterator aRegionIter( aCaseRegions ); - NCollection_IndexedDataMap aFacesToNames; + NCollection_IndexedDataMap aShToNames; for ( ; aRegionIter.More(); aRegionIter.Next() ) { Handle(HYDROData_Region) aRegion = @@ -1088,7 +1088,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, isAllNotSubmersible = false; TopoDS_Shape aRegionShape = aRegion->GetShape( &aSeqOfGroupsDefs ); - aFacesToNames.Add( aRegionShape, aRegion->GetName() ); + aShToNames.Add( aRegionShape, aRegion->GetName() ); } bool aRes = false; @@ -1098,7 +1098,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, } else if ( isAllNotSubmersible ) { theErrorMsg = QString("there are no submersible regions."); } else { - aRes = Export( theGeomEngine, theStudy, aFacesToNames, aSeqOfGroupsDefs, theGeomObjEntry );; + aRes = Export( theGeomEngine, theStudy, aShToNames, aSeqOfGroupsDefs, theGeomObjEntry );; } if( aRes && !GetLandCoverMap().IsNull() && !GetStricklerTable().IsNull() ) @@ -1111,7 +1111,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, SALOMEDS::Study_ptr theStudy, - const NCollection_IndexedDataMap& aFacesToName, + const NCollection_IndexedDataMap& aShToName, const HYDROData_ShapesGroup::SeqOfGroupsDefs& theGroupsDefs, QString& theGeomObjEntry ) const { @@ -1122,9 +1122,9 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var TCollection_AsciiString aNam("Sh_"); int i=1; #endif - for ( int i = 1; i <= aFacesToName.Extent(); i++ ) + for ( int i = 1; i <= aShToName.Extent(); i++ ) { - const TopoDS_Shape& aShape = aFacesToName.FindKey(i); + const TopoDS_Shape& aShape = aShToName.FindKey(i); if ( aShape.IsNull() ) continue; @@ -1158,14 +1158,18 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var NCollection_IndexedDataMap aFacesToNameModif; - for ( int i = 1; i <= aFacesToName.Extent(); i++ ) + for ( int i = 1; i <= aShToName.Extent(); i++ ) { - const TopoDS_Shape& CurShape = aFacesToName.FindKey(i); - const QString& Qstr = aFacesToName.FindFromIndex(i); - if (aSewing.IsModified(CurShape)) - aFacesToNameModif.Add(aSewing.Modified(CurShape), Qstr); - else - aFacesToNameModif.Add(CurShape, Qstr); + const TopoDS_Shape& CurShape = aShToName.FindKey(i); + const QString& Qstr = aShToName.FindFromIndex(i); + for (TopExp_Explorer Exp(CurShape, TopAbs_FACE); Exp.More(); Exp.Next()) + { + const TopoDS_Face& cf = TopoDS::Face(Exp.Current()); + if (aSewing.IsModified(cf)) + aFacesToNameModif.Add(aSewing.Modified(cf), Qstr); + else + aFacesToNameModif.Add(cf, Qstr); + } } diff --git a/src/HYDROData/HYDROData_GeomTool.h b/src/HYDROData/HYDROData_GeomTool.h index ab84b701..17d48314 100644 --- a/src/HYDROData/HYDROData_GeomTool.h +++ b/src/HYDROData/HYDROData_GeomTool.h @@ -118,7 +118,7 @@ public: static GEOM::GEOM_Object_ptr ExplodeShapeInGEOMandPublish( GEOM::GEOM_Gen_var theGeomEngine, SALOMEDS::Study_ptr theStudy, const TopoDS_Shape& theShape, - const NCollection_IndexedDataMap& aFacesToNameModif, + const NCollection_IndexedDataMap& aShToNameModif, const QString& theName, QString& theGeomObjEntry); diff --git a/src/HYDROGUI/HYDROGUI_StreamDlg.cxx b/src/HYDROGUI/HYDROGUI_StreamDlg.cxx index 06707d5f..9a4419ab 100644 --- a/src/HYDROGUI/HYDROGUI_StreamDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_StreamDlg.cxx @@ -57,7 +57,7 @@ HYDROGUI_StreamDlg::HYDROGUI_StreamDlg( HYDROGUI_Module* theModule, const QStrin myAxes = new QComboBox( aParamGroup ); myAxes->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myDDZ = new QDoubleSpinBox( aParamGroup ); - myDDZ->setRange( 0.1, 100 ); + myDDZ->setRange( 0.01, 100 ); myDDZ->setSingleStep( 0.1 ); myDDZ->setValue( 0.1 ); myDDZ->setDecimals( 2 ); -- 2.39.2