for(anIndex = 0; anIndex < aSubsToKeepNb; ++anIndex) {
AttributeSelectionPtr anAttrSelectionInList = aSubShapesToKeepAttrList->value(anIndex);
GeomShapePtr aSubShapeToKeep = anAttrSelectionInList->value();
- if (aSubShapeToKeep.get() &&
- (aSubShapeToKeep->isEqual(aSubShape) || aSubShapeToKeep->isSubShape(aSubShape))) {
+ if (aSubShapeToKeep.get() && aSubShapeToKeep->isEqual(aSubShape)) {
break;
}
}
for(anIndex = 0; anIndex < aSubsToRemoveNb; ++anIndex) {
AttributeSelectionPtr anAttrSelectionInList = aSubShapesToRemoveAttrList->value(anIndex);
GeomShapePtr aSubShapeToRemove = anAttrSelectionInList->value();
- if (aSubShapeToRemove.get() &&
- (aSubShapeToRemove->isEqual(aSubShape) || aSubShapeToRemove->isSubShape(aSubShape))) {
+ if (aSubShapeToRemove.get() && aSubShapeToRemove->isEqual(aSubShape)) {
break;
}
}
return false;
}
- ListOfShape aSubShapes = GeomAlgoAPI_ShapeTools::getLowLevelSubShapes(aBaseShape);
- // add to the list all sub-shapes of the compound due to they can be selected as a shapes to keep
- for (GeomAPI_ShapeIterator anIt(aBaseShape); anIt.more(); anIt.next())
- aSubShapes.push_back(anIt.current());
+ std::list<GeomShapePtr> aSubShapes = GeomAlgoAPI_ShapeTools::getLowLevelSubShapes(aBaseShape);
for(int anIndex = 0; anIndex < aSubShapesAttrList->size(); ++anIndex) {
bool isSameFound = false;
AttributeSelectionPtr anAttrSelectionInList = aSubShapesAttrList->value(anIndex);
Remove_SubShapes_1.setSubShapesToRemove([model.selection("COMPSOLID", "Partition_1_1_1/Partition_1_1_1")])
model.do()
+# check error when compsolid is selected
+assert(Remove_SubShapes_1.feature().error() != "")
+
+# fix the problematic feature
+Remove_SubShapes_1.setSubShapesToRemove([model.selection("SOLID", "Partition_1_1_1_1"), model.selection("SOLID", "Partition_1_1_1_2"), model.selection("SOLID", "Partition_1_1_1_3")])
+model.do()
+assert(Remove_SubShapes_1.feature().error() == "")
+
# check number of sub-shapes
model.testNbResults(Remove_SubShapes_1, 1)
model.testNbSubResults(Remove_SubShapes_1, [2])
Remove_SubShapes_1.setSubShapesToKeep([model.selection("COMPSOLID", "Partition_1_1_1")])
model.do()
+# check error when compsolid is selected
+assert(Remove_SubShapes_1.feature().error() != "")
+
+# fix the problematic feature
+Remove_SubShapes_1.setSubShapesToKeep([model.selection("SOLID", "Partition_1_1_1_1"), model.selection("SOLID", "Partition_1_1_1_2"), model.selection("SOLID", "Partition_1_1_1_3")])
+model.do()
+assert(Remove_SubShapes_1.feature().error() == "")
+
# check number of sub-shapes
model.testNbResults(Remove_SubShapes_1, 1)
model.testNbSubResults(Remove_SubShapes_1, [3])