0032137: Coding Rules - merge redundant .lxx files into header files within Package gp
[occt.git] / src / gp / gp_XYZ.lxx
diff --git a/src/gp/gp_XYZ.lxx b/src/gp/gp_XYZ.lxx
deleted file mode 100644 (file)
index f975907..0000000
+++ /dev/null
@@ -1,313 +0,0 @@
-// Copyright (c) 1995-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-// LPA et JCV 07/92 
-
-#include <gp.hxx>
-#include <gp_Mat.hxx>
-#include <Standard_ConstructionError.hxx>
-#include <Standard_OutOfRange.hxx>
-
-inline gp_XYZ::gp_XYZ () : x(0.), y(0.), z(0.) { }
-
-inline gp_XYZ::gp_XYZ (const Standard_Real X,
-                      const Standard_Real Y,
-                      const Standard_Real Z) : x(X),y(Y),z(Z) { }
-
-inline void gp_XYZ::SetCoord (const Standard_Real X,
-                             const Standard_Real Y,
-                             const Standard_Real Z)
-{ x = X;  y = Y;  z = Z; }
-
-inline void gp_XYZ::SetCoord (const Standard_Integer i,
-                             const Standard_Real X) {
-  Standard_OutOfRange_Raise_if( i < 1 || i > 3,NULL);
-  (&x)[i-1] = X;
-}
-
-inline void gp_XYZ::SetX (const Standard_Real X)
-{ x = X; }
-
-inline void gp_XYZ::SetY (const Standard_Real Y)
-{ y = Y; }
-
-inline void gp_XYZ::SetZ (const Standard_Real Z) 
-{ z = Z; }
-
-inline Standard_Real gp_XYZ::Coord (const Standard_Integer i) const {
-  Standard_OutOfRange_Raise_if( i < 1 || i > 3,NULL);
-  return (&x)[i-1];
-}
-
-inline Standard_Real& gp_XYZ::ChangeCoord(const Standard_Integer theIndex)
-{
-  Standard_OutOfRange_Raise_if(theIndex < 1 || theIndex > 3,NULL);
-  return (&x)[theIndex - 1];
-}
-
-inline void gp_XYZ::Coord (Standard_Real& X,
-                          Standard_Real& Y,
-                          Standard_Real& Z) const
-{ X = x; Y = y; Z = z; }
-
-inline Standard_Real gp_XYZ::X () const
-{ return x; }
-
-inline Standard_Real gp_XYZ::Y () const
-{ return y; }
-
-inline Standard_Real gp_XYZ::Z () const
-{ return z; }
-
-inline Standard_Real gp_XYZ::Modulus () const { 
-  return sqrt (x * x + y * y + z * z);
-}
-
-inline Standard_Real gp_XYZ::SquareModulus () const {
-  return (x * x + y * y + z * z);
-}
-
-inline void gp_XYZ::Add (const gp_XYZ& Other)
-{
-  x += Other.x;
-  y += Other.y;
-  z += Other.z;
-}
-
-inline gp_XYZ gp_XYZ::Added (const gp_XYZ& Other) const {
-  return gp_XYZ(x + Other.x,y + Other.y,z + Other.z);
-}
-
-inline void gp_XYZ::Cross (const gp_XYZ& Right)
-{
-  Standard_Real Xresult = y * Right.z - z * Right.y;
-  Standard_Real Yresult = z * Right.x - x * Right.z;
-  z                     = x * Right.y - y * Right.x;
-  x = Xresult;
-  y = Yresult;
-}
-
-inline gp_XYZ gp_XYZ::Crossed (const gp_XYZ& Right) const
-{
-  return gp_XYZ (y * Right.z - z * Right.y,
-                z * Right.x - x * Right.z,
-                x * Right.y - y * Right.x);
-}
-
-inline Standard_Real gp_XYZ::CrossMagnitude (const gp_XYZ& Right) const
-{
-  Standard_Real Xresult = y * Right.z - z * Right.y;
-  Standard_Real Yresult = z * Right.x - x * Right.z;
-  Standard_Real Zresult = x * Right.y - y * Right.x;
-  return sqrt(Xresult * Xresult + Yresult * Yresult + Zresult * Zresult);
-}
-
-inline Standard_Real gp_XYZ::CrossSquareMagnitude (const gp_XYZ& Right) const
-{
-  Standard_Real Xresult = y * Right.z - z * Right.y;
-  Standard_Real Yresult = z * Right.x - x * Right.z;
-  Standard_Real Zresult = x * Right.y - y * Right.x;
-  return Xresult * Xresult + Yresult * Yresult + Zresult * Zresult;
-}
-
-inline void gp_XYZ::CrossCross (const gp_XYZ& Coord1,
-                               const gp_XYZ& Coord2)
-{
-  Standard_Real Xresult = 
-    y * (Coord1.x * Coord2.y - Coord1.y * Coord2.x) -
-      z * (Coord1.z * Coord2.x - Coord1.x * Coord2.z);
-  Standard_Real Yresult  = 
-    z * (Coord1.y * Coord2.z - Coord1.z * Coord2.y) -
-      x * (Coord1.x * Coord2.y - Coord1.y * Coord2.x);
-  z = 
-    x * (Coord1.z * Coord2.x - Coord1.x * Coord2.z) -
-      y * (Coord1.y * Coord2.z - Coord1.z * Coord2.y);
-  x = Xresult;
-  y = Yresult;
-}
-
-inline gp_XYZ gp_XYZ::CrossCrossed (const gp_XYZ& Coord1,
-                                   const gp_XYZ& Coord2) const
-{
-  gp_XYZ Coord0 = *this;
-  Coord0.CrossCross (Coord1, Coord2);
-  return Coord0;
-}
-
-inline void gp_XYZ::Divide (const Standard_Real Scalar)
-{
-  x /= Scalar;
-  y /= Scalar;
-  z /= Scalar;
-}
-
-inline gp_XYZ gp_XYZ::Divided (const Standard_Real Scalar) const {
-  return gp_XYZ(x / Scalar,y / Scalar,z / Scalar);
-}
-
-inline Standard_Real gp_XYZ::Dot (const gp_XYZ& Other) const {
-  return(x * Other.x + y * Other.y + z * Other.z);
-}
-
-inline Standard_Real gp_XYZ::DotCross (const gp_XYZ& Coord1,
-                                      const gp_XYZ& Coord2) const
-{
-  Standard_Real Xresult = Coord1.y * Coord2.z - Coord1.z * Coord2.y;
-  Standard_Real Yresult = Coord1.z * Coord2.x - Coord1.x * Coord2.z;
-  Standard_Real Zresult = Coord1.x * Coord2.y - Coord1.y * Coord2.x;
-  return ( x * Xresult + y * Yresult + z * Zresult);
-}
-
-inline void gp_XYZ::Multiply (const Standard_Real Scalar)
-{
-  x *= Scalar;
-  y *= Scalar;
-  z *= Scalar;
-}
-
-inline void gp_XYZ::Multiply (const gp_XYZ& Other)
-{
-  x *= Other.x;
-  y *= Other.y;
-  z *= Other.z;
-}
-
-inline void gp_XYZ::Multiply (const gp_Mat& Matrix)
-{
-  Standard_Real Xresult = Matrix.matrix[0][0] * x + Matrix.matrix[0][1] * y + Matrix.matrix[0][2] * z;
-  Standard_Real Yresult = Matrix.matrix[1][0] * x + Matrix.matrix[1][1] * y + Matrix.matrix[1][2] * z;
-  z                     = Matrix.matrix[2][0] * x + Matrix.matrix[2][1] * y + Matrix.matrix[2][2] * z;
-  x                     = Xresult;
-  y                     = Yresult;
-}
-
-inline gp_XYZ gp_XYZ::Multiplied (const Standard_Real Scalar) const {
-  return gp_XYZ(x * Scalar,y * Scalar,z * Scalar);
-}
-
-inline gp_XYZ gp_XYZ::Multiplied (const gp_XYZ& Other) const {
-  return gp_XYZ(x * Other.x, y * Other.y, z * Other.z);
-}
-
-inline gp_XYZ gp_XYZ::Multiplied (const gp_Mat& Matrix) const
-{
-  return gp_XYZ (Matrix.matrix[0][0] * x + Matrix.matrix[0][1] * y + Matrix.matrix[0][2] * z,
-                Matrix.matrix[1][0] * x + Matrix.matrix[1][1] * y + Matrix.matrix[1][2] * z,
-                Matrix.matrix[2][0] * x + Matrix.matrix[2][1] * y + Matrix.matrix[2][2] * z);
-}
-
-inline void gp_XYZ::Normalize ()
-{
-  Standard_Real D = Modulus();
-  Standard_ConstructionError_Raise_if (D <= gp::Resolution(),
-                                       "gp_XYZ::Normalize() - vector has zero norm");
-  x = x / D;  y = y / D;  z = z / D;
-}
-
-inline gp_XYZ gp_XYZ::Normalized () const
-{
-  Standard_Real D = Modulus();
-  Standard_ConstructionError_Raise_if (D <= gp::Resolution(),
-                                       "gp_XYZ::Normalized() - vector has zero norm");
-  return gp_XYZ (x / D, y / D, z / D);
-}
-
-inline void gp_XYZ::Reverse ()
-{
-  x = - x;
-  y = - y;
-  z = - z;
-}
-
-inline gp_XYZ gp_XYZ::Reversed () const
-{
-  return gp_XYZ(-x, -y,        -z);
-}
-
-inline void gp_XYZ::Subtract (const gp_XYZ& Right)
-{
-  x-=Right.x;
-  y-=Right.y;
-  z-=Right.z;
-}
-
-inline gp_XYZ gp_XYZ::Subtracted (const gp_XYZ& Right) const
-{
-  return gp_XYZ(x - Right.x, y - Right.y, z - Right.z);
-}
-
-inline void gp_XYZ::SetLinearForm (const Standard_Real L, 
-                                  const gp_XYZ& Left,
-                                  const Standard_Real R, 
-                                  const gp_XYZ& Right) {
-  
-  x = L * Left.x + R * Right.x;
-  y = L * Left.y + R * Right.y;
-  z = L * Left.z + R * Right.z; 
-}
-
-inline void gp_XYZ::SetLinearForm(const Standard_Real L, 
-                                 const gp_XYZ& Left,
-                                 const gp_XYZ& Right) {
-  x = L * Left.x + Right.x;
-  y = L * Left.y + Right.y;
-  z = L * Left.z + Right.z;
-}
-
-inline void gp_XYZ::SetLinearForm (const gp_XYZ& Left, const gp_XYZ& Right) {
-  x = Left.x + Right.x;
-  y = Left.y + Right.y;
-  z = Left.z + Right.z;
-}
-
-inline void gp_XYZ::SetLinearForm (const Standard_Real A1, const gp_XYZ& XYZ1,
-                                  const Standard_Real A2, const gp_XYZ& XYZ2, 
-                                  const Standard_Real A3, const gp_XYZ& XYZ3) {
-  
-  x = A1 * XYZ1.x + A2 * XYZ2.x + A3 * XYZ3.x;
-  y = A1 * XYZ1.y + A2 * XYZ2.y + A3 * XYZ3.y;
-  z = A1 * XYZ1.z + A2 * XYZ2.z + A3 * XYZ3.z;  
-}
-
-inline void gp_XYZ::SetLinearForm (const Standard_Real A1, const gp_XYZ& XYZ1,
-                                  const Standard_Real A2, const gp_XYZ& XYZ2, 
-                                  const gp_XYZ& XYZ3) {
-  x = A1 * XYZ1.x + A2 * XYZ2.x + XYZ3.x;
-  y = A1 * XYZ1.y + A2 * XYZ2.y + XYZ3.y;
-  z = A1 * XYZ1.z + A2 * XYZ2.z + XYZ3.z;
-}
-
-inline void gp_XYZ::SetLinearForm (const Standard_Real A1, const gp_XYZ& XYZ1,
-                                  const Standard_Real A2, const gp_XYZ& XYZ2, 
-                                  const Standard_Real A3, const gp_XYZ& XYZ3,
-                                  const gp_XYZ& XYZ4) {
-  x = A1 * XYZ1.x + A2 * XYZ2.x + A3 * XYZ3.x + XYZ4.x;
-  y = A1 * XYZ1.y + A2 * XYZ2.y + A3 * XYZ3.y + XYZ4.y;
-  z = A1 * XYZ1.z + A2 * XYZ2.z + A3 * XYZ3.z + XYZ4.z;
-  
-}
-
-inline gp_XYZ operator* (const gp_Mat& Matrix, const gp_XYZ& Coord1) {
-  return Coord1.Multiplied (Matrix);
-}
-
-inline gp_XYZ operator* (const Standard_Real Scalar, const gp_XYZ& Coord1) {
-  return Coord1.Multiplied (Scalar);
-}
-
-
-
-
-
-