Skip to content

Commit c3745fd

Browse files
committed
Use view instead of plot
1 parent 5e6c41e commit c3745fd

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Generated by roxygen2: do not edit by hand
22

33
export(plot_xyzrgb)
4-
exportMethods(plot)
4+
export(view)
55
importClassesFrom(lidR,LAS)
66
importFrom(Rcpp,evalCpp)
77
useDynLib(lidRviewer, .registration = TRUE)

R/plot.R

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,18 @@
1313
#' - Keyboard <kbd>l</kbd> to enable/disable eyes-dome lightning
1414
#'
1515
#' @param x a point cloud with minimally 3 columns named X,Y,Z
16-
#' @param y Unused (inherited from R base)
1716
#' @param ... Support detach = TRUE
1817
#' @export
19-
#' @method plot LAS
2018
#' @importClassesFrom lidR LAS
2119
#' @useDynLib lidRviewer, .registration = TRUE
2220
#' @importFrom Rcpp evalCpp
2321
#' @md
24-
setMethod("plot", signature(x = "LAS", y = "missing"), function(x, y, ...)
22+
view = function(x, ...)
2523
{
2624
p = list(...)
2725
detach = isTRUE(p$detach)
2826
viewer(x@data, detach, "")
29-
})
27+
}
3028

3129
render = function(f)
3230
{

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ While `rgl` is a powerful package, it has some limitations when it comes to hand
1111
### Advantages of `lidRviewer`:
1212

1313
* Capable of handling hundred millions of points efficiently if they fits in memory, unlike `rgl`, which may struggle with a few million.
14-
* More memory efficient: it requires only a small amount of additional memory, whereas `rgl` may need gigabytes to store a full copy of the point cloud.
14+
* More memory efficient: it requires less additional memory than `rgl` that may require gigabytes to store a full copy of the point cloud.
1515
* Provides keyboard controls for changing coloring attributes and point size on-the-fly.
1616
* Features eyes-dome lighting for better visualization.
1717

@@ -28,14 +28,13 @@ devtools::install_github("lidRviewer", repos = 'https://r-lidar.r-universe.dev')
2828

2929
## Usage
3030

31-
Use `library(lidRviewer)` after `library(lidR)`to overide the default `rgl` plot function from `lidR`.
32-
3331
```r
3432
library(lidR)
3533
library(lidRviewer)
3634
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
3735
las <- readLAS(LASfile)
38-
plot(las)
36+
view(las)
37+
# Close the view to continue working in your R session
3938
```
4039

4140
- Rotate with left mouse button
Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lidRviewer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,12 @@ void sdl_loop(DataFrame df, std::string hnof)
187187
break;
188188
case SDLK_PLUS:
189189
case SDLK_KP_PLUS:
190+
case SDLK_p:
190191
drawer->point_size_plus();
191192
break;
192193
case SDLK_MINUS:
193194
case SDLK_KP_MINUS:
195+
case SDLK_m:
194196
drawer->point_size_minus();
195197
break;
196198
break;

0 commit comments

Comments
 (0)