[Paraview] Extending Broken in 2.6.0
Mike Jackson
imikejackson at gmail.com
Tue May 8 10:34:13 EDT 2007
--
Mike Jackson Senior Research Engineer
Innovative Management & Technology Services
On May 7, 2007, at 10:10 PM, David C Thompson wrote:
> First of all, I have to apologize... I did commit a fix to stop the
> LS-Dyna reader from printing crud out from within CanReadFile, but it
> apparently did not make it into the 2.6 branch. I've just sent a patch
> to Amy to be included if there are any more 2.6 releases.
>
>>> <rant>So basically you have to hack up paraview because someone can
>>> not put a file extension on a data file and we all get to incur that
>>> performance penalty.</rant>
> Yes, although I could make a similar rant along the lines of "You mean
> there are still applications that have to determine a file's type
> by its
> extension?" or "You mean there are still file selection dialogs that
> won't let you choose a file because it happens to be a directory?"
>
>> Actually, the right way of dealing with this is assigning priorities
>> to readers and have paraview try readers in the order of priority.
>> LSDyna would have a priority of -infinity :-) I cannot guarantee we
>> would implement it quickly but I suggest putting in a feature request
>> for it.
> I would like to suggest an alternative: have readers register mime
> types
> as well as file extensions. Then libmagic (see
> ftp://ftp.astron.com/pub/file/file-4.20.tar.gz) or other OS-specific
> utilities (i.e., file attributes on MacOS X) could be used to find the
> proper reader without instantiating any readers and without the
> overhead
> of calling many CanReadFile implementations on many files.
>
> David
>
I am a mac guy so I am all in favor of the world moving to a
filesystem that supports resource forks, file types and file creator
codes, but until that happens we all get to play in a world with file
extensions.
Here is the work around for those wishing to "fix" readers that
insist on reading every file: I'll use the LSDyna Reader as an example:
Look in ParaView-2.6.1/GUI/Client/Resources/Readers.xml at line 931:
Change the <Module .... > section to the following:
<Module name="LSDynaReader"
root_name="LSDynaReader"
output="vtkMultiBlockDataSet"
class="vtkPVAdvancedReaderModule"
module_type="Reader"
extensions=".d3plot .k .lsdyna"
always_try_can_read="0"
file_description="LSDyna">
<Source class="vtkLSDynaReader"/>
Also note that there is an error on line 936. There is a missing "."
before "d3plot". This should stop the LSDyna reader for reading files
it shouldn't.
Recompile ParaView.
Cheers, Peace
Mike Jackson
More information about the ParaView
mailing list