Salome HOME
OCC dev (IR-2014-10-23) porting part 2
[modules/gui.git] / src / OCCViewer / OCCViewer_ViewWindow.cxx
index 621df3289406cb5e1309662700dd4dc1f4d885de..2fa68a577e0317016ab4664bc643cc620fffe8b3 100755 (executable)
@@ -653,12 +653,12 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou
 
 #if OCC_VERSION_LARGE > 0x06070100
     Bnd_Box aBox = aStructure->MinMaxValues();
-    aXmin = aBox.CornerMin().X();
-    aYmin = aBox.CornerMin().Y();
-    aZmin = aBox.CornerMin().Z();
-    aXmax = aBox.CornerMax().X();
-    aYmax = aBox.CornerMax().Y();
-    aZmax = aBox.CornerMax().Z();
+    aXmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X();
+    aYmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y();
+    aZmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Z();
+    aXmax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().X();
+    aYmax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().Y();
+    aZmax = aBox.IsVoid() ? RealLast()  : aBox.CornerMax().Z();
 #else
     aStructure->MinMaxValues( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax );
 #endif