|
@@ -1161,33 +1161,16 @@ VTKLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
}
|
|
|
|
|
|
- function getStringFile( data ) {
|
|
|
-
|
|
|
- var stringFile = '';
|
|
|
- var charArray = new Uint8Array( data );
|
|
|
- var i = 0;
|
|
|
- var len = charArray.length;
|
|
|
-
|
|
|
- while ( len -- ) {
|
|
|
-
|
|
|
- stringFile += String.fromCharCode( charArray[ i ++ ] );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return stringFile;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
// get the 5 first lines of the files to check if there is the key word binary
|
|
|
var meta = LoaderUtils.decodeText( new Uint8Array( data, 0, 250 ) ).split( '\n' );
|
|
|
|
|
|
if ( meta[ 0 ].indexOf( 'xml' ) !== - 1 ) {
|
|
|
|
|
|
- return parseXML( getStringFile( data ) );
|
|
|
+ return parseXML( LoaderUtils.decodeText( data ) );
|
|
|
|
|
|
} else if ( meta[ 2 ].includes( 'ASCII' ) ) {
|
|
|
|
|
|
- return parseASCII( getStringFile( data ) );
|
|
|
+ return parseASCII( LoaderUtils.decodeText( data ) );
|
|
|
|
|
|
} else {
|
|
|
|