EgtExchange 1.5d3 :
- miglioria in funzione riconoscimento STL ASCII e binari - ricompilazione per modifiche a GeomKernel.
This commit is contained in:
+10
-6
@@ -55,18 +55,22 @@ ImportStl::StlType( const std::string& sFile)
|
||||
if ( InFile.fail())
|
||||
return STL_ERROR ;
|
||||
|
||||
// lettura dei primi ottanta byte
|
||||
char cBuff[81] ;
|
||||
InFile.read( cBuff, 80) ;
|
||||
// lettura dei primi 256 byte
|
||||
char cBuff[256] ;
|
||||
InFile.read( cBuff, 255) ;
|
||||
cBuff[InFile.gcount()] = '\0' ;
|
||||
|
||||
// chiusura del file
|
||||
InFile.close() ;
|
||||
|
||||
// verifico se iniziano con "solid"
|
||||
// verifico se iniziano con "solid" e poi "facet" e "normal"
|
||||
string sBuff = cBuff ;
|
||||
size_t nPos = sBuff.find( "solid") ;
|
||||
if ( nPos != string::npos && nPos < 10)
|
||||
size_t nPosS = sBuff.find( "solid") ;
|
||||
size_t nPosF = sBuff.find( "facet") ;
|
||||
size_t nPosN = sBuff.find( "normal") ;
|
||||
if ( nPosS != string::npos && nPosS < 10 &&
|
||||
nPosF != string::npos &&
|
||||
nPosN != string::npos)
|
||||
return STL_ASCII ;
|
||||
else
|
||||
return STL_BINARY ;
|
||||
|
||||
Reference in New Issue
Block a user