File: test-user2window.R

package info (click to toggle)
rgl 1.3.34-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,968 kB
  • sloc: cpp: 23,234; ansic: 7,462; javascript: 6,125; sh: 3,555; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 770 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library(rgl)

test_that("rgl.user2window and rgl.window2user work", {
	xyz <- rbind(x = c(2, 4, 6))
	abc <- rbind(x = c(0.1, 0.2, 0.3))
	open3d()
	mfrow3d(2, 2)
	points3d(1:10, 1:10, 1:10)
	expect_equal(rgl.window2user(rgl.user2window(xyz)), xyz)
	expect_equal(rgl.user2window(rgl.window2user(abc)), abc)
	next3d()
	points3d(1:10, 1:10, 1:10)
	expect_equal(rgl.window2user(rgl.user2window(xyz)), xyz)
	expect_equal(rgl.user2window(rgl.window2user(abc)), abc)
	next3d()
	points3d(1:10, 1:10, 1:10)
	expect_equal(rgl.window2user(rgl.user2window(xyz)), xyz)
	expect_equal(rgl.user2window(rgl.window2user(abc)), abc)
	next3d()
	points3d(1:10, 1:10, 1:10)
	expect_equal(rgl.window2user(rgl.user2window(xyz)), xyz)
	expect_equal(rgl.user2window(rgl.window2user(abc)), abc)
})