1 |
""" |
""" |
2 |
@author: John NGUI |
@var __author__: name of author |
3 |
|
@var __copyright__: copyrights |
4 |
|
@var __license__: licence agreement |
5 |
|
@var __url__: url entry point on documentation |
6 |
|
@var __version__: version |
7 |
|
@var __date__: date of the version |
8 |
""" |
""" |
9 |
|
|
10 |
|
__author__="John Ngui, john.ngui@uq.edu.au" |
11 |
|
__copyright__=""" Copyright (c) 2006 by ACcESS MNRF |
12 |
|
http://www.access.edu.au |
13 |
|
Primary Business: Queensland, Australia""" |
14 |
|
__license__="""Licensed under the Open Software License version 3.0 |
15 |
|
http://www.opensource.org/licenses/osl-3.0.php""" |
16 |
|
__url__="http://www.iservo.edu.au/esys" |
17 |
|
__version__="$Revision$" |
18 |
|
__date__="$Date$" |
19 |
|
|
20 |
|
|
21 |
import vtk |
import vtk |
22 |
import tempfile, os, sys |
import tempfile, os, sys |
23 |
from constant import Source, ColorMode |
from constant import Source, ColorMode |
50 |
self.__source = source |
self.__source = source |
51 |
# Keeps track on whether DataCollector have been modified. |
# Keeps track on whether DataCollector have been modified. |
52 |
self.__modified = True |
self.__modified = True |
53 |
|
# Keeps track of the number of times the 'setFileName' or 'setData' |
54 |
|
# method have been executed. |
55 |
|
self.__count = 0 |
56 |
# Keeps track on whether any specific scalar, vector or tensor |
# Keeps track on whether any specific scalar, vector or tensor |
57 |
# field have been specified. |
# field have been specified. |
58 |
self.__set_scalar = False |
self.__set_scalar = False |
84 |
""" |
""" |
85 |
|
|
86 |
self.__modified = True |
self.__modified = True |
87 |
|
self.__count += 1 |
88 |
|
|
89 |
if(self.__source == Source.XML): |
if(self.__source == Source.XML): |
90 |
# Check whether the specified file exists, otherwise exit. |
# Check whether the specified file exists, otherwise exit. |
108 |
""" |
""" |
109 |
|
|
110 |
self.__modified = True |
self.__modified = True |
111 |
|
self.__count += 1 |
112 |
|
|
113 |
if self.__source == Source.ESCRIPT: |
if self.__source == Source.ESCRIPT: |
114 |
esys.escript.saveVTK(self.__tmp_file,**args) |
esys.escript.saveVTK(self.__tmp_file,**args) |
382 |
""" |
""" |
383 |
|
|
384 |
if(self.__modified == True): |
if(self.__modified == True): |
385 |
#self.__modified = False |
# 'self.__modified' is set to False only if the 'setFileName' or |
386 |
|
# 'setData' method have been called once. This is to prevent |
387 |
|
# the scalar range and active field (i.e. scalar, vector or tensor) |
388 |
|
# from being updated as no changes has taken place (for performance |
389 |
|
# reasons). However if the 'setFileName' or 'setData' method is |
390 |
|
# called more than once, then 'self.__modified' remains True. |
391 |
|
if(self.__count == 1): |
392 |
|
self.__modified = False |
393 |
return True |
return True |
394 |
else: |
else: |
395 |
return False |
return False |