small modifications

This commit is contained in:
rnc 2012-03-05 15:33:17 +00:00
parent ee148cc6a5
commit 87ceb14207

View File

@ -203,25 +203,19 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
for(;anExp.More();anExp.Next()) for(;anExp.More();anExp.Next())
{ {
solidCount++; solidCount++;
} if (solidCount > 1)
if (solidCount == 0)
{
Standard_ConstructionError::Raise("The input shape is a compound without any solid");
}
else if (solidCount > 1)
{
Standard_ConstructionError::Raise("The input shape is a compound with more than one solid"); Standard_ConstructionError::Raise("The input shape is a compound with more than one solid");
} }
if (solidCount == 0)
Standard_ConstructionError::Raise("The input shape is a compound without any solid");
} }
TopoDS_Face aFaceBase; // if (aSketch.ShapeType() == TopAbs_FACE)
// {
if (aSketch.ShapeType() == TopAbs_FACE) // aFaceBase = TopoDS::Face(aSketch);
{ // }
aFaceBase = TopoDS::Face(aSketch); // else
} // {
else
{
TopoDS_Wire aWire = TopoDS_Wire(); TopoDS_Wire aWire = TopoDS_Wire();
if (aSketch.ShapeType() == TopAbs_EDGE) if (aSketch.ShapeType() == TopAbs_EDGE)
@ -234,7 +228,7 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
} }
else else
{ {
Standard_ConstructionError::Raise("The input sketch is not a wire, an edge or a face"); Standard_ConstructionError::Raise("The input profile is neither a wire, nor edge");
} }
TopoDS_Vertex aV1, aV2; TopoDS_Vertex aV1, aV2;
@ -243,7 +237,7 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
aWire.Closed( true ); aWire.Closed( true );
if (!aWire.Closed()) if (!aWire.Closed())
Standard_ConstructionError::Raise("The edge or wire is not closed"); Standard_ConstructionError::Raise("The input profile is not closed");
// history of the Base wire (RefBase) // history of the Base wire (RefBase)
Handle(GEOM_Object) aSuppObj; Handle(GEOM_Object) aSuppObj;
@ -260,7 +254,7 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
} }
// Construction of the face if the wire hasn't any support face // Construction of the face if the wire hasn't any support face
aFaceBase = BRepBuilderAPI_MakeFace(aWire); TopoDS_Face aFaceBase = BRepBuilderAPI_MakeFace(aWire);
if(!aSuppObj.IsNull()) // If the wire has a support if(!aSuppObj.IsNull()) // If the wire has a support
{ {
@ -278,7 +272,7 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
aFaceBase=aTempFace; aFaceBase=aTempFace;
} }
} }
} // }
// Invert height and angle if the operation is an extruded cut // Invert height and angle if the operation is an extruded cut
bool invert = !isProtrusion; bool invert = !isProtrusion;