From: jfa Date: Fri, 2 Jun 2017 11:20:15 +0000 (+0300) Subject: INT PAL 0054211: SALOME-8.3.0: Geometry fields are displayed incorrectly X-Git-Tag: Before_multi_study_removal_06072017 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=61e3f7e90a35ce43ffbd180213da56d493979f41;p=modules%2Fgeom.git INT PAL 0054211: SALOME-8.3.0: Geometry fields are displayed incorrectly --- diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index be8d25b0c..488b426f3 100755 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -2965,7 +2965,11 @@ QList GEOM_Displayer::groupFieldData( const QList& theFieldS { QColor aQColor; Quantity_Color aColor; +#if OCC_VERSION_MAJOR < 7 if( FindColor( aVariant.toDouble(), theFieldStepRangeMin, theFieldStepRangeMax, anIsBoolean ? 2 : aNbIntervals, aColor ) ) +#else + if( AIS_ColorScale::FindColor( aVariant.toDouble(), theFieldStepRangeMin, theFieldStepRangeMax, anIsBoolean ? 2 : aNbIntervals, aColor ) ) +#endif aQColor = QColor::fromRgbF( aColor.Red(), aColor.Green(), aColor.Blue() ); aResultList << aQColor; } @@ -2973,7 +2977,8 @@ QList GEOM_Displayer::groupFieldData( const QList& theFieldS return aResultList; } -// Note: the method is copied from AIS_ColorScale class +#if OCC_VERSION_MAJOR < 7 +// Note: the method is copied from Aspect_ColorScale class Standard_Integer GEOM_Displayer::HueFromValue( const Standard_Integer aValue, const Standard_Integer aMin, const Standard_Integer aMax ) @@ -2989,7 +2994,7 @@ Standard_Integer GEOM_Displayer::HueFromValue( const Standard_Integer aValue, return aHue; } -// Note: the method is copied from AIS_ColorScale class +// Note: the method is copied from Aspect_ColorScale class Standard_Boolean GEOM_Displayer::FindColor( const Standard_Real aValue, const Standard_Real aMin, const Standard_Real aMax, @@ -3016,6 +3021,7 @@ Standard_Boolean GEOM_Displayer::FindColor( const Standard_Real aValue, return Standard_True; } } +#endif void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, const bool updateViewer ) { @@ -3027,7 +3033,6 @@ void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, cons if( !aViewModel ) return; -#if OCC_VERSION_MAJOR < 7 Handle(V3d_Viewer) aViewer = aViewModel->getViewer3d(); if( aViewer.IsNull() ) return; @@ -3039,7 +3044,6 @@ void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, cons Handle(V3d_View) aView = aViewer->ActiveView(); if( aView.IsNull() ) return; -#endif Standard_Boolean anIsDisplayColorScale = Standard_False; TCollection_AsciiString aColorScaleTitle; @@ -3103,18 +3107,25 @@ void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, cons Handle(Aspect_ColorScale) myColorScale = aView->ColorScale(); if( !myColorScale.IsNull() ) { -#endif + myColorScale->SetXPosition( anXPos ); + myColorScale->SetYPosition( anYPos ); + myColorScale->SetWidth( aWidth ); + myColorScale->SetHeight( aHeight ); +#else + Standard_Integer aWinWidth = 0, aWinHeight = 0; + aView->Window()->Size (aWinWidth, aWinHeight); - myColorScale->SetXPosition( anXPos ); - myColorScale->SetYPosition( anYPos ); - myColorScale->SetWidth( aWidth ); - myColorScale->SetHeight( aHeight ); + myColorScale->SetPosition (aWinWidth*anXPos, aWinHeight*anYPos); + //myColorScale->SetBreadth (aWinWidth); // ??? + myColorScale->SetBreadth (aWinWidth*aWidth); // ??? + myColorScale->SetHeight (aWinHeight*aHeight); +#endif - myColorScale->SetTextHeight( aTextHeight ); - myColorScale->SetNumberOfIntervals( anIsBoolean ? 2 : aNbIntervals ); + myColorScale->SetRange( aColorScaleMin, aColorScaleMax ); + myColorScale->SetNumberOfIntervals( anIsBoolean ? 2 : aNbIntervals ); - myColorScale->SetTitle( aColorScaleTitle ); - myColorScale->SetRange( aColorScaleMin, aColorScaleMax ); + myColorScale->SetTextHeight( aTextHeight ); + myColorScale->SetTitle( aColorScaleTitle ); #if OCC_VERSION_MAJOR < 7 } diff --git a/src/GEOMGUI/GEOM_Displayer.h b/src/GEOMGUI/GEOM_Displayer.h index 50b6c1798..c7c6d879b 100755 --- a/src/GEOMGUI/GEOM_Displayer.h +++ b/src/GEOMGUI/GEOM_Displayer.h @@ -277,6 +277,7 @@ protected: double& theFieldStepRangeMin, double& theFieldStepRangeMax ); +#if OCC_VERSION_MAJOR < 7 // Note: the method is copied from Aspect_ColorScale class static Standard_Integer HueFromValue( const Standard_Integer aValue, const Standard_Integer aMin, @@ -288,6 +289,7 @@ protected: const Standard_Real aMax, const Standard_Integer ColorsCount, Quantity_Color& aColor ); +#endif protected: Handle(SALOME_InteractiveObject) myIO;