return;
}
std::shared_ptr<GeomAPI_Shape> aWire(new GeomAPI_Shape);
+ std::shared_ptr<GeomAPI_Shape> aBShape(new GeomAPI_Shape);
aWire->setImpl(new TopoDS_Shape(aPipeWire));
- aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aPipeBuilder, aWire));
+ aBShape->setImpl(new TopoDS_Shape(aBasisShape));
+ aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aPipeBuilder, aWire, aBShape)));
TopoDS_Shape aResult = aPipeBuilder->Shape();
// Orienting bounding planes.
if(!aToCutBuilder->IsDone()) {
return;
}
- aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aToCutBuilder));
+ aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aToCutBuilder)));
const TopTools_ListOfShape& aToShapes = aToCutBuilder->Modified(aToShape);
for(TopTools_ListIteratorOfListOfShape anIt(aToShapes); anIt.More(); anIt.Next()) {
std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
if(!aFromCutBuilder->IsDone()) {
return;
}
- aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aFromCutBuilder));
+ aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aFromCutBuilder)));
const TopTools_ListOfShape& aFromShapes = aFromCutBuilder->Modified(aFromShape);
for(TopTools_ListIteratorOfListOfShape anIt(aFromShapes); anIt.More(); anIt.Next()) {
std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
if(aResult.ShapeType() == TopAbs_COMPOUND) {
aResult = GeomAlgoAPI_DFLoader::refineResult(aResult);
}
-
- myShape = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape);
- myShape->setImpl(new TopoDS_Shape(aResult));
+ if(aResult.ShapeType() == TopAbs_COMPOUND) {
+ std::shared_ptr<GeomAPI_Shape> aCompound(new GeomAPI_Shape);
+ aCompound->setImpl(new TopoDS_Shape(aResult));
+ ListOfShape aCompSolids, aFreeSolids;
+ GeomAlgoAPI_ShapeTools::combineShapes(aCompound, GeomAPI_Shape::COMPSOLID, aCompSolids, aFreeSolids);
+ if(aCompSolids.size() == 1 && aFreeSolids.size() == 0) {
+ aResult = aCompSolids.front()->impl<TopoDS_Shape>();
+ } else if (aCompSolids.size() > 1 || (aCompSolids.size() >= 1 && aFreeSolids.size() >= 1)) {
+ TopoDS_Compound aResultComp;
+ TopoDS_Builder aBuilder;
+ aBuilder.MakeCompound(aResultComp);
+ for(ListOfShape::const_iterator anIter = aCompSolids.cbegin(); anIter != aCompSolids.cend(); anIter++) {
+ aBuilder.Add(aResultComp, (*anIter)->impl<TopoDS_Shape>());
+ }
+ for(ListOfShape::const_iterator anIter = aFreeSolids.cbegin(); anIter != aFreeSolids.cend(); anIter++) {
+ aBuilder.Add(aResultComp, (*anIter)->impl<TopoDS_Shape>());
+ }
+ aResult = aResultComp;
+ }
+ }
// Fill data map to keep correct orientation of sub-shapes.
myMap = std::shared_ptr<GeomAPI_DataMapOfShapeShape>(new GeomAPI_DataMapOfShapeShape);
aCurrentShape->setImpl(new TopoDS_Shape(Exp.Current()));
myMap->bind(aCurrentShape, aCurrentShape);
}
-
+ myShape = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape);
+ myShape->setImpl(new TopoDS_Shape(aResult));
myMkShape = std::shared_ptr<GeomAlgoAPI_MakeShapeList>(new GeomAlgoAPI_MakeShapeList(aListOfMakeShape));
myDone = true;
}