+
+ // Treat parts of a whole.
+ while (!aMapInc.IsEmpty()) {
+ TopTools_MapIteratorOfMapOfShape aMapIt(aMapInc);
+ const TopoDS_Shape &aWhole = myShapesInclusive.Find(aMapIt.Key());
+
+ if (!myImages.IsBound(aWhole)) {
+ // Should not be.
+ UpdateChecked(theS, 0);
+ myFound = Standard_False;
+ return 0;
+ }
+
+ const TopTools_ListOfShape& aLS1 = myImages.Find(aWhole);
+
+ if (aLS1.IsEmpty()) {
+ // Empty list of parts. Should not be.
+ UpdateChecked(theS, 0);
+ myFound = Standard_False;
+ return 0;
+ }
+
+ TopTools_ListIteratorOfListOfShape aItS1x(aLS1);
+
+ for (; aItS1x.More(); aItS1x.Next()) {
+ const TopoDS_Shape &aS1x = aItS1x.Value();
+
+ if (!aMapInc.Remove(aS1x)) {
+ // There is no aS1x in theS. Should not be.
+ UpdateChecked(theS, 0);
+ myFound = Standard_False;
+ return 0;
+ }
+ }
+
+ // Compare a shape with an image.
+ if (!CompareGProps(aWhole, aLS1)) {
+ // Image doesn't correspond to the shape.
+ UpdateChecked(theS, 0);
+ myFound = Standard_False;
+ return 0;
+ }
+ }
+
+ return myFound ? 1 : 0;