Salome HOME
Fix for issue #1000
[modules/shaper.git] / src / GeomAPI / GeomAPI_Trsf.cpp
index 7a3c8c17800cc50c88910b2e7feaa22d0f76706f..f0775141ceb40c9c22919d747ace9f04b977b31f 100644 (file)
@@ -6,14 +6,35 @@
 
 #include<GeomAPI_Trsf.h>
 
+#include <GeomAPI_Ax1.h>
+
+#include <gp_Ax1.hxx>
 #include<gp_Trsf.hxx>
 
+#define MY_TRSF implPtr<gp_Trsf>()
+
+//=================================================================================================
 GeomAPI_Trsf::GeomAPI_Trsf()
-    : GeomAPI_Interface()
+: GeomAPI_Interface(new gp_Trsf())
 {
 }
 
+//=================================================================================================
 GeomAPI_Trsf::GeomAPI_Trsf(void* theTrsf)
-    : GeomAPI_Interface(theTrsf)
+: GeomAPI_Interface(theTrsf)
+{
+}
+
+//=================================================================================================
+void GeomAPI_Trsf::setTranslation(const std::shared_ptr<GeomAPI_Ax1> theAxis,
+                                  const double theDistance)
+{
+  MY_TRSF->SetTranslation(gp_Vec(theAxis->impl<gp_Ax1>().Direction()) * theDistance);
+}
+
+//=================================================================================================
+void GeomAPI_Trsf::setRotation(const std::shared_ptr<GeomAPI_Ax1> theAxis,
+                               const double theAngle)
 {
+  MY_TRSF->SetRotation(theAxis->impl<gp_Ax1>(), theAngle / 180.0 * M_PI);
 }