0025374: [6.8.0beta regression] gp_Trsf2d::SetMirror() looses transformation form
authornbv <nbv@opencascade.com>
Thu, 23 Oct 2014 14:02:23 +0000 (18:02 +0400)
committerbugmaster <bugmaster@opencascade.com>
Fri, 24 Oct 2014 06:53:44 +0000 (10:53 +0400)
1. Elements of gp_TrsfForm have been documented
2. gp_Trsf2d class has been reverted to non-regression case.

Update of test-cases

src/gp/gp.cdl
src/gp/gp_Trsf.cxx
src/gp/gp_Trsf2d.cxx
tests/de/iges_1/J9
tests/de/iges_1/K3
tests/de/iges_2/B8
tests/de/iges_2/E6
tests/de/iges_2/G1

index 73fe69d..490cfc2 100644 (file)
@@ -34,8 +34,24 @@ is
   exception VectorWithNullMagnitude inherits DomainError;
 
   enumeration TrsfForm is 
-  Identity, Rotation, Translation, PntMirror, Ax1Mirror, Ax2Mirror, Scale, 
-  CompoundTrsf, Other
+  Identity,
+    -- Transformation matrix is identity.
+  Rotation,
+    -- "Rotation" transformation was applied
+  Translation,
+    -- "Translation" with given vector or "from point - to point" was applied
+  PntMirror,
+    -- central symmetry
+  Ax1Mirror,
+    -- rotational symmetry
+  Ax2Mirror,
+    -- bilateral symmetry
+  Scale, 
+    -- "Scale" transformation was applied
+  CompoundTrsf,
+    -- All cases which is not enumerated here 
+  Other
+    -- Transformation with not-orthogonal matrix
   end TrsfForm;
   ---Purpose: Identifies the type of a geometric transformation.
 
index e19b2e4..ee7e339 100644 (file)
@@ -273,10 +273,10 @@ void gp_Trsf::SetScaleFactor (const Standard_Real S)
   scale = S;
   As = scale - 1.;
   if (As < 0) As = - As;
-  Standard_Boolean unit  = As <= gp::Resolution();
+  Standard_Boolean unit  = As <= gp::Resolution(); // = (scale == 1)
   As = scale + 1.;
   if (As < 0) As = - As;
