PAL9074. Now MakeSolidShells() makes one solid of all given shells like OCC MakeSolid() does

This commit is contained in:
eap 2005-06-30 08:24:39 +00:00
parent d43286833e
commit 74a4d30fb0

View File

@ -226,8 +226,7 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
unsigned int ind, nbshapes = aShapes->Length(); unsigned int ind, nbshapes = aShapes->Length();
Standard_Integer ish = 0; Standard_Integer ish = 0;
TopoDS_Solid Sol; TopoDS_Solid Sol;
TopoDS_Compound Res; B.MakeSolid(Sol);
B.MakeCompound(Res);
// add shapes // add shapes
for (ind = 1; ind <= nbshapes; ind++) { for (ind = 1; ind <= nbshapes; ind++) {
@ -237,20 +236,21 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
Standard_NullObject::Raise("Shell for solid construction is null"); Standard_NullObject::Raise("Shell for solid construction is null");
} }
if (aShapeShell.ShapeType() == TopAbs_SHELL) { if (aShapeShell.ShapeType() == TopAbs_SHELL) {
B.MakeSolid(Sol);
B.Add(Sol, aShapeShell); B.Add(Sol, aShapeShell);
BRepClass3d_SolidClassifier SC (Sol);
SC.PerformInfinitePoint(Precision::Confusion());
if (SC.State() == TopAbs_IN) {
B.MakeSolid(Sol);
B.Add(Sol, aShapeShell.Reversed());
}
B.Add(Res, Sol);
ish++; ish++;
} }
} }
if (ish == 1) aShape = Sol; if ( ish == 0 ) return 0;
else aShape = Res; BRepClass3d_SolidClassifier SC (Sol);
SC.PerformInfinitePoint(Precision::Confusion());
switch (SC.State()) {
case TopAbs_IN:
aShape = Sol.Reversed(); break;
case TopAbs_OUT:
aShape = Sol; break;
default: // not closed shell?
return 0;
}
} else if (aType == COMPOUND_SHAPES) { } else if (aType == COMPOUND_SHAPES) {
Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes(); Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();