+//=================================================================================================
+void FeaturesPlugin_Symmetry::buildResult(GeomAlgoAPI_Symmetry& theSymmetryAlgo,
+ std::shared_ptr<GeomAPI_Shape> theBaseShape,
+ int theResultIndex)
+{
+ // Compose source shape and the result of symmetry.
+ GeomShapePtr aCompound;
+ if (boolean(KEEP_ORIGINAL_RESULT())->value()) {
+ ListOfShape aShapes;
+ aShapes.push_back(theBaseShape);
+ aShapes.push_back(theSymmetryAlgo.shape());
+ aCompound = GeomAlgoAPI_CompoundBuilder::compound(aShapes);
+ } else
+ aCompound = theSymmetryAlgo.shape();
+
+ // Store and name the result.
+ ResultBodyPtr aResultBody = document()->createBody(data(), theResultIndex);
+ aResultBody->storeModified(theBaseShape, aCompound);
+ loadNamingDS(theSymmetryAlgo, aResultBody, theBaseShape);
+ setResult(aResultBody, theResultIndex);
+}
+
+//=================================================================================================
+void FeaturesPlugin_Symmetry::buildResult(ResultPartPtr theOriginal,
+ std::shared_ptr<GeomAPI_Trsf> theTrsf,
+ int& theResultIndex)
+{
+ if (boolean(KEEP_ORIGINAL_RESULT())->value()) {
+ std::shared_ptr<GeomAPI_Trsf> anIdentity(new GeomAPI_Trsf());
+ ResultPartPtr aCopy = document()->copyPart(theOriginal, data(), theResultIndex);
+ aCopy->setTrsf(theOriginal, anIdentity);
+ setResult(aCopy, theResultIndex);
+ ++theResultIndex;
+ }
+
+ ResultPartPtr aResultPart = document()->copyPart(theOriginal, data(), theResultIndex);
+ aResultPart->setTrsf(theOriginal, theTrsf);
+ setResult(aResultPart, theResultIndex);
+}
+