Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EO Time Series Viewer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin Jakimow
EO Time Series Viewer
Commits
fd6cc955
Commit
fd6cc955
authored
11 years ago
by
Luke Campagnola
Browse files
Options
Downloads
Patches
Plain Diff
Fixed GLGridItem.setSize, added setSpacing
parent
5f7e4dc6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG
+1
-0
1 addition, 0 deletions
CHANGELOG
pyqtgraph/opengl/items/GLGridItem.py
+29
-9
29 additions, 9 deletions
pyqtgraph/opengl/items/GLGridItem.py
with
30 additions
and
9 deletions
CHANGELOG
+
1
−
0
View file @
fd6cc955
...
...
@@ -76,6 +76,7 @@ pyqtgraph-0.9.9 [unreleased]
- Allow images with NaN in ImageView
- MeshData can generate edges from face-indexed vertexes
- Fixed multiprocess deadlocks on windows
- Fixed GLGridItem.setSize
pyqtgraph-0.9.8 2013-11-24
...
...
This diff is collapsed.
Click to expand it.
pyqtgraph/opengl/items/GLGridItem.py
+
29
−
9
View file @
fd6cc955
import
numpy
as
np
from
OpenGL.GL
import
*
from
..
GLGraphicsItem
import
GLGraphicsItem
from
...
import
QtGui
...
...
@@ -16,8 +18,9 @@ class GLGridItem(GLGraphicsItem):
self
.
setGLOptions
(
glOptions
)
self
.
antialias
=
antialias
if
size
is
None
:
size
=
QtGui
.
QVector3D
(
1
,
1
,
1
)
size
=
QtGui
.
QVector3D
(
20
,
20
,
1
)
self
.
setSize
(
size
=
size
)
self
.
setSpacing
(
1
,
1
,
1
)
def
setSize
(
self
,
x
=
None
,
y
=
None
,
z
=
None
,
size
=
None
):
"""
...
...
@@ -33,8 +36,22 @@ class GLGridItem(GLGraphicsItem):
def
size
(
self
):
return
self
.
__size
[:]
def
setSpacing
(
self
,
x
=
None
,
y
=
None
,
z
=
None
,
spacing
=
None
):
"""
Set the spacing between grid lines.
Arguments can be x,y,z or spacing=QVector3D().
"""
if
spacing
is
not
None
:
x
=
spacing
.
x
()
y
=
spacing
.
y
()
z
=
spacing
.
z
()
self
.
__spacing
=
[
x
,
y
,
z
]
self
.
update
()
def
spacing
(
self
):
return
self
.
__spacing
[:]
def
paint
(
self
):
self
.
setupGLState
()
...
...
@@ -47,12 +64,15 @@ class GLGridItem(GLGraphicsItem):
glBegin
(
GL_LINES
)
x
,
y
,
z
=
self
.
size
()
xs
,
ys
,
zs
=
self
.
spacing
()
xvals
=
np
.
arange
(
-
x
/
2.
,
x
/
2.
+
xs
*
0.001
,
xs
)
yvals
=
np
.
arange
(
-
y
/
2.
,
y
/
2.
+
ys
*
0.001
,
ys
)
glColor4f
(
1
,
1
,
1
,
.
3
)
for
x
in
range
(
-
10
,
11
)
:
glVertex3f
(
x
,
-
10
,
0
)
glVertex3f
(
x
,
10
,
0
)
for
y
in
range
(
-
10
,
11
)
:
glVertex3f
(
-
10
,
y
,
0
)
glVertex3f
(
10
,
y
,
0
)
for
x
in
xvals
:
glVertex3f
(
x
,
yvals
[
0
]
,
0
)
glVertex3f
(
x
,
yvals
[
-
1
]
,
0
)
for
y
in
yvals
:
glVertex3f
(
xvals
[
0
]
,
y
,
0
)
glVertex3f
(
xvals
[
-
1
]
,
y
,
0
)
glEnd
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment