Mercurial > repos > greg > icqsol_refine_shape
comparison icqsol_refine_shape.py @ 12:6af995a34aa4 draft
Uploaded
| author | greg |
|---|---|
| date | Mon, 11 Jan 2016 09:13:01 -0500 |
| parents | abb58cabca82 |
| children |
comparison
equal
deleted
inserted
replaced
| 11:7d3136d9d70a | 12:6af995a34aa4 |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 import argparse | 2 import argparse |
| 3 import shutil | 3 import shutil |
| 4 | 4 |
| 5 import icqsol_utils | 5 import icqsol_utils |
| 6 from icqsol.shapes.icqShapeManager import ShapeManager | |
| 7 | 6 |
| 8 # Parse Command Line. | 7 # Parse Command Line. |
| 9 parser = argparse.ArgumentParser() | 8 parser = argparse.ArgumentParser() |
| 10 parser.add_argument('--input', dest='input', help='Shape dataset selected from history') | 9 parser.add_argument('--input', dest='input', help='Shape dataset selected from history') |
| 11 parser.add_argument('--input_file_format_and_type', dest='input_file_format_and_type', help='Input file format and type') | 10 parser.add_argument('--input_file_format_and_type', dest='input_file_format_and_type', help='Input file format and type') |
| 18 | 17 |
| 19 input_format, input_file_type = icqsol_utils.get_format_and_type(args.input_file_format_and_type) | 18 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() | 19 tmp_dir = icqsol_utils.get_temp_dir() |
| 21 | 20 |
| 22 # Instantiate a ShapeManager for loading the input. | 21 # Instantiate a ShapeManager for loading the input. |
| 23 if input_format == icqsol_utils.VTK: | 22 shape_mgr = icqsol_utils.get_shape_manager(input_format, args.input_dataset_type) |
| 24 shape_mgr = ShapeManager(file_format=input_format, vtk_dataset_type=args.input_dataset_type) | |
| 25 else: | |
| 26 shape_mgr = ShapeManager(file_format=input_format) | |
| 27 | 23 |
| 28 # Get the vtk polydata from the input dataset. | 24 # Get the vtk polydata from the input dataset. |
| 29 vtk_poly_data = shape_mgr.loadAsVtkPolyData(args.input) | 25 vtk_poly_data = shape_mgr.loadAsVtkPolyData(args.input) |
| 30 | 26 |
| 31 # Refine the shape if requested. | 27 # Refine the shape if requested. |
