Salome HOME
Updated copyright comment
[modules/gui.git] / src / OCCViewer / OCCViewer_ClipPlane.cxx
index 8584ddcb03e261a947f6c1bcfd445decc406a65d..00d2d6fcf64a189a2c9b97942cf5d672bed1b9f4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -36,14 +36,14 @@ namespace
     result[1] = first[2]*second[0] - first[0]*second[2];
     result[2] = first[0]*second[1] - first[1]*second[0];
   }
-};
+}
 
 OCCViewer_ClipPlane::OCCViewer_ClipPlane()
-: X( 0.0 ),
+: Mode( Absolute ),
+  IsOn( true ),
+  X( 0.0 ),
   Y( 0.0 ),
-  Z( 0.0 ),
-  Mode( Absolute ),
-  IsOn( true )
+  Z( 0.0 )
 {
   OrientationType = AbsoluteCustom;
   AbsoluteOrientation.Dx = 0.0;
@@ -117,9 +117,10 @@ void OCCViewer_ClipPlane::OrientationToXYZ( double &theDx, double &theDy, double
         break;
 
       case AbsoluteCustom :
-        theDx = AbsoluteOrientation.Dx;
-        theDy = AbsoluteOrientation.Dy;
-        theDz = AbsoluteOrientation.Dz;
+        int anInvertCoeff = AbsoluteOrientation.IsInvert ? 1 : -1;
+        theDx = anInvertCoeff * AbsoluteOrientation.Dx;
+        theDy = anInvertCoeff * AbsoluteOrientation.Dy;
+        theDz = anInvertCoeff * AbsoluteOrientation.Dz;
         break;
     }