Skip to content

Commit da3fd26

Browse files
committed
Fixed issue with rendering grid axes when using different conventions.
1 parent 97995e4 commit da3fd26

File tree

4 files changed

+49
-17
lines changed

4 files changed

+49
-17
lines changed

FEBioStudio/GLView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ void CGLView::mouseMoveEvent(QMouseEvent* ev)
809809
}
810810
update();
811811
}
812-
else m_view.m_nview = VIEW_USER;
812+
else SetViewMode(VIEW_USER);
813813
}
814814
else if ((but2 || (but3 && balt)) && !m_bsel)
815815
{

FEBioStudio/GLView.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,6 @@ class GLRenderEngine;
6060
#define COORD_LOCAL 1
6161
#define COORD_SCREEN 2
6262

63-
// view conventions
64-
enum View_Convention {
65-
CONV_FR_XZ,
66-
CONV_FR_XY,
67-
CONV_US_XY
68-
};
69-
7063
// snap modes
7164
enum Snap_Mode
7265
{

GLLib/GLGrid.cpp

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,48 @@ void GLGrid::Render(GLRenderEngine& re, GLContext& renderContext)
9292
// determine the colors for the major axis
9393
GLColor cx, cy;
9494
View_Mode view = renderContext.m_settings.m_nview;
95-
switch (view)
95+
int conv = renderContext.m_settings.m_nconv;
96+
if (conv == CONV_FR_XZ)
9697
{
97-
case VIEW_USER:
98-
case VIEW_ISOMETRIC:
99-
case VIEW_TOP:
100-
case VIEW_BOTTOM: cx = GLColor(200, 0, 0); cy = GLColor(0, 200, 0); break;
101-
case VIEW_RIGHT:
102-
case VIEW_LEFT: cx = GLColor(0, 200, 0); cy = GLColor(0, 0, 255); break;
103-
case VIEW_FRONT:
104-
case VIEW_BACK: cx = GLColor(200, 0, 0); cy = GLColor(0, 0, 255); break;
98+
switch (view)
99+
{
100+
case VIEW_USER:
101+
case VIEW_ISOMETRIC:
102+
case VIEW_TOP:
103+
case VIEW_BOTTOM: cx = GLColor(200, 0, 0); cy = GLColor(0, 200, 0); break;
104+
case VIEW_RIGHT:
105+
case VIEW_LEFT: cx = GLColor(0, 200, 0); cy = GLColor(0, 0, 255); break;
106+
case VIEW_FRONT:
107+
case VIEW_BACK: cx = GLColor(200, 0, 0); cy = GLColor(0, 0, 255); break;
108+
}
109+
}
110+
else if (conv == CONV_FR_XY)
111+
{
112+
switch (view)
113+
{
114+
case VIEW_USER:
115+
case VIEW_ISOMETRIC:
116+
case VIEW_FRONT:
117+
case VIEW_BACK: cx = GLColor(200, 0, 0); cy = GLColor(0, 200, 0); break;
118+
case VIEW_RIGHT:
119+
case VIEW_LEFT: cx = GLColor(0, 0, 255); cy = GLColor(0, 200, 0); break;
120+
case VIEW_TOP:
121+
case VIEW_BOTTOM: cx = GLColor(200, 0, 0); cy = GLColor(0, 0, 255); break;
122+
}
123+
}
124+
else // US_XY
125+
{
126+
switch (view)
127+
{
128+
case VIEW_USER:
129+
case VIEW_ISOMETRIC:
130+
case VIEW_FRONT:
131+
case VIEW_BACK: cx = GLColor(200, 0, 0); cy = GLColor(0, 200, 0); break;
132+
case VIEW_RIGHT:
133+
case VIEW_LEFT: cx = GLColor(0, 0, 255); cy = GLColor(0, 200, 0); break;
134+
case VIEW_TOP:
135+
case VIEW_BOTTOM: cx = GLColor(200, 0, 0); cy = GLColor(0, 0, 255); break;
136+
}
105137
}
106138

107139
// get the camera position

GLLib/GLViewSettings.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ enum View_Mode {
6868
VIEW_ISOMETRIC
6969
};
7070

71+
// view conventions
72+
enum View_Convention {
73+
CONV_FR_XZ,
74+
CONV_FR_XY,
75+
CONV_US_XY
76+
};
77+
7178
enum Planecut_Mode
7279
{
7380
PLANECUT,

0 commit comments

Comments
 (0)