@@ -18,16 +18,12 @@ function vtkPDBReader(publicAPI, model) {
18
18
}
19
19
20
20
// Internal method to fetch Array
21
- function fetchPDB ( url ) {
22
- const { compression, progressCallback } = model ;
23
- return model . dataAccessHelper . fetchText ( publicAPI , url , {
24
- compression,
25
- progressCallback,
26
- } ) ;
21
+ function fetchPDB ( url , option ) {
22
+ return model . dataAccessHelper . fetchText ( publicAPI , url , option ) ;
27
23
}
28
24
29
25
// Set DataSet url
30
- publicAPI . setUrl = ( url ) => {
26
+ publicAPI . setUrl = ( url , option ) => {
31
27
if ( url . indexOf ( '.pdb' ) === - 1 ) {
32
28
model . baseURL = url ;
33
29
model . url = `${ url } ` ; // `${url}/index.pdb`;
@@ -41,13 +37,14 @@ function vtkPDBReader(publicAPI, model) {
41
37
}
42
38
43
39
// Fetch metadata
44
- return publicAPI . loadData ( ) ;
40
+ return publicAPI . loadData ( option ) ;
45
41
} ;
46
42
47
43
// Fetch the actual data arrays
48
- publicAPI . loadData = ( ) => fetchPDB ( model . url ) . then ( publicAPI . parseText ) ;
44
+ publicAPI . loadData = ( option ) =>
45
+ fetchPDB ( model . url , option ) . then ( publicAPI . parseAsText ) ;
49
46
50
- publicAPI . parseText = ( txt ) => {
47
+ publicAPI . parseAsText = ( txt ) => {
51
48
model . pdb = txt ;
52
49
model . molecule = [ ] ;
53
50
model . molecule = model . pdb . split ( '\n' ) ;
@@ -183,14 +180,6 @@ export function extend(publicAPI, model, initialValues = {}) {
183
180
184
181
// Object methods
185
182
vtkPDBReader ( publicAPI , model ) ;
186
-
187
- // To support destructuring
188
- if ( ! model . compression ) {
189
- model . compression = null ;
190
- }
191
- if ( ! model . progressCallback ) {
192
- model . progressCallback = null ;
193
- }
194
183
}
195
184
196
185
// ----------------------------------------------------------------------------
0 commit comments