comparison icqsol_scale_shape.py @ 4:89216e1c25b8 draft

Uploaded
author greg
date Mon, 11 Jan 2016 09:21:47 -0500
parents c8b87f2bb2e8
children
comparison
equal deleted inserted replaced
3:22bb80483a8d 4:89216e1c25b8
2 import argparse 2 import argparse
3 import shutil 3 import shutil
4 import operator 4 import operator
5 5
6 import icqsol_utils 6 import icqsol_utils
7 from icqsol.shapes.icqShapeManager import ShapeManager
8 7
9 # Parse Command Line. 8 # Parse Command Line.
10 parser = argparse.ArgumentParser() 9 parser = argparse.ArgumentParser()
11 parser.add_argument('--input', dest='input', help='Shape dataset selected from history') 10 parser.add_argument('--input', dest='input', help='Shape dataset selected from history')
12 parser.add_argument('--input_file_format_and_type', dest='input_file_format_and_type', help='Input file format and type') 11 parser.add_argument('--input_file_format_and_type', dest='input_file_format_and_type', help='Input file format and type')
22 # Get the format of the input - either vtk or ply. 21 # Get the format of the input - either vtk or ply.
23 input_format, input_file_type = icqsol_utils.get_format_and_type(args.input_file_format_and_type) 22 input_format, input_file_type = icqsol_utils.get_format_and_type(args.input_file_format_and_type)
24 tmp_dir = icqsol_utils.get_temp_dir() 23 tmp_dir = icqsol_utils.get_temp_dir()
25 24
26 # Instantiate a ShapeManager for loading the input. 25 # Instantiate a ShapeManager for loading the input.
27 if input_format == icqsol_utils.VTK: 26 shape_mgr = icqsol_utils.get_shape_manager(input_format, args.input_dataset_type)
28 shape_mgr = ShapeManager(file_format=input_format, vtk_dataset_type=args.input_dataset_type)
29 else:
30 shape_mgr = ShapeManager(file_format=input_format)
31 27
32 # Get the vtk polydata from the input dataset. 28 # Get the vtk polydata from the input dataset.
33 vtk_poly_data = shape_mgr.loadAsVtkPolyData(args.input) 29 vtk_poly_data = shape_mgr.loadAsVtkPolyData(args.input)
34 30
35 # Scale (in place operation). 31 # Scale (in place operation).