Uranium
Application Framework
Loading...
Searching...
No Matches
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

 __init__ (self, str writer_type, str reader_type, parent=None)
 
 setApplication (cls, application)
 
 getApplication (cls)
 
"FileHandler" getInstance (cls, *args, **kwargs)
 Return the singleton instance of the filehandler.
 
 supportedReadFileTypes (self)
 
 supportedWriteFileTypes (self)
 
 readLocalFile (self, file)
 
 getSupportedFileTypesWrite (self)
 Get list of all supported filetypes for writing.
 
 getSupportedFileTypesRead (self)
 
 addReader (self, "MeshReader" reader)
 
 addWriter (self, "MeshWriter" writer)
 
 readerRead (self, reader, file_name, **kwargs)
 
Optional["MeshWriter"] getWriterByMimeType (self, mime)
 Get a mesh writer object that supports writing the specified mime type.
 
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.
 

Public Attributes

 addWriter
 
 addReader
 

Protected Member Functions

 _readLocalFile (self, file)
 

Protected Attributes

 _readers
 
 _writers
 
 _writer_type
 
 _reader_type
 

Static Protected Attributes

 _instance = None
 
 _application = None
 

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

◆ 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()

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: