ParaView
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkSMReaderFactory Class Reference

is a factory for creating a reader proxy based on the filename/extension. More...

#include <vtkSMReaderFactory.h>

Inheritance diagram for vtkSMReaderFactory:
Inheritance graph
[legend]
Collaboration diagram for vtkSMReaderFactory:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
void Initialize ()
void RegisterPrototypes (vtkSMSession *session, const char *xmlgroup)
bool CanReadFile (const char *filename, vtkSMSession *session)
vtkStringListGetPossibleReaders (const char *filename, vtkSMSession *session)
vtkStringListGetReaders (vtkSMSession *session)
vtkStringListGetReaders (const char *filename, vtkSMSession *session)
const char * GetSupportedFileTypes (vtkSMSession *session)
unsigned int GetNumberOfRegisteredPrototypes ()
void RegisterPrototype (const char *xmlgroup, const char *xmlname)
void UnRegisterPrototype (const char *xmlgroup, const char *xmlname)
bool LoadConfigurationFile (const char *filename)
bool LoadConfiguration (const char *xmlcontents)
bool LoadConfiguration (vtkPVXMLElement *root)
virtual char * GetReaderName ()
virtual char * GetReaderGroup ()

Static Public Member Functions

static vtkSMReaderFactoryNew ()
static int IsTypeOf (const char *type)
static vtkSMReaderFactorySafeDownCast (vtkObject *o)
static bool TestFileReadability (const char *filename, vtkSMSession *session)
static bool CanReadFile (const char *filename, vtkSMProxy *reader)
static bool CanReadFile (const char *filename, const char *readerxmlgroup, const char *readerxmlname, vtkSMSession *session)

Protected Member Functions

 vtkSMReaderFactory ()
 ~vtkSMReaderFactory ()
void RegisterPrototype (const char *xmlgroup, const char *xmlname, const char *extensions, const char *description)
virtual void SetReaderName (const char *)
virtual void SetReaderGroup (const char *)

Protected Attributes

char * ReaderName
char * ReaderGroup
vtkStringListReaders

Detailed Description

is a factory for creating a reader proxy based on the filename/extension.

vtkSMReaderFactory is a factory for creating a reader that reads a particular file. The reader factory needs to be configured to register the reader prototypes supported by the application. This can be done using an XML with the following format:

 <ParaViewReaders>
    <Proxy name="[xmlname for the reader proxy]"
            group="[optional: xmlgroup for the reader proxy, sources by default]"
            />
    ...
 </ParaViewReaders>
 

Alternatively, one can register prototypes using RegisterPrototype API.

Once the factory has been configured, the API to create readers, get available readers etc. can be used.

Definition at line 47 of file vtkSMReaderFactory.h.


Constructor & Destructor Documentation

vtkSMReaderFactory::vtkSMReaderFactory ( ) [protected]
vtkSMReaderFactory::~vtkSMReaderFactory ( ) [protected]

Member Function Documentation

static vtkSMReaderFactory* vtkSMReaderFactory::New ( ) [static]

Reimplemented from vtkSMObject.

virtual const char* vtkSMReaderFactory::GetClassName ( ) [virtual]

Reimplemented from vtkSMObject.

static int vtkSMReaderFactory::IsTypeOf ( const char *  type) [static]

Reimplemented from vtkSMObject.

virtual int vtkSMReaderFactory::IsA ( const char *  type) [virtual]

Reimplemented from vtkSMObject.

static vtkSMReaderFactory* vtkSMReaderFactory::SafeDownCast ( vtkObject o) [static]

Reimplemented from vtkSMObject.

void vtkSMReaderFactory::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Reimplemented from vtkSMObject.

void vtkSMReaderFactory::Initialize ( )

Cleanup all registered prototypes.

void vtkSMReaderFactory::RegisterPrototype ( const char *  xmlgroup,
const char *  xmlname 
)

Register a prototype.

void vtkSMReaderFactory::UnRegisterPrototype ( const char *  xmlgroup,
const char *  xmlname 
)

Register a prototype.

void vtkSMReaderFactory::RegisterPrototypes ( vtkSMSession session,
const char *  xmlgroup 
)

Registers all prototypes from a particular group that have the "ReaderFactory" hint.

bool vtkSMReaderFactory::LoadConfigurationFile ( const char *  filename)

Load configuration XML. This adds the prototypes specified in the configuration XML to those already present in the factory. Use Initialize() is start with an empty factory before calling this method if needed. If two readers support reading the same file, the reader added more recently is given priority.

bool vtkSMReaderFactory::LoadConfiguration ( const char *  xmlcontents)

Load configuration XML. This adds the prototypes specified in the configuration XML to those already present in the factory. Use Initialize() is start with an empty factory before calling this method if needed. If two readers support reading the same file, the reader added more recently is given priority.

bool vtkSMReaderFactory::LoadConfiguration ( vtkPVXMLElement root)

Load configuration XML. This adds the prototypes specified in the configuration XML to those already present in the factory. Use Initialize() is start with an empty factory before calling this method if needed. If two readers support reading the same file, the reader added more recently is given priority.

bool vtkSMReaderFactory::CanReadFile ( const char *  filename,
vtkSMSession session 
)

Returns true if a reader can be determined that can read the file. When this returns true, one can use GetReaderGroup() and GetReaderName() to obtain the xmlgroup and xmlname for the reader that can read the file. When this returns false, use GetPossibleReaders() to get the list of readers that can possibly read the file.

virtual char* vtkSMReaderFactory::GetReaderName ( ) [virtual]

Returns the xml-name for the reader that can read the file queried by the most recent CanReadFile() call. This is valid only if CanReadFile() returned true.

virtual char* vtkSMReaderFactory::GetReaderGroup ( ) [virtual]

Returns the xml-group for the reader that can read the file queried by the most recent CanReadFile() call. This is valid only if CanReadFile() returned true.

vtkStringList* vtkSMReaderFactory::GetPossibleReaders ( const char *  filename,
vtkSMSession session 
)

Get the list of readers that can possibly read the file. This is used when the factory cannot determine which reader to use for reading the file. The user can then choose from the provided options. Returns a list of 3-tuples where the 1st string is the group, the 2nd string is the reader name and the 3rd string is the reader description Note that the extension test is skipped in this case.

vtkStringList* vtkSMReaderFactory::GetReaders ( vtkSMSession session)

Returns a list of 3-tuples where the 1st string is the group, the 2nd string is the reader name and the 3rd string is the reader description This returns all the possible readers with a given connection id.

vtkStringList* vtkSMReaderFactory::GetReaders ( const char *  filename,
vtkSMSession session 
)

Returls list of readers that can read the file using its extension and connection id. Returns a list of 3-tuples where the 1st string is the group, the 2nd string is the reader name and the 3rd string is the reader description

static bool vtkSMReaderFactory::TestFileReadability ( const char *  filename,
vtkSMSession session 
) [static]

Helper method to test is a file is readable on the server side. This has nothing to do with the whether the file is readable by a reader, just test the file permissions etc. Internally uses the ServerFileListing proxy.

const char* vtkSMReaderFactory::GetSupportedFileTypes ( vtkSMSession session)

Returns a formatted string with all supported file types. cid is not used currently. An example returned string would look like:

"Supported Files (*.vtk *.pvd);;PVD Files (*.pvd);;VTK
      Files (*.vtk)" 
static bool vtkSMReaderFactory::CanReadFile ( const char *  filename,
vtkSMProxy reader 
) [static]

Helper method to check if the reader can read the given file. This is a generic method that simply tries to call CanReadFile() on the reader. If the reader des not support CanReadFile() then we assume the reader can read the file, and return true.

static bool vtkSMReaderFactory::CanReadFile ( const char *  filename,
const char *  readerxmlgroup,
const char *  readerxmlname,
vtkSMSession session 
) [static]

Helper method to check if the reader can read the given file. This is a generic method that simply tries to call CanReadFile() on the reader. If the reader des not support CanReadFile() then we assume the reader can read the file, and return true.

unsigned int vtkSMReaderFactory::GetNumberOfRegisteredPrototypes ( )

Returns the number of registered prototypes.

void vtkSMReaderFactory::RegisterPrototype ( const char *  xmlgroup,
const char *  xmlname,
const char *  extensions,
const char *  description 
) [protected]
virtual void vtkSMReaderFactory::SetReaderName ( const char *  ) [protected, virtual]
virtual void vtkSMReaderFactory::SetReaderGroup ( const char *  ) [protected, virtual]

Member Data Documentation

char* vtkSMReaderFactory::ReaderName [protected]

Definition at line 157 of file vtkSMReaderFactory.h.

Definition at line 160 of file vtkSMReaderFactory.h.

Definition at line 161 of file vtkSMReaderFactory.h.


The documentation for this class was generated from the following file: