// Get older tools and main shape
if (aMainObjectShape->shapeType() == GeomAPI_Shape::COMPOUND){
- ListOfShape aMainObjectSubShapes = aMainObjectShape->subShapes(GeomAPI_Shape::SOLID);
- for (auto it = aMainObjectSubShapes.begin(); it != aMainObjectSubShapes.end(); it++) {
- if (it == aMainObjectSubShapes.begin())
- aMainObjectShape = *it;
- else
+ //Get COMPOUND and SOLID Shape list
+ ListOfShape aSubSolidShapeList = aMainObjectShape->subShapes(GeomAPI_Shape::SOLID);
+ ListOfShape aSubCompoundShapeList = aMainObjectShape->subShapes(GeomAPI_Shape::COMPOUND);
+ //Get main solid
+ aMainObjectShape = *(aSubSolidShapeList.begin());
+ //Only add node in compound
+ if (aSubCompoundShapeList.size() > 1) {
+ aSubCompoundShapeList.pop_back();
+ for (auto it = aSubCompoundShapeList.begin(); it != aSubCompoundShapeList.end(); it++)
aToolList.push_back(*it);
}
+ // Only solid in compound
+ else
+ {
+ aSubSolidShapeList.pop_front();
+ for (auto it = aSubCompoundShapeList.begin(); it != aSubCompoundShapeList.end(); it++)
+ aToolList.push_back(*it);
+ }
+ //TODO Merge to allow both in AddNode
}
// Get Case