From 148fc44cfb9114849974f209db4c8596e0d97507 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Fri, 1 Jun 2018 09:39:05 +0200 Subject: [PATCH] debug salome tests --- .../examples/h014_caseDigueManualInterpolZ.py | 2 +- .../examples/h017_interpolationLineaire.py | 2 +- .../examples/h018_streamInterpolation.py | 19 ++++++++++++++++++- src/HYDROData/HYDROData_CalculationCase.cxx | 1 + src/HYDROData/HYDROData_Region.cxx | 8 ++++++++ src/HYDROData/HYDROData_ShapesGroup.cxx | 11 ++++++++++- 6 files changed, 39 insertions(+), 4 deletions(-) diff --git a/doc/salome/examples/h014_caseDigueManualInterpolZ.py b/doc/salome/examples/h014_caseDigueManualInterpolZ.py index adfe9dcf..0b34a67a 100644 --- a/doc/salome/examples/h014_caseDigueManualInterpolZ.py +++ b/doc/salome/examples/h014_caseDigueManualInterpolZ.py @@ -613,7 +613,7 @@ m3d = True statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef, interpolMethod, m3d) #print statz refstatz = {'riveDroite': (10.88, 32.61, 24.09, 5.13, 17.57, 31.33, 0.2), - 'riveGauche': (7.72, 72.40, 21.59, 8.37, 16.71, 35.71, 0.2), + 'riveGauche': (7.72, 72.40, 21.59, 8.37, 16.71, 35.71, 0.3), 'litMineur': (2.06, 25.41, 13.93, 4.33, 8.47, 21.78), 'digue': (14.10, 27.09, 22.01, 2.56, 18.15, 25.02)} controlStatZ(statz, refstatz) diff --git a/doc/salome/examples/h017_interpolationLineaire.py b/doc/salome/examples/h017_interpolationLineaire.py index d9be303b..86ef8dea 100644 --- a/doc/salome/examples/h017_interpolationLineaire.py +++ b/doc/salome/examples/h017_interpolationLineaire.py @@ -365,7 +365,7 @@ m3d = True # --- Z interpolation on the bathymety/altimetry on the mesh nodes statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef, interpolMethod, m3d) #print statz -refstatz = {'domaine': (27.10, 168.28, 91.77, 46.047, 28.637, 161.17)} +refstatz = {'domaine': (27.10, 168.28, 91.77, 46.047, 28.637, 161.17, 0.2)} controlStatZ(statz, refstatz) # --- add a field on nodes of type double with z values, named "BOTTOM" diff --git a/doc/salome/examples/h018_streamInterpolation.py b/doc/salome/examples/h018_streamInterpolation.py index 23e2d5c3..263eb1df 100644 --- a/doc/salome/examples/h018_streamInterpolation.py +++ b/doc/salome/examples/h018_streamInterpolation.py @@ -358,8 +358,25 @@ geompy = geomBuilder.New(theStudy) # --- manual definition: useful groups of edges Case_1_plaine_Outer = geompy.CreateGroup(HYDRO_Case_1, geompy.ShapeType["EDGE"]) geompy.UnionIDs(Case_1_plaine_Outer, [4, 12, 19, 23, 25, 21, 14, 9]) + +# --- manual identification of all useful edge groups (boundary conditions) + +allEdgesIds = geompy.SubShapeAllIDs(HYDRO_Case_1, geompy.ShapeType["EDGE"]) +print "allEdgesIds", allEdgesIds + +(isDone, ClosedFreeBoundary, OpenFreeBoundary) = geompy.GetFreeBoundary(HYDRO_Case_1) +geompy.addToStudyInFather(HYDRO_Case_1, ClosedFreeBoundary[0], "ClosedFreeBoundary") + +freeBoundary = geompy.ExtractShapes(ClosedFreeBoundary[0], geompy.ShapeType["EDGE"], True) +freeBoundaryIds = [ geompy.GetSubShapeID(HYDRO_Case_1, freeBoundary[i]) for i in range(len(freeBoundary)) ] +print "freeBoundaryIds", freeBoundaryIds + +edges_litMineur = geompy.GetSharedShapesMulti([HYDRO_Case_1, litMineur], geompy.ShapeType["EDGE"], True) +edges_litMineurIds = [ geompy.GetSubShapeID(HYDRO_Case_1, edges_litMineur[i]) for i in range(len(edges_litMineur)) ] +sectionsIds = [Id for Id in edges_litMineurIds if Id in freeBoundaryIds] +print "sectionsIds", sectionsIds sections = geompy.CreateGroup(HYDRO_Case_1, geompy.ShapeType["EDGE"]) -geompy.UnionIDs(sections, [14, 12]) +geompy.UnionIDs(sections, sectionsIds) # --- publish in study geompy.addToStudyInFather( HYDRO_Case_1, riveGauche, 'riveGauche' ) diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index aac4b9ba..7a18f687 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -1074,6 +1074,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, QString& theErrorMsg, QString& statMess) const { + DEBTRACE("Export"); HYDROData_ShapesGroup::SeqOfGroupsDefs aSeqOfGroupsDefs; // Get groups definitions diff --git a/src/HYDROData/HYDROData_Region.cxx b/src/HYDROData/HYDROData_Region.cxx index 80c005cc..5961978f 100644 --- a/src/HYDROData/HYDROData_Region.cxx +++ b/src/HYDROData/HYDROData_Region.cxx @@ -51,6 +51,9 @@ #include "gp_Pln.hxx" #include "BRepTools_ReShape.hxx" +//#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + //#define DEB_GET_REGION_SHAPE IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Region, HYDROData_Entity) @@ -246,6 +249,7 @@ void getUsedGroups( const TopoDS_Shape& theShape, TopoDS_Shape HYDROData_Region::GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs* theSeqOfGroups, const TopTools_SequenceOfShape* IntSh ) const { + DEBTRACE("GetShape"); HYDROData_ShapesGroup::SeqOfGroupsDefs aSeqOfGroups; HYDROData_ShapesGroup::SeqOfGroupsDefs aSeqOfUsedGroups; if ( theSeqOfGroups ) @@ -285,6 +289,7 @@ TopoDS_Shape HYDROData_Region::GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs* getUsedGroups( aZoneFace, aSeqOfGroups, aSeqOfUsedGroups ); } // zones iterator + DEBTRACE("--- IntSh->Length():" << IntSh->Length()); for (int i = 1; i <= IntSh->Length(); i++) { const TopoDS_Shape& CS = (*IntSh)(i); @@ -299,6 +304,7 @@ TopoDS_Shape HYDROData_Region::GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs* if ( aRegionFacesList.Extent() == 1 ) { + DEBTRACE("--- aRegionFacesList.Extent() == 1 "); aResShape = TopoDS::Face( aRegionFacesList.First() ); } else @@ -330,6 +336,7 @@ TopoDS_Shape HYDROData_Region::GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs* //update history of internal edges TopTools_IndexedMapOfShape DIE; TopTools_ListOfShape newSh1, newSh2; + DEBTRACE("IE.Extent():" << IE.Extent()); for (int i = 1; i <= IE.Extent(); i++) { const TopoDS_Shape& CSH = IE(i); @@ -368,6 +375,7 @@ TopoDS_Shape HYDROData_Region::GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs* TopoDS_Face DF; if (!IE.IsEmpty()) { + DEBTRACE("---!IE.IsEmpty() "); //add dummy face to existing shell //this face contains all internal edges //USD algo will skip such edges and will not perform unifying through them diff --git a/src/HYDROData/HYDROData_ShapesGroup.cxx b/src/HYDROData/HYDROData_ShapesGroup.cxx index 96b3d6c9..7eaad896 100644 --- a/src/HYDROData/HYDROData_ShapesGroup.cxx +++ b/src/HYDROData/HYDROData_ShapesGroup.cxx @@ -32,6 +32,9 @@ #include #include +//#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ShapesGroup,HYDROData_Entity) void HYDROData_ShapesGroup::GroupDefinition::Update( SeqOfGroupsDefs* theGroupsDefs, @@ -93,7 +96,13 @@ void HYDROData_ShapesGroup::GroupDefinition::Update( SeqOfGroupsDefs* { TopoDS_Shape aShape = aGroupDef.Shapes.Value( i ); - TopoDS_Shape aGeneratedByAlgo = theAlgo->History()->Modified(aShape).First(); //??TODO check + TopoDS_Shape aGeneratedByAlgo = TopoDS_Shape(); + if ( !theAlgo->History().IsNull() && ! aShape.IsNull()) + { + const TopTools_ListOfShape& listModified = theAlgo->History()->Modified(aShape); + if (listModified.Extent() > 0) + aGeneratedByAlgo = listModified.First(); + } if ( aGeneratedByAlgo.IsNull() ) { // Edge has been removed -- 2.39.2