From 0ab4e621833f4eae945a3762c9a29ee12e2eec53 Mon Sep 17 00:00:00 2001 From: msv Date: Tue, 19 Dec 2017 16:01:06 +0300 Subject: [PATCH] 0028248: [Regression] HLR Algo result is retrieved from the last added shape only Mistakes in retrieving of HLRBRep_EdgeData by value instead of reference have been corrected. --- src/HLRBRep/HLRBRep_InternalAlgo.cxx | 6 ++--- tests/bugs/modalg_7/bug28248 | 35 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 tests/bugs/modalg_7/bug28248 diff --git a/src/HLRBRep/HLRBRep_InternalAlgo.cxx b/src/HLRBRep/HLRBRep_InternalAlgo.cxx index ca885ca044..c13cb06b8e 100644 --- a/src/HLRBRep/HLRBRep_InternalAlgo.cxx +++ b/src/HLRBRep/HLRBRep_InternalAlgo.cxx @@ -165,7 +165,7 @@ void HLRBRep_InternalAlgo::Update () SB.Bounds(v1,v2,e1,e2,f1,f2); for (Standard_Integer e = e1; e <= e2; e++) { - HLRBRep_EdgeData ed = aEDataArray.ChangeValue(e); + HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e); HLRAlgo::DecodeMinMax(ed.MinMax(), TheMin, TheMax); if (FirstTime) { FirstTime = Standard_False; @@ -307,7 +307,7 @@ void HLRBRep_InternalAlgo::InitEdgeStatus () Standard_Integer nf = myDS->NbFaces(); for (Standard_Integer e = 1; e <= ne; e++) { - HLRBRep_EdgeData ed = aEDataArray.ChangeValue(e); + HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e); if (ed.Selected()) ed.Status().ShowAll(); } // for (Standard_Integer f = 1; f <= nf; f++) { @@ -368,7 +368,7 @@ void HLRBRep_InternalAlgo::Select () Standard_Integer nf = myDS->NbFaces(); for (Standard_Integer e = 1; e <= ne; e++) { - HLRBRep_EdgeData ed = aEDataArray.ChangeValue(e); + HLRBRep_EdgeData& ed = aEDataArray.ChangeValue(e); ed.Selected(Standard_True); } diff --git a/tests/bugs/modalg_7/bug28248 b/tests/bugs/modalg_7/bug28248 new file mode 100644 index 0000000000..93bdfa8890 --- /dev/null +++ b/tests/bugs/modalg_7/bug28248 @@ -0,0 +1,35 @@ +puts "=======" +puts "OCC28248" +puts "=======" +puts "" +################################################################ +# HLR Algo result is retrieved from the last added shape only +################################################################ + +box b1 -10 -10 0 20 20 5 +pcylinder c1 5 10 + +hprj proj 0 0 0 0 1 0 0 0 1 +hremove + +houtl b1_outl b1 +hfill b1_outl proj 0 +hload b1_outl + +houtl c1_outl c1 +hfill c1_outl proj 0 +hload c1_outl + +hsetprj proj +hupdate +hhide +hres2d + +compound vl v1l vnl vol vil hl h1l hnl hol hil result + +checknbshapes result -edge 16 + +don result +smallview +X+Y +fit +checkview -screenshot -2d -path ${imagedir}/${test_image}.png