1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D
3 // File: GeomAPI_Trsf.cpp
4 // Created: 13 Jul 2015
5 // Author: Mikhail PONIKAROV
7 // Modified by Clarisse Genrault (CEA) : 17 Nov 2016
9 #include<GeomAPI_Trsf.h>
11 #include <GeomAPI_Ax1.h>
12 #include <GeomAPI_Ax2.h>
16 #include <gp_GTrsf.hxx>
17 #include <gp_Trsf.hxx>
19 #define MY_TRSF implPtr<gp_Trsf>()
23 //=================================================================================================
24 GeomAPI_Trsf::GeomAPI_Trsf()
25 : GeomAPI_Interface(new gp_Trsf())
29 //=================================================================================================
30 GeomAPI_Trsf::GeomAPI_Trsf(void* theTrsf)
31 : GeomAPI_Interface(theTrsf)
35 //=================================================================================================
36 void GeomAPI_Trsf::setTranslation(const std::shared_ptr<GeomAPI_Ax1> theAxis,
37 const double theDistance)
39 MY_TRSF->SetTranslation(gp_Vec(theAxis->impl<gp_Ax1>().Direction()) * theDistance);
42 //=================================================================================================
43 void GeomAPI_Trsf::setTranslation(const double theDx, const double theDy, const double theDz)
45 MY_TRSF->SetTranslation(gp_Vec(theDx, theDy, theDz));
48 //=================================================================================================
49 void GeomAPI_Trsf::setTranslation(const std::shared_ptr<GeomAPI_Pnt> theStartPoint,
50 const std::shared_ptr<GeomAPI_Pnt> theEndPoint)
52 MY_TRSF->SetTranslation(theStartPoint->impl<gp_Pnt>(), theEndPoint->impl<gp_Pnt>());
55 //=================================================================================================
56 void GeomAPI_Trsf::setRotation(const std::shared_ptr<GeomAPI_Ax1> theAxis,
57 const double theAngle)
59 MY_TRSF->SetRotation(theAxis->impl<gp_Ax1>(), theAngle / 180.0 * M_PI);
62 //=================================================================================================
63 void GeomAPI_Trsf::setSymmetry(const std::shared_ptr<GeomAPI_Pnt> thePoint)
65 MY_TRSF->SetMirror(thePoint->impl<gp_Pnt>());
68 //=================================================================================================
69 void GeomAPI_Trsf::setSymmetry(const std::shared_ptr<GeomAPI_Ax1> theAxis)
71 MY_TRSF->SetMirror(theAxis->impl<gp_Ax1>());
74 //=================================================================================================
75 void GeomAPI_Trsf::setSymmetry(const std::shared_ptr<GeomAPI_Ax2> thePlane)
77 MY_TRSF->SetMirror(thePlane->impl<gp_Ax2>());