Part: Avoid code duplication in Part2DObject

This commit is contained in:
logari81 2013-02-13 12:18:31 +01:00
parent 8160c8280f
commit 9c7719e91b

View File

@ -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)));