is a factory for creating a reader proxy based on the filename/extension. More...
#include <vtkSMReaderFactory.h>
Public Types | |
typedef vtkSMObject | Superclass |
Public Types inherited from vtkSMObject | |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) override |
void | Initialize () |
Cleanup all registered prototypes. More... | |
void | RegisterPrototype (const char *xmlgroup, const char *xmlname) |
Register a prototype. More... | |
bool | CanReadFile (const char *filename, vtkSMSession *session) |
Returns true if a reader can be determined that can read the file. More... | |
vtkStringList * | GetPossibleReaders (const char *filename, vtkSMSession *session) |
Get the list of readers that can possibly read the file. More... | |
vtkStringList * | 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. More... | |
vtkStringList * | GetReaders (const char *filename, vtkSMSession *session) |
Returls list of readers that can read the file using its extension and connection id. More... | |
virtual const char * | GetSupportedFileTypes (vtkSMSession *session) |
Returns a formatted string with all supported file types. More... | |
virtual std::vector< FileTypeDetailed > | GetSupportedFileTypesDetailed (vtkSMSession *session) |
Returns the list of supported file types with details on the corresponding readers and its supported patterns. More... | |
unsigned int | GetNumberOfRegisteredPrototypes () |
Returns the number of registered prototypes. More... | |
virtual void | UpdateAvailableReaders () |
Every time a new proxy definition is added we check to see if it is a reader and then we add it to the list of available readers. More... | |
virtual char * | GetReaderName () |
Returns the xml-name for the reader that can read the file queried by the most recent CanReadFile() call. More... | |
virtual char * | GetReaderGroup () |
Returns the xml-group for the reader that can read the file queried by the most recent CanReadFile() call. More... | |
void | AddGroup (const char *groupName) |
Add/remove a group name to look for readers in. More... | |
void | RemoveGroup (const char *groupName) |
Add/remove a group name to look for readers in. More... | |
void | GetGroups (vtkStringList *groups) |
Add/remove a group name to look for readers in. More... | |
Public Member Functions inherited from vtkObject | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool debugFlag) |
virtual void | Modified () |
virtual vtkMTimeType | GetMTime () |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
void | PrintRevisions (ostream &) |
Static Public Member Functions | |
static vtkSMReaderFactory * | New () |
static int | IsTypeOf (const char *type) |
static vtkSMReaderFactory * | SafeDownCast (vtkObject *o) |
static bool | TestFileReadability (const char *filename, vtkSMSession *session) |
Helper method to test is a file is readable on the server side. More... | |
static void | AddReaderToWhitelist (const char *readerxmlgroup, const char *readerxmlname) |
This function is for ParaView based applications that only wish to expose a subset of the readers. More... | |
static bool | CanReadFile (const char *filename, vtkSMProxy *reader) |
Helper method to check if the reader can read the given file. More... | |
static bool | CanReadFile (const char *filename, const char *readerxmlgroup, const char *readerxmlname, vtkSMSession *session) |
Helper method to check if the reader can read the given file. More... | |
Static Public Member Functions inherited from vtkSMObject | |
static vtkSMObject * | New () |
static int | IsTypeOf (const char *type) |
static vtkSMObject * | SafeDownCast (vtkObject *o) |
static std::string | CreatePrettyLabel (const std::string &name) |
Return a well-formated label using provided name by adding spaces between lower cases and upper cases: More... | |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
Static Public Member Functions inherited from vtkObjectBase | |
static vtkTypeBool | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
static vtkObjectBase * | New () |
Static Public Attributes | |
static const std::string | SUPPORTED_TYPES_DESCRIPTION |
Description of the file type used for all supported types. More... | |
static const std::string | ALL_FILES_DESCRIPTION |
Description of the file type used for all files. More... | |
Protected Member Functions | |
vtkSMReaderFactory () | |
~vtkSMReaderFactory () override | |
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 Member Functions inherited from vtkSMObject | |
vtkSMObject () | |
~vtkSMObject () override | |
Protected Member Functions inherited from vtkObject | |
vtkObject () | |
virtual | ~vtkObject () |
void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE |
void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Static Protected Member Functions | |
static bool | GetFilenameIsDirectory (const char *fname, vtkSMSession *session) |
Returns true if the fname refers to a directory or a link to a directory. More... | |
Protected Attributes | |
char * | ReaderName |
char * | ReaderGroup |
vtkStringList * | Readers |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
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 is done automatically when the reader's proxy definition is registered AND if it has the extensions specified in the Hints section of the XML proxy definition. It is done with the following format:
* <ReaderFactory extensions="[list of expected extensions]" * file_description="[description of the file]" /> *
Once the factory has been configured, the API to create readers, get available readers etc. can be used.
Definition at line 45 of file vtkSMReaderFactory.h.
Definition at line 49 of file vtkSMReaderFactory.h.
|
protected |
|
overrideprotected |
|
static |
|
virtual |
Reimplemented from vtkSMObject.
Reimplemented from vtkSMObject.
|
static |
|
overridevirtual |
Reimplemented from vtkSMObject.
void vtkSMReaderFactory::Initialize | ( | ) |
Cleanup all registered prototypes.
Register a prototype.
If it is already registered this becomes a no-op.
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 |
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 |
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 |
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.
|
virtual |
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)" *
|
virtual |
Returns the list of supported file types with details on the corresponding readers and its supported patterns.
The two first values of this vector are Supported Type and All Files to simplify its use with the pqFileDialog. They do not have a name or group fields.
|
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 |
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.
|
virtual |
Every time a new proxy definition is added we check to see if it is a reader and then we add it to the list of available readers.
void vtkSMReaderFactory::AddGroup | ( | const char * | groupName | ) |
Add/remove a group name to look for readers in.
By default "source" is included.
void vtkSMReaderFactory::RemoveGroup | ( | const char * | groupName | ) |
Add/remove a group name to look for readers in.
By default "source" is included.
void vtkSMReaderFactory::GetGroups | ( | vtkStringList * | groups | ) |
Add/remove a group name to look for readers in.
By default "source" is included.
|
static |
This function is for ParaView based applications that only wish to expose a subset of the readers.
If this function is never called, the reader factory will expose all the readers as it has in the past. However, if any readers are specified by passing their group name and reader name to this function, then only those readers will be available in any reader factories created by the application. This is intended to be called at the beginning of the application's execution before any sessions are created.
|
protected |
|
staticprotected |
Returns true if the fname refers to a directory or a link to a directory.
|
protectedvirtual |
|
protectedvirtual |
|
static |
Description of the file type used for all supported types.
Definition at line 187 of file vtkSMReaderFactory.h.
|
static |
Description of the file type used for all files.
Definition at line 192 of file vtkSMReaderFactory.h.
|
protected |
Definition at line 208 of file vtkSMReaderFactory.h.
|
protected |
Definition at line 211 of file vtkSMReaderFactory.h.
|
protected |
Definition at line 212 of file vtkSMReaderFactory.h.