-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
#include "FeaturesPlugin_Pipe.h"
-#include "FeaturesPlugin_Tools.h"
#include <ModelAPI_AttributeSelection.h>
#include <ModelAPI_AttributeSelectionList.h>
// Store generated edges/faces.
GeomAPI_Shape::ShapeType aBaseShapeType = theBaseShape->shapeType();
- GeomAPI_Shape::ShapeType aShapeTypeToExplode;
+ GeomAPI_Shape::ShapeType aShapeTypeToExplode = GeomAPI_Shape::SHAPE;
switch(aBaseShapeType) {
case GeomAPI_Shape::VERTEX: {
case GeomAPI_Shape::COMPOUND: {
aShapeTypeToExplode = GeomAPI_Shape::COMPOUND;
}
+ default:
+ return; // unsupported type of shape
}
if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX ||
{
GeomShapePtr aBaseShape = *anIter;
GeomAPI_Shape::ShapeType aBaseShapeType = aBaseShape->shapeType();
- GeomAPI_Shape::ShapeType aShapeTypeToExplode;
+ GeomAPI_Shape::ShapeType aShapeTypeToExplode = GeomAPI_Shape::SHAPE;
switch(aBaseShapeType) {
case GeomAPI_Shape::VERTEX: {
aShapeTypeToExplode = GeomAPI_Shape::VERTEX;
ListOfShape aV1History, aV2History;
thePipeAlgo->generated(aV1, aV1History);
thePipeAlgo->generated(aV2, aV2History);
- aResultBody->generated(aV1, aV1History.front());
- aResultBody->generated(aV2, aV2History.front());
+ if (!aV1History.empty())
+ aResultBody->generated(aV1, aV1History.front());
+ if (!aV2History.empty())
+ aResultBody->generated(aV2, aV2History.front());
}
case GeomAPI_Shape::FACE:
case GeomAPI_Shape::SHELL: {
aShapeTypeToExplode = GeomAPI_Shape::EDGE;
break;
}
+ default:
+ return; // unsupported type of shape
}
aResultBody->loadGeneratedShapes(thePipeAlgo, aBaseShape, aShapeTypeToExplode);
}
aResultBody->loadGeneratedShapes(thePipeAlgo, thePathShape, GeomAPI_Shape::EDGE);
// Store from shapes.
- FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, thePipeAlgo->fromShapes(), ListOfShape(),
- thePipeAlgo, thePipeAlgo->shape(), "From");
+ storeShapes(aResultBody, theBaseShapes.front()->shapeType(), thePipeAlgo->fromShapes(), "From_");
// Store to shapes.
- FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, thePipeAlgo->toShapes(), ListOfShape(),
- thePipeAlgo, thePipeAlgo->shape(), "To");
+ storeShapes(aResultBody, theBaseShapes.back()->shapeType(), thePipeAlgo->toShapes(), "To_");
+
setResult(aResultBody, theResultIndex);
}
aShapeTypeToExplore = GeomAPI_Shape::COMPOUND;
break;
}
+ default:
+ return; // unsupported type of shape
}
// Store shapes.