void GeomAlgoAPI_Pipe::build(const GeomShapePtr theBaseShape,
const GeomShapePtr thePathShape)
{
- // Getting base shape.
- if(!theBaseShape.get()) {
- return;
- }
- TopoDS_Shape aBaseShape = theBaseShape->impl<TopoDS_Shape>();
- 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.
+ // Getting base shape and path.
+ TopoDS_Shape aBaseShape;
+ TopAbs_ShapeEnum aBaseShapeType;
TopoDS_Wire aPathWire;
- if(!getPath(aPathWire, thePathShape)) {
+ if (!getBase(aBaseShape, aBaseShapeType, theBaseShape) ||
+ !getPath(aPathWire, thePathShape)) {
return;
}
+
aPathWire.Move(getPathToBaseTranslation(aBaseShape, aPathWire));
// Making pipe.
const GeomShapePtr thePathShape,
const GeomShapePtr theBiNormal)
{
- // Getting base shape.
+ // Getting base shape and path.
TopoDS_Shape aBaseShape;
TopAbs_ShapeEnum aBaseShapeType;
- if(!getBase(aBaseShape, aBaseShapeType, theBaseShape)) {
- return;
- }
-
- // Getting path.
TopoDS_Wire aPathWire;
- if(!getPath(aPathWire, thePathShape)) {
+ if (!getBase(aBaseShape, aBaseShapeType, theBaseShape) ||
+ !getPath(aPathWire, thePathShape) ||
+ !theBiNormal.get()) {
return;
}
aPathWire.Move(getPathToBaseTranslation(theBaseShape->impl<TopoDS_Shape>(), aPathWire));
// Getting Bi-Normal.
- if(!theBiNormal.get()) {
- return;
- }
TopoDS_Shape aBiNormalShape = theBiNormal->impl<TopoDS_Shape>();
if(aBiNormalShape.IsNull() || aBiNormalShape.ShapeType() != TopAbs_EDGE) {
return;
this->initialize(aPipeBuilder);
// Checking result.
- if(aBaseShapeType == TopAbs_FACE) {
- if(aPipeBuilder->MakeSolid() == Standard_False) {
- return;
- }
+ if(aBaseShapeType == TopAbs_FACE && !aPipeBuilder->MakeSolid()) {
+ return;
}
TopoDS_Shape aResult = aPipeBuilder->Shape();
if(aResult.IsNull()) {
return;
}
- // Getting path.
+ // Getting base shape and path.
TopoDS_Shape aBaseShape;
TopAbs_ShapeEnum aBaseShapeType;
- if (!getBase(aBaseShape, aBaseShapeType, theBaseShapes.front())) {
- return;
- }
-
TopoDS_Wire aPathWire;
- if(!getPath(aPathWire, thePathShape)) {
+ if (!getBase(aBaseShape, aBaseShapeType, theBaseShapes.front()) ||
+ !getPath(aPathWire, thePathShape)) {
return;
}
this->initialize(aPipeBuilder);
// Checking result.
- if(anIsSolidNeeded) {
- if(aPipeBuilder->MakeSolid() == Standard_False) {
- return;
- }
+ if(anIsSolidNeeded && !aPipeBuilder->MakeSolid()) {
+ return;
}
TopoDS_Shape aResult = aPipeBuilder->Shape();