From 1cf6f2781f9849f1e8caab10c381c9a3fed77483 Mon Sep 17 00:00:00 2001 From: zarquon42b Date: Thu, 18 Sep 2014 10:20:12 +0200 Subject: [PATCH] added option silent for vcgImport, vcgIsolated, vcgQEdecim and vcgUpdateNormals. --- R/vcgImport.r | 5 +- R/vcgIsolated.r | 5 +- R/vcgQEdecim.r | 5 +- R/vcgUpdateNormals.r | 5 +- config.log | 281 ++++++++++++ config.status | 978 ++++++++++++++++++++++++++++++++++++++++ man/vcgImport.Rd | 5 +- man/vcgIsolated.Rd | 4 +- man/vcgQEdecim.Rd | 4 +- man/vcgUpdateNormals.Rd | 4 +- src/Makevars | 5 + src/RQEdecim.cpp | 180 ++++---- src/RallRead.cpp | 5 +- src/Rclost.cpp | 4 +- src/Rintersect.cpp | 7 +- src/Risolated.cpp | 15 +- src/Rmarch.cpp | 1 - src/RupdateNormals.cpp | 8 +- 18 files changed, 1397 insertions(+), 124 deletions(-) create mode 100644 config.log create mode 100755 config.status create mode 100644 src/Makevars diff --git a/R/vcgImport.r b/R/vcgImport.r index 4970ae8a..4c1e784f 100644 --- a/R/vcgImport.r +++ b/R/vcgImport.r @@ -9,6 +9,7 @@ #' vertex normals will be (re)calculated. Otherwise, normals will be a matrix containing zeros. #' @param readcolor if TRUE, vertex colors and texture (face and vertex) coordinates will be processed - if available, otherwise all vertices will be colored white. #' @param clean if TRUE, duplicated and unreferenced vertices as well as duplicate faces are removed (be careful when importing point clouds). +#' @param silent logical, if TRUE no console output is issued. #' @note currently only meshes with either color or texture can be processed. If both are present, the function will mark the mesh as non-readable. #' @return Object of class "mesh3d" #' @@ -25,7 +26,7 @@ #' @keywords ~kwd1 ~kwd2 #' @export -vcgImport <- function(file, updateNormals = TRUE, readcolor=FALSE, clean = TRUE) { +vcgImport <- function(file, updateNormals = TRUE, readcolor=FALSE, clean = TRUE,silent=FALSE) { ncfile <- nchar(file) ext <- substr(file,ncfile-2,ncfile) @@ -46,7 +47,7 @@ vcgImport <- function(file, updateNormals = TRUE, readcolor=FALSE, clean = TRUE) clean <- as.logical(clean) - tmp <- .Call("RallRead", file, updateNormals, readcolor, clean) + tmp <- .Call("RallRead", file, updateNormals, readcolor, clean, silent) if (!is.list(tmp)) stop("mesh is not readable") ## go back to current wd diff --git a/R/vcgIsolated.r b/R/vcgIsolated.r index 2b07a31f..73608956 100644 --- a/R/vcgIsolated.r +++ b/R/vcgIsolated.r @@ -11,6 +11,7 @@ #' with the most faces is kept. #' @param diameter numeric: all connected pieces smaller diameter are removed #' removed. \code{diameter = 0} removes all component but the largest ones. This option overrides the option \code{facenum}. +#' @param silent logical, if TRUE no console output is issued. #' @return returns the reduced mesh. #' @author Stefan Schlager #' @seealso \code{\link{vcgPlyRead}} @@ -23,7 +24,7 @@ #' #' #' @export vcgIsolated -vcgIsolated <- function(mesh,facenum=NULL,diameter=NULL) { +vcgIsolated <- function(mesh,facenum=NULL,diameter=NULL,silent=FALSE) { if (!inherits(mesh,"mesh3d")) stop("argument 'mesh' needs to be object of class 'mesh3d'") if (is.null(facenum)) @@ -41,7 +42,7 @@ vcgIsolated <- function(mesh,facenum=NULL,diameter=NULL) { it <- mesh$it-1 dimit <- dim(it)[2] dimvb <- dim(vb)[2] - tmp <- .Call("Risolated", vb, it, diameter, facenum) + tmp <- .Call("Risolated", vb, it, diameter, facenum,silent) class(tmp) <- "mesh3d" tmp$vb <- rbind(tmp$vb,1) tmp$it <- tmp$it diff --git a/R/vcgQEdecim.r b/R/vcgQEdecim.r index d9abc65f..deb0bdca 100644 --- a/R/vcgQEdecim.r +++ b/R/vcgQEdecim.r @@ -23,6 +23,7 @@ #' @param qthresh numeric: Quality threshold for decimation process. #' @param boundweight numeric: Weight assigned to mesh boundaries. #' @param normalthr numeric: threshold for normal check in radians. +#' @param silent logical, if TRUE no console output is issued. #' @return Returns a reduced mesh of class mesh3d. #' @author Stefan Schlager #' @seealso \code{\link{vcgSmooth}} @@ -42,7 +43,7 @@ #' decimface <- vcgSmooth(decimface,iteration = 1) #' } #' @export vcgQEdecim -vcgQEdecim <- function(mesh,tarface=NULL,percent=NULL,edgeLength=NULL, topo=FALSE,quality=TRUE,bound=FALSE, optiplace = TRUE, scaleindi = TRUE, normcheck = FALSE, safeheap =FALSE, qthresh=0.3, boundweight = 1, normalthr = pi/2) +vcgQEdecim <- function(mesh,tarface=NULL,percent=NULL,edgeLength=NULL, topo=FALSE,quality=TRUE,bound=FALSE, optiplace = TRUE, scaleindi = TRUE, normcheck = FALSE, safeheap =FALSE, qthresh=0.3, boundweight = 1, normalthr = pi/2,silent=FALSE) { if (!inherits(mesh,"mesh3d")) stop("argument 'mesh' needs to be object of class 'mesh3d'") @@ -77,7 +78,7 @@ vcgQEdecim <- function(mesh,tarface=NULL,percent=NULL,edgeLength=NULL, topo=FALS doubleparams <- c(qthresh, boundweight, normalthr) storage.mode(doubleparams) <- "double" ###tmp <- .C("RQEdecim",vb,ncol(vb),it,ncol(it),tarface,vb,as.integer(topo),as.integer(quality),as.integer(bound)) - tmp <- .Call("RQEdecim", vb, it, tarface, boolparams, doubleparams) + tmp <- .Call("RQEdecim", vb, it, tarface, boolparams, doubleparams,silent) outmesh$vb <- rbind(tmp$vb,1) outmesh$it <- tmp$it diff --git a/R/vcgUpdateNormals.r b/R/vcgUpdateNormals.r index ca3a4bcf..8c75bdde 100644 --- a/R/vcgUpdateNormals.r +++ b/R/vcgUpdateNormals.r @@ -4,6 +4,7 @@ #' @param mesh triangular mesh of class 'mesh3d' or a n x 3 matrix containing 3D-coordinates. #' @param type select the method to compute per-vertex normals: 0=area weighted average of surrounding face normals; 1 = angle weighted vertex normals. #' @param pointcloud integer vector of length 2: containing optional parameters for normal calculation of point clouds. The first enty specifies the number of neighbouring points to consider. The second entry specifies the amount of smoothing iterations to be performed. +#' @param silent logical, if TRUE no console output is issued. #' #' @return mesh with updated/created normals, or in case \code{mesh} is a matrix, a list of class "mesh3d" with #' \item{vb }{4 x n matrix containing coordinates (as homologous coordinates} @@ -21,7 +22,7 @@ #' } #' @export -vcgUpdateNormals <- function(mesh,type = 0, pointcloud=c(10,0)) +vcgUpdateNormals <- function(mesh,type = 0, pointcloud=c(10,0), silent=FALSE) { if (is.matrix(mesh)) { tmp <- list() @@ -38,7 +39,7 @@ vcgUpdateNormals <- function(mesh,type = 0, pointcloud=c(10,0)) pointcloud <- c(10,0) if (! type %in% c(0,1)) stop("please set valid type") - normals <- .Call("RupdateNormals", vb, it, type, pointcloud) + normals <- .Call("RupdateNormals", vb, it, type, pointcloud, silent) mesh$normals <- rbind(normals,1) return(mesh) diff --git a/config.log b/config.log new file mode 100644 index 00000000..09ece904 --- /dev/null +++ b/config.log @@ -0,0 +1,281 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by RVCG configure 0.6, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ ./configure + +## --------- ## +## Platform. ## +## --------- ## + +hostname = anthro-TERRA-WS +uname -m = x86_64 +uname -r = 3.13.0-35-generic +uname -s = Linux +uname -v = #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = unknown +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +/usr/bin/hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: /home/schlager/bin +PATH: /usr/local/sbin +PATH: /usr/local/bin +PATH: /usr/sbin +PATH: /usr/bin +PATH: /sbin +PATH: /bin +PATH: /usr/games +PATH: /usr/local/games + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:1901: checking for C++ compiler version +configure:1910: g++ --version >&5 +g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 +Copyright (C) 2013 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +configure:1921: $? = 0 +configure:1910: g++ -v >&5 +Using built-in specs. +COLLECT_GCC=g++ +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.2-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) +configure:1921: $? = 0 +configure:1910: g++ -V >&5 +g++: error: unrecognized command line option '-V' +g++: fatal error: no input files +compilation terminated. +configure:1921: $? = 4 +configure:1910: g++ -qversion >&5 +g++: error: unrecognized command line option '-qversion' +g++: fatal error: no input files +compilation terminated. +configure:1921: $? = 4 +configure:1941: checking whether the C++ compiler works +configure:1963: g++ -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -pedantic -Wl,-Bsymbolic-functions -Wl,-z,relro conftest.cpp >&5 +configure:1967: $? = 0 +configure:2015: result: yes +configure:2018: checking for C++ compiler default output file name +configure:2020: result: a.out +configure:2026: checking for suffix of executables +configure:2033: g++ -o conftest -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -pedantic -Wl,-Bsymbolic-functions -Wl,-z,relro conftest.cpp >&5 +configure:2037: $? = 0 +configure:2059: result: +configure:2081: checking whether we are cross compiling +configure:2089: g++ -o conftest -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -pedantic -Wl,-Bsymbolic-functions -Wl,-z,relro conftest.cpp >&5 +configure:2093: $? = 0 +configure:2100: ./conftest +configure:2104: $? = 0 +configure:2119: result: no +configure:2124: checking for suffix of object files +configure:2146: g++ -c -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -pedantic conftest.cpp >&5 +configure:2150: $? = 0 +configure:2171: result: o +configure:2175: checking whether we are using the GNU C++ compiler +configure:2194: g++ -c -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -pedantic conftest.cpp >&5 +configure:2194: $? = 0 +configure:2203: result: yes +configure:2212: checking whether g++ accepts -g +configure:2232: g++ -c -g -pedantic conftest.cpp >&5 +configure:2232: $? = 0 +configure:2273: result: yes +configure:2304: checking whether g++ supports C++11 features by default +configure:2330: g++ -c -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -pedantic conftest.cpp >&5 +conftest.cpp:13:21: error: expected identifier before 'sizeof' + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + ^ +conftest.cpp:13:21: error: expected ',' or '...' before 'sizeof' +conftest.cpp:13:63: error: ISO C++ forbids declaration of 'static_assert' with no type [-fpermissive] + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + ^ +conftest.cpp:16:29: error: '>>' should be '> >' within a nested template argument list + typedef check> right_angle_brackets; + ^ +conftest.cpp:19:13: error: expected constructor, destructor, or type conversion before '(' token + decltype(a) b; + ^ +conftest.cpp:23:15: error: expected unqualified-id before '&&' token + check_type&& cr = static_cast(c); + ^ +conftest.cpp:25:10: error: 'd' does not name a type + auto d = a; + ^ +configure:2330: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "RVCG" +| #define PACKAGE_TARNAME "rvcg" +| #define PACKAGE_VERSION "0.6" +| #define PACKAGE_STRING "RVCG 0.6" +| #define PACKAGE_BUGREPORT "" +| #define PACKAGE_URL "" +| /* end confdefs.h. */ +| +| template +| struct check +| { +| static_assert(sizeof(int) <= sizeof(T), "not big enough"); +| }; +| +| typedef check> right_angle_brackets; +| +| int a; +| decltype(a) b; +| +| typedef check check_type; +| check_type c; +| check_type&& cr = static_cast(c); +| +| auto d = a; +| +configure:2337: result: no +configure:2348: checking whether g++ supports C++11 features with -std=c++11 +configure:2376: g++ -c -std=c++11 -pedantic conftest.cpp >&5 +configure:2376: $? = 0 +configure:2385: result: yes +configure:2423: checking for ISO C++ TR1 include files +configure:2449: g++ -c -std=c++11 -pedantic conftest.cpp >&5 +configure:2449: $? = 0 +configure:2463: result: yes +configure:2475: checking for inttypes.h +configure:2500: g++ -c -std=c++11 -pedantic conftest.cpp >&5 +configure:2500: $? = 0 +configure:2514: result: yes +configure:2642: creating ./config.status + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by RVCG config.status 0.6, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on anthro-TERRA-WS + +config.status:788: creating src/Makevars +config.status:788: creating src/config.h +config.status:958: src/config.h is unchanged + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_cxx_compiler_gnu=yes +ac_cv_cxx_stdcxx_inttypes=yes +ac_cv_cxx_stdcxx_tr1=yes +ac_cv_env_CCC_set= +ac_cv_env_CCC_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CXXFLAGS_set= +ac_cv_env_CXXFLAGS_value= +ac_cv_env_CXX_set= +ac_cv_env_CXX_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_LIBS_set= +ac_cv_env_LIBS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_objext=o +ac_cv_prog_cxx_g=yes +ax_cv_cxx_compile_cxx11=no +ax_cv_cxx_compile_cxx11__std_cpp11=yes + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +CPPFLAGS='-pedantic' +CXX='g++' +CXXFLAGS='-std=c++11' +DEFS='-DHAVE_CONFIG_H' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EXEEXT='' +HAVE_CXX11='1' +LDFLAGS='-Wl,-Bsymbolic-functions -Wl,-z,relro' +LIBOBJS='' +LIBS='' +LTLIBOBJS='' +OBJEXT='o' +PACKAGE_BUGREPORT='' +PACKAGE_NAME='RVCG' +PACKAGE_STRING='RVCG 0.6' +PACKAGE_TARNAME='rvcg' +PACKAGE_URL='' +PACKAGE_VERSION='0.6' +PATH_SEPARATOR=':' +SHELL='/bin/bash' +ac_ct_CXX='' +bindir='${exec_prefix}/bin' +build_alias='' +datadir='${datarootdir}' +datarootdir='${prefix}/share' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +dvidir='${docdir}' +exec_prefix='${prefix}' +host_alias='' +htmldir='${docdir}' +includedir='${prefix}/include' +infodir='${datarootdir}/info' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localedir='${datarootdir}/locale' +localstatedir='${prefix}/var' +mandir='${datarootdir}/man' +oldincludedir='/usr/include' +pdfdir='${docdir}' +prefix='/usr/local' +program_transform_name='s,x,x,' +psdir='${docdir}' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target_alias='' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +/* confdefs.h */ +#define PACKAGE_NAME "RVCG" +#define PACKAGE_TARNAME "rvcg" +#define PACKAGE_VERSION "0.6" +#define PACKAGE_STRING "RVCG 0.6" +#define PACKAGE_BUGREPORT "" +#define PACKAGE_URL "" +#define HAVE_CXX11 1 +#define HAVE_TR1 /**/ +#define HAVE_INTTYPES /**/ + +configure: exit 0 diff --git a/config.status b/config.status new file mode 100755 index 00000000..1ae84bbe --- /dev/null +++ b/config.status @@ -0,0 +1,978 @@ +#! /bin/bash +# Generated by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=${CONFIG_SHELL-/bin/bash} +export SHELL +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by RVCG $as_me 0.6, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +# Files that config.status was made for. +config_files=" src/Makevars" +config_headers=" src/config.h" + +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to the package provider." + +ac_cs_config="" +ac_cs_version="\ +RVCG config.status 0.6 +configured by ./configure, generated by GNU Autoconf 2.69, + with options \"$ac_cs_config\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='/home/schlager/GIT/Rvcg' +srcdir='.' +test -n "$AWK" || AWK=awk +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +if $ac_cs_recheck; then + set X /bin/bash './configure' $ac_configure_extra_args --no-create --no-recursion + shift + $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 + CONFIG_SHELL='/bin/bash' + export CONFIG_SHELL + exec "$@" +fi + +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; + "src/Makevars") CONFIG_FILES="$CONFIG_FILES src/Makevars" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +cat >>"$ac_tmp/subs1.awk" <<\_ACAWK && +S["LTLIBOBJS"]="" +S["LIBOBJS"]="" +S["HAVE_CXX11"]="1" +S["OBJEXT"]="o" +S["EXEEXT"]="" +S["ac_ct_CXX"]="" +S["CPPFLAGS"]="-pedantic" +S["LDFLAGS"]="-Wl,-Bsymbolic-functions -Wl,-z,relro" +S["CXXFLAGS"]="-std=c++11" +S["CXX"]="g++" +S["target_alias"]="" +S["host_alias"]="" +S["build_alias"]="" +S["LIBS"]="" +S["ECHO_T"]="" +S["ECHO_N"]="-n" +S["ECHO_C"]="" +S["DEFS"]="-DHAVE_CONFIG_H" +S["mandir"]="${datarootdir}/man" +S["localedir"]="${datarootdir}/locale" +S["libdir"]="${exec_prefix}/lib" +S["psdir"]="${docdir}" +S["pdfdir"]="${docdir}" +S["dvidir"]="${docdir}" +S["htmldir"]="${docdir}" +S["infodir"]="${datarootdir}/info" +S["docdir"]="${datarootdir}/doc/${PACKAGE_TARNAME}" +S["oldincludedir"]="/usr/include" +S["includedir"]="${prefix}/include" +S["localstatedir"]="${prefix}/var" +S["sharedstatedir"]="${prefix}/com" +S["sysconfdir"]="${prefix}/etc" +S["datadir"]="${datarootdir}" +S["datarootdir"]="${prefix}/share" +S["libexecdir"]="${exec_prefix}/libexec" +S["sbindir"]="${exec_prefix}/sbin" +S["bindir"]="${exec_prefix}/bin" +S["program_transform_name"]="s,x,x," +S["prefix"]="/usr/local" +S["exec_prefix"]="${prefix}" +S["PACKAGE_URL"]="" +S["PACKAGE_BUGREPORT"]="" +S["PACKAGE_STRING"]="RVCG 0.6" +S["PACKAGE_VERSION"]="0.6" +S["PACKAGE_TARNAME"]="rvcg" +S["PACKAGE_NAME"]="RVCG" +S["PATH_SEPARATOR"]=":" +S["SHELL"]="/bin/bash" +_ACAWK +cat >>"$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +D["PACKAGE_NAME"]=" \"RVCG\"" +D["PACKAGE_TARNAME"]=" \"rvcg\"" +D["PACKAGE_VERSION"]=" \"0.6\"" +D["PACKAGE_STRING"]=" \"RVCG 0.6\"" +D["PACKAGE_BUGREPORT"]=" \"\"" +D["PACKAGE_URL"]=" \"\"" +D["HAVE_CXX11"]=" 1" +D["HAVE_TR1"]=" /**/" +D["HAVE_INTTYPES"]=" /**/" + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t (]|$)/ { + line = $ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + ac_datarootdir_hack=' + s&@datadir@&${datarootdir}&g + s&@docdir@&${datarootdir}/doc/${PACKAGE_TARNAME}&g + s&@infodir@&${datarootdir}/info&g + s&@localedir@&${datarootdir}/locale&g + s&@mandir@&${datarootdir}/man&g + s&\${datarootdir}&${prefix}/share&g' ;; +esac +ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +} + +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi + ;; + + + esac + +done # for ac_tag + + +as_fn_exit 0 diff --git a/man/vcgImport.Rd b/man/vcgImport.Rd index 86835042..dd0bf019 100644 --- a/man/vcgImport.Rd +++ b/man/vcgImport.Rd @@ -3,7 +3,8 @@ \alias{vcgImport} \title{Import common mesh file formats.} \usage{ -vcgImport(file, updateNormals = TRUE, readcolor = FALSE, clean = TRUE) +vcgImport(file, updateNormals = TRUE, readcolor = FALSE, clean = TRUE, + silent = FALSE) } \arguments{ \item{file}{character: file to be read.} @@ -14,6 +15,8 @@ vertex normals will be (re)calculated. Otherwise, normals will be a matrix conta \item{readcolor}{if TRUE, vertex colors and texture (face and vertex) coordinates will be processed - if available, otherwise all vertices will be colored white.} \item{clean}{if TRUE, duplicated and unreferenced vertices as well as duplicate faces are removed (be careful when importing point clouds).} + +\item{silent}{logical, if TRUE no console output is issued.} } \value{ Object of class "mesh3d" diff --git a/man/vcgIsolated.Rd b/man/vcgIsolated.Rd index 36d3fe8b..3f32f34e 100644 --- a/man/vcgIsolated.Rd +++ b/man/vcgIsolated.Rd @@ -3,7 +3,7 @@ \alias{vcgIsolated} \title{Remove isolated pieces from a surface mesh.} \usage{ -vcgIsolated(mesh, facenum = NULL, diameter = NULL) +vcgIsolated(mesh, facenum = NULL, diameter = NULL, silent = FALSE) } \arguments{ \item{mesh}{triangular mesh of class "mesh3d".} @@ -14,6 +14,8 @@ with the most faces is kept.} \item{diameter}{numeric: all connected pieces smaller diameter are removed removed. \code{diameter = 0} removes all component but the largest ones. This option overrides the option \code{facenum}.} + +\item{silent}{logical, if TRUE no console output is issued.} } \value{ returns the reduced mesh. diff --git a/man/vcgQEdecim.Rd b/man/vcgQEdecim.Rd index 57d54865..05f89113 100644 --- a/man/vcgQEdecim.Rd +++ b/man/vcgQEdecim.Rd @@ -6,7 +6,7 @@ vcgQEdecim(mesh, tarface = NULL, percent = NULL, edgeLength = NULL, topo = FALSE, quality = TRUE, bound = FALSE, optiplace = TRUE, scaleindi = TRUE, normcheck = FALSE, safeheap = FALSE, qthresh = 0.3, - boundweight = 1, normalthr = pi/2) + boundweight = 1, normalthr = pi/2, silent = FALSE) } \arguments{ \item{mesh}{Triangular mesh of class "mesh3d"} @@ -39,6 +39,8 @@ long by dividing the triangle into 4 regular smaller triangles.} \item{boundweight}{numeric: Weight assigned to mesh boundaries.} \item{normalthr}{numeric: threshold for normal check in radians.} + +\item{silent}{logical, if TRUE no console output is issued.} } \value{ Returns a reduced mesh of class mesh3d. diff --git a/man/vcgUpdateNormals.Rd b/man/vcgUpdateNormals.Rd index 4e94083d..9a14a8b8 100644 --- a/man/vcgUpdateNormals.Rd +++ b/man/vcgUpdateNormals.Rd @@ -3,7 +3,7 @@ \alias{vcgUpdateNormals} \title{updates vertex normals of a triangular meshes or point clouds} \usage{ -vcgUpdateNormals(mesh, type = 0, pointcloud = c(10, 0)) +vcgUpdateNormals(mesh, type = 0, pointcloud = c(10, 0), silent = FALSE) } \arguments{ \item{mesh}{triangular mesh of class 'mesh3d' or a n x 3 matrix containing 3D-coordinates.} @@ -11,6 +11,8 @@ vcgUpdateNormals(mesh, type = 0, pointcloud = c(10, 0)) \item{type}{select the method to compute per-vertex normals: 0=area weighted average of surrounding face normals; 1 = angle weighted vertex normals.} \item{pointcloud}{integer vector of length 2: containing optional parameters for normal calculation of point clouds. The first enty specifies the number of neighbouring points to consider. The second entry specifies the amount of smoothing iterations to be performed.} + +\item{silent}{logical, if TRUE no console output is issued.} } \value{ mesh with updated/created normals, or in case \code{mesh} is a matrix, a list of class "mesh3d" with diff --git a/src/Makevars b/src/Makevars new file mode 100644 index 00000000..1d85ab5e --- /dev/null +++ b/src/Makevars @@ -0,0 +1,5 @@ +OBJECTS=vcglib/wrap/ply/plylib.o RallRead.o Rborder.o Rclean.o Rclost.o Rcurvature.o RgetEdge.o Rintersect.o Risolated.o Rkdtree.o Rmarch.o Rmeshres.o RPly.o RQEdecim.o Rsample.o Rsmooth.o RupdateNormals.o RVFadj.o + +PKG_CPPFLAGS=-Ivcglib -I. +PKG_LIBS=`$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` +PKG_CXXFLAGS=-std=c++11 diff --git a/src/RQEdecim.cpp b/src/RQEdecim.cpp index 0fc9b00d..3c59f3c3 100644 --- a/src/RQEdecim.cpp +++ b/src/RQEdecim.cpp @@ -48,10 +48,10 @@ class CVertex : public Vertex< CUsedTypes, vertex::Mark, vertex::BitFlags > { - public: - vcg::math::Quadric &Qd() {return q;} - private: - math::Quadric q; +public: + vcg::math::Quadric &Qd() {return q;} +private: + math::Quadric q; }; class CEdge : public Edge< CUsedTypes> {}; @@ -72,7 +72,7 @@ class CTriEdgeCollapse: public vcg::tri::TriEdgeCollapseQuadric< CMeshDec, VertexPair, CTriEdgeCollapse, QInfoStandard > { - public: +public: typedef vcg::tri::TriEdgeCollapseQuadric< CMeshDec, VertexPair, CTriEdgeCollapse, @@ -90,103 +90,107 @@ typedef CMeshDec::VertexPointer VertexPointer; -RcppExport SEXP RQEdecim(SEXP vb_ , SEXP it_, SEXP Finsize_, SEXP boolparams_, SEXP doubleparams_) +RcppExport SEXP RQEdecim(SEXP vb_ , SEXP it_, SEXP Finsize_, SEXP boolparams_, SEXP doubleparams_,SEXP silent_) { - // declare Mesh and helper variables - int i; - CMeshDec m; - VertexIterator vi; - FaceIterator fi; - - int check = Rvcg::IOMesh::RvcgReadR(m,vb_,it_); - if (check == 1) { - Rprintf("%s\n","Warning: mesh has no faces, nothing done"); - return Rcpp::List::create(Rcpp::Named("vb") = vb_, - Rcpp::Named("normals") = 0, - Rcpp::Named("it") = it_ - ); - } else { - Rcpp::LogicalVector boolparams(boolparams_); - Rcpp::NumericVector doubleparams(doubleparams_); - //boolparams: 0=topo 1=quality 2=boundary 3=optiplace 4=scaleindi, 5= normcheck, 6=safeheap) - //doubleparams: 0 = qthresh, 1 = boundweight 2=normalthr - int FinalSize = Rcpp::as(Finsize_); + try { + // declare Mesh and helper variables + int i; + CMeshDec m; + VertexIterator vi; + FaceIterator fi; + bool silent = as(silent_); + int check = Rvcg::IOMesh::RvcgReadR(m,vb_,it_); + if (check == 1) { + ::Rf_error("mesh has no faces"); + } else { + Rcpp::LogicalVector boolparams(boolparams_); + Rcpp::NumericVector doubleparams(doubleparams_); + //boolparams: 0=topo 1=quality 2=boundary 3=optiplace 4=scaleindi, 5= normcheck, 6=safeheap) + //doubleparams: 0 = qthresh, 1 = boundweight 2=normalthr + int FinalSize = Rcpp::as(Finsize_); - //initiate decimation process - TriEdgeCollapseQuadricParameter qparams; - float TargetError=std::numeric_limits::max(); - qparams.QualityThr = doubleparams[0]; - qparams.BoundaryWeight = doubleparams[1]; - qparams.NormalThrRad = doubleparams[2]; - - qparams.PreserveTopology = boolparams[0]; - qparams.QualityCheck = boolparams[1]; - qparams.PreserveBoundary = boolparams[2]; - qparams.OptimalPlacement = boolparams[3]; - qparams.ScaleIndependent = boolparams[4]; - qparams.NormalCheck = boolparams[5]; - qparams.SafeHeapUpdate = boolparams[6]; + //initiate decimation process + TriEdgeCollapseQuadricParameter qparams; + float TargetError=std::numeric_limits::max(); + qparams.QualityThr = doubleparams[0]; + qparams.BoundaryWeight = doubleparams[1]; + qparams.NormalThrRad = doubleparams[2]; + + qparams.PreserveTopology = boolparams[0]; + qparams.QualityCheck = boolparams[1]; + qparams.PreserveBoundary = boolparams[2]; + qparams.OptimalPlacement = boolparams[3]; + qparams.ScaleIndependent = boolparams[4]; + qparams.NormalCheck = boolparams[5]; + qparams.SafeHeapUpdate = boolparams[6]; - tri::Clean::RemoveDuplicateVertex(m); - tri::Clean::RemoveUnreferencedVertex(m); - - Rprintf("reducing it to %i faces\n",FinalSize); + tri::Clean::RemoveDuplicateVertex(m); + tri::Clean::RemoveUnreferencedVertex(m); + if (!silent) + Rprintf("reducing it to %i faces\n",FinalSize); - vcg::tri::UpdateBounding::Box(m); + vcg::tri::UpdateBounding::Box(m); - // decimator initialization - vcg::LocalOptimization DeciSession(m,&qparams); + // decimator initialization + vcg::LocalOptimization DeciSession(m,&qparams); - DeciSession.Init(); - Rprintf("Initial Heap Size %i\n",int(DeciSession.h.size())); + DeciSession.Init(); + if (!silent) + Rprintf("Initial Heap Size %i\n",int(DeciSession.h.size())); - DeciSession.SetTargetSimplices(FinalSize); - DeciSession.SetTimeBudget(0.5f); - if(TargetError< std::numeric_limits::max() ) DeciSession.SetTargetMetric(TargetError); + DeciSession.SetTargetSimplices(FinalSize); + DeciSession.SetTimeBudget(0.5f); + if(TargetError< std::numeric_limits::max() ) DeciSession.SetTargetMetric(TargetError); - while(m.fn > FinalSize && DeciSession.currMetric < TargetError){ - DeciSession.DoOptimization(); - } + while(m.fn > FinalSize && DeciSession.currMetric < TargetError){ + DeciSession.DoOptimization(); + } - vcg::tri::Allocator< CMeshDec >::CompactVertexVector(m); - vcg::tri::Allocator< CMeshDec >::CompactFaceVector(m); - SimpleTempData indices(m.vert); - tri::UpdateNormal::PerVertexAngleWeighted(m); - tri::UpdateNormal::NormalizePerVertex(m); - Rprintf("Result: %d vertices and %d faces.\nEstimated error: %g \n",m.vn,m.fn,DeciSession.currMetric); + vcg::tri::Allocator< CMeshDec >::CompactVertexVector(m); + vcg::tri::Allocator< CMeshDec >::CompactFaceVector(m); + SimpleTempData indices(m.vert); + tri::UpdateNormal::PerVertexAngleWeighted(m); + tri::UpdateNormal::NormalizePerVertex(m); + if (!silent) + Rprintf("Result: %d vertices and %d faces.\nEstimated error: %g \n",m.vn,m.fn,DeciSession.currMetric); - Rcpp::NumericMatrix vb(3, m.vn), normals(3, m.vn); - Rcpp::IntegerMatrix itout(3, m.fn); + Rcpp::NumericMatrix vb(3, m.vn), normals(3, m.vn); + Rcpp::IntegerMatrix itout(3, m.fn); - //write back data - vi=m.vert.begin(); - for (i=0; i < m.vn; i++) { - indices[vi] = i;//important: updates vertex indices - vb(0,i) = (*vi).P()[0]; - vb(1,i) = (*vi).P()[1]; - vb(2,i) = (*vi).P()[2]; - normals(0,i) = (*vi).N()[0]; - normals(1,i) = (*vi).N()[1]; - normals(2,i) = (*vi).N()[2]; - ++vi; - } + //write back data + vi=m.vert.begin(); + for (i=0; i < m.vn; i++) { + indices[vi] = i;//important: updates vertex indices + vb(0,i) = (*vi).P()[0]; + vb(1,i) = (*vi).P()[1]; + vb(2,i) = (*vi).P()[2]; + normals(0,i) = (*vi).N()[0]; + normals(1,i) = (*vi).N()[1]; + normals(2,i) = (*vi).N()[2]; + ++vi; + } - FacePointer fp; - fi=m.face.begin(); - for (i=0; i < m.fn;i++) { - fp=&(*fi); - if( ! fp->IsD() ) { - itout(0,i) = indices[fp->cV(0)]+1; - itout(1,i) = indices[fp->cV(1)]+1; - itout(2,i) = indices[fp->cV(2)]+1; - ++fi; + FacePointer fp; + fi=m.face.begin(); + for (i=0; i < m.fn;i++) { + fp=&(*fi); + if( ! fp->IsD() ) { + itout(0,i) = indices[fp->cV(0)]+1; + itout(1,i) = indices[fp->cV(1)]+1; + itout(2,i) = indices[fp->cV(2)]+1; + ++fi; + } + } + return Rcpp::List::create(Rcpp::Named("vb") = vb, + Rcpp::Named("normals") = normals, + Rcpp::Named("it") = itout + ); } + } catch (std::exception& e) { + ::Rf_error( e.what()); + } catch (...) { + ::Rf_error("unknown exception"); } - return Rcpp::List::create(Rcpp::Named("vb") = vb, - Rcpp::Named("normals") = normals, - Rcpp::Named("it") = itout - ); - } } diff --git a/src/RallRead.cpp b/src/RallRead.cpp index 25c2da1c..3c0e4631 100644 --- a/src/RallRead.cpp +++ b/src/RallRead.cpp @@ -28,7 +28,7 @@ bool CompareVertex(const MyMeshImport & m, const MyMeshImport::VertexType & vA, } /////// -RcppExport SEXP RallRead(SEXP filename_, SEXP updateNormals_, SEXP colorread_, SEXP clean_) +RcppExport SEXP RallRead(SEXP filename_, SEXP updateNormals_, SEXP colorread_, SEXP clean_,SEXP silent_) { try { std::string str = Rcpp::as(filename_); @@ -36,6 +36,7 @@ RcppExport SEXP RallRead(SEXP filename_, SEXP updateNormals_, SEXP colorread_, S bool updateNormals = as(updateNormals_); bool colorread = as(colorread_); bool clean = as(clean_); + bool silent = as(silent_); MyMeshImport m; bool hasNormal = false, WedgeTex=false, VertTex = false; int mask0 = 0; //initializie import mask @@ -71,7 +72,7 @@ RcppExport SEXP RallRead(SEXP filename_, SEXP updateNormals_, SEXP colorread_, S int unref = tri::Clean::RemoveUnreferencedVertex(m); vcg::tri::Allocator< MyMeshImport >::CompactVertexVector(m); vcg::tri::Allocator< MyMeshImport >::CompactFaceVector(m); - if (dup > 0 || unref > 0 || dupface > 0) + if ((dup > 0 || unref > 0 || dupface > 0) && !silent) Rprintf("Removed %i duplicate %i unreferenced vertices and %i duplicate faces\n",dup,unref,dupface); } // do texture processing diff --git a/src/Rclost.cpp b/src/Rclost.cpp index f523daa6..4186f9ea 100644 --- a/src/Rclost.cpp +++ b/src/Rclost.cpp @@ -26,8 +26,8 @@ RcppExport SEXP Rclost(SEXP vb_ , SEXP it_, SEXP ioclost_, SEXP sign_, SEXP bord // section read from input int checkit = Rvcg::IOMesh::RvcgReadR(m,vb_,it_); if (checkit == 1) { - Rprintf("%s\n", "Target mesh has no triangular faces"); - return wrap(1); + ::Rf_error("target mesh has no faces, nothing done"); + } else if (checkit >= 0) { Rvcg::IOMesh::RvcgReadR(refmesh, ioclost_); m.face.EnableNormal(); diff --git a/src/Rintersect.cpp b/src/Rintersect.cpp index cd157490..edeacde5 100644 --- a/src/Rintersect.cpp +++ b/src/Rintersect.cpp @@ -26,12 +26,7 @@ RcppExport SEXP Rintersect(SEXP vb_ , SEXP it_, SEXP ioclost_, SEXP normals_, SE float t, t1; int check = Rvcg::IOMesh::RvcgReadR(m,vb_,it_); if (check != 0) { - Rprintf("%s\n","Warning: mesh has no faces or no vertices, nothing done"); - return Rcpp::List::create(Rcpp::Named("vb") = 0, - Rcpp::Named("normals") = 0, - Rcpp::Named("hitbool") = 0, - Rcpp::Named("dis") = 0 - ); + ::Rf_error("mesh has no faces or no vertices, nothing done"); } else { //Allocate target typedef MyMesh::VertexPointer VertexPointer; diff --git a/src/Risolated.cpp b/src/Risolated.cpp index 68b059dd..75a889ed 100644 --- a/src/Risolated.cpp +++ b/src/Risolated.cpp @@ -10,24 +10,20 @@ using namespace vcg; using namespace tri; using namespace Rcpp; -RcppExport SEXP Risolated(SEXP vb_ , SEXP it_, SEXP diam_, SEXP facenum_) { +RcppExport SEXP Risolated(SEXP vb_ , SEXP it_, SEXP diam_, SEXP facenum_,SEXP silent_) { try { // declare Mesh and helper variables int i; TopoMyMesh m; VertexIterator vi; FaceIterator fi; - + bool silent = as(silent_); int check = Rvcg::IOMesh::RvcgReadR(m,vb_,it_); /*m.vert.EnableVFAdjacency(); m.face.EnableFFAdjacency(); m.face.EnableVFAdjacency();*/ if (check != 0) { - Rprintf("%s\n","Warning: mesh has no faces and/or no vertices, nothing done"); - return Rcpp::List::create(Rcpp::Named("vb") = vb_, - Rcpp::Named("normals") = 0, - Rcpp::Named("it") = it_ - ); + ::Rf_error("mesh has no faces and/or no vertices, nothing done"); } else { double diameter = Rcpp::as(diam_); int connect = Rcpp::as(facenum_); @@ -66,8 +62,8 @@ RcppExport SEXP Risolated(SEXP vb_ , SEXP it_, SEXP diam_, SEXP facenum_) { connect = *std::max_element(chunkface.begin(),chunkface.end()); delInfo = tri::Clean::RemoveSmallConnectedComponentsSize(m,connect); } - - Rprintf("Removed %i connected components out of %i\n", delInfo.second, delInfo.first); + if (!silent) + Rprintf("Removed %i connected components out of %i\n", delInfo.second, delInfo.first); tri::Clean::RemoveUnreferencedVertex(m); // get a vector of which vertices were removed std::vector remvert(m.vert.size()); @@ -119,7 +115,6 @@ RcppExport SEXP Risolated(SEXP vb_ , SEXP it_, SEXP diam_, SEXP facenum_) { } } catch (std::exception& e) { ::Rf_error( e.what()); - return wrap(1); } catch (...) { ::Rf_error("unknown exception"); } diff --git a/src/Rmarch.cpp b/src/Rmarch.cpp index b5732ff1..42390fe7 100644 --- a/src/Rmarch.cpp +++ b/src/Rmarch.cpp @@ -72,7 +72,6 @@ walker.BuildMesh(m, volume, mc, 0.0); Rcpp::NumericMatrix vbout(3,m.vn), normals(3,m.vn); Rcpp::IntegerMatrix itout(3,m.fn); -Rprintf("%d\n",m.vn); vi=m.vert.begin(); for (i=0; i < m.vn; i++) { indiceout[vi] = i; diff --git a/src/RupdateNormals.cpp b/src/RupdateNormals.cpp index 4e17019e..800ad45f 100644 --- a/src/RupdateNormals.cpp +++ b/src/RupdateNormals.cpp @@ -9,12 +9,13 @@ using namespace Rcpp; //using namespace std; -RcppExport SEXP RupdateNormals(SEXP vb_, SEXP it_, SEXP type_, SEXP pointcloud_) +RcppExport SEXP RupdateNormals(SEXP vb_, SEXP it_, SEXP type_, SEXP pointcloud_, SEXP silent_) { try { // declare Mesh and helper variables int select = Rcpp::as(type_); Rcpp::IntegerVector pointcloud(pointcloud_); + bool silent = as(silent_); MyMesh m; VertexIterator vi; FaceIterator fi; @@ -22,10 +23,11 @@ RcppExport SEXP RupdateNormals(SEXP vb_, SEXP it_, SEXP type_, SEXP pointcloud_) int check = Rvcg::IOMesh::RvcgReadR(m,vb_,it_); Rcpp::NumericMatrix normals(3,m.vn); if (check < 0) { - Rprintf("%s\n","Info: mesh has no faces and/or no vertices"); + ::Rf_error("mesh has no faces and/or no vertices"); return wrap(1); } else if (check == 1) { - Rprintf("%s\n","Info: mesh has no faces normals for point clouds are computed"); + if (!silent) + Rprintf("%s\n","Info: mesh has no faces normals for point clouds are computed"); PointCloudNormal::Param p; p.fittingAdjNum = pointcloud[0]; p.smoothingIterNum = pointcloud[1];