# HG changeset patch # User greg # Date 1449329474 18000 # Node ID 415160ef2f85dbc34813469d14a60e884926843e # Parent b18f4c1c852d3afe3bcfb6d27fa715a5515321cd Uploaded diff -r b18f4c1c852d -r 415160ef2f85 icqsol_translate_shape.py --- a/icqsol_translate_shape.py Sat Dec 05 10:31:03 2015 -0500 +++ b/icqsol_translate_shape.py Sat Dec 05 10:31:14 2015 -0500 @@ -23,7 +23,7 @@ tmp_dir = icqsol_utils.get_temp_dir() # Instantiate a ShapeManager for loading the input. -if input_format == 'vtk': +if input_format == icqsol_utils.VTK: shape_mgr = ShapeManager(file_format=input_format, vtk_dataset_type=args.input_dataset_type) else: shape_mgr = ShapeManager(file_format=input_format) @@ -35,8 +35,9 @@ displ = (args.displacement_x, args.displacement_y, args.displacement_z) shape_mgr.translateVtkPolyData(vtk_poly_data, displ=displ) +# Save the output. output_format, output_file_type = icqsol_utils.get_format_and_type(args.output_vtk_type) tmp_dir = icqsol_utils.get_temp_dir() -tmp_output_path = icqsol_utils.get_temporary_file_path(tmp_dir, 'vtk') +tmp_output_path = icqsol_utils.get_temporary_file_path(tmp_dir, icqsol_utils.VTK) shape_mgr.saveVtkPolyData(vtk_poly_data, file_name=tmp_output_path, file_type=output_file_type) shutil.move(tmp_output_path, args.output)