-  Standard_Boolean munit = As <= gp::Resolution();
+  Standard_Boolean munit = As <= gp::Resolution(); // = (scale == -1)
   
   switch (shape) {
   case gp_Identity :
index 7fae973..4b99e91 100644 (file)
 void gp_Trsf2d::SetMirror (const gp_Ax2d& A)
 {
   shape = gp_Ax1Mirror;
+  scale = - 1.0;
   const gp_Dir2d& V = A.Direction ();
   const gp_Pnt2d& P = A.Location ();
   Standard_Real VX = V.X();
   Standard_Real VY = V.Y();
   Standard_Real X0 = P.X();
   Standard_Real Y0 = P.Y();
+  matrix.SetCol (1, gp_XY (1.0 - 2.0 * VX * VX, -2.0 * VX * VY));
+  matrix.SetCol (2, gp_XY (-2.0 * VX * VY, 1.0 - 2.0 * VY * VY));
 
-  SetValues(1.0-2.0*VX*VX, -2.0*VX*VY, -2.0*((VX * VX - 1.0)*X0 + (VX*VY*Y0)), 
-            -2.0*VX*VY, 1.0-2.0*VY*VY, -2.0*((VX*VY*X0)+(VY*VY-1.0)*Y0));
-
-  scale = - 1.0;
+  loc.SetCoord  (-2.0 * ((VX * VX - 1.0) * X0 + (VX * VY * Y0)),
+                 -2.0 * ((VX * VY * X0) + (VY * VY - 1.0) * Y0));
 }
 
 void gp_Trsf2d::SetTransformation (const gp_Ax2d& FromA1,
                                   const gp_Ax2d& ToA2)
 {
   shape = gp_CompoundTrsf;
+  scale = 1.0;
   //matrix from XOY to A2 :
   const gp_XY& V1 = ToA2.Direction().XY();
   gp_XY V2 (-V1.Y(), V1.X());
-
-  SetValues(V1.X(), V2.X(), ToA2.Location().X(),
-            V1.Y(), V2.Y(), ToA2.Location().Y());
-
-  scale = 1.0;
-
+  matrix.SetCol (1, V1);
+  matrix.SetCol (2, V2);
+  loc = ToA2.Location().XY();
   matrix.Transpose();
   loc.Multiply (matrix);
   loc.Reverse();
@@ -66,14 +65,12 @@ void gp_Trsf2d::SetTransformation (const gp_Ax2d& FromA1,
 void gp_Trsf2d::SetTransformation (const gp_Ax2d& A)
 {
   shape = gp_CompoundTrsf;
+  scale = 1.0;
   const gp_XY& V1 = A.Direction().XY();
   gp_XY V2 (-V1.Y(), V1.X());
-
-  SetValues(V1.X(), V2.X(), A.Location().X(),
-            V1.Y(), V2.Y(), A.Location().Y());
-
-  scale = 1.0;
-
+  matrix.SetCol (1, V1);
+  matrix.SetCol (2, V2);
+  loc = A.Location().XY();
   matrix.Transpose();
   loc.Multiply (matrix);
   loc.Reverse();
index 3ff8684..cfbb818 100644 (file)
@@ -8,9 +8,9 @@ set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 1 )  Summary  = 0  ( 1 )
 TPSTAT      : Faulties = 0  ( 28 )  Warnings = 115  ( 7 )  Summary  = 115  ( 35 )
 CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 0 )  Shells   = 0  ( 1 )   Solids   = 0 ( 1 )
-NBSHAPES    : Solid    = 0  ( 18 )  Shell    = 0  ( 18 )  Face     = 1190  ( 1190 )   Summary  = 15073  ( 7693 )
-STATSHAPE   : Solid    = 0  ( 18 )  Shell    = 0  ( 18 )  Face     = 1190  ( 1190 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 6283  ( 3134 )
-TOLERANCE   : MaxTol   =   0.2496383637  (   0.2496258832 )  AvgTol   =  0.002193043247  (  0.004111699336 )
+NBSHAPES    : Solid    = 0  ( 18 )  Shell    = 0  ( 18 )  Face     = 1190  ( 1190 )   Summary  = 15075  ( 7693 )
+STATSHAPE   : Solid    = 0  ( 18 )  Shell    = 0  ( 18 )  Face     = 1190  ( 1190 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 6284  ( 3134 )
+TOLERANCE   : MaxTol   =   0.2496383637  (   0.2496258832 )  AvgTol   =   0.00219239232  (  0.004111699336 )
 LABELS      : N0Labels = 27  ( 27 )  N1Labels = 0  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 27  ( 27 )   NameLabels = 27  ( 27 )   ColorLabels = 0  ( 0 )   LayerLabels = 0  ( 0 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 0  ( 0 )
index ea16d18..713c5f8 100644 (file)
@@ -1,6 +1,5 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: LABELS : Faulty" 
-puts "TODO OCC24156 MacOS: Error : 1 differences with reference data found"
 
 
 set filename FRA62468-1.igs
@@ -11,8 +10,8 @@ TPSTAT      : Faulties = 0  ( 0 )  Warnings = 299  ( 5226 )  Summary  = 299  ( 5
 CHECKSHAPE  : Wires    = 12  ( 18 )  Faces    = 16  ( 16 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
 NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 5163  ( 5163 )   Summary  = 68418  ( 68418 )
 STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 5163  ( 5163 )   FreeWire = 10  ( 10 )   FreeEdge  = 283 ( 283 )   SharedEdge = 29071  ( 29075 )
-TOLERANCE   : MaxTol   =   0.9874083984  (   0.9875071265 )  AvgTol   =    0.0111430941  (   0.01115568387 )
-LABELS      : N0Labels = 5392  ( 5458 )  N1Labels = 18  ( 4443 )  N2Labels = 0  ( 0 )   TotalLabels = 5410  ( 9901 )   NameLabels = 5392  ( 5458 )   ColorLabels = 5391  ( 9835 )   LayerLabels = 5391  ( 9835 )
+TOLERANCE   : MaxTol   =   0.9874083984  (   0.9875071265 )  AvgTol   =   0.01114309412  (   0.01115568387 )
+LABELS      : N0Labels = 5392  ( 5458 )  N1Labels = 18  ( 4437 )  N2Labels = 0  ( 0 )   TotalLabels = 5410  ( 9895 )   NameLabels = 5392  ( 5458 )   ColorLabels = 5391  ( 9829 )   LayerLabels = 5391  ( 9829 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 4  ( 4 )
 COLORS      : Colors   = BLACK BLUE1 CYAN1 GREEN  ( BLACK BLUE1 CYAN1 GREEN )
index f4ad21c..b3b166c 100644 (file)
@@ -1,7 +1,9 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: CHECKSHAPE : Faulty" 
 puts "TODO CR23096 ALL: LABELS : Faulty" 
-puts "TODO OCC24156 MacOS: Error : 1 differences with reference data found" 
+
+
+puts "TODO CR23096 ALL: Error : 1 differences with reference data found :" 
 
 set LinuxDiff 1
 set filename FRA62468-2.igs
@@ -12,8 +14,8 @@ TPSTAT      : Faulties = 0  ( 0 )  Warnings = 253  ( 4993 )  Summary  = 253  ( 4
 CHECKSHAPE  : Wires    = 12  ( 17 )  Faces    = 12  ( 11 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
 NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 4729  ( 4729 )   Summary  = 63154  ( 63144 )
 STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 4729  ( 4729 )   FreeWire = 18  ( 18 )   FreeEdge  = 452 ( 452 )   SharedEdge = 26794  ( 26793 )
-TOLERANCE   : MaxTol   =   0.9804479161  (   0.9805459497 )  AvgTol   =   0.01153089029  (   0.01154870945 )
-LABELS      : N0Labels = 5089  ( 5165 )  N1Labels = 26  ( 3846 )  N2Labels = 0  ( 0 )   TotalLabels = 5115  ( 9011 )   NameLabels = 5089  ( 5165 )   ColorLabels = 5086  ( 8935 )   LayerLabels = 5086  ( 8935 )
+TOLERANCE   : MaxTol   =   0.9804479161  (   0.9805459497 )  AvgTol   =   0.01153089031  (   0.01154870945 )
+LABELS      : N0Labels = 5089  ( 5165 )  N1Labels = 26  ( 3844 )  N2Labels = 0  ( 0 )   TotalLabels = 5115  ( 9009 )   NameLabels = 5089  ( 5165 )   ColorLabels = 5086  ( 8933 )   LayerLabels = 5086  ( 8933 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 3  ( 3 )
 COLORS      : Colors   = BLUE1 CYAN1 GREEN  ( BLUE1 CYAN1 GREEN )
index 901abce..f1e069c 100644 (file)
@@ -2,6 +2,9 @@
 puts "TODO CR23096 ALL: TOLERANCE : Faulty" 
 puts "TODO CR23096 ALL: LABELS : Faulty" 
 
+
+puts "TODO CR23096 ALL: Error : 1 differences with reference data found :" 
+
 set LinuxDiff 1
 set filename ims010.igs
 
@@ -11,8 +14,8 @@ TPSTAT      : Faulties = 0  ( 0 )  Warnings = 6  ( 523 )  Summary  = 6  ( 523 )
 CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
 NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 1177  ( 1177 )   Summary  = 18232  ( 18230 )
 STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 1177  ( 1177 )   FreeWire = 5  ( 5 )   FreeEdge  = 714 ( 714 )   SharedEdge = 7614  ( 7614 )
-TOLERANCE   : MaxTol   =   0.9436610236  (   0.8261873283 )  AvgTol   =   0.01104814109  (    0.0107628002 )
-LABELS      : N0Labels = 1884  ( 1885 )  N1Labels = 0  ( 1019 )  N2Labels = 0  ( 0 )   TotalLabels = 1884  ( 2904 )   NameLabels = 1884  ( 1885 )   ColorLabels = 1873  ( 2903 )   LayerLabels = 1873  ( 2903 )
+TOLERANCE   : MaxTol   =   0.9436610236  (   0.8261873283 )  AvgTol   =   0.01104814108  (   0.01076280021 )
+LABELS      : N0Labels = 1884  ( 1885 )  N1Labels = 0  ( 1020 )  N2Labels = 0  ( 0 )   TotalLabels = 1884  ( 2905 )   NameLabels = 1884  ( 1885 )   ColorLabels = 1873  ( 2904 )   LayerLabels = 1873  ( 2904 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 7  ( 7 )
 COLORS      : Colors   = BLACK BLUE1 CYAN1 GREEN RED WHITE YELLOW  ( BLACK BLUE1 CYAN1 GREEN RED WHITE YELLOW )
index a48fcc5..637025f 100755 (executable)
@@ -1,7 +1,13 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
 puts "TODO CR23096 ALL: TPSTAT : Faulty" 
+puts "TODO CR23096 ALL: CHECKSHAPE : Faulty" 
 puts "TODO CR23096 ALL: LABELS : Faulty" 
 
+
+puts "TODO CR23096 ALL: STATSHAPE : Faulty " 
+
+puts "TODO CR23096 ALL: Error : 2 differences with reference data found :" 
+
 set LinuxDiff 2
 set LinuxFaulties {STATSHAPE}
 set filename Henri.igs
@@ -12,7 +18,7 @@ TPSTAT      : Faulties = 0  ( 0 )  Warnings = 69  ( 41 )  Summary  = 69  ( 41 )
 CHECKSHAPE  : Wires    = 8  ( 2 )  Faces    = 8  ( 2 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
 NBSHAPES    : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 3592  ( 2312 )   Summary  = 112063  ( 71736 )
 STATSHAPE   : Solid    = 0  ( 0 )  Shell    = 0  ( 0 )  Face     = 3592  ( 3592 )   FreeWire = 4024  ( 4024 )   FreeEdge  = 28849 ( 28849 )   SharedEdge = 44966  ( 28775 )
-TOLERANCE   : MaxTol   =   0.9133007093  (   0.9133008813 )  AvgTol   =  0.005629101888  (  0.005904201197 )
+TOLERANCE   : MaxTol   =   0.9133007093  (   0.9133008813 )  AvgTol   =  0.005629101837  (  0.005904201197 )
 LABELS      : N0Labels = 24  ( 24 )  N1Labels = 5153  ( 6559 )  N2Labels = 0  ( 0 )   TotalLabels = 5177  ( 6583 )   NameLabels = 5177  ( 6583 )   ColorLabels = 5153  ( 6559 )   LayerLabels = 0  ( 0 )
 PROPS       : Centroid = 0  ( 0 )  Volume   = 0  ( 0 )  Area     = 0  ( 0 )
 NCOLORS     : NColors  = 6  ( 6 )