Skip to content

Commit 1879315

Browse files
committed
Doc and fixes
1 parent e9f3757 commit 1879315

File tree

6 files changed

+76
-41
lines changed

6 files changed

+76
-41
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

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

R/plot.R

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,42 @@
11
#' Display big 3D point clouds
22
#'
3-
#' Display aritrary large in memory 3D point clouds. This function does no lag and can display
4-
#' almost instantly millions of points. It is optimized to used the lowest possible memory
5-
#' and is capable of displaying gigabytes of points allocating only few megabyte of memory
3+
#' Display arbitrary large in memory 3D point clouds from the lidR package. Keyboard can be use
4+
#' to control the rendering
5+
#' - Rotate with left mouse button
6+
#' - Zoom with mouse wheel
7+
#' - Pan with right mouse button
8+
#' - Keyboard <kbd>r</kbd> or <kbd>g</kbd> or <kbd>b</kbd> to color with RGB
9+
#' - Keyboard <kbd>z</kbd> to color with Z
10+
#' - Keyboard <kbd>i</kbd> to color with Intensity
11+
#' - Keyboard <kbd>c</kbd> to color with Classification
12+
#' - Keyboard <kbd>+</kbd> or <kbd>-</kbd> to change the point size
13+
#' - Keyboard <kbd>l</kbd> to enable/disable eyes-dome lightning
614
#'
7-
#' @param x A \code{LAS*} object from the lidR package
15+
#' @param x a point cloud with minimally 3 columns named X,Y,Z
816
#' @param y Unused (inherited from R base)
917
#' @export
1018
#' @method plot LAS
1119
#' @importClassesFrom lidR LAS
1220
#' @useDynLib lidRviewer, .registration = TRUE
1321
#' @importFrom Rcpp evalCpp
14-
setGeneric("plot", function(x, y, ...) standardGeneric("plot"))
15-
16-
#' @rdname plot
22+
#' @md
1723
setMethod("plot", signature(x = "LAS", y = "missing"), function(x, y, ...)
1824
{
19-
plot.LAS(x, y, ...)
25+
viewer(x@data)
2026
})
2127

22-
plot.LAS <- function(x, y, ...)
28+
#' @rdname plot
29+
setMethod("plot", signature(x = "data.frame", y = "missing"), function(x, y, ...)
2330
{
24-
viewer(x@data)
25-
}
31+
viewer(x)
32+
})
2633

27-
#' @aliases plot
28-
#' @rdname plot
34+
#' Deprecated backward compatible function
35+
#'
36+
#' @param x,y,z numeric vector
37+
#' @param r,g,b integer vector
38+
#' @param id index
39+
#' @param size not used
2940
#' @export
3041
plot_xyzrgb <- function(x, y, z, r, g, b, id = NULL, size = 4)
3142
{

man/plot-LAS-missing-method.Rd

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot.Rd

Lines changed: 0 additions & 24 deletions
This file was deleted.

man/plot_xyzrgb.Rd

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/drawer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Drawer::Drawer(SDL_Window *window, DataFrame df)
138138

139139
auto end = std::chrono::high_resolution_clock::now();
140140
std::chrono::duration<double> duration = end - start;
141-
printf("Indexation: %.1lf seconds (%.1lfM pts/s)\n", duration.count(), x.size()/duration.count()/1000000);
141+
//printf("Indexation: %.1lf seconds (%.1lfM pts/s)\n", duration.count(), x.size()/duration.count()/1000000);
142142

143143
this->point_budget *= 10;
144144
camera.changed = true;
@@ -340,11 +340,11 @@ bool Drawer::draw()
340340
std::chrono::duration<double> query_duration = end_query - start_query;
341341
std::chrono::duration<double> rendering_duration = end_rendering - start_rendering;
342342

343-
printf("Displayed %dk/%ldk points (%.1f\%)\n", (int)pp.size()/1000, x.size()/1000, (double)pp.size()/(double)x.size()*100);
343+
/*printf("Displayed %dk/%ldk points (%.1f\%)\n", (int)pp.size()/1000, x.size()/1000, (double)pp.size()/(double)x.size()*100);
344344
printf("Full Rendering: %.3f seconds (%.1f fps)\n", total_duration.count(), 1.0f/total_duration.count());
345345
printf("Cloud rendering: %.3f seconds (%.1f fps, %.1f\%)\n", rendering_duration.count(), 1.0f/rendering_duration.count(), rendering_duration.count()/total_duration.count()*100);
346346
printf("Spatial query: %.3f seconds (%.1f fps %.1f\%)\n", query_duration.count(), 1.0f/query_duration.count(), query_duration.count()/total_duration.count()*100);
347-
printf("\n");
347+
printf("\n");*/
348348

349349
glFlush();
350350
SDL_GL_SwapWindow(window);

0 commit comments

Comments
 (0)