From 5fb25a480bcefb8504efb884ed0da62c6450d32b Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 28 Apr 2015 19:55:03 +0300 Subject: [PATCH] OCCT dev compatibility --- src/OCCViewer/CMakeLists.txt | 5 +++++ src/OCCViewer/OCCViewer_CubeAxesDlg.cxx | 30 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/OCCViewer/CMakeLists.txt b/src/OCCViewer/CMakeLists.txt index eefdd3f50..975d3b8ad 100755 --- a/src/OCCViewer/CMakeLists.txt +++ b/src/OCCViewer/CMakeLists.txt @@ -41,6 +41,11 @@ INCLUDE_DIRECTORIES( # additional preprocessor / compiler flags ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${OGL_DEFINITIONS}) +# VSR: TEMPORARY, to be removed +IF(OCCT_DEV_COMPAT) +ADD_DEFINITIONS(-DOCCT_DEV_COMPAT) +ENDIF(OCCT_DEV_COMPAT) + # libraries to link to SET(_link_LIBRARIES ${OPENGL_LIBRARIES} ${QT_LIBRARIES} ${CAS_KERNEL} ${CAS_VIEWER} ${CAS_TKGeomAlgo} diff --git a/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx b/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx index fa66a7054..107824adb 100644 --- a/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx +++ b/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx @@ -265,6 +265,35 @@ void OCCViewer_CubeAxesDlg::ApplyData( const Handle(V3d_View)& theView ) int aGap = 20; #if OCC_VERSION_LARGE > 0x06080000 +#ifdef OCCT_DEV_COMPAT // VSR: temporarily, to be removed later and replace below implementation + Graphic3d_GraduatedTrihedron gt; + // main params + gt.SetDrawGrid(Standard_True); // to draw grid + gt.SetDrawAxes(Standard_True); // to draw axes + gt.SetGridColor(Quantity_NOC_WHITE); // grid color + // axes params + for ( int i = 0; i < 3; i++ ) { + Graphic3d_AxisAspect& aspect = gt.ChangeAxisAspect(i); + aspect.SetName(anAxisData[i].Name.toLatin1().constData()); + aspect.SetDrawName(anAxisData[i].DrawName); + aspect.SetDrawValues(anAxisData[i].DrawValues); + aspect.SetDrawTickmarks(anAxisData[i].DrawTickmarks); + aspect.SetNameColor(Quantity_Color(anAxisData[i].NameColor.redF(), + anAxisData[i].NameColor.greenF(), + anAxisData[i].NameColor.blueF(), + Quantity_TOC_RGB)); + aspect.SetColor(Quantity_Color(anAxisData[i].Color.redF(), + anAxisData[i].Color.greenF(), + anAxisData[i].Color.blueF(), + Quantity_TOC_RGB)); + aspect.SetTickmarksNumber(anAxisData[i].NbValues-1); + aspect.SetTickmarksLength(anAxisData[i].TickmarkLength); + aspect.SetValuesOffset(anAxisData[i].Offset); + aspect.SetNameOffset(anAxisData[i].Offset + aGap); // see above + } + // draw trihedron + theView->GraduatedTrihedronDisplay(gt); +#else // #ifdef OCCT_DEV_COMPAT / VSR: temporarily, to be removed later and replace below implementation Graphic3d_GraduatedTrihedron gt; // main params gt.SetToDrawTickmarks(Standard_True); // to draw grid @@ -323,6 +352,7 @@ void OCCViewer_CubeAxesDlg::ApplyData( const Handle(V3d_View)& theView ) gt.ChangeZAxisAspect().SetNameOffset(anAxisData[2].Offset + aGap); // see above // draw trihedron theView->GraduatedTrihedronDisplay(gt); +#endif // #ifdef OCCT_DEV_COMPAT / VSR: temporarily, to be removed later and replace below implementation #else theView->GraduatedTrihedronDisplay( anAxisData[0].Name.toLatin1().constData(), -- 2.39.2