0028248: [Regression] HLR Algo result is retrieved from the last added shape only
authormsv <msv@opencascade.com>
Tue, 19 Dec 2017 13:01:06 +0000 (16:01 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 20 Dec 2017 15:51:43 +0000 (18:51 +0300)
Mistakes in retrieving of HLRBRep_EdgeData by value instead of reference have been corrected.

src/HLRBRep/HLRBRep_InternalAlgo.cxx
tests/bugs/modalg_7/bug28248 [new file with mode: 0644]

index ca885ca..c13cb06 100644 (file)
@@ -165,7 +165,7 @@ void HLRBRep_InternalAlgo::Update ()
       SB.Bounds(v1,v2,e1,e2,f1,f2);
 
       for (Standard_Integer e = e1; e <= e2; e++) {
       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;
         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++) {
   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++) {
     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++) {
     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);
     }
     
       ed.Selected(Standard_True);
     }
     
diff --git a/tests/bugs/modalg_7/bug28248 b/tests/bugs/modalg_7/bug28248
new file mode 100644 (file)
index 0000000..93bdfa8
--- /dev/null
@@ -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