Uranium
Application Framework
UM.FileHandler.FileHandler.FileHandler Class Reference

Central class for reading and writing meshes. More...

Inheritance diagram for UM.FileHandler.FileHandler.FileHandler:
UM.Mesh.MeshFileHandler.MeshFileHandler UM.Workspace.WorkspaceFileHandler.WorkspaceFileHandler

Public Member Functions

def __init__ (self, str writer_type, str reader_type, parent=None)
 
def setApplication (cls, application)
 
def getApplication (cls)
 
"FileHandler" getInstance (cls, *args, **kwargs)
 Return the singleton instance of the filehandler. More...
 
def supportedReadFileTypes (self)
 
def supportedWriteFileTypes (self)
 
def readLocalFile (self, file)
 
def getSupportedFileTypesWrite (self)
 Get list of all supported filetypes for writing. More...
 
def getSupportedFileTypesRead (self)
 
def addReader (self, "MeshReader" reader)
 
def addWriter (self, "MeshWriter" writer)
 
def readerRead (self, reader, file_name, **kwargs)
 
Optional["MeshWriter"] getWriterByMimeType (self, mime)
 Get a mesh writer object that supports writing the specified mime type. More...
 
Optional["MeshWriter"] getWriter (self, writer_id)
 Get an instance of a mesh writer by ID.
 
Optional["MeshReader"] getReaderForFile (self, file_name)
 Find a Reader that accepts the given file name. More...
 

Static Public Attributes

 constant
 

Detailed Description

Central class for reading and writing meshes.

This class is created by Application and handles reading and writing mesh files.

Member Function Documentation

◆ getInstance()

"FileHandler" UM.FileHandler.FileHandler.FileHandler.getInstance (   cls,
args,
**  kwargs 
)

Return the singleton instance of the filehandler.

◆ getReaderForFile()

Optional["MeshReader"] UM.FileHandler.FileHandler.FileHandler.getReaderForFile (   self,
  file_name 
)

Find a Reader that accepts the given file name.

Parameters
file_nameThe name of file to load.
Returns
Reader that accepts the given file name. If no acceptable Reader is found None is returned.

◆ getSupportedFileTypesWrite()

def UM.FileHandler.FileHandler.FileHandler.getSupportedFileTypesWrite (   self)

Get list of all supported filetypes for writing.

Returns
List of dicts containing id, extension, description and mime_type for all supported file types.

◆ getWriterByMimeType()

Optional["MeshWriter"] UM.FileHandler.FileHandler.FileHandler.getWriterByMimeType (   self,
  mime 
)

Get a mesh writer object that supports writing the specified mime type.

Parameters
mimeThe mime type that should be supported.
Returns
A MeshWriter instance or None if no mesh writer supports the specified mime type. If there are multiple writers that support the specified mime type, the first entry is returned.

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