[MOAB-dev] Detecting file types
Jason Kraftcheck
kraftche at cae.wisc.edu
Mon Nov 30 19:48:45 CST 2009
Steve Jackson wrote:
> On Nov 30, 2009, at 15:36 , Jason Kraftcheck wrote:
>> So you don't need to know the file type. You need to know whether or not
>> the file contained geometry that was read into CGM. Why not just query CGM
>> to see if it has any geometry?
>
> Fair enough. That seemed to me like a roundabout way of coming at the problem, but it sounds like the simplest fix.
>
Well, the direct solution would be to determine whether or not MOAB used
the ReadCGM class to read the file. But asking about the file type is
equally indirect, as CGM can read a variety of file formats as well. If
we do want to proved the string name of the reader, then I think the way
to do this is to use a file set. The MOAB load_file function allows an
optional EntitySet handle to be passed. If that handle is provided, the
contents of the file will be added to the set. MOAB should hang
pertinent data in tags on that set (file name, file reader name/file
type, etc.)
- jason
More information about the moab-dev
mailing list