aExp.Init(aS, myType);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Shape& aST = aExp.Current();
- if (!myImages.IsBound(aST)) {
- BOPCol_ListOfShape aLS;
- aLS.Append(aS);
- myIndex.Add(aST, aLS);
+ const BOPCol_ListOfShape* pLSIm = myImages.Seek(aST);
+ if (!pLSIm) {
+ BOPCol_ListOfShape* pLS = myIndex.ChangeSeek(aST);
+ if (!pLS) {
+ pLS = &myIndex(myIndex.Add(aST, BOPCol_ListOfShape()));
+ }
+ pLS ->Append(aS);
continue;
}
//
- const BOPCol_ListOfShape& aLSIm = myImages.Find(aST);
- aItIm.Initialize(aLSIm);
+ aItIm.Initialize(*pLSIm);
for (; aItIm.More(); aItIm.Next()) {
const TopoDS_Shape& aSTIm = aItIm.Value();
//
- if (myIndex.Contains(aSTIm)) {
- BOPCol_ListOfShape& aLS = myIndex.ChangeFromKey(aSTIm);
- aLS.Append(aS);
- }
- else {
- BOPCol_ListOfShape aLS;
- aLS.Append(aS);
- myIndex.Add(aSTIm, aLS);
+ BOPCol_ListOfShape* pLS = myIndex.ChangeSeek(aSTIm);
+ if (!pLS) {
+ pLS = &myIndex(myIndex.Add(aSTIm, BOPCol_ListOfShape()));
}
+ pLS ->Append(aS);
} // for (; aItIm.More(); aItIm.Next()) {
} // for (; aExp.More(); aExp.Next()) {
} // for (; aIt.More(); aIt.Next()) {
--- /dev/null
+puts "========"
+puts "OCC27987"
+puts "========"
+puts ""
+#################################################
+# CellsBuilder algorithm does not find shared common parts of the arguments
+#################################################
+
+restore [locate_data_file bug27987.brep] b
+
+explode b
+bclearobjects
+bcleartools
+baddobjects b_1
+baddtools b_2
+bfillds
+bcbuild rx
+bcadd result b_1 1 b_2 1
+
+checknbshapes result -face 1
+checkview -display result -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file