From 9c7719e91b8ff1e4a8c3de90f020d84704aaa990 Mon Sep 17 00:00:00 2001 From: logari81 Date: Wed, 13 Feb 2013 12:18:31 +0100 Subject: [PATCH] Part: Avoid code duplication in Part2DObject --- src/Mod/Part/App/Part2DObject.cpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/Mod/Part/App/Part2DObject.cpp b/src/Mod/Part/App/Part2DObject.cpp index ecdefd60d..9d6d324e3 100644 --- a/src/Mod/Part/App/Part2DObject.cpp +++ b/src/Mod/Part/App/Part2DObject.cpp @@ -162,30 +162,10 @@ void Part2DObject::positionBySupport(void) gp_Trsf Trf; Trf.SetTransformation(SketchPos); Trf.Invert(); + Trf.SetScaleFactor(Standard_Real(1.0)); Base::Matrix4D mtrx; - - gp_Mat m = Trf._CSFDB_Getgp_Trsfmatrix(); - gp_XYZ p = Trf._CSFDB_Getgp_Trsfloc(); - Standard_Real scale = 1.0; - - // set Rotation matrix - mtrx[0][0] = scale * m._CSFDB_Getgp_Matmatrix(0,0); - mtrx[0][1] = scale * m._CSFDB_Getgp_Matmatrix(0,1); - mtrx[0][2] = scale * m._CSFDB_Getgp_Matmatrix(0,2); - - mtrx[1][0] = scale * m._CSFDB_Getgp_Matmatrix(1,0); - mtrx[1][1] = scale * m._CSFDB_Getgp_Matmatrix(1,1); - mtrx[1][2] = scale * m._CSFDB_Getgp_Matmatrix(1,2); - - mtrx[2][0] = scale * m._CSFDB_Getgp_Matmatrix(2,0); - mtrx[2][1] = scale * m._CSFDB_Getgp_Matmatrix(2,1); - mtrx[2][2] = scale * m._CSFDB_Getgp_Matmatrix(2,2); - - // set pos vector - mtrx[0][3] = p._CSFDB_Getgp_XYZx(); - mtrx[1][3] = p._CSFDB_Getgp_XYZy(); - mtrx[2][3] = p._CSFDB_Getgp_XYZz(); + TopoShape::convertToMatrix(Trf,mtrx); // check the angle against the Z Axis //Standard_Real a = Normal.Angle(gp_Ax1(gp_Pnt(0,0,0),gp_Dir(0,0,1)));