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_Trsf.hxx>
18 #define MY_TRSF implPtr<gp_Trsf>()
20 //=================================================================================================
21 GeomAPI_Trsf::GeomAPI_Trsf()
22 : GeomAPI_Interface(new gp_Trsf())
26 //=================================================================================================
27 GeomAPI_Trsf::GeomAPI_Trsf(void* theTrsf)
28 : GeomAPI_Interface(theTrsf)
32 //=================================================================================================
33 void GeomAPI_Trsf::setTranslation(const std::shared_ptr<GeomAPI_Ax1> theAxis,
34 const double theDistance)
36 MY_TRSF->SetTranslation(gp_Vec(theAxis->impl<gp_Ax1>().Direction()) * theDistance);
39 //=================================================================================================
40 void GeomAPI_Trsf::setTranslation(const double theDx, const double theDy, const double theDz)
42 MY_TRSF->SetTranslation(gp_Vec(theDx, theDy, theDz));
45 //=================================================================================================
46 void GeomAPI_Trsf::setTranslation(const std::shared_ptr<GeomAPI_Pnt> theStartPoint,
47 const std::shared_ptr<GeomAPI_Pnt> theEndPoint)
49 MY_TRSF->SetTranslation(theStartPoint->impl<gp_Pnt>(), theEndPoint->impl<gp_Pnt>());
52 //=================================================================================================
53 void GeomAPI_Trsf::setRotation(const std::shared_ptr<GeomAPI_Ax1> theAxis,
54 const double theAngle)
56 MY_TRSF->SetRotation(theAxis->impl<gp_Ax1>(), theAngle / 180.0 * M_PI);
59 //=================================================================================================
60 void GeomAPI_Trsf::setSymmetry(const std::shared_ptr<GeomAPI_Pnt> thePoint)
62 MY_TRSF->SetMirror(thePoint->impl<gp_Pnt>());
65 //=================================================================================================
66 void GeomAPI_Trsf::setSymmetry(const std::shared_ptr<GeomAPI_Ax1> theAxis)
68 MY_TRSF->SetMirror(theAxis->impl<gp_Ax1>());
71 //=================================================================================================
72 void GeomAPI_Trsf::setSymmetry(const std::shared_ptr<GeomAPI_Ax2> thePlane)
74 MY_TRSF->SetMirror(thePlane->impl<gp_Ax2>());