From a0a6bcbdd11cabe3e27a642725c9c05719a0ef8f Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 15 Apr 2015 18:21:27 +0300 Subject: [PATCH] OCCT 6.9.0 (after beta tag) compatibility --- src/OCCViewer/OCCViewer_CubeAxesDlg.cxx | 77 ++++++++----------------- 1 file changed, 23 insertions(+), 54 deletions(-) diff --git a/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx b/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx index fa66a7054..2edcb4b6f 100644 --- a/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx +++ b/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx @@ -267,60 +267,29 @@ void OCCViewer_CubeAxesDlg::ApplyData( const Handle(V3d_View)& theView ) #if OCC_VERSION_LARGE > 0x06080000 Graphic3d_GraduatedTrihedron gt; // main params - gt.SetToDrawTickmarks(Standard_True); // to draw grid - gt.SetToDrawAxes(Standard_True); // to draw axes - gt.SetGridColor(Quantity_NOC_WHITE); // grid color - // X axis aspect - gt.ChangeXAxisAspect().SetName(anAxisData[0].Name.toLatin1().constData()); - gt.ChangeXAxisAspect().SetToDrawName(anAxisData[0].DrawName); - gt.ChangeXAxisAspect().SetToDrawValues(anAxisData[0].DrawValues); - gt.ChangeXAxisAspect().SetToDrawTickmarks(anAxisData[0].DrawTickmarks); - gt.ChangeXAxisAspect().SetNameColor(Quantity_Color(anAxisData[0].NameColor.redF(), - anAxisData[0].NameColor.greenF(), - anAxisData[0].NameColor.blueF(), - Quantity_TOC_RGB)); - gt.ChangeXAxisAspect().SetColor(Quantity_Color(anAxisData[0].Color.redF(), - anAxisData[0].Color.greenF(), - anAxisData[0].Color.blueF(), - Quantity_TOC_RGB)); - gt.ChangeXAxisAspect().SetTickmarkNumber(anAxisData[0].NbValues-1); - gt.ChangeXAxisAspect().SetTickmarkLength(anAxisData[0].TickmarkLength); - gt.ChangeXAxisAspect().SetValuesOffset(anAxisData[0].Offset); - gt.ChangeXAxisAspect().SetNameOffset(anAxisData[0].Offset + aGap); // see above - // Y axis aspect - gt.ChangeYAxisAspect().SetName(anAxisData[1].Name.toLatin1().constData()); - gt.ChangeYAxisAspect().SetToDrawName(anAxisData[1].DrawName); - gt.ChangeYAxisAspect().SetToDrawValues(anAxisData[1].DrawValues); - gt.ChangeYAxisAspect().SetToDrawTickmarks(anAxisData[1].DrawTickmarks); - gt.ChangeYAxisAspect().SetNameColor(Quantity_Color(anAxisData[1].NameColor.redF(), - anAxisData[1].NameColor.greenF(), - anAxisData[1].NameColor.blueF(), - Quantity_TOC_RGB)); - gt.ChangeYAxisAspect().SetColor(Quantity_Color(anAxisData[1].Color.redF(), - anAxisData[1].Color.greenF(), - anAxisData[1].Color.blueF(), - Quantity_TOC_RGB)); - gt.ChangeYAxisAspect().SetTickmarkNumber(anAxisData[1].NbValues-1); - gt.ChangeYAxisAspect().SetTickmarkLength(anAxisData[1].TickmarkLength); - gt.ChangeYAxisAspect().SetValuesOffset(anAxisData[1].Offset); - gt.ChangeYAxisAspect().SetNameOffset(anAxisData[1].Offset + aGap); // see above - // Z axis aspect - gt.ChangeZAxisAspect().SetName(anAxisData[2].Name.toLatin1().constData()); - gt.ChangeZAxisAspect().SetToDrawName(anAxisData[2].DrawName); - gt.ChangeZAxisAspect().SetToDrawValues(anAxisData[2].DrawValues); - gt.ChangeZAxisAspect().SetToDrawTickmarks(anAxisData[2].DrawTickmarks); - gt.ChangeZAxisAspect().SetNameColor(Quantity_Color(anAxisData[2].NameColor.redF(), - anAxisData[2].NameColor.greenF(), - anAxisData[2].NameColor.blueF(), - Quantity_TOC_RGB)); - gt.ChangeZAxisAspect().SetColor(Quantity_Color(anAxisData[2].Color.redF(), - anAxisData[2].Color.greenF(), - anAxisData[2].Color.blueF(), - Quantity_TOC_RGB)); - gt.ChangeZAxisAspect().SetTickmarkNumber(anAxisData[2].NbValues-1); - gt.ChangeZAxisAspect().SetTickmarkLength(anAxisData[2].TickmarkLength); - gt.ChangeZAxisAspect().SetValuesOffset(anAxisData[2].Offset); - gt.ChangeZAxisAspect().SetNameOffset(anAxisData[2].Offset + aGap); // see above + 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 = ( i == 0 ? gt.ChangeXAxisAspect() : ( i == 1 ? gt.ChangeYAxisAspect() : gt.ChangeZAxisAspect() ) ); + 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 -- 2.39.2