From ba89da1b1663a9ae63a39595e58ef5281f1179f7 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 28 Oct 2014 09:33:55 +0300 Subject: [PATCH] OCC dev (IR-2014-10-23) porting part 2 --- src/OCCViewer/OCCViewer_ClippingDlg.cxx | 12 ++++++------ src/OCCViewer/OCCViewer_ViewModel.cxx | 12 ++++++------ src/OCCViewer/OCCViewer_ViewWindow.cxx | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/OCCViewer/OCCViewer_ClippingDlg.cxx b/src/OCCViewer/OCCViewer_ClippingDlg.cxx index d6359071f..2c993287b 100644 --- a/src/OCCViewer/OCCViewer_ClippingDlg.cxx +++ b/src/OCCViewer/OCCViewer_ClippingDlg.cxx @@ -96,12 +96,12 @@ void getMinMaxFromContext( Handle(AIS_InteractiveContext) ic, double xmin, ymin, zmin, xmax, ymax, zmax; #if OCC_VERSION_LARGE > 0x06070100 Bnd_Box aBox = aPrs->MinMaxValues(); - xmin = aBox.CornerMin().X(); - ymin = aBox.CornerMin().Y(); - zmin = aBox.CornerMin().Z(); - xmax = aBox.CornerMax().X(); - ymax = aBox.CornerMax().Y(); - zmax = aBox.CornerMax().Z(); + xmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X(); + ymin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y(); + zmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Z(); + xmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().X(); + ymax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Y(); + zmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Z(); #else aPrs->MinMaxValues( xmin, ymin, zmin, xmax, ymax, zmax ); #endif diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index c11d24ca0..ae9e8639f 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -960,12 +960,12 @@ double OCCViewer_Viewer::computeSceneSize(const Handle(V3d_View)& view3d) const #if OCC_VERSION_LARGE > 0x06070100 Bnd_Box aBox = view3d->View()->MinMaxValues(); - Xmin = aBox.CornerMin().X(); - Ymin = aBox.CornerMin().Y(); - Zmin = aBox.CornerMin().Z(); - Xmax = aBox.CornerMax().X(); - Ymax = aBox.CornerMax().Y(); - Zmax = aBox.CornerMax().Z(); + Xmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().X(); + Ymin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Y(); + Zmin = aBox.IsVoid() ? RealFirst() : aBox.CornerMin().Z(); + Xmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().X(); + Ymax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Y(); + Zmax = aBox.IsVoid() ? RealLast() : aBox.CornerMax().Z(); #else view3d->View()->MinMaxValues( Xmin, Ymin, Zmin, Xmax, Ymax, Zmax ); #endif diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 621df3289..2fa68a577 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -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 -- 2.30.2