| 32 | @mark.gui |
| 33 | @mark.skipif(platform != "win32", reason="CI with UI only works on win for now") |
| 34 | def test_fig(fig, showables): |
| 35 | |
| 36 | (s, s1, wp, assy, sk, ctrl_pts, v, loc, act) = showables |
| 37 | |
| 38 | # individual showables |
| 39 | fig.show(*showables) |
| 40 | |
| 41 | # fit |
| 42 | fig.fit() |
| 43 | |
| 44 | # views |
| 45 | fig.iso() |
| 46 | fig.up() |
| 47 | fig.front() |
| 48 | fig.side() |
| 49 | |
| 50 | # clear |
| 51 | fig.clear() |
| 52 | |
| 53 | # clear with an arg |
| 54 | for showable in showables: |
| 55 | fig.show(showable) |
| 56 | |
| 57 | for el in (s, wp, assy, sk, ctrl_pts): |
| 58 | fig.clear(el) |
| 59 | |
| 60 | # show multiple showables at once |
| 61 | fig.clear() |
| 62 | fig.show(*showables) |
| 63 | |
| 64 | # more than one Solid showable -> more than 2 actors |
| 65 | assert len(list(fig.actors.values())[-1]) > 2 |
| 66 | |
| 67 | # lists of showables |
| 68 | fig.show(s.Edges()).show([Vector(), Vector(0, 1)]) |
| 69 | |
| 70 | # displaying nonsense does not throw |
| 71 | fig.show("a").show(["a", 1234]) |
| 72 | |
| 73 | # pop |
| 74 | for el in showables: |
| 75 | fig.show(el, color="red") |
| 76 | fig.pop() |
| 77 | |
| 78 | # test singleton behavior of fig |
| 79 | fig2 = Figure() |
| 80 | assert fig is fig2 |
| 81 | |
| 82 | # test onSelection |
| 83 | fig.onVisibility(fig.state.actors[0]) |
| 84 | |
| 85 | # test onVisbility |
| 86 | fig.onSelection([fig.state.actors[0]]) |
| 87 | |
| 88 | |
| 89 | @mark.gui |