]> OCCT Git - occt-copy.git/commitdiff
0028636: Optimisation of gp_* classes in order to avoid unnecesary calling gp_Dir...
authormsv <msv@opencascade.com>
Thu, 6 Apr 2017 12:28:26 +0000 (15:28 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 12 Apr 2017 14:53:55 +0000 (17:53 +0300)
The improvement is concluded in replacement of calls to gp_Dir2d(1,0) with calls to gp_Dir2d(void).
Thus we avoid sqrt() that is called from within gp_Dir2d(double,double). The same is with direction in 3D space.

src/gp/gp_Ax2.lxx
src/gp/gp_Ax22d.lxx
src/gp/gp_Ax2d.lxx
src/gp/gp_Ax3.lxx

index d48f3e407e6dd1074de33b92f5bb1a61768ed0b0..3e94b37be67275899963225ccc331ffd987e1f5f 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <gp.hxx>
-#include <gp_Ax1.hxx>
 #include <Precision.hxx>
 
-inline gp_Ax2::gp_Ax2() : vydir(0.,1.,0.), vxdir(1.,0.,0.)
+inline gp_Ax2::gp_Ax2()
+  :
+  vydir(0.,1.,0.)
+  // vxdir(1.,0.,0.) use default ctor of gp_Dir, as it creates the same dir(1,0,0)
 { }
 
 inline gp_Ax2::gp_Ax2(const gp_Pnt& P,
index 286668ab8a97556c75d35a9e44487f89829feb74..40d1597465cad23291b10d51215fd5901da503f3 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-inline gp_Ax22d::gp_Ax22d() : vydir(0.,1.), vxdir(1.,0.)
+inline gp_Ax22d::gp_Ax22d()
+  :
+  vydir(0.,1.)
+  // vxdir(1.,0.) use default ctor of gp_Dir2d, as it creates the same dir(1, 0)
 {}
 
 inline gp_Ax22d::gp_Ax22d(const gp_Pnt2d& P , 
index 098d6cd56b23960e42fcb166128466562517c9d7..37048626a237681a6ae59d3fbccfd377f8eb1e25 100644 (file)
 
 #include <gp_Ax2d.hxx>
 
-inline gp_Ax2d::gp_Ax2d() : loc(0.,0.), vdir(1.,0.)
+inline gp_Ax2d::gp_Ax2d()
+  :
+  loc(0.,0.)
+  //vdir(1.,0.) use default ctor of gp_Dir2d, as it creates the same dir (1,0)
 { }
 
 inline gp_Ax2d::gp_Ax2d (const gp_Pnt2d& P,
index 71d4044f37bee7bec29973c4ea60ba16f10d1d4c..2b4fe6d91ac28e45ef43d14ed2e9ae9356d3c45b 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <gp.hxx>
 #include <gp_Ax2.hxx>
-#include <gp_Ax1.hxx>
 
-inline gp_Ax3::gp_Ax3() : vydir(0.,1.,0.), vxdir(1.,0.,0.)
+inline gp_Ax3::gp_Ax3()
+  :
+  vydir(0.,1.,0.)
+  // vxdir(1.,0.,0.) use default ctor of gp_Dir, as it creates the same dir(1,0,0)
 { }
 
 inline gp_Ax3::gp_Ax3(const gp_Ax2& A) :