Salome HOME
Issue #1063: Problem of dynamic cast on Linux for Selection validators is solved
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Placement.cpp
index 35ea7c186211d35d4fcf1ac43259d087f1d0941a..4e29cdb305d6df989964137f3b9a8ecbba547c9d 100644 (file)
@@ -24,7 +24,6 @@
 #include <BRepGProp.hxx>
 #include <Precision.hxx>
 
-#define DEB_PLACEMENT 1
 GeomAlgoAPI_Placement::GeomAlgoAPI_Placement(
   std::shared_ptr<GeomAPI_Shape> theSourceSolid,
   std::shared_ptr<GeomAPI_Shape> theDestSolid,
@@ -195,6 +194,10 @@ void GeomAlgoAPI_Placement::build(
     TopLoc_Location aDelta(aTrsf);
     TopoDS_Shape aResult = aSourceShape.Moved(aDelta);
     myShape->setImpl(new TopoDS_Shape(aResult));
+    // store the accumulated information about the result and this delta
+    //myTrsf = std::shared_ptr<GeomAPI_Trsf>(new GeomAPI_Trsf(new gp_Trsf(aTrsf * aSourceShape.Location().Transformation())));
+    myTrsf = std::shared_ptr<GeomAPI_Trsf>(new GeomAPI_Trsf(new gp_Trsf(aTrsf)));
+    myDone = true; // it is allways true for simple transformation generation
   } else { // internal rebuild of the shape
     // Transform the shape with copying it
     BRepBuilderAPI_Transform* aBuilder = new BRepBuilderAPI_Transform(aSourceShape, aTrsf, true);
@@ -209,12 +212,6 @@ void GeomAlgoAPI_Placement::build(
           aCurrentShape->setImpl(new TopoDS_Shape(Exp.Current()));
           myMap.bind(aCurrentShape, aCurrentShape);
         }
-  #ifdef DEB_PLACEMENT
-        int aNum = myMap.size();
-        cout << "MAP of Oriented shapes =" << aNum <<endl;
-
-  #endif
-
         myShape->setImpl(new TopoDS_Shape(aResult));
         myMkShape = new GeomAlgoAPI_MakeShape (aBuilder);
       }
@@ -264,6 +261,11 @@ GeomAlgoAPI_MakeShape * GeomAlgoAPI_Placement::makeShape() const
   return myMkShape;
 }
 
+std::shared_ptr<GeomAPI_Trsf> GeomAlgoAPI_Placement::transformation() const
+{
+  return myTrsf;
+}
+
 //============================================================================
 GeomAlgoAPI_Placement::~GeomAlgoAPI_Placement()
 {