1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-13 14:27:08 +03:00

0023774: Incorrect conversion from gp_Trsf2d to gp_Trsf

Adding test command for this fix
Adding test case for this fix
This commit is contained in:
jgv
2013-03-15 12:40:54 +04:00
parent 0dc98b5b0a
commit bead40f28c
5 changed files with 199 additions and 14 deletions

View File

@@ -64,7 +64,6 @@ is
--- Purpose : Returns the identity transformation.
Create(T : Trsf2d from gp) returns Trsf from gp;
---C++: inline
---Purpose: Creates a 3D transformation from the 2D transformation T.
-- The resulting transformation has a homogeneous
-- vectorial part, V3, and a translation part, T3, built from T:

View File

@@ -27,6 +27,30 @@
#include <gp.hxx>
#include <Standard_ConstructionError.hxx>
//=======================================================================
//function : gp_Trsf
//purpose : Constructor from 2d
//=======================================================================
gp_Trsf::gp_Trsf (const gp_Trsf2d& T) :
scale(T.ScaleFactor()),
shape(T.Form()),
loc(T.TranslationPart().X(),T.TranslationPart().Y(), 0.0)
{
const gp_Mat2d& M = T.HVectorialPart();
matrix(1,1) = M(1,1);
matrix(1,2) = M(1,2);
matrix(2,1) = M(2,1);
matrix(2,2) = M(2,2);
matrix(3,3) = 1.;
if (shape == gp_Ax1Mirror)
{
scale = 1;
matrix.Multiply(-1);
}
}
//=======================================================================
//function : SetMirror
//purpose :

View File

@@ -32,19 +32,6 @@ matrix(1,0,0, 0,1,0, 0,0,1),
loc(0.0, 0.0, 0.0)
{}
inline gp_Trsf::gp_Trsf (const gp_Trsf2d& T) :
scale(T.ScaleFactor()),
shape(T.Form()),
loc(T.TranslationPart().X(),T.TranslationPart().Y(), 0.0)
{
const gp_Mat2d& M = T.HVectorialPart();
matrix(1,1) = M(1,1);
matrix(1,2) = M(1,2);
matrix(2,1) = M(2,1);
matrix(2,2) = M(2,2);
matrix(3,3) = 1.;
}
inline void gp_Trsf::SetMirror (const gp_Pnt& P)
{
shape = gp_PntMirror;