From e232236eb57c37a9daef7d114d940fb60d9f659f Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 25 Nov 2013 06:53:07 +0000 Subject: [PATCH] Porting to latest OCCT master --- src/OCCViewer/OCCViewer_ViewModel.cxx | 2 +- src/OCCViewer/OCCViewer_ViewModel.h | 3 ++- src/OCCViewer/OCCViewer_ViewWindow.cxx | 37 +++++--------------------- 3 files changed, 10 insertions(+), 32 deletions(-) diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index 3735978ed..55ad5e67f 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -1038,7 +1038,7 @@ void OCCViewer_Viewer::setClipPlanes(ClipPlanesList theList) Handle(Graphic3d_ClipPlane) aGraphic3dPlane = new Graphic3d_ClipPlane(); aGraphic3dPlane->SetEquation (aPln); aGraphic3dPlane->SetOn(plane.IsOn); - myInternalClipPlanes.Add(aGraphic3dPlane); + myInternalClipPlanes.Append(aGraphic3dPlane); } // 3. Apply clipping planes diff --git a/src/OCCViewer/OCCViewer_ViewModel.h b/src/OCCViewer/OCCViewer_ViewModel.h index 2e111ae83..20ee49e6d 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.h +++ b/src/OCCViewer/OCCViewer_ViewModel.h @@ -37,6 +37,7 @@ #include #include #include +#include class QKeyEvent; class QMouseEvent; @@ -224,7 +225,7 @@ protected: OCCViewer_ClippingDlg* myClippingDlg; ClipPlanesList myClipPlanes; - Graphic3d_SetOfHClipPlane myInternalClipPlanes; + Graphic3d_SequenceOfHClipPlane myInternalClipPlanes; }; #ifdef WIN32 diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index ae69b7c9b..683f0499e 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -81,7 +81,7 @@ #include #if OCC_VERSION_LARGE > 0x06060000 -#include +#include #include #endif @@ -1932,11 +1932,10 @@ void OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x, const doub double a, b, c, d; pln.Coefficients(a, b, c, d); -#if OCC_VERSION_LARGE > 0x06060000 // Porting to OCCT higher 6.6.0 version - Graphic3d_SetOfHClipPlane aPlanes = view->GetClipPlanes(); + Graphic3d_SequenceOfHClipPlane aPlanes = view->GetClipPlanes(); Handle(Graphic3d_ClipPlane) aClipPlane; if(aPlanes.Size() > 0 ) { - Graphic3d_SetOfHClipPlane::Iterator anIter (aPlanes); + Graphic3d_SequenceOfHClipPlane::Iterator anIter (aPlanes); aClipPlane = anIter.Value(); aClipPlane->SetEquation(pln); aClipPlane->SetOn(Standard_True); @@ -1945,31 +1944,14 @@ void OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x, const doub view->AddClipPlane(aClipPlane); aClipPlane->SetOn(Standard_True); } -#elif OCC_VERSION_LARGE > 0x06040000 && CC_VERSION_LARGE <= 0x06060000 // Porting to OCCT6.5.1 - if (view->MoreActivePlanes()) { - clipPlane = view->ActivePlane(); - clipPlane->SetPlane(a, b, c, d); - } - else { - clipPlane = new V3d_Plane (a, b, c, d); - view->SetPlaneOn(clipPlane); - } -#else - clipPlane = new V3d_Plane (viewer); - clipPlane->SetPlane(a, b, c, d); -#endif } else { -#if OCC_VERSION_LARGE > 0x06060000 // Porting to OCCT higher 6.6.0 version - Graphic3d_SetOfHClipPlane aPlanes = view->GetClipPlanes(); - Graphic3d_SetOfHClipPlane::Iterator anIter (aPlanes); + Graphic3d_SequenceOfHClipPlane aPlanes = view->GetClipPlanes(); + Graphic3d_SequenceOfHClipPlane::Iterator anIter (aPlanes); for( ;anIter.More();anIter.Next() ){ Handle(Graphic3d_ClipPlane) aClipPlane = anIter.Value(); aClipPlane->SetOn(Standard_False); } -#else - view->SetPlaneOff(); -#endif } view->Update(); @@ -1991,10 +1973,9 @@ void OCCViewer_ViewWindow::setCuttingPlane( bool on, const gp_Pln pln ) bool OCCViewer_ViewWindow::isCuttingPlane() { Handle(V3d_View) view = myViewPort->getView(); -#if OCC_VERSION_LARGE > 0x06060000 // Porting to OCCT higher 6.6.0 version bool res = false; - Graphic3d_SetOfHClipPlane aPlanes = view->GetClipPlanes(); - Graphic3d_SetOfHClipPlane::Iterator anIter (aPlanes); + Graphic3d_SequenceOfHClipPlane aPlanes = view->GetClipPlanes(); + Graphic3d_SequenceOfHClipPlane::Iterator anIter (aPlanes); for( ;anIter.More();anIter.Next() ) { Handle(Graphic3d_ClipPlane) aClipPlane = anIter.Value(); if(aClipPlane->IsOn()) { @@ -2003,10 +1984,6 @@ bool OCCViewer_ViewWindow::isCuttingPlane() } } return res; -#else - view->InitActivePlanes(); - return (view->MoreActivePlanes()); -#endif } /*! -- 2.39.2