Salome HOME
Issue 0020904: [CEA 411] export VTK in GEOM
[modules/geom.git] / src / MeasureGUI / MeasureGUI_InertiaDlg.cxx
index 2ff5495be9fdc6db0c2dbb6b690a15adfb2e3b6e..9d2c323c43210dca43893ff1bb4638fc4ed5e9da 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -19,6 +19,7 @@
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 // GEOM GEOMGUI : GUI for Geometry component
 // File   : MeasureGUI_InertiaDlg.cxx
 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
@@ -169,13 +170,14 @@ bool MeasureGUI_InertiaDlg::getParameters( gp_Mat& I,
   if ( myObj->_is_nil() )
     return false;
   else {
+    GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
     try {
       double x, y, z;
-      GEOM::GEOM_IMeasureOperations::_narrow( getOperation() )->GetInertia( myObj,
-        I( 1, 1 ), I( 1, 2 ), I( 1, 3 ),
-        I( 2, 1 ), I( 2, 2 ), I( 2, 3 ),
-        I( 3, 1 ), I( 3, 2 ), I( 3, 3 ),
-        x, y, z );
+      anOper->GetInertia( myObj,
+                          I( 1, 1 ), I( 1, 2 ), I( 1, 3 ),
+                          I( 2, 1 ), I( 2, 2 ), I( 2, 3 ),
+                          I( 3, 1 ), I( 3, 2 ), I( 3, 3 ),
+                          x, y, z );
 
         theIXYZ.SetCoord( x, y, z );
     }
@@ -184,6 +186,6 @@ bool MeasureGUI_InertiaDlg::getParameters( gp_Mat& I,
       return false;
     }
 
-    return getOperation()->IsDone();
+    return anOper->IsDone();
   }
 }