Class SBIFileImporter#
#include <SBIFileImporter.hpp>
Public Functions#
Type | Name |
---|---|
virtual bool | canImportFromFile (const std::string & fileName) Returns true when the file fileName can be imported using this importer. |
virtual std::string | getExtension () const Returns the extension, e.g. "pdb". |
virtual std::string | getFilter () const Returns the filter, e.g. "Protein Data Bank (*.pdb)" (Qt format) |
SBGFileImporter * | getPropertyDialog () const Returns the property dialog of the importer. |
virtual bool | importFromFile (const std::string & fileName, const std::unordered_map< std::string, SBValue > * parameters=nullptr, SBDDocumentFolder * preferredFolder=nullptr) = 0 Imports data from a file fileName into the folderpreferredFolder with the givenparameters . |
void | setPropertyDialog (SBGFileImporter * g) Sets the property dialog of the importer. |
virtual | ~SBIFileImporter () |
Protected Attributes#
Type | Name |
---|---|
SBGFileImporter * | propertyDialog |
Protected Functions#
Type | Name |
---|---|
SBIFileImporter () |
Detailed Description#
This class is the base class for importers
Short name: SBImporter
Public Functions Documentation#
function canImportFromFile#
Returns true when the file fileName
can be imported using this importer.
This function should return whether this importer can import data from the file fileName
.
This function is called before trying to import a file and is particularly useful if there are multiple importers each supporting different subsets of the format. If your importer supports only a subset of the format then you can check in this function whether the file corresponds to this format and return the result.
By default it returns true and doesn't check for the file's extension.
function getExtension#
Returns the extension, e.g. "pdb".
function getFilter#
Returns the filter, e.g. "Protein Data Bank (*.pdb)" (Qt format)
function getPropertyDialog#
Returns the property dialog of the importer.
function importFromFile#
Imports data from a file fileName
into the folderpreferredFolder
with the givenparameters
.
virtual bool SBIFileImporter::importFromFile (
const std::string & fileName,
const std::unordered_map< std::string, SBValue > * parameters=nullptr,
SBDDocumentFolder * preferredFolder=nullptr
) = 0
function setPropertyDialog#
Sets the property dialog of the importer.