Salome HOME
ca5c55abefd6457f8bb9f391dc8c2d2ec749faeb
[modules/shaper.git] / src / GeomAPI / GeomAPI_Trsf.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_Trsf.cpp
4 // Created:     13 Jul 2015
5 // Author:      Mikhail PONIKAROV
6
7 #include<GeomAPI_Trsf.h>
8
9 #include <GeomAPI_Ax1.h>
10
11 #include <gp_Ax1.hxx>
12 #include<gp_Trsf.hxx>
13
14 #define MY_TRSF implPtr<gp_Trsf>()
15
16 //=================================================================================================
17 GeomAPI_Trsf::GeomAPI_Trsf()
18 : GeomAPI_Interface(new gp_Trsf())
19 {
20 }
21
22 //=================================================================================================
23 void GeomAPI_Trsf::setTranslation(const std::shared_ptr<GeomAPI_Ax1> theAxis,
24                                   const double theDistance)
25 {
26   MY_TRSF->SetTranslation(gp_Vec(theAxis->impl<gp_Ax1>().Direction()) * theDistance);
27 }
28
29 //=================================================================================================
30 void GeomAPI_Trsf::setRotation(const std::shared_ptr<GeomAPI_Ax1> theAxis,
31                                const double theAngle)
32 {
33   MY_TRSF->SetRotation(theAxis->impl<gp_Ax1>(), theAngle / 180.0 * M_PI);
34 }