Mercurial > repos > greg > icqsol_refine_shape
comparison icqsol_refine_shape.py @ 6:918771601157 draft
Uploaded
author | greg |
---|---|
date | Sat, 05 Dec 2015 10:29:25 -0500 |
parents | da0ef88d5af2 |
children | abb58cabca82 |
comparison
equal
deleted
inserted
replaced
5:b2ded1c154a8 | 6:918771601157 |
---|---|
18 | 18 |
19 input_format, input_file_type = icqsol_utils.get_format_and_type(args.input_file_format_and_type) | 19 input_format, input_file_type = icqsol_utils.get_format_and_type(args.input_file_format_and_type) |
20 tmp_dir = icqsol_utils.get_temp_dir() | 20 tmp_dir = icqsol_utils.get_temp_dir() |
21 | 21 |
22 # Instantiate a ShapeManager for loading the input. | 22 # Instantiate a ShapeManager for loading the input. |
23 if input_format == 'vtk': | 23 if input_format == icqsol_utils.VTK: |
24 shape_mgr = ShapeManager(file_format=input_format, vtk_dataset_type=args.input_dataset_type) | 24 shape_mgr = ShapeManager(file_format=input_format, vtk_dataset_type=args.input_dataset_type) |
25 else: | 25 else: |
26 shape_mgr = ShapeManager(file_format=input_format) | 26 shape_mgr = ShapeManager(file_format=input_format) |
27 | 27 |
28 # Get the vtk polydata from the input dataset. | 28 # Get the vtk polydata from the input dataset. |
34 # Define the output file format and type (the output_format can only be 'vtk'). | 34 # Define the output file format and type (the output_format can only be 'vtk'). |
35 output_format, output_file_type = icqsol_utils.get_format_and_type(args.output_vtk_type) | 35 output_format, output_file_type = icqsol_utils.get_format_and_type(args.output_vtk_type) |
36 tmp_output_path = icqsol_utils.get_temporary_file_path(tmp_dir, output_format) | 36 tmp_output_path = icqsol_utils.get_temporary_file_path(tmp_dir, output_format) |
37 | 37 |
38 # Make sure the ShapeManager's writer is vtk. | 38 # Make sure the ShapeManager's writer is vtk. |
39 shape_mgr.setWriter(file_format='vtk', vtk_dataset_type=icqsol_utils.POLYDATA) | 39 shape_mgr.setWriter(file_format=icqsol_utils.VTK, vtk_dataset_type=icqsol_utils.POLYDATA) |
40 | 40 |
41 # Save the output. | 41 # Save the output. |
42 shape_mgr.saveVtkPolyData(vtk_poly_data=vtk_poly_data, file_name=tmp_output_path, file_type=output_file_type) | 42 shape_mgr.saveVtkPolyData(vtk_poly_data=vtk_poly_data, file_name=tmp_output_path, file_type=output_file_type) |
43 shutil.move(tmp_output_path, args.output) | 43 shutil.move(tmp_output_path, args.output) |