mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Removed unneeded application reference in construction of meshreaders
This commit is contained in:
parent
2b83af2497
commit
b4f59a7822
10 changed files with 23 additions and 19 deletions
|
@ -38,8 +38,8 @@ except ImportError:
|
|||
|
||||
## Base implementation for reading 3MF files. Has no support for textures. Only loads meshes!
|
||||
class ThreeMFReader(MeshReader):
|
||||
def __init__(self, application):
|
||||
super().__init__(application)
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
MimeTypeDatabase.addMimeType(
|
||||
MimeType(
|
||||
|
|
|
@ -18,7 +18,7 @@ catalog = i18nCatalog("cura")
|
|||
|
||||
|
||||
def getMetaData() -> Dict:
|
||||
# Workarround for osx not supporting double file extensions correctly.
|
||||
# Workaround for osx not supporting double file extensions correctly.
|
||||
if Platform.isOSX():
|
||||
workspace_extension = "3mf"
|
||||
else:
|
||||
|
@ -44,7 +44,7 @@ def getMetaData() -> Dict:
|
|||
|
||||
def register(app):
|
||||
if "3MFReader.ThreeMFReader" in sys.modules:
|
||||
return {"mesh_reader": ThreeMFReader.ThreeMFReader(app),
|
||||
return {"mesh_reader": ThreeMFReader.ThreeMFReader(),
|
||||
"workspace_reader": ThreeMFWorkspaceReader.ThreeMFWorkspaceReader()}
|
||||
else:
|
||||
return {}
|
||||
|
|
|
@ -11,9 +11,8 @@ from UM.PluginRegistry import PluginRegistry
|
|||
#
|
||||
# If you're zipping g-code, you might as well use gzip!
|
||||
class GCodeGzReader(MeshReader):
|
||||
|
||||
def __init__(self, application):
|
||||
super().__init__(application)
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self._supported_extensions = [".gcode.gz"]
|
||||
|
||||
def _read(self, file_name):
|
||||
|
|
|
@ -19,6 +19,7 @@ def getMetaData():
|
|||
]
|
||||
}
|
||||
|
||||
|
||||
def register(app):
|
||||
app.addNonSliceableExtension(".gz")
|
||||
return { "mesh_reader": GCodeGzReader.GCodeGzReader(app) }
|
||||
return {"mesh_reader": GCodeGzReader.GCodeGzReader()}
|
||||
|
|
|
@ -19,16 +19,16 @@ MimeTypeDatabase.addMimeType(
|
|||
)
|
||||
)
|
||||
|
||||
|
||||
# Class for loading and parsing G-code files
|
||||
class GCodeReader(MeshReader):
|
||||
|
||||
_flavor_default = "Marlin"
|
||||
_flavor_keyword = ";FLAVOR:"
|
||||
_flavor_readers_dict = {"RepRap" : RepRapFlavorParser.RepRapFlavorParser(),
|
||||
"Marlin" : MarlinFlavorParser.MarlinFlavorParser()}
|
||||
|
||||
def __init__(self, application):
|
||||
super(GCodeReader, self).__init__(application)
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self._supported_extensions = [".gcode", ".g"]
|
||||
self._flavor_reader = None
|
||||
|
||||
|
|
|
@ -20,7 +20,8 @@ def getMetaData():
|
|||
]
|
||||
}
|
||||
|
||||
|
||||
def register(app):
|
||||
app.addNonSliceableExtension(".gcode")
|
||||
app.addNonSliceableExtension(".g")
|
||||
return { "mesh_reader": GCodeReader.GCodeReader(app) }
|
||||
return {"mesh_reader": GCodeReader.GCodeReader()}
|
||||
|
|
|
@ -17,8 +17,8 @@ from cura.Scene.CuraSceneNode import CuraSceneNode as SceneNode
|
|||
|
||||
|
||||
class ImageReader(MeshReader):
|
||||
def __init__(self, application):
|
||||
super(ImageReader, self).__init__(application)
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self._supported_extensions = [".jpg", ".jpeg", ".bmp", ".gif", ".png"]
|
||||
self._ui = ImageReaderUI(self)
|
||||
|
||||
|
|
|
@ -32,5 +32,6 @@ def getMetaData():
|
|||
]
|
||||
}
|
||||
|
||||
|
||||
def register(app):
|
||||
return { "mesh_reader": ImageReader.ImageReader(app) }
|
||||
return {"mesh_reader": ImageReader.ImageReader()}
|
||||
|
|
|
@ -26,8 +26,8 @@ except ImportError:
|
|||
DEFAULT_SUBDIV = 16 # Default subdivision factor for spheres, cones, and cylinders
|
||||
EPSILON = 0.000001
|
||||
|
||||
class Shape:
|
||||
|
||||
class Shape:
|
||||
# Expects verts in MeshBuilder-ready format, as a n by 3 mdarray
|
||||
# with vertices stored in rows
|
||||
def __init__(self, verts, faces, index_base, name):
|
||||
|
@ -37,9 +37,10 @@ class Shape:
|
|||
self.index_base = index_base
|
||||
self.name = name
|
||||
|
||||
|
||||
class X3DReader(MeshReader):
|
||||
def __init__(self, application):
|
||||
super().__init__(application)
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self._supported_extensions = [".x3d"]
|
||||
self._namespaces = {}
|
||||
|
||||
|
|
|
@ -15,5 +15,6 @@ def getMetaData():
|
|||
]
|
||||
}
|
||||
|
||||
|
||||
def register(app):
|
||||
return { "mesh_reader": X3DReader.X3DReader(app) }
|
||||
return {"mesh_reader": X3DReader.X3DReader()}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue