From df6f5b98ec60a53f6f262ecd24c62ae0ec0ea914 Mon Sep 17 00:00:00 2001 From: cignoni Date: Wed, 28 Oct 2009 08:24:56 +0000 Subject: [PATCH] completed the templating of the stuff for fast loading of bbox of ply --- wrap/ply/plystuff.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wrap/ply/plystuff.h b/wrap/ply/plystuff.h index e8fd48d2..c2b74cb4 100644 --- a/wrap/ply/plystuff.h +++ b/wrap/ply/plystuff.h @@ -227,10 +227,13 @@ bool GetCacheName( const char * fname, const char * ext_name, char * cname ) } -static bool SaveBBoxCache( const char * fname, const Box3d & box ) +template +static bool SaveBBoxCache( const char * fname, const Box3 & boxOut ) { char d[MAXBPATH]; + Box3d box; + box.Import(boxOut); if( !GetCacheName(fname,bboxcacheext,d) ) return false; @@ -327,7 +330,8 @@ bool ScanBBox( const char * fname, Box3 & box, bool use_cache=true ) // Come la precedente ma applica la matrice m ai punti prima di calcolare il bbox. // Visto che la matrice di solito e' tenuta in un qualche file, se si vuole usare la cache // si puo' passare anche un'altro filename da controllare -bool ScanBBox( const char * fname, Box3d & box, const Matrix44d & m, bool use_cache, const char *matrixfname) +template +bool ScanBBox( const char * fname, Box3 & box, const Matrix44 & m, bool use_cache, const char *matrixfname) { if(use_cache) @@ -370,7 +374,7 @@ bool ScanBBox( const char * fname, Box3d & box, const Matrix44d & m, bool use_ca PlyPoint3d t; pf.Read( (void *)(&t) ); - box.Add( m*Point3d(t.x,t.y,t.z) ); + box.Add( m*Point3(t.x,t.y,t.z) ); } } else