Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CommonGUI
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Frédéric Larue
CommonGUI
Commits
42c40beb
Commit
42c40beb
authored
Oct 14, 2019
by
Frédéric Larue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Metric grid modified so as to recover the current scale level.
parent
1df7cd5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
GLViewer/MetricGrid.cpp
GLViewer/MetricGrid.cpp
+4
-4
GLViewer/MetricGrid.h
GLViewer/MetricGrid.h
+3
-0
No files found.
GLViewer/MetricGrid.cpp
View file @
42c40beb
...
...
@@ -214,7 +214,7 @@ void MetricGrid::display( GLViewer *viewer )
double
log10Dist
=
std
::
log10
(
1.75
*
viewer
->
distToFocusPoint
()
);
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.
...
...
@@ -268,10 +268,10 @@ void MetricGrid::display( GLViewer *viewer )
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
if
(
alpha
!=
255
)
displayGrid
(
viewer
,
10.0
*
scaleFactor
,
255
-
alpha
);
displayGrid
(
viewer
,
scaleFactor
,
255
);
displayGrid
(
viewer
,
10.0
*
m_CurrentScale
,
255
-
alpha
);
displayGrid
(
viewer
,
m_CurrentScale
,
255
);
if
(
alpha
)
displayGrid
(
viewer
,
0.1
*
scaleFactor
,
alpha
);
displayGrid
(
viewer
,
0.1
*
m_CurrentScale
,
alpha
);
// Restore the previously backed up state.
...
...
GLViewer/MetricGrid.h
View file @
42c40beb
...
...
@@ -47,6 +47,7 @@ private:
bool
m_EnableLabels
;
int
m_EnableAxisOnAlignedOrtho
;
int
m_EnableGridsOnAlignedOrtho
;
double
m_CurrentScale
;
const
QString
*
m_Suffix
;
/*****************************\
...
...
@@ -102,6 +103,8 @@ public:
inline
void
setSuffix
(
const
QString
*
suffix
)
{
m_Suffix
=
suffix
;
}
inline
QString
suffix
()
const
{
return
*
m_Suffix
;
}
inline
double
currentScale
()
const
{
return
m_CurrentScale
;
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment