From 9ced0a4704a63779ef298266dad69306265feea8 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Mon, 27 Mar 2017 16:19:54 -0300 Subject: [PATCH] Reading obj mesh files --- invesalius/data/surface.py | 4 +++- invesalius/gui/dialogs.py | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/invesalius/data/surface.py b/invesalius/data/surface.py index 53e2457..155a107 100644 --- a/invesalius/data/surface.py +++ b/invesalius/data/surface.py @@ -245,7 +245,7 @@ class SurfaceManager(): def OnImportSurfaceFile(self, pubsub_evt): """ - Creates a new surface from a surface file (STL, PLY or VTP) + Creates a new surface from a surface file (STL, PLY, OBJ or VTP) """ filename = pubsub_evt.data self.CreateSurfaceFromFile(filename) @@ -255,6 +255,8 @@ class SurfaceManager(): reader = vtk.vtkSTLReader() elif filename.lower().endswith('.ply'): reader = vtk.vtkPLYReader() + elif filename.lower().endswith('.obj'): + reader = vtk.vtkOBJReader() elif filename.lower().endswith('.vtp'): reader = vtk.vtkXMLPolyDataReader() else: diff --git a/invesalius/gui/dialogs.py b/invesalius/gui/dialogs.py index 4ae1ba2..ac750ae 100644 --- a/invesalius/gui/dialogs.py +++ b/invesalius/gui/dialogs.py @@ -223,9 +223,10 @@ WILDCARD_NIFTI = "NIfTI 1 (*.nii)|*.nii|" \ WILDCARD_PARREC = "PAR/REC (*.par)|*.par|" \ "All files (*.*)|*.*" -WILDCARD_MESH_FILES = "STL (*.stl)|*.stl|" \ - "PLY (*.ply)|*.ply|" \ - "VTP (*.vtp)|*.vtp|" \ +WILDCARD_MESH_FILES = "STL File format (*.stl)|*.stl|" \ + "Standard Polygon File Format (*.ply)|*.ply|" \ + "Alias Wavefront Object (*.obj)|*.obj|" \ + "VTK Polydata File Format (*.vtp)|*.vtp|" \ "All files (*.*)|*.*" -- libgit2 0.21.2