Commit 42c40beb authored by Frédéric Larue's avatar Frédéric Larue

Metric grid modified so as to recover the current scale level.

parent 1df7cd5b
...@@ -214,7 +214,7 @@ void MetricGrid::display( GLViewer *viewer ) ...@@ -214,7 +214,7 @@ void MetricGrid::display( GLViewer *viewer )
double log10Dist = std::log10( 1.75*viewer->distToFocusPoint() ); double log10Dist = std::log10( 1.75*viewer->distToFocusPoint() );
int log10DistI = (int) std::floor( log10Dist ); int log10DistI = (int) std::floor( log10Dist );
double scaleFactor = std::pow( 10.0, (double)log10DistI ); m_CurrentScale = std::pow( 10.0, (double)log10DistI );
// Determine the alpha value for smooth transitions between successive grid scales. // Determine the alpha value for smooth transitions between successive grid scales.
...@@ -268,10 +268,10 @@ void MetricGrid::display( GLViewer *viewer ) ...@@ -268,10 +268,10 @@ void MetricGrid::display( GLViewer *viewer )
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
if( alpha != 255 ) if( alpha != 255 )
displayGrid( viewer, 10.0*scaleFactor, 255-alpha ); displayGrid( viewer, 10.0*m_CurrentScale, 255-alpha );
displayGrid( viewer, scaleFactor, 255 ); displayGrid( viewer, m_CurrentScale, 255 );
if( alpha ) if( alpha )
displayGrid( viewer, 0.1*scaleFactor, alpha ); displayGrid( viewer, 0.1*m_CurrentScale, alpha );
// Restore the previously backed up state. // Restore the previously backed up state.
......
...@@ -47,6 +47,7 @@ private: ...@@ -47,6 +47,7 @@ private:
bool m_EnableLabels; bool m_EnableLabels;
int m_EnableAxisOnAlignedOrtho; int m_EnableAxisOnAlignedOrtho;
int m_EnableGridsOnAlignedOrtho; int m_EnableGridsOnAlignedOrtho;
double m_CurrentScale;
const QString* m_Suffix; const QString* m_Suffix;
/*****************************\ /*****************************\
...@@ -102,6 +103,8 @@ public: ...@@ -102,6 +103,8 @@ public:
inline void setSuffix( const QString *suffix ) { m_Suffix = suffix; } inline void setSuffix( const QString *suffix ) { m_Suffix = suffix; }
inline QString suffix() const { return *m_Suffix; } inline QString suffix() const { return *m_Suffix; }
inline double currentScale() const { return m_CurrentScale; }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment