+ return true;
+}
+
+//=================================================================================================
+void FeaturesPlugin_CompositeSketch::storeResult(const GeomShapePtr theBaseShape,
+ const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
+ const int theResultIndex)
+{
+ // Create result body.
+ ResultBodyPtr aResultBody = document()->createBody(data(), theResultIndex);
+
+ // Store generated shape.
+ aResultBody->storeGenerated(theBaseShape, theMakeShape->shape());
+
+ // Store generated edges/faces.
+ int aGenTag = 1;
+ storeGenerationHistory(aResultBody, theBaseShape, theMakeShape, aGenTag);
+
+ setResult(aResultBody, theResultIndex);
+}
+
+//=================================================================================================
+void FeaturesPlugin_CompositeSketch::storeGenerationHistory(ResultBodyPtr theResultBody,
+ const GeomShapePtr theBaseShape,
+ const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
+ int& theTag)
+{
+ GeomAPI_Shape::ShapeType aBaseShapeType = theBaseShape->shapeType();
+ GeomAPI_Shape::ShapeType aShapeTypeToExplode;
+ std::string aGenName = "Generated_";
+
+ std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfSubShapes = theMakeShape->mapOfSubShapes();
+ switch(aBaseShapeType) {
+ case GeomAPI_Shape::VERTEX: {
+ aShapeTypeToExplode = GeomAPI_Shape::VERTEX;
+ aGenName += "Edge";
+ break;
+ }
+ case GeomAPI_Shape::EDGE:
+ case GeomAPI_Shape::WIRE: {
+ std::shared_ptr<GeomAPI_Vertex> aV1, aV2;
+ GeomAlgoAPI_ShapeTools::findBounds(theBaseShape, aV1, aV2);
+ ListOfShape aV1History, aV2History;
+ theMakeShape->generated(aV1, aV1History);
+ theMakeShape->generated(aV2, aV2History);
+ if(!aV1History.empty()) {
+ theResultBody->generated(aV1, aV1History.front(), aGenName + "Edge_1", theTag++);
+ }
+ if(!aV2History.empty()) {
+ theResultBody->generated(aV2, aV2History.front(), aGenName + "Edge_2", theTag++);
+ }
+ }
+ case GeomAPI_Shape::FACE:
+ case GeomAPI_Shape::SHELL: {
+ aShapeTypeToExplode = GeomAPI_Shape::EDGE;
+ aGenName += "Face";
+ break;
+ }