Commit 91f87eb6 authored by Frédéric Larue's avatar Frédéric Larue

Display of metric grid improved.

parent e7e9b102
......@@ -240,18 +240,18 @@ void MetricGrid::display( GLViewer *viewer )
QVector3D front = viewer->frontAxis();
if( std::abs(front.x()) == 1.0f )
{
m_EnabledGrids = m_EnableGridsOnAlignedOrtho? YZ : NONE;
m_EnabledAxis = m_EnableAxisOnAlignedOrtho? Y|Z : NONE;
m_EnabledGrids = m_EnableGridsOnAlignedOrtho * YZ;
m_EnabledAxis = m_EnableAxisOnAlignedOrtho * (Y|Z);
}
else if( std::abs(front.y()) == 1.0f )
{
m_EnabledGrids = m_EnableGridsOnAlignedOrtho? ZX : NONE;
m_EnabledAxis = m_EnableAxisOnAlignedOrtho? Z|X : NONE;
m_EnabledGrids = m_EnableGridsOnAlignedOrtho * ZX;
m_EnabledAxis = m_EnableAxisOnAlignedOrtho * (Z|X);
}
else if( std::abs(front.z()) == 1.0f )
{
m_EnabledGrids = m_EnableGridsOnAlignedOrtho? XY : NONE;
m_EnabledAxis = m_EnableAxisOnAlignedOrtho? X|Y : NONE;
m_EnabledGrids = m_EnableGridsOnAlignedOrtho * XY;
m_EnabledAxis = m_EnableAxisOnAlignedOrtho * (X|Y);
}
}
......
......@@ -44,8 +44,8 @@ private:
int m_EnabledGrids;
int m_EnabledAxis;
bool m_EnableLabels;
bool m_EnableAxisOnAlignedOrtho;
bool m_EnableGridsOnAlignedOrtho;
int m_EnableAxisOnAlignedOrtho;
int m_EnableGridsOnAlignedOrtho;
/*****************************\
| Constructor(s) / destructor |
......@@ -55,16 +55,16 @@ public:
m_EnabledGrids(NONE),
m_EnabledAxis(ALL),
m_EnableLabels(true),
m_EnableAxisOnAlignedOrtho(true),
m_EnableGridsOnAlignedOrtho(true)
m_EnableAxisOnAlignedOrtho(1),
m_EnableGridsOnAlignedOrtho(1)
{}
inline MetricGrid( int enabledGrids,
int enabledAxis ) :
m_EnabledGrids(enabledGrids),
m_EnabledAxis(enabledAxis),
m_EnableLabels(true),
m_EnableAxisOnAlignedOrtho(true),
m_EnableGridsOnAlignedOrtho(true)
m_EnableAxisOnAlignedOrtho(1),
m_EnableGridsOnAlignedOrtho(1)
{}
/********************\
......@@ -88,13 +88,13 @@ public:
inline void disableLabels() { m_EnableLabels = false; }
inline bool areLabelsEnabled() const { return m_EnableLabels; }
inline void enableAxisOnAlignedOrtho() { m_EnableAxisOnAlignedOrtho = true; }
inline void disableAxisOnAlignedOrtho() { m_EnableAxisOnAlignedOrtho = false; }
inline bool areAxisOnAlignedOrthoEnabled() const { return m_EnableAxisOnAlignedOrtho; }
inline void enableAxisOnAlignedOrtho() { m_EnableAxisOnAlignedOrtho = 1; }
inline void disableAxisOnAlignedOrtho() { m_EnableAxisOnAlignedOrtho = 0; }
inline bool areAxisOnAlignedOrthoEnabled() const { return m_EnableAxisOnAlignedOrtho != 0; }
inline void enableGridsOnAlignedOrtho() { m_EnableGridsOnAlignedOrtho = true; }
inline void disableGridsOnAlignedOrtho() { m_EnableGridsOnAlignedOrtho = false; }
inline bool areGridsOnAlignedOrthoEnabled() const { return m_EnableGridsOnAlignedOrtho; }
inline void enableGridsOnAlignedOrtho() { m_EnableGridsOnAlignedOrtho = 1; }
inline void disableGridsOnAlignedOrtho() { m_EnableGridsOnAlignedOrtho = 0; }
inline bool areGridsOnAlignedOrthoEnabled() const { return m_EnableGridsOnAlignedOrtho != 0; }
void display( GLViewer *viewer );
};
......
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