From 7bd3c4601a5dce1440efbadf5ba1425533e4ae9d Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 2 Dec 2005 00:00:53 +0000 Subject: [PATCH] Moved and corrected interpret_texture_name from plystuff.h to plylib.cpp --- wrap/ply/plylib.cpp | 5 ++++- wrap/ply/plylib.h | 9 +++++--- wrap/ply/plystuff.h | 51 +++++---------------------------------------- 3 files changed, 15 insertions(+), 50 deletions(-) diff --git a/wrap/ply/plylib.cpp b/wrap/ply/plylib.cpp index def5d5fb..ddf32095 100644 --- a/wrap/ply/plylib.cpp +++ b/wrap/ply/plylib.cpp @@ -31,6 +31,9 @@ of Greg Turk and on the work of Claudio Rocchini History $Log: not supported by cvs2svn $ +Revision 1.10 2005/11/26 00:22:46 cignoni +added untested code of interpret_texture + Revision 1.9 2005/11/12 07:07:47 cignoni Changed Offset types to remove warnings @@ -3612,7 +3615,7 @@ int PlyFile::Read( void * mem ) return 0; } -void __interpret_texture_name(const char*a, const char*fn, char*output){ +void interpret_texture_name(const char*a, const char*fn, char*output){ int ia=0,io=0; output[0]=0; while (a[ia]!=0){ diff --git a/wrap/ply/plylib.h b/wrap/ply/plylib.h index e4ea7094..a9585026 100644 --- a/wrap/ply/plylib.h +++ b/wrap/ply/plylib.h @@ -30,6 +30,9 @@ of Greg Turk and on the work of Claudio Rocchini History $Log: not supported by cvs2svn $ +Revision 1.5 2005/11/26 00:12:25 cignoni +added prototype of interpret_texture_name + Revision 1.4 2005/11/12 07:07:47 cignoni Changed Offset types to remove warnings @@ -321,8 +324,8 @@ protected: PlyElement * FindElement( const char * name ); }; -void __interpret_texture_name(const char*a, const char*fn, char*output); +void interpret_texture_name(const char*a, const char*fn, char*output); -} -} + } // end namespace ply +} // end namespace vcg #endif diff --git a/wrap/ply/plystuff.h b/wrap/ply/plystuff.h index 4b91bdca..3aba8d21 100644 --- a/wrap/ply/plystuff.h +++ b/wrap/ply/plystuff.h @@ -31,6 +31,9 @@ of Greg Turk and on the work of Claudio Rocchini History $Log: not supported by cvs2svn $ +Revision 1.3 2005/03/18 00:14:40 cignoni +removed small gcc compiling issues + Revision 1.2 2005/03/15 11:46:52 cignoni Cleaning of the automatic bbox caching support for ply files. First working version. @@ -370,51 +373,7 @@ bool ScanBBox( const char * fname, Box3d & box, const Matrix44d & m, bool use_ca return true; } -void __interpret_texture_name(const char*a, const char*fn, char*output){ - int ia=0,io=0; - output[0]=0; - while (a[ia]!=0){ - if (a[ia]=='<') { - if (strlen(a)>ia+5) { - if ( ( (a[ia+1]=='t') || (a[ia+1]=='T') ) && - ( (a[ia+2]=='h') || (a[ia+2]=='H') ) && - ( (a[ia+3]=='i') || (a[ia+3]=='I') ) && - ( (a[ia+4]=='s') || (a[ia+4]=='S') ) && - ( a[ia+5]=='>' ) ) - { - // substitute "" with filename: - // 1) remove path from filename - int lastbar=0; - int ifn=0; - while (fn[ifn]!=0) { if ((fn[ifn]=='/') || (fn[ifn]=='\\')) lastbar=ifn+1; ifn++;} - ifn=lastbar; - char fn2[255]; - while (fn[ifn]!=0) { fn2[ifn-lastbar]=fn[ifn]; ifn++;} - fn2[ifn-lastbar]=0; - - // 2) remove ".ply" extention from filename - int l=ifn-lastbar; - if ((fn2[l-4]=='.') - && ((fn2[l-3]=='P') || (fn2[l-3]=='p')) - && ((fn2[l-2]=='L') || (fn2[l-2]=='l')) - && ((fn2[l-1]=='Y') || (fn2[l-1]=='y')) ) - fn2[l-4]=0; - - // 3) append - output[io]=0; - sprintf(output,"%s%s",output,fn2); - io=strlen(output); - ia+=6; //skip the "" - continue; - }; - } - } - output[io++]=a[ia++]; - }; - output[io]=0; -}; - -} -} +} // end namespace ply +} // end namespace vcg #endif