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
3eeffd3b
Commit
3eeffd3b
authored
11 years ago
by
Luke Campagnola
Browse files
Options
Downloads
Patches
Plain Diff
GLLinePLotItem accepts array of colors (thanks Felix!)
parent
6131427d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.txt
+1
-0
1 addition, 0 deletions
README.txt
pyqtgraph/opengl/items/GLLinePlotItem.py
+14
-3
14 additions, 3 deletions
pyqtgraph/opengl/items/GLLinePlotItem.py
with
15 additions
and
3 deletions
README.txt
+
1
−
0
View file @
3eeffd3b
...
...
@@ -12,6 +12,7 @@ Contributors:
Christian Gavin
Michael Cristopher Hogg
Ulrich Leutner
Felix Schill
Requirements:
PyQt 4.7+ or PySide
...
...
This diff is collapsed.
Click to expand it.
pyqtgraph/opengl/items/GLLinePlotItem.py
+
14
−
3
View file @
3eeffd3b
...
...
@@ -30,8 +30,9 @@ class GLLinePlotItem(GLGraphicsItem):
Arguments:
------------------------------------------------------------------------
pos (N,3) array of floats specifying point locations.
color tuple of floats (0.0-1.0) specifying
a color for the entire item.
color (N,4) array of floats (0.0-1.0) or
tuple of floats specifying
a single color for the entire item.
width float specifying line width
antialias enables smooth line drawing
==================== ==================================================
...
...
@@ -71,9 +72,18 @@ class GLLinePlotItem(GLGraphicsItem):
self
.
setupGLState
()
glEnableClientState
(
GL_VERTEX_ARRAY
)
try
:
glVertexPointerf
(
self
.
pos
)
glColor4f
(
*
self
.
color
)
if
isinstance
(
self
.
color
,
np
.
ndarray
):
glEnableClientState
(
GL_COLOR_ARRAY
)
glColorPointerf
(
self
.
color
)
else
:
if
isinstance
(
self
.
color
,
QtGui
.
QColor
):
glColor4f
(
*
fn
.
glColor
(
self
.
color
))
else
:
glColor4f
(
*
self
.
color
)
glLineWidth
(
self
.
width
)
#glPointSize(self.width)
...
...
@@ -85,6 +95,7 @@ class GLLinePlotItem(GLGraphicsItem):
glDrawArrays
(
GL_LINE_STRIP
,
0
,
self
.
pos
.
size
/
self
.
pos
.
shape
[
-
1
])
finally
:
glDisableClientState
(
GL_COLOR_ARRAY
)
glDisableClientState
(
GL_VERTEX_ARRAY
)
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