working on glvisualize

This commit is contained in:
Thomas Breloff 2016-06-24 12:15:21 -04:00
parent 1ecd9f9e19
commit 69b69714cb

View File

@ -78,9 +78,17 @@ end
function gl_display(plt::Plot{GLVisualizeBackend}) function gl_display(plt::Plot{GLVisualizeBackend})
screen = plt.o screen = plt.o
for sp in plt.subplots # for sp in plt.subplots
for (name, sp) in plt.spmap
# TODO: setup subplot # TODO: setup subplot
f = rect -> gl_viewport(bbox(sp), rect)
sp_screen = Screen(
screen,
name = name,
area = GLVisualize.const_lift(f, screen.area)
)
for series in series_list(sp) for series in series_list(sp)
d = series.d d = series.d
st = d[:seriestype] st = d[:seriestype]
@ -92,7 +100,7 @@ function gl_display(plt::Plot{GLVisualizeBackend})
ismatrix(y) || (y = repmat(y, 1, length(x))) ismatrix(y) || (y = repmat(y, 1, length(x)))
z = transpose_z(d, map(Float32, d[:z].surf), false) z = transpose_z(d, map(Float32, d[:z].surf), false)
viz = GLVisualize.visualize((x, y, z), :surface) viz = GLVisualize.visualize((x, y, z), :surface)
GLVisualize.view(viz, screen, camera = :perspective) GLVisualize.view(viz, sp_screen, camera = :perspective)
else else
points = if is3d(st) points = if is3d(st)
@ -108,7 +116,7 @@ function gl_display(plt::Plot{GLVisualizeBackend})
if st in (:scatter, :scatter3d) || d[:markershape] != :none if st in (:scatter, :scatter3d) || d[:markershape] != :none
marker = gl_marker(d[:markershape], msize, is3d(st)) marker = gl_marker(d[:markershape], msize, is3d(st))
viz = GLVisualize.visualize((marker, points), color = gl_color(d[:markercolor], d[:markeralpha])) viz = GLVisualize.visualize((marker, points), color = gl_color(d[:markercolor], d[:markeralpha]))
GLVisualize.view(viz, screen, camera = camera) GLVisualize.view(viz, sp_screen, camera = camera)
# TODO: might need to switch to these forms later? # TODO: might need to switch to these forms later?
# GLVisualize.visualize((marker ,(x, y, z))) # GLVisualize.visualize((marker ,(x, y, z)))
@ -121,7 +129,7 @@ function gl_display(plt::Plot{GLVisualizeBackend})
lw = d[:linewidth] lw = d[:linewidth]
if !(st in (:scatter, :scatter3d)) && lw > 0 if !(st in (:scatter, :scatter3d)) && lw > 0
viz = GLVisualize.visualize(points, :lines) #, color=colors, model=rotation) viz = GLVisualize.visualize(points, :lines) #, color=colors, model=rotation)
GLVisualize.view(viz, screen, camera = camera) GLVisualize.view(viz, sp_screen, camera = camera)
end end
end end
end end