Skip to content

Commit

Permalink
gui render: improve sliders
Browse files Browse the repository at this point in the history
  • Loading branch information
barnex committed Feb 7, 2014
1 parent e65e331 commit 61de20f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
8 changes: 6 additions & 2 deletions engine/gui.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,12 @@
{{.Data.Div "display"}}

<p>
{{.Data.QuantNames | .SelectArray "renderQuant" "m"}} {{.Select "renderComp" "" "" "x" "y" "z"}} {{.Span "renderDoc" "" "style=\"color:gray\""}} <br/>
z-slice: {{.Range "renderLayer" 0 0 0 }} zoom out: {{.Range "renderScale" 0 31 31}}
Quantity: {{.Data.QuantNames | .SelectArray "renderQuant" "m"}} {{.Select "renderComp" "" "" "x" "y" "z"}} {{.Span "renderDoc" "" "style=\"color:gray\""}} <br/>
<table>
<tr title="Scroll through previously saved data"> <td> Time: {{.Range "renderTime" -1000 1 1}} </td><td> {{.Span "renderTimeLabel" "live"}} </td></tr>
<tr title="Slice through z layers"> <td> Slice: {{.Range "renderLayer" 0 0 0 }} </td><td> {{.Span "renderLayerLabel" "0"}} </td></tr>
<tr title="Zoom out large images"> <td> Scale: {{.Range "renderScale" 0 31 31}} </td><td> {{.Span "renderScaleLabel" "1/1"}} </td></tr>
</table>
</p>

<p>
Expand Down
8 changes: 6 additions & 2 deletions engine/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,12 @@ m = {{.Data.Configs | .SelectArray "mselect" "Uniform"}} {{.TextBox "margs" "(1,
{{.Data.Div "display"}}
<p>
{{.Data.QuantNames | .SelectArray "renderQuant" "m"}} {{.Select "renderComp" "" "" "x" "y" "z"}} {{.Span "renderDoc" "" "style=\"color:gray\""}} <br/>
z-slice: {{.Range "renderLayer" 0 0 0 }} zoom out: {{.Range "renderScale" 0 31 31}}
Quantity: {{.Data.QuantNames | .SelectArray "renderQuant" "m"}} {{.Select "renderComp" "" "" "x" "y" "z"}} {{.Span "renderDoc" "" "style=\"color:gray\""}} <br/>
<table>
<tr title="Scroll through previously saved data"> <td> Time: {{.Range "renderTime" -1000 1 1}} </td><td> {{.Span "renderTimeLabel" "live"}} </td></tr>
<tr title="Slice through z layers"> <td> Slice: {{.Range "renderLayer" 0 0 0 }} </td><td> {{.Span "renderLayerLabel" "0"}} </td></tr>
<tr title="Zoom out large images"> <td> Scale: {{.Range "renderScale" 0 31 31}} </td><td> {{.Span "renderScaleLabel" "1/1"}} </td></tr>
</table>
</p>
<p>
Expand Down
3 changes: 3 additions & 0 deletions engine/render.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package engine

import (
"fmt"
"github.com/mumax/3/cuda"
"github.com/mumax/3/data"
"github.com/mumax/3/draw"
Expand Down Expand Up @@ -66,13 +67,15 @@ func (ren *render) render(quant Quantity, comp string) {
renderLayer = 0
GUI.Set("renderLayer", renderLayer)
}
GUI.Set("renderLayerLabel", fmt.Sprint(renderLayer, "/", Mesh().Size()[Z]))
if quant.NComp() == 1 {
comp = ""
GUI.Set("renderComp", "")
}

// scale the size
renderScale := maxScale - GUI.IntValue("renderScale")
GUI.Set("renderScaleLabel", fmt.Sprint("1/", renderScale))
for i := range size {
size[i] /= renderScale
if size[i] == 0 {
Expand Down

0 comments on commit 61de20f

Please sign in to comment.