Salome HOME
Multiple selection in placement
authordbv <dbv@opencascade.com>
Wed, 29 Jul 2015 12:26:44 +0000 (15:26 +0300)
committerdbv <dbv@opencascade.com>
Wed, 29 Jul 2015 12:26:59 +0000 (15:26 +0300)
src/FeaturesPlugin/FeaturesPlugin_Placement.cpp
src/FeaturesPlugin/FeaturesPlugin_Placement.h
src/FeaturesPlugin/placement_widget.xml
src/GeomAlgoAPI/CMakeLists.txt
src/GeomAlgoAPI/GeomAlgoAPI.i
src/GeomAlgoAPI/GeomAlgoAPI_Transform.cpp [new file with mode: 0644]
src/GeomAlgoAPI/GeomAlgoAPI_Transform.h [new file with mode: 0644]

index 28ae8523426fa8ce16914abb94813b0a87359b81..ee954f593161602b26ea927311725caffcab773f 100644 (file)
@@ -17,6 +17,7 @@
 #include <GeomAPI_Face.h>
 #include <GeomAPI_Pln.h>
 #include <GeomAlgoAPI_Placement.h>
+#include <GeomAlgoAPI_Transform.h>
 
 #define _MODIFIEDF_TAG 1
 #define _MODIFIEDE_TAG 2
@@ -28,144 +29,155 @@ FeaturesPlugin_Placement::FeaturesPlugin_Placement()
 
 void FeaturesPlugin_Placement::initAttributes()
 {
-  /* Modification for specification of 1.3.0
+
   AttributeSelectionListPtr aSelection = 
     std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(data()->addAttribute(
-    FeaturesPlugin_Placement::LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
+    OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
   // extrusion works with faces always
   aSelection->setSelectionType("SOLID");
-  */
-  data()->addAttribute(FeaturesPlugin_Placement::BASE_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
-  data()->addAttribute(FeaturesPlugin_Placement::ATTRACT_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
-  data()->addAttribute(FeaturesPlugin_Placement::REVERSE_ID(), ModelAPI_AttributeBoolean::typeId());
-  data()->addAttribute(FeaturesPlugin_Placement::CENTERING_ID(), ModelAPI_AttributeBoolean::typeId());
+
+  data()->addAttribute(START_FACE_ID(), ModelAPI_AttributeSelection::typeId());
+  data()->addAttribute(END_FACE_ID(), ModelAPI_AttributeSelection::typeId());
+  data()->addAttribute(REVERSE_ID(), ModelAPI_AttributeBoolean::typeId());
+  data()->addAttribute(CENTERING_ID(), ModelAPI_AttributeBoolean::typeId());
 }
 
 void FeaturesPlugin_Placement::execute()
 {
-  // Verify the base face
-  std::shared_ptr<ModelAPI_AttributeSelection> anObjRef = std::dynamic_pointer_cast<
-    ModelAPI_AttributeSelection>(data()->attribute(FeaturesPlugin_Placement::BASE_OBJECT_ID()));
-  if (!anObjRef)
+  // Getting objects.
+  ListOfShape anObjects;
+  std::list<ResultPtr> aContextes;
+  AttributeSelectionListPtr anObjectsSelList = selectionList(OBJECTS_LIST_ID());
+  if(anObjectsSelList->size() == 0) {
     return;
+  }
+  for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
+    std::shared_ptr<ModelAPI_AttributeSelection> anObjectAttr = anObjectsSelList->value(anObjectsIndex);
+    std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
+    if(!anObject.get()) {
+      return;
+    }
+    anObjects.push_back(anObject);
+    aContextes.push_back(anObjectAttr->context());
+  }
 
-  std::shared_ptr<GeomAPI_Shape> aBaseShape = 
-    std::dynamic_pointer_cast<GeomAPI_Shape>(anObjRef->value());
-  if (!aBaseShape)
+  // Verify the start face
+  AttributeSelectionPtr anObjRef = selection(START_FACE_ID());
+  if(!anObjRef) {
+    return;
+  }
+  std::shared_ptr<GeomAPI_Shape> aStartFace = anObjRef->value();
+  if(!aStartFace || !GeomAPI_Face(aStartFace).isPlanar()) {
+    static const std::string aSelectionError = "The start face selection is bad";
+    setError(aSelectionError);
     return;
+  }
 
-  std::shared_ptr<GeomAPI_Shape> aBaseObject;
+
+  std::shared_ptr<GeomAPI_Shape> aStartShape;
   ResultPtr aContextRes = anObjRef->context();
   if (aContextRes.get()) {
-    aBaseObject = aContextRes->shape();
+    aStartShape = aContextRes->shape();
   }
-  if (!aBaseObject.get()) {
-    static const std::string aContextError = "The base selection context is bad";
+  if(!aStartShape.get()) {
+    static const std::string aContextError = "The start face selection context is bad";
     setError(aContextError);
     return;
   }
 
-  // Verify the attractive face
-  anObjRef = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(
-      data()->attribute(FeaturesPlugin_Placement::ATTRACT_OBJECT_ID()));
-
-  std::shared_ptr<GeomAPI_Shape> aSlaveShape = 
-    std::dynamic_pointer_cast<GeomAPI_Shape>(anObjRef->value());
-  if (!aSlaveShape)
+  // Verify the end face
+  anObjRef = selection(END_FACE_ID());
+  std::shared_ptr<GeomAPI_Shape> anEndFace = anObjRef->value();
+  if(!anEndFace || !GeomAPI_Face(anEndFace).isPlanar()) {
+    static const std::string aSelectionError = "The end face selection is bad";
+    setError(aSelectionError);
     return;
+  }
 
-  std::shared_ptr<GeomAPI_Shape> aSlaveObject;
+  std::shared_ptr<GeomAPI_Shape> anEndShape;
   aContextRes = anObjRef->context();
-  if (aContextRes.get()) {
-    aSlaveObject = aContextRes->shape();
+  if(aContextRes.get()) {
+    anEndShape = aContextRes->shape();
   }
-  if (!aSlaveObject.get()) {
-    static const std::string aContextError = "The tool selection context is bad";
+  if(!anEndShape.get()) {
+    static const std::string aContextError = "The end face selection context is bad";
     setError(aContextError);
     return;
   }
 
-  // Verify planarity of faces and linearity of edges
-  std::shared_ptr<GeomAPI_Shape> aShapes[2] = {aBaseShape, aSlaveShape};
-  for (int i = 0; i < 2; i++) {
-    if (aShapes[i]->isFace()) {
-      std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aShapes[i]));
-      if (!aFace->isPlanar()) {
-        static const std::string aPlanarityError = "One of selected faces is not planar";
-        setError(aPlanarityError);
-        return;
-      }
-    }
-    else if (aShapes[i]->isEdge()) {
-      std::shared_ptr<GeomAPI_Edge> anEdge(new GeomAPI_Edge(aShapes[i]));
-      if (!anEdge->isLine()) {
-        static const std::string aLinearityError = "One of selected endges is not linear";
-        setError(aLinearityError);
-        return;
-      }
-    }
-  }
-
   // Flags of the Placement
-  AttributeBooleanPtr aBoolAttr = std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(
-      data()->attribute(FeaturesPlugin_Placement::REVERSE_ID()));
-  bool isReverse = aBoolAttr->value();
-  aBoolAttr = std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(
-      data()->attribute(FeaturesPlugin_Placement::CENTERING_ID()));
-  bool isCentering = aBoolAttr->value();
+  bool isReverse = boolean(REVERSE_ID())->value();
+  bool isCentering = boolean(CENTERING_ID())->value();
 
   bool isPart = aContextRes->groupName() == ModelAPI_ResultPart::group();
 
-  std::shared_ptr<ModelAPI_ResultBody> aResultBody;
-  if (!isPart) 
-    aResultBody = document()->createBody(data());
-  GeomAlgoAPI_Placement aFeature(
-    aSlaveObject, aBaseObject, aSlaveShape, aBaseShape, isReverse, isCentering, isPart);
-  if(!aFeature.isDone()) {
+  // Getting transformation.
+  GeomAlgoAPI_Placement aPlacementAlgo(
+    aStartShape, anEndShape, aStartFace, anEndFace, isReverse, isCentering, true);
+  if(!aPlacementAlgo.isDone()) {
     static const std::string aFeatureError = "Placement algorithm failed";
     setError(aFeatureError);
     return;
   }
+  std::shared_ptr<GeomAPI_Trsf> aTrsf = aPlacementAlgo.transformation();
+
+  // Applying transformation to each object.
+  int aResultIndex = 0;
+  std::list<ResultPtr>::iterator aContext = aContextes.begin();
+  for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
+      anObjectsIt++, aContext++) {
+
+    if (isPart) { // for part results just set transformation
+      ResultPartPtr anOrigin = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aContextRes);
+      ResultPartPtr aResultPart = document()->copyPart(firstResult(), anOrigin);
+      aResultPart->setTrsf(aContextRes, aTrsf);
+      setResult(aResultPart);
+    } else {
+      std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
+      GeomAlgoAPI_Transform aTransformAlgo(aBaseShape, aTrsf);
+
+      // Checking that the algorithm worked properly.
+      if(!aTransformAlgo.isDone()) {
+        static const std::string aFeatureError = "Transform algorithm failed";
+        setError(aFeatureError);
+        break;
+      }
+      if(aTransformAlgo.shape()->isNull()) {
+        static const std::string aShapeError = "Resulting shape is Null";
+        setError(aShapeError);
+        break;
+      }
+      if(!aTransformAlgo.isValid()) {
+        std::string aFeatureError = "Warning: resulting shape is not valid";
+        setError(aFeatureError);
+        break;
+      }
 
-  // Check if shape is valid
-  if (aFeature.shape()->isNull()) {
-    static const std::string aShapeError = "Resulting shape is Null";
-    setError(aShapeError);
-    return;
-  }
-  if(!aFeature.isValid()) {
-    std::string aFeatureError = "Warning: resulting shape is not valid";
-    setError(aFeatureError);
-    return;
-  }  
-
-  if (isPart) { // for part results just set transformation
-    ResultPartPtr anOrigin = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aContextRes);
-    ResultPartPtr aResultPart = document()->copyPart(firstResult(), anOrigin);
-    aResultPart->setTrsf(aContextRes, aFeature.transformation());
-    setResult(aResultPart);
-  } else {
-    //LoadNamingDS
-    LoadNamingDS(aFeature, aResultBody, aSlaveObject);
-
-    setResult(aResultBody);
+      //LoadNamingDS
+      std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
+      LoadNamingDS(aTransformAlgo, aResultBody, aBaseShape);
+      setResult(aResultBody, aResultIndex);
+    }
+    aResultIndex++;
   }
+
+  // Remove the rest results if there were produced in the previous pass.
+  removeResults(aResultIndex);
 }
 
 //============================================================================
-void FeaturesPlugin_Placement::LoadNamingDS(
-    GeomAlgoAPI_Placement& theFeature,
-    std::shared_ptr<ModelAPI_ResultBody> theResultBody,
-    std::shared_ptr<GeomAPI_Shape> theSlaveObject)
+void FeaturesPlugin_Placement::LoadNamingDS(GeomAlgoAPI_Transform& theTransformAlgo,
+                                            std::shared_ptr<ModelAPI_ResultBody> theResultBody,
+                                            std::shared_ptr<GeomAPI_Shape> theSlaveObject)
 {
   //load result
-  theResultBody->storeModified(theSlaveObject, theFeature.shape()); // the initial Slave, the resulting Slave
+  theResultBody->storeModified(theSlaveObject, theTransformAlgo.shape()); // the initial Slave, the resulting Slave
+
+  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theTransformAlgo.mapOfShapes();
 
-  GeomAPI_DataMapOfShapeShape* aSubShapes = new GeomAPI_DataMapOfShapeShape();
-  theFeature.mapOfShapes(*aSubShapes);
-  
     // put modifed faces in DF
   std::string aModName = "Modified";
-  theResultBody->loadAndOrientModifiedShapes(theFeature.makeShape(), theSlaveObject, _FACE, _MODIFIEDF_TAG, aModName, *aSubShapes); 
-
+  theResultBody->loadAndOrientModifiedShapes(theTransformAlgo.makeShape().get(),
+                                             theSlaveObject, _FACE,
+                                             _MODIFIEDF_TAG, aModName, *aSubShapes.get());
 }
index b83d07e9593f40e72586cca0a23d2f3c5ef5320b..46acd79e29fe1b3352aac69f0c19db920cac7736 100644 (file)
@@ -10,6 +10,7 @@
 #include "FeaturesPlugin.h"
 #include <ModelAPI_Feature.h>
 #include <GeomAlgoAPI_Placement.h>
+#include <GeomAlgoAPI_Transform.h>
 
 class ModelAPI_ResultBody;
 class GeomAPI_Shape;
@@ -31,25 +32,26 @@ class FeaturesPlugin_Placement : public ModelAPI_Feature
     static const std::string MY_PLACEMENT_ID("Placement");
     return MY_PLACEMENT_ID;
   }
+
   /// attribute name of references sketch entities list, it should contain a sketch result or
   /// a pair a sketch result to sketch face
-  /*Modification for specification of 1.3.0
-  inline static const std::string& LIST_ID()
+  inline static const std::string& OBJECTS_LIST_ID()
   {
-    static const std::string MY_GROUP_LIST_ID("base");
-    return MY_GROUP_LIST_ID;
-  }*/
+    static const std::string MY_OBJECTS_LIST_ID("placement_objects_list");
+    return MY_OBJECTS_LIST_ID;
+  }
+
   /// attribute name of referenced object
-  inline static const std::string& BASE_OBJECT_ID()
+  inline static const std::string& START_FACE_ID()
   {
-    static const std::string MY_BASE_OBJECT_ID("placement_base_object");
-    return MY_BASE_OBJECT_ID;
+    static const std::string MY_START_FACE_ID("placement_start_face");
+    return MY_START_FACE_ID;
   }
   /// attribute name of attractable face
-  inline static const std::string& ATTRACT_OBJECT_ID()
+  inline static const std::string& END_FACE_ID()
   {
-    static const std::string MY_ATTRACT_OBJECT_ID("placement_attractable_object");
-    return MY_ATTRACT_OBJECT_ID;
+    static const std::string MY_END_FACE_ID("placement_end_face");
+    return MY_END_FACE_ID;
   }
   /// attribute name of flag of reverse direction
   inline static const std::string& REVERSE_ID()
@@ -81,7 +83,7 @@ class FeaturesPlugin_Placement : public ModelAPI_Feature
   FeaturesPlugin_Placement();
 private:
   /// Load Naming data structure of the feature to the document
-  void LoadNamingDS(GeomAlgoAPI_Placement& theFeature,
+  void LoadNamingDS(GeomAlgoAPI_Transform& theTransformAlgo,
                     std::shared_ptr<ModelAPI_ResultBody> theResultBody,
                     std::shared_ptr<GeomAPI_Shape> theSlaveObject);
 };
index 2e6b8f2375504eebcc59ac3eeea13eeb9d71e2d4..ec6f228b0d53e17cb32afd1427ee7e5345f27519 100644 (file)
@@ -1,28 +1,23 @@
 <!-- Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
 
 <source>
-  <!--Modification for specification of 1.3.0
-  <multi_selector id="base"
-    label="Select a sketch face"
+  <multi_selector id="placement_objects_list"
+    label="Select a solid objects"
     icon=":icons/cut_shape.png"
-    tooltip="Select a sketch face"
+    tooltip="Select a solid objects"
     type_choice="Solids">
-  </multi_selector>-->
-  <!--Modification for specification of 1.3.0
-    icon=":icons/placement_from.png"-->
-  <shape_selector id="placement_base_object" 
+  </multi_selector>
+  <shape_selector id="placement_start_face"
     label="Select an object" 
-    icon=":icons/cut_shape.png" 
-    tooltip="Select a destination element"
-    shape_types="face edge vertex"
+    icon=":icons/placement_from.png"
+    tooltip="Select a start face"
+    shape_types="face"
   />
-  <!--Modification for specification of 1.3.0
-      icon=":icons/placement_to.png"-->
-  <shape_selector id="placement_attractable_object" 
+  <shape_selector id="placement_end_face"
     label="Select an object" 
-    icon=":icons/cut_shape.png"
-    tooltip="Select an element of moved object" 
-    shape_types="face edge vertex" 
+    icon=":icons/placement_to.png"
+    tooltip="Select an end face"
+    shape_types="face"
     concealment="true" >
     <validator id="PartSet_DifferentObjects"/>
   </shape_selector>
index 3bc40373254e4e79147ef4d5f48ef69212d9e858..6d14a195d8f185caa9012931274b4505609bfb32 100644 (file)
@@ -30,6 +30,7 @@ SET(PROJECT_HEADERS
     GeomAlgoAPI_BREPExport.h
     GeomAlgoAPI_STEPExport.h
     GeomAlgoAPI_IGESExport.h
+    GeomAlgoAPI_Transform.h
 )
 
 SET(PROJECT_SOURCES
@@ -56,6 +57,7 @@ SET(PROJECT_SOURCES
     GeomAlgoAPI_BREPExport.cpp
     GeomAlgoAPI_STEPExport.cpp
     GeomAlgoAPI_IGESExport.cpp
+    GeomAlgoAPI_Transform.cpp
 )
 
 SET(PROJECT_LIBRARIES
index 6a49f1fae2e2ea3e0dd73931f3a0f74706631cea..5d102832a96f9d7ab54b3bf7dd46b770ab55d59d 100644 (file)
@@ -25,6 +25,7 @@
   #include "GeomAlgoAPI_IGESImport.h"
   #include "GeomAlgoAPI_STEPImport.h"
   #include "GeomAlgoAPI_Tools.h"
+  #include "GeomAlgoAPI_Transform.h"
 
   #include <memory>
   #include <string>
@@ -64,6 +65,7 @@
 %include "GeomAlgoAPI_IGESImport.h"
 %include "GeomAlgoAPI_STEPImport.h"
 %include "GeomAlgoAPI_Tools.h"
+%include "GeomAlgoAPI_Transform.h"
 
 %typemap(out) std::list< std::shared_ptr< GeomAPI_Shape > >::value_type & {
   $result = SWIG_NewPointerObj(SWIG_as_voidptr(new std::shared_ptr<GeomAPI_Shape>(*$1)), $descriptor(std::shared_ptr<GeomAPI_Shape> *), SWIG_POINTER_OWN | 0 );
diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Transform.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Transform.cpp
new file mode 100644 (file)
index 0000000..65840c2
--- /dev/null
@@ -0,0 +1,105 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:        GeomAlgoAPI_Transform.cpp
+// Created:     29 July 2015
+// Author:      Dmitry Bobylev
+
+#include <GeomAlgoAPI_Transform.h>
+
+#include <GeomAlgoAPI_ShapeProps.h>
+
+#include <BRepBuilderAPI_Transform.hxx>
+#include <BRepCheck_Analyzer.hxx>
+#include <Precision.hxx>
+#include <TopExp_Explorer.hxx>
+
+//=================================================================================================
+GeomAlgoAPI_Transform::GeomAlgoAPI_Transform(std::shared_ptr<GeomAPI_Shape> theSourceShape,
+                                             std::shared_ptr<GeomAPI_Trsf>  theTrsf)
+: myDone(false),
+  myTrsf(theTrsf),
+  myShape(new GeomAPI_Shape()),
+  myMap(new GeomAPI_DataMapOfShapeShape()),
+  myMkShape(new GeomAlgoAPI_MakeShape())
+{
+  build(theSourceShape, theTrsf);
+}
+
+//=================================================================================================
+void GeomAlgoAPI_Transform::build(std::shared_ptr<GeomAPI_Shape> theSourceShape,
+                                  std::shared_ptr<GeomAPI_Trsf>  theTrsf)
+{
+  if(!theSourceShape || !theTrsf) {
+    return;
+  }
+
+  const TopoDS_Shape& aSourceShape = theSourceShape->impl<TopoDS_Shape>();
+  const gp_Trsf& aTrsf = theTrsf->impl<gp_Trsf>();
+
+  if(aSourceShape.IsNull()) {
+    return;
+  }
+
+  BRepBuilderAPI_Transform* aBuilder = new BRepBuilderAPI_Transform(aSourceShape, aTrsf, true);
+  if(!aBuilder) {
+    return;
+  }
+
+  myDone = aBuilder->IsDone() == Standard_True;
+  if(!myDone) {
+    return;
+  }
+
+  TopoDS_Shape aResult = aBuilder->Shape();
+
+  // Fill data map to keep correct orientation of sub-shapes.
+  for(TopExp_Explorer anExp(aResult, TopAbs_FACE); anExp.More(); anExp.Next()) {
+    std::shared_ptr<GeomAPI_Shape> aCurrentShape(new GeomAPI_Shape());
+    aCurrentShape->setImpl(new TopoDS_Shape(anExp.Current()));
+    myMap->bind(aCurrentShape, aCurrentShape);
+  }
+
+  myMkShape->setImpl(aBuilder);
+  myShape->setImpl(new TopoDS_Shape(aResult));
+}
+
+//=================================================================================================
+const bool GeomAlgoAPI_Transform::isValid() const
+{
+  BRepCheck_Analyzer aChecker(myShape->impl<TopoDS_Shape>());
+  return (aChecker.IsValid() == Standard_True);
+}
+
+//=================================================================================================
+const bool GeomAlgoAPI_Transform::hasVolume() const
+{
+  bool hasVolume(false);
+  if(isValid() && (GeomAlgoAPI_ShapeProps::volume(myShape) > Precision::Confusion())) {
+    hasVolume = true;
+  }
+  return hasVolume;
+}
+
+//=================================================================================================
+const std::shared_ptr<GeomAPI_Shape>& GeomAlgoAPI_Transform::shape() const
+{
+  return myShape;
+}
+
+//=================================================================================================
+std::shared_ptr<GeomAPI_DataMapOfShapeShape> GeomAlgoAPI_Transform::mapOfShapes() const
+{
+  return myMap;
+}
+
+//=================================================================================================
+std::shared_ptr<GeomAlgoAPI_MakeShape> GeomAlgoAPI_Transform::makeShape() const
+{
+  return myMkShape;
+}
+
+//=================================================================================================
+std::shared_ptr<GeomAPI_Trsf> GeomAlgoAPI_Transform::transformation() const
+{
+  return myTrsf;
+}
diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Transform.h b/src/GeomAlgoAPI/GeomAlgoAPI_Transform.h
new file mode 100644 (file)
index 0000000..aeb085a
--- /dev/null
@@ -0,0 +1,66 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:        GeomAlgoAPI_Transform.h
+// Created:     29 July 2015
+// Author:      Dmitry Bobylev
+
+#ifndef GeomAlgoAPI_Transform_H_
+#define GeomAlgoAPI_Transform_H_
+
+#include <GeomAlgoAPI.h>
+#include <GeomAlgoAPI_MakeShape.h>
+#include <GeomAPI_DataMapOfShapeShape.h>
+#include <GeomAPI_Shape.h>
+#include <GeomAPI_Trsf.h>
+
+/** \class GeomAlgoAPI_Transform
+ *  \ingroup DataAlgo
+ *  \brief Creates a copy of the object by transformating it.
+ */
+class GeomAlgoAPI_Transform : public GeomAPI_Interface
+{
+public:
+  /** \brief Creates an object which is obtained from current object by transformating it.
+   *  \param[in] theSourceShape  a shape to be transformed.
+   *  \param[in] theTrsf         transformation.
+   */
+  GEOMALGOAPI_EXPORT GeomAlgoAPI_Transform(std::shared_ptr<GeomAPI_Shape> theSourceShape,
+                                           std::shared_ptr<GeomAPI_Trsf>  theTrsf);
+
+  /// \return true if algorithm succeed.
+  GEOMALGOAPI_EXPORT const bool isDone() const
+  { return myDone; }
+
+  /// \return true if resulting shape is valid.
+  GEOMALGOAPI_EXPORT const bool isValid() const;
+
+  /// \return true if resulting shape has volume.
+  GEOMALGOAPI_EXPORT const bool hasVolume() const;
+
+  /// \return result of the transformation algorithm.
+  GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape>& shape() const;
+
+  /// \return map of sub-shapes of the result. To be used for History keeping.
+  GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_DataMapOfShapeShape> mapOfShapes() const;
+
+  /// \return interface for for History processing.
+  GEOMALGOAPI_EXPORT std::shared_ptr<GeomAlgoAPI_MakeShape> makeShape() const;
+
+  /// \return the transformation.
+  GEOMALGOAPI_EXPORT std::shared_ptr<GeomAPI_Trsf> transformation() const;
+
+private:
+  /// Builds resulting shape.
+  void build(std::shared_ptr<GeomAPI_Shape> theSourceShape,
+             std::shared_ptr<GeomAPI_Trsf>  theTrsf);
+
+private:
+  /// Fields.
+  bool myDone;
+  std::shared_ptr<GeomAPI_Trsf> myTrsf;
+  std::shared_ptr<GeomAPI_Shape> myShape;
+  std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
+  std::shared_ptr<GeomAlgoAPI_MakeShape> myMkShape;
+};
+
+#endif