diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca0e35bc1..823d338ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: sudo apt-get install libgl1-mesa-dev xorg-dev mesa-vulkan-drivers - uses: actions/setup-go@v3 with: - go-version: "1.19" + go-version: "1.21" - run: go build ./... - run: go test -tags=multinet -race ./... @@ -38,7 +38,7 @@ jobs: sudo apt-get install libgl1-mesa-dev xorg-dev mesa-vulkan-drivers - uses: actions/setup-go@v3 with: - go-version: "1.19" + go-version: "1.21" - name: Generate coverage report run: go test -tags=multinet ./... -coverprofile=coverage.txt -covermode=atomic -timeout=20m - name: Upload coverage report diff --git a/axon/networkbase.go b/axon/networkbase.go index 178ad2b9c..b30a3d77e 100644 --- a/axon/networkbase.go +++ b/axon/networkbase.go @@ -342,8 +342,8 @@ func (nt *NetworkBase) Layout() { // BoundsUpdt updates the Min / Max display bounds for 3D display func (nt *NetworkBase) BoundsUpdt() { - mn := mat32.NewVec3Scalar(mat32.Infinity) - mx := mat32.Vec3Zero + mn := mat32.V3Scalar(mat32.Infinity) + mx := mat32.Vec3{} for _, ly := range nt.Layers { ps := ly.Pos() sz := ly.Size() diff --git a/examples/bench_objrec/leds.go b/examples/bench_objrec/leds.go index 9d2985187..352759c50 100644 --- a/examples/bench_objrec/leds.go +++ b/examples/bench_objrec/leds.go @@ -63,8 +63,8 @@ func (ld *LEDraw) Init() { } ld.Paint = paint.NewContextFromImage(ld.Image) ld.Paint.StrokeStyle.Width.Pw(ld.Width) - ld.Paint.StrokeStyle.Color.SetSolid(ld.LineColor) - ld.Paint.FillStyle.Color.SetSolid(ld.BgColor) + ld.Paint.StrokeStyle.Color = colors.C(ld.LineColor) + ld.Paint.FillStyle.Color = colors.C(ld.BgColor) ld.Paint.SetUnitContextExt(ld.ImgSize) } diff --git a/examples/bench_objrec/objrec.go b/examples/bench_objrec/objrec.go index 7d837e879..7094fe1b2 100644 --- a/examples/bench_objrec/objrec.go +++ b/examples/bench_objrec/objrec.go @@ -672,7 +672,7 @@ func (ss *Sim) ConfigGUI() { nv.SetNet(ss.Net) ss.ViewUpdt.Config(nv, etime.Phase, etime.Phase) - cam := &(nv.Scene().Camera) + cam := &(nv.SceneXYZ().Camera) cam.Pose.Pos.Set(0.0, 1.733, 2.3) cam.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) diff --git a/examples/boa/armaze/gui.go b/examples/boa/armaze/gui.go index a9bc5ed26..d0afae3f5 100644 --- a/examples/boa/armaze/gui.go +++ b/examples/boa/armaze/gui.go @@ -92,7 +92,7 @@ type GUI struct { EnvName string // 3D visualization of the Scene - Scene3D *xyzv.Scene3D + SceneView *xyzv.SceneView // 2D visualization of the Scene Scene2D *gi.SVG @@ -250,16 +250,17 @@ func (vw *GUI) ConfigWorldGUI(ev *Env) *gi.Body { vw.ConfigWorld() - vw.Scene3D = xyzv.NewScene3D(scfr, "sceneview") - se := vw.Scene3D.Scene + vw.SceneView = xyzv.NewSceneView(scfr, "sceneview") + vw.SceneView.Config() + se := vw.SceneView.SceneXYZ() vw.ConfigView3D(se) se.Camera.Pose.Pos = mat32.Vec3{0, 29, -4} - se.Camera.LookAt(mat32.Vec3{0, 4, -5}, mat32.Vec3Y) + se.Camera.LookAt(mat32.Vec3{0, 4, -5}, mat32.V3(0, 1, 0)) se.SaveCamera("2") se.Camera.Pose.Pos = mat32.Vec3{0, 17, 21} - se.Camera.LookAt(mat32.Vec3{0, 3.6, 0}, mat32.Vec3Y) + se.Camera.LookAt(mat32.Vec3{0, 3.6, 0}, mat32.V3(0, 1, 0)) se.SaveCamera("1") se.SaveCamera("default") @@ -560,7 +561,7 @@ func (vw *GUI) ConfigWorldView(tg *etview.TensorGrid) { func (vw *GUI) UpdateWorld(ctx *axon.Context, ev *Env, net *axon.Network, state TraceStates) { vw.State = state vw.Trace.AddRec(ctx, uint32(ev.Di), ev, net, state) - if vw.Scene3D == nil || !vw.Disp { + if vw.SceneView == nil || !vw.Disp { return } @@ -583,11 +584,11 @@ func (vw *GUI) SetEmeryPose() { } func (vw *GUI) UpdateWorldGUI() { - if vw.Scene3D == nil || !vw.Disp { + if vw.SceneView == nil || !vw.Disp { return } - updt := vw.Scene3D.Sc.UpdateStartAsync() - defer vw.Scene3D.Sc.UpdateEndAsyncRender(updt) + updt := vw.SceneView.Sc.UpdateStartAsync() + defer vw.SceneView.Sc.UpdateEndAsyncRender(updt) // update state: vw.SetEmeryPose() @@ -599,8 +600,8 @@ func (vw *GUI) UpdateWorldGUI() { // update views: vw.GrabEyeImg() - if vw.Scene3D.IsVisible() { - vw.Scene3D.SetNeedsRender(true) + if vw.SceneView.IsVisible() { + vw.SceneView.SetNeedsRender(true) } // if vw.Scene2D.IsVisible() { // vw.Scene2D.SetNeedsRender(true) diff --git a/examples/boa/boa.go b/examples/boa/boa.go index db744b3b7..f5665db30 100644 --- a/examples/boa/boa.go +++ b/examples/boa/boa.go @@ -1221,8 +1221,8 @@ func (ss *Sim) ConfigGUI() { nv.SetNet(ss.Net) ss.ViewUpdt.Config(nv, etime.Phase, etime.Phase) - nv.Scene().Camera.Pose.Pos.Set(0, 1.4, 2.6) - nv.Scene().Camera.LookAt(mat32.Vec3{X: 0, Y: 0, Z: 0}, mat32.Vec3{X: 0, Y: 1, Z: 0}) + nv.SceneXYZ().Camera.Pose.Pos.Set(0, 1.4, 2.6) + nv.SceneXYZ().Camera.LookAt(mat32.Vec3{X: 0, Y: 0, Z: 0}, mat32.Vec3{X: 0, Y: 1, Z: 0}) ss.GUI.ViewUpdt = &ss.ViewUpdt diff --git a/examples/deep_move/deep_move.go b/examples/deep_move/deep_move.go index b87eb0553..a17049e66 100644 --- a/examples/deep_move/deep_move.go +++ b/examples/deep_move/deep_move.go @@ -601,8 +601,8 @@ func (ss *Sim) Log(mode etime.Modes, time etime.Times) { func (ss *Sim) ConfigNetView(nv *netview.NetView) { nv.ViewDefaults() - nv.Scene().Camera.Pose.Pos.Set(0, 2.1, 2.0) - nv.Scene().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) + nv.SceneXYZ().Camera.Pose.Pos.Set(0, 2.1, 2.0) + nv.SceneXYZ().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) } // ConfigGUI configures the GoGi gui interface for this simulation, diff --git a/examples/deep_music/deep_music.go b/examples/deep_music/deep_music.go index 2d3051fe5..7f35cec86 100644 --- a/examples/deep_music/deep_music.go +++ b/examples/deep_music/deep_music.go @@ -593,8 +593,8 @@ func (ss *Sim) Log(mode etime.Modes, time etime.Times) { func (ss *Sim) ConfigNetView(nv *netview.NetView) { nv.ViewDefaults() - nv.Scene().Camera.Pose.Pos.Set(0, 2.1, 2.0) - nv.Scene().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) + nv.SceneXYZ().Camera.Pose.Pos.Set(0, 2.1, 2.0) + nv.SceneXYZ().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) } // ConfigGUI configures the GoGi gui interface for this simulation, diff --git a/examples/hip/hip.go b/examples/hip/hip.go index f2f0d97a1..375a977e1 100644 --- a/examples/hip/hip.go +++ b/examples/hip/hip.go @@ -790,8 +790,8 @@ func (ss *Sim) ConfigGUI() { ss.ViewUpdt.Config(nv, etime.Phase, etime.Phase) ss.GUI.ViewUpdt = &ss.ViewUpdt - nv.Scene().Camera.Pose.Pos.Set(0, 1, 2.75) // more "head on" than default which is more "top down" - nv.Scene().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) + nv.SceneXYZ().Camera.Pose.Pos.Set(0, 1, 2.75) // more "head on" than default which is more "top down" + nv.SceneXYZ().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) ss.GUI.AddPlots(title, &ss.Logs) diff --git a/examples/inhib/inhib.go b/examples/inhib/inhib.go index 6265fa89e..cb75abe15 100644 --- a/examples/inhib/inhib.go +++ b/examples/inhib/inhib.go @@ -524,8 +524,8 @@ func (ss *Sim) ConfigGUI() { ss.ViewUpdt.Config(nv, etime.AlphaCycle, etime.AlphaCycle) ss.GUI.ViewUpdt = &ss.ViewUpdt - nv.Scene().Camera.Pose.Pos.Set(0, 1, 2.75) // more "head on" than default which is more "top down" - nv.Scene().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) + nv.SceneXYZ().Camera.Pose.Pos.Set(0, 1, 2.75) // more "head on" than default which is more "top down" + nv.SceneXYZ().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) ss.GUI.AddPlots(title, &ss.Logs) diff --git a/examples/mpi/ra25.go b/examples/mpi/ra25.go index 93aa63928..81ea7979c 100644 --- a/examples/mpi/ra25.go +++ b/examples/mpi/ra25.go @@ -710,8 +710,8 @@ func (ss *Sim) ConfigGUI() { ss.ViewUpdt.Config(nv, etime.Phase, etime.Phase) ss.GUI.ViewUpdt = &ss.ViewUpdt - nv.Scene().Camera.Pose.Pos.Set(0, 1, 2.75) // more "head on" than default which is more "top down" - nv.Scene().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) + nv.SceneXYZ().Camera.Pose.Pos.Set(0, 1, 2.75) // more "head on" than default which is more "top down" + nv.SceneXYZ().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) ss.GUI.AddPlots(title, &ss.Logs) diff --git a/examples/neuron/neuron.go b/examples/neuron/neuron.go index 26bcdf94d..c69e2095b 100644 --- a/examples/neuron/neuron.go +++ b/examples/neuron/neuron.go @@ -29,7 +29,6 @@ import ( "github.com/emer/emergent/v2/params" "github.com/emer/emergent/v2/prjn" "github.com/emer/empi/v2/mpi" - "goki.dev/etable/v2/eplot" "goki.dev/etable/v2/etable" "goki.dev/etable/v2/etensor" _ "goki.dev/etable/v2/etview" // include to get gui views @@ -122,9 +121,6 @@ type Sim struct { // manages all the gui elements GUI egui.GUI `view:"-"` - // the test-trial plot - TstCycPlot *eplot.Plot2D `view:"-"` - // map of values for detailed debugging / testing ValMap map[string]float32 `view:"-"` } @@ -201,7 +197,7 @@ func (ss *Sim) Counters() string { } func (ss *Sim) UpdateView() { - ss.TstCycPlot.UpdatePlot() + ss.GUI.UpdatePlot(etime.Test, etime.Cycle) ss.GUI.ViewUpdt.Text = ss.Counters() ss.GUI.ViewUpdt.UpdateCycle(int(ss.Context.Cycle)) } @@ -373,7 +369,7 @@ func (ss *Sim) ConfigLogItems() { func (ss *Sim) ResetTstCycPlot() { ss.Logs.ResetLog(etime.Test, etime.Cycle) - ss.TstCycPlot.GoUpdatePlot() + ss.GUI.UpdatePlot(etime.Test, etime.Cycle) } //////////////////////////////////////////////////////////////////////////////////////////// @@ -396,11 +392,12 @@ func (ss *Sim) ConfigGUI() { ss.ViewUpdt.Config(nv, etime.AlphaCycle, etime.AlphaCycle) ss.GUI.ViewUpdt = &ss.ViewUpdt - plt := eplot.NewPlot2D(ss.GUI.Tabs.NewTab("TstCycPlot")) - key := etime.Scope(etime.Test, etime.Cycle) - plt.SetTable(ss.Logs.Table(etime.Test, etime.Cycle)) - egui.ConfigPlotFromLog("Neuron", plt, &ss.Logs, key) - ss.TstCycPlot = plt + ss.GUI.AddPlots(title, &ss.Logs) + // key := etime.Scope(etime.Test, etime.Cycle) + // plt := ss.GUI.NewPlot(key, ss.GUI.Tabs.NewTab("TstCycPlot")) + // plt.SetTable(ss.Logs.Table(etime.Test, etime.Cycle)) + // egui.ConfigPlotFromLog("Neuron", plt, &ss.Logs, key) + // ss.TstCycPlot = plt ss.GUI.Body.AddAppBar(func(tb *gi.Toolbar) { ss.GUI.AddToolbarItem(tb, egui.ToolbarItem{Label: "Init", Icon: "update", diff --git a/examples/pvlv/pvlv.go b/examples/pvlv/pvlv.go index 9d4073d1a..ddb1d2dab 100644 --- a/examples/pvlv/pvlv.go +++ b/examples/pvlv/pvlv.go @@ -739,8 +739,8 @@ func (ss *Sim) ConfigGUI() { ss.ViewUpdt.Config(nv, etime.Phase, etime.Phase) ss.GUI.ViewUpdt = &ss.ViewUpdt - nv.Scene().Camera.Pose.Pos.Set(0, 1.4, 2.6) - nv.Scene().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) + nv.SceneXYZ().Camera.Pose.Pos.Set(0, 1.4, 2.6) + nv.SceneXYZ().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) ss.GUI.AddPlots(title, &ss.Logs) diff --git a/examples/ra25/ra25.go b/examples/ra25/ra25.go index 72e430ca8..d44282f8f 100644 --- a/examples/ra25/ra25.go +++ b/examples/ra25/ra25.go @@ -663,8 +663,8 @@ func (ss *Sim) ConfigGUI() { ss.ViewUpdt.Config(nv, etime.Phase, etime.Phase) ss.GUI.ViewUpdt = &ss.ViewUpdt - nv.Scene().Camera.Pose.Pos.Set(0, 1, 2.75) // more "head on" than default which is more "top down" - nv.Scene().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) + nv.SceneXYZ().Camera.Pose.Pos.Set(0, 1, 2.75) // more "head on" than default which is more "top down" + nv.SceneXYZ().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) ss.GUI.AddPlots(title, &ss.Logs) diff --git a/examples/ra25x/ra25x.go b/examples/ra25x/ra25x.go index 7eaeb4fdd..26b1b0877 100644 --- a/examples/ra25x/ra25x.go +++ b/examples/ra25x/ra25x.go @@ -628,8 +628,8 @@ func (ss *Sim) ConfigGUI() { ss.ViewUpdt.Config(nv, etime.Phase, etime.Phase) ss.GUI.ViewUpdt = &ss.ViewUpdt - nv.Scene().Camera.Pose.Pos.Set(0, 1, 2.75) // more "head on" than default which is more "top down" - nv.Scene().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) + nv.SceneXYZ().Camera.Pose.Pos.Set(0, 1, 2.75) // more "head on" than default which is more "top down" + nv.SceneXYZ().Camera.LookAt(mat32.Vec3{0, 0, 0}, mat32.Vec3{0, 1, 0}) ss.GUI.AddPlots(title, &ss.Logs)