Skip to content

Commit

Permalink
version 1.3.14
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurdoch authored and cran-robot committed Nov 16, 2024
1 parent 7ba578c commit acd4e4d
Show file tree
Hide file tree
Showing 24 changed files with 282 additions and 149 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: rgl
Version: 1.3.12
Version: 1.3.14
Title: 3D Visualization Using OpenGL
Authors@R: c(person("Duncan", "Murdoch", role = c("aut", "cre"),
email = "murdoch.duncan@gmail.com"),
Expand Down Expand Up @@ -53,7 +53,7 @@ VignetteBuilder: knitr
Biarch: true
RoxygenNote: 7.2.3
NeedsCompilation: yes
Packaged: 2024-10-28 10:03:27 UTC; murdoch
Packaged: 2024-11-16 13:53:20 UTC; murdoch
Author: Duncan Murdoch [aut, cre],
Daniel Adler [aut],
Oleg Nenadic [ctb],
Expand All @@ -79,4 +79,4 @@ Author: Duncan Murdoch [aut, cre],
Jonathon Love [ctb]
Maintainer: Duncan Murdoch <murdoch.duncan@gmail.com>
Repository: CRAN
Date/Publication: 2024-10-28 11:40:07 UTC
Date/Publication: 2024-11-16 17:10:02 UTC
45 changes: 23 additions & 22 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
e73499cb89e0d6e97b8ba271c46739fd *COPYING
60297012814683083c9e0c6d398c58da *DESCRIPTION
853030f2297cc511e40b6722284a5639 *NAMESPACE
2b78af5ae6de498c5dcf65e05d219bfc *NEWS.md
dea6a14199d51773b8e341e6f8cfedd3 *DESCRIPTION
4d0f472918fbde70f8fbc4683caa098d *NAMESPACE
29da4b5db26cfe1d4d8a6934e244ffc3 *NEWS.md
664118a44d0cbf5e0754bf2b3fcce21b *R/Sweave.R
488aa117a50a2759259e34bb73705935 *R/addNormals.mesh3d.R
d62767b6f3a51c93f666e30e437e5556 *R/animate.R
Expand All @@ -19,7 +19,7 @@ e58c30139e520927c319f1320074bbd2 *R/bgplot3d.R
2179470e4c58ed4fb8bb3f4f20353feb *R/clipMesh3d.R
f84082194ec14e7ce9ecac1412ba38ba *R/contourLines3d.R
149f8a63713267831727369515a66e8c *R/conversions.R
506aa1a55eff7114713220b4ccab82d1 *R/convertScene.R
68668d4099a18b56e03f26f56f707cc9 *R/convertScene.R
65156022f84e81643c16a32481df32dc *R/cylinder3d.R
c4539dceb2d20a6d322e60f1d2b77bc4 *R/device.R
d55ef045a0119182af274b982c383a6f *R/drape3d.R
Expand Down Expand Up @@ -54,13 +54,13 @@ ae7ca13011a8a6ca0956f684ceaee5da *R/plot3d.R
2e0496fdbd878a17593d2ea5a927614e *R/plotmath3d.R
6c65179fb5627597f264c331297dbe74 *R/plugin.R
e4e9093d4c0e6f821c1134fcbc38278e *R/ply.R
21aa3dbcb3345281054fb83aa63459ad *R/r3d.rgl.R
d978403da95e69881a85ee7385dd716a *R/r3d.rgl.R
a82494d493925454323cd8102200995d *R/rgl.bringtotop.R
90d938b7a5e25ba1696d438518f9a2cc *R/rglMouse.R
da053234d673ee26ad3a4034b143014f *R/rglcontroller.R
510b62d3c44f615bebe035aa65fe5d99 *R/rglwidget.R
50efd82368dd3b4df9c217b8280cfda5 *R/saveURI.R
bf5f2d059b67ccf2b38ffd3c70577ce4 *R/scene.R
05d49ce59bc1b678d9576ad6ab7d5180 *R/scene.R
173f11ad48795145a85e59406d434f9e *R/selectpoints3d.R
a4a5d0ac6a2c3ee48f3d951ffb3395fc *R/setUserCallbacks.R
30a66fd063b105795234a7e38ced1156 *R/setUserShaders.R
Expand Down Expand Up @@ -101,24 +101,24 @@ c56a043aa14d19271d1943429565d957 *demo/simpleShinyRgl.R
8c5d291e3f47c3395fff092f09f599b9 *inst/WebGL/template.html
5bac46c36b13eac1302260ee06b16c0f *inst/demodata/population.dat
5544dce93555cfaced50ee41283e9e58 *inst/demodata/region.dat
6291532f8471d92e3d7b808fce8d74f0 *inst/doc/WebGL.R
7cb1d00317b98837740fe4f337de1319 *inst/doc/WebGL.R
ba423688f47be227b23d1a99f70ae19b *inst/doc/WebGL.Rmd
d0fda94a6c28e05d94a73579a3aced91 *inst/doc/WebGL.html
15c07e459a22c78950a60ea25e7a3f3e *inst/doc/WebGL.html
45bbc4edb6f6054e4147fdee9adba607 *inst/doc/demos.R
9e4e2dfd8be1d70ff5d08c1350616dc5 *inst/doc/demos.Rmd
546279b63ae1e383a3534f4c3602f10e *inst/doc/demos.html
8477e3a1f91d21478570cab23a060ccb *inst/doc/demos.html
46750e778a5cdb4d65c347f8e43df623 *inst/doc/deprecation.R
d93699606e0a70e2cfcfad8f46a49818 *inst/doc/deprecation.Rmd
88e2c55f4a0c46967eefc0d32e0d65e1 *inst/doc/deprecation.html
18511ce70cf0d7eadd49b9250dfc66f0 *inst/doc/pkgdown.R
199eced6a24f35b2e4ff3446d5e1a31f *inst/doc/deprecation.html
102273b012dbe6da84fc3dc0210942c9 *inst/doc/pkgdown.R
c68ce6499014b01fafd7123168af5804 *inst/doc/pkgdown.Rmd
1e63a55ef61998467875dc04f87d413a *inst/doc/pkgdown.html
16b66d3f0df6dec38f71d1c7327848d4 *inst/doc/rgl.R
e2503ee1ab52211d4fb075e58d0c9961 *inst/doc/pkgdown.html
9664d98e81455c748449d8e81f5b55dc *inst/doc/rgl.R
80a7cf9bed625bb15f6b8aec3871c875 *inst/doc/rgl.Rmd
60fdf64989e0c0d79b824e329a638c9a *inst/doc/rgl.html
cb1bef5f7bbc31c54a4d1b6bb808f1a7 *inst/doc/rgl.html
64c8d0281c1a359f8e8c8c5dd0a901a4 *inst/doc/transparency.R
f5ccff0ed1d816f4a67335fbf76d9016 *inst/doc/transparency.Rmd
7732ed2e6ae4f259f3948dfc8138e773 *inst/doc/transparency.html
8c250aae0259848fd54d1d238efc3551 *inst/doc/transparency.html
b4ef592c88333c7c509dd74fcd1912d9 *inst/fonts/FreeMono.ttf
867469f13ff81dec9adf2ae2f6ea2899 *inst/fonts/FreeSans.ttf
dc0004a804503e126bc99998c7a1c677 *inst/fonts/FreeSerif.ttf
Expand Down Expand Up @@ -177,7 +177,7 @@ f69d3bee8aa2d46434aa489a0efa275f *man/as.triangles3d.Rd
fba9e60f5ae7d71f3c7e2e0be3d50298 *man/asRow.Rd
91224edeba2f1c2b44988b76069571b4 *man/aspect3d.Rd
d908ac708af0e144164ee0fcd2a3b9a5 *man/attributes.Rd
0edf2d28ff47b3007b23c5d24b3182e7 *man/axes3d.Rd
7e4d40480d5aa2274b305cb5c96a8e4e *man/axes3d.Rd
6b6dca20adb6588a37e49c67beb0d180 *man/bbox.Rd
4749976d31c45c2932622c756e5fafa2 *man/bg.Rd
ae65a25a2c9d749155a122369d7f89f0 *man/bgplot3d.Rd
Expand Down Expand Up @@ -221,7 +221,7 @@ bc399992457ed1eecf0805eef7497d16 *man/observer3d.Rd
24f834df17f89ec5ac419b845d452f44 *man/pch3d.Rd
ff9a1560782401227c9de2711d227d34 *man/persp3d.Rd
bf233ab3e4da37a51dc9ae61f6c32bcc *man/persp3d.deldir.Rd
b8b8fcaebb75c173e3ff66408bb578b7 *man/persp3d.function.Rd
55d4779b35b365641c22a648eca50ee7 *man/persp3d.function.Rd
23334202fe8a8793b25b5a7ba3472a40 *man/persp3d.tri.Rd
39e0c74149e26b66ab2c534fb8aab40a *man/planes.Rd
626c767bf010fe599661a1860c124916 *man/play3d.Rd
Expand All @@ -246,6 +246,7 @@ b5e10c72208b0f5ea350e16a41125d19 *man/rgl.attrib.info.Rd
1ff53f1bd578f50f34371de05a52336e *man/rgl.bringtotop.Rd
08a731b68340e8776762f278fa1ead9d *man/rgl.fns.Rd
5dfa9e3fa93988f51ed6b48ee054f5f4 *man/rgl.getAxisCallback.Rd
0176b28b1c2fbc88e85a6f72c4e86888 *man/rgl.incrementID.Rd
092c268370800d54d950953057bfb073 *man/rgl.init.Rd
37ed09923795b7aaf6a603e0420f3d86 *man/rgl.pixels.Rd
22a6bcc888d1df4b0877f1d9e2b18c0f *man/rgl.select.Rd
Expand All @@ -264,7 +265,7 @@ b1b940fb69f79f07b79e0978a4500165 *man/scene3d.Rd
ef63bae9826deb1a816b27d241fd4e39 *man/sceneChange.Rd
7557be32789ac5a46d69ead9505d9299 *man/select3d.Rd
7286a5ae58912e503c6a0735b290a88f *man/selectpoints3d.Rd
afc49fa82aae4e39d81aca18566bc4e7 *man/setAxisCallbacks.Rd
8bb1f0712bdba16342c8f68233d3749f *man/setAxisCallbacks.Rd
d25ef62df68ae6ed8640e48318775bd9 *man/setGraphicsDelay.Rd
950cc82996f8665358ae88972a801817 *man/setUserCallbacks.Rd
55bd1b235bfb9e72ab093114d366143f *man/setUserShaders.Rd
Expand Down Expand Up @@ -352,8 +353,8 @@ a491381a9ebba6b3b96e948ae91c7690 *src/TextSet.h
5bf40c5486f74c77abe6d6cf1c3b4e05 *src/Texture.h
185da3f91499a82042e390c6c6fe0bee *src/Viewpoint.cpp
3658644b5831742b84bc8ca6f098d0ec *src/Viewpoint.h
e5146eb2448041baf006f3b1aa00b237 *src/api.cpp
52424aa40e16e5cb4a2b90da24d88d06 *src/api.h
cfdeef059a3ac805b9c5d42564c68143 *src/api.cpp
a410cf95b47be6ea4829cbe8a2c0fcb1 *src/api.h
66827aad6cbe13a612d9c49f606330ae *src/assert.cpp
1a30ef7cbbd3426ec7047805ab23c156 *src/assert.h
e8d73cefb6eef5a933e3552bcf1850fb *src/build/autoconf/config.guess
Expand Down Expand Up @@ -461,7 +462,7 @@ e2aa679f6fa6e32cfca3a7866ff0f744 *src/gl2ps.h
1d04ab6833c14ba95e190ecdd7a9ed71 *src/glgui.h
8c82bd7fe8397a6811976db16363319e *src/gui.cpp
2ca359dab037ad2aef6ee87226d34402 *src/gui.h
3acc43cf5dc3274489ff40e2e62cfa99 *src/init.cpp
179ede15d389d070a83e720ffdce8ba8 *src/init.cpp
53469e8732dbde6abd8888821b5e9d47 *src/init.h
fe7602c5e1f839e5a131e1e75e95a219 *src/lib.h
08e21b435918c9b61a599b4457b91aea *src/opengl.h
Expand All @@ -485,7 +486,7 @@ f3554de93b52174223b88ff1989dcb05 *src/rglmath.cpp
fac235696a7454133d287870ac5a1237 *src/scene.h
5a7649daaf33cbe272304dd001515acb *src/select.cpp
4f05e840d60d3d37706ef41e59e1b28e *src/select.h
e437bc9a968186f28d67871cd9dbe4e7 *src/subscene.cpp
febd9e89d7f0be0a0fe263718c89e1f6 *src/subscene.cpp
9f224a3de3fd08d5986c23d563ac0b1d *src/subscene.h
85a2bf4ffefd0d62fb061e7fc5db0a0d *src/types.h
92c672a5afea844e91842981af75c5ed *src/useNULL/Makevars
Expand Down
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export(.check3d,
rgl.primitive, rgl.projection, rgl.quads, rgl.quit, rgl.Sweave, rgl.Sweave.off,
rgl.select, rgl.select3d, rgl.set, rgl.snapshot, rgl.spheres, rgl.sprites,
rgl.surface, rgl.texts, rgl.triangles, rgl.user2window,
rgl.attrib, rgl.attrib.count, rgl.attrib.info, rgl.dev.list, rgl.useNULL,
rgl.attrib, rgl.attrib.count, rgl.attrib.info,
rgl.dev.list, rgl.incrementID, rgl.useNULL,
rgl.viewpoint, rgl.window2user, rglExtrafonts,
rglFonts, rglId, rglMouse, rglShared, rglToLattice, rglToBase,
r3dDefaults, rotate3d, rotationMatrix,
Expand Down
19 changes: 19 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# rgl 1.3.14

## Minor changes

* `rgl.incrementID()` has been added.
* An example using log axes has been added to the
help page for `axes3d()`.

## Bug fixes

* `clear3d("all")`, calling `bg3d()` on the root
subscene, and some cases of `pop3d()` involving the
background could create a leak of a background object
(issue #439). For back compatibility of saved results, these cases
still increment the object ID number, but don't
actually create a new object.
* `rglwidget()` displays didn't support objects with
`smooth = FALSE`.

# rgl 1.3.12

## Minor changes
Expand Down
61 changes: 60 additions & 1 deletion R/convertScene.R
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ convertScene <- function(x = scene3d(minimal), width = NULL, height = NULL,
}
if (!is.null(obj$material)) # Never use material$color
obj$material$color <- NULL

if (!is.null(obj$material) && !is.null(obj$material$smooth) && !obj$material$smooth)
obj <- nonSmooth(obj)
} else if (obj$type == "subscene") {
obj$par3d$viewport$x <- obj$par3d$viewport$x/fullviewport$width
obj$par3d$viewport$width <- obj$par3d$viewport$width/fullviewport$width
Expand Down Expand Up @@ -502,3 +503,61 @@ convertScene <- function(x = scene3d(minimal), width = NULL, height = NULL,

result
}

# Modify objects that have smooth = FALSE. Convert
# surfaces to triangles, add vertices so that we can
# set all triangles or quads to solid colours.

nonSmooth <- function(obj) {
oldcolors <- obj$colors
ncolors <- NROW(oldcolors)
if (ncolors > 1) {
if (obj$type == "surface") {
dim <- obj$dim
ul <- rep(2:dim[1], dim[2]-1) + dim[1]*rep(0:(dim[2]-2), each=dim[1]-1)
if (obj$flipped)
indices <- c(rbind(ul-1,
ul,
ul-1+dim[1],
ul+dim[1],
ul-1+dim[1],
ul
))
else
indices <- c(rbind(ul,
ul-1,
ul-1+dim[1],
ul-1+dim[1],
ul+dim[1],
ul))
} else
indices <- obj$indices

if (!is.null(indices)) {
obj$vertices <- obj$vertices[indices,]
oldcolors <- obj$colors[indices,]
obj$normals <- obj$normals[indices,]
if (!is.null(obj$texcoords))
obj$texcoords <- obj$texcoords[indices,]
obj$indices <- NULL
}
newcolors <- oldcolors
i <- seq_len(NROW(newcolors))
nverts <- switch(obj$type,
"triangles" = 3,
"quads" = 4,
"surface" = 6)

for (j in seq_len(nverts-1))
newcolors[i %% nverts == j] <- newcolors[i %% nverts == 0]
obj$colors <- newcolors
if (obj$type == "surface") {
obj$type <- "triangles"
obj$dim <- NULL
obj$centers <- (obj$vertices[i %% 3 == 0,] +
obj$vertices[i %% 3 == 1,] +
obj$vertices[i %% 3 == 2,])/3
}
}
obj
}
15 changes: 13 additions & 2 deletions R/r3d.rgl.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ clear3d <- function(type = c("shapes", "bboxdeco", "material"),
type <- names(typeid)

if (subscene == 0) {
idata <- as.integer(c(length(typeid), typeid))
nobg <- setdiff(typeid, 6)
idata <- as.integer(c(length(nobg), nobg))
ret <- .C( rgl_clear,
success = FALSE,
idata
)$success
if (6 %in% typeid)
rgl.incrementID() # for back compatibility

if (! ret)
stop("'rgl_clear' failed")
Expand Down Expand Up @@ -226,7 +229,8 @@ bg3d <- function(color,
else if (flags["exp_fog", 1]) "exp"
else if (flags["exp2_fog", 1]) "exp2"
else "none"
pop3d(type = "background", id = bgid)
if (currentSubscene3d() == rootSubscene())
rgl.incrementID() # for back compatibility
}
dots <- list(...)

Expand Down Expand Up @@ -276,6 +280,9 @@ bg3d <- function(color,
if (! ret$success)
stop("'rgl_bg' failed")

if (length(bgid))
pop3d(type = "background", id = bgid)

lowlevel(ret$success)
}

Expand Down Expand Up @@ -1114,3 +1121,7 @@ snapshot3d <- function(filename = tempfile(fileext = ".png"),
}
rgl.snapshot(filename, fmt, top)
}

rgl.incrementID <- function(n = 1L) {
.C(rgl_incrementID, n = as.integer(n))$n
}
5 changes: 4 additions & 1 deletion R/scene.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ rgl.clear <- function( type = "shapes", subscene = 0 ) {
type <- names(typeid)

if (subscene == 0) {
idata <- as.integer(c(length(typeid), typeid))
nobg <- setdiff(typeid, 6)
idata <- as.integer(c(length(nobg), nobg))
ret <- .C( rgl_clear,
success = FALSE,
idata
)$success
if (6 %in% typeid)
rgl.incrementID() # For back compatibility
} else {
sceneids <- ids3d(type=type, subscene = 0)$id
thisids <- ids3d(type=type, subscene = subscene)$id
Expand Down
8 changes: 4 additions & 4 deletions inst/doc/WebGL.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ rglwidget() %>%
toggleWidget(ids = plotids["data"], label = "Data")

## ----eval=FALSE---------------------------------------------------------------
# rglwidget() |>
# toggleWidget(ids = plotids["data"], label = "Data")
# rglwidget() |>
# toggleWidget(ids = plotids["data"], label = "Data")

## ----"Control before widget"--------------------------------------------------
toggleWidget(NA, ids = plotids["data"], label = "Data") %>%
rglwidget(controllers = .)

## ----eval=FALSE---------------------------------------------------------------
# toggleWidget(NA, ids = plotids["data"], label = "Data") |>
# w => rglwidget(controllers = w)
# toggleWidget(NA, ids = plotids["data"], label = "Data") |>
# w => rglwidget(controllers = w)

## ----"Toggle subsets"---------------------------------------------------------
clear3d() # Remove the earlier display
Expand Down
34 changes: 17 additions & 17 deletions inst/doc/WebGL.html

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions inst/doc/demos.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/doc/deprecation.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<div class="frontmatter">
<div class="title"><h1>Deprecating the <code>rgl.*</code> interface</h1></div>
<div class="author"><h2>Duncan Murdoch</h2></div>
<div class="date"><h3>2024-10-28</h3></div>
<div class="date"><h3>2024-11-16</h3></div>
</div>
<div class="body">
<div id="TOC">
Expand Down
2 changes: 1 addition & 1 deletion inst/doc/pkgdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ options(rgl.useNULL = TRUE)
setupKnitr(autoprint = TRUE)

## ----eval=FALSE---------------------------------------------------------------
# setupKnitr(autoprint = TRUE)
# setupKnitr(autoprint = TRUE)

## -----------------------------------------------------------------------------
# Show regression plane with z as dependent variable
Expand Down
6 changes: 3 additions & 3 deletions inst/doc/pkgdown.html

Large diffs are not rendered by default.

Loading

0 comments on commit acd4e4d

Please sign in to comment.