Salome HOME
Merge remote branch 'origin/Doc_update_ver741' into V7_5_BR
[modules/gui.git] / src / OCCViewer / OCCViewer_ClippingDlg.cxx
index ec75a10529ccbf4c4e93c1cfaddddf4078b41f33..2c993287b88d4b1f749a61981607c80e007d97ea 100644 (file)
@@ -37,6 +37,8 @@
 #include "OCCViewer_ViewManager.h"
 #include "OCCViewer_ClipPlaneInteractor.h"
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <V3d_View.hxx>
 #include <Visual3d_View.hxx>
 #include <Geom_Plane.hxx>
@@ -92,7 +94,17 @@ void getMinMaxFromContext( Handle(AIS_InteractiveContext) ic,
       if ( !aPrs->IsEmpty() && !aPrs->IsInfinite() ) {
         isFound = true;
         double xmin, ymin, zmin, xmax, ymax, zmax;
+#if OCC_VERSION_LARGE > 0x06070100
+       Bnd_Box aBox = aPrs->MinMaxValues();
+       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
         aXMin = qMin( aXMin, xmin );  aXMax = qMax( aXMax, xmax );
         aYMin = qMin( aYMin, ymin );  aYMax = qMax( aYMax, ymax );
         aZMin = qMin( aZMin, zmin );  aZMax = qMax( aZMax, zmax );