From 57da53bdb609f84fe8b58b2811cf1c55be5b6579 Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 20 Dec 2018 09:32:47 +0300 Subject: [PATCH] Avoid regression in Pipe unit tests --- src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp index 4ce80d3ff..57cfdf985 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Pipe.cpp @@ -77,15 +77,26 @@ GeomAlgoAPI_Pipe::GeomAlgoAPI_Pipe(const ListOfShape& theBaseShapes, void GeomAlgoAPI_Pipe::build(const GeomShapePtr theBaseShape, const GeomShapePtr thePathShape) { - // Getting base shape and path. - TopoDS_Shape aBaseShape; - TopAbs_ShapeEnum aBaseShapeType; - TopoDS_Wire aPathWire; - if (!getBase(aBaseShape, aBaseShapeType, theBaseShape) || - !getPath(aPathWire, thePathShape)) { + // Getting base shape. + if(!theBaseShape.get()) { + return; + } + TopoDS_Shape aBaseShape = theBaseShape->impl(); + if(aBaseShape.IsNull()) { + return; + } + TopAbs_ShapeEnum aBaseShapeType = aBaseShape.ShapeType(); + if(aBaseShapeType != TopAbs_VERTEX && aBaseShapeType != TopAbs_EDGE && + aBaseShapeType != TopAbs_WIRE && aBaseShapeType != TopAbs_FACE && + aBaseShapeType != TopAbs_SHELL && aBaseShapeType != TopAbs_COMPOUND) { return; } + // Getting path. + TopoDS_Wire aPathWire; + if(!getPath(aPathWire, thePathShape)) { + return; + } aPathWire.Move(getPathToBaseTranslation(aBaseShape, aPathWire)); // Making pipe. -- 2.39.2