X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOCCViewer%2FOCCViewer_CubeAxesDlg.cxx;h=fa66a70546057c25d47c9d3377c55816ff85f990;hb=259ecb356eb789678497db6b655cc3e377a67cce;hp=86cade97c6b468d6358581c2202057abd10ad5d2;hpb=627194285d9b5354291d3a442b68b8740f114eda;p=modules%2Fgui.git diff --git a/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx b/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx index 86cade97c..fa66a7054 100644 --- a/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx +++ b/src/OCCViewer/OCCViewer_CubeAxesDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -31,6 +31,10 @@ #include +#if OCC_VERSION_LARGE > 0x06080000 +#include +#endif + #include #include #include @@ -244,22 +248,82 @@ void OCCViewer_CubeAxesDlg::SetData( bool theIsVisible, OCCViewer_AxisWidget::Ax */ void OCCViewer_CubeAxesDlg::ApplyData( const Handle(V3d_View)& theView ) { -#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 and higher version if( theView.IsNull() ) return; if( myIsVisible->isChecked() ) { OCCViewer_AxisWidget::AxisData anAxisData[3]; - for( int i = 0; i < 3; i++ ) + for( int i = 0; i < 3; i++ ) { if( OCCViewer_AxisWidget* anAxisWidget = dynamic_cast( myAxes[ i ] ) ) anAxisWidget->GetData( anAxisData[i] ); + } // A gap used offset of axis names' offset // (this hard-coded value will be removed when the // font support will be introduced in OCC-6.4) int aGap = 20; +#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 + // draw trihedron + theView->GraduatedTrihedronDisplay(gt); +#else theView->GraduatedTrihedronDisplay( anAxisData[0].Name.toLatin1().constData(), anAxisData[1].Name.toLatin1().constData(), @@ -312,10 +376,10 @@ void OCCViewer_CubeAxesDlg::ApplyData( const Handle(V3d_View)& theView ) anAxisData[2].Color.greenF(), anAxisData[2].Color.blueF(), Quantity_TOC_RGB ) ); +#endif // OCC_VERSION_LARGE > 0x06080000 } else theView->GraduatedTrihedronErase(); theView->Redraw(); -#endif }