comparison icqsol_rotate_shape.py @ 6:59f7e97dc5bf draft

Uploaded
author greg
date Mon, 11 Jan 2016 09:16:26 -0500
parents 9767d2d8505e
children
comparison
equal deleted inserted replaced
5:25a8989c8d74 6:59f7e97dc5bf
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')
23 # Get the format of the input - either vtk or ply. 22 # Get the format of the input - either vtk or ply.
24 input_format, input_file_type = icqsol_utils.get_format_and_type(args.input_file_format_and_type) 23 input_format, input_file_type = icqsol_utils.get_format_and_type(args.input_file_format_and_type)
25 tmp_dir = icqsol_utils.get_temp_dir() 24 tmp_dir = icqsol_utils.get_temp_dir()
26 25
27 # Instantiate a ShapeManager for loading the input. 26 # Instantiate a ShapeManager for loading the input.
28 if input_format == icqsol_utils.VTK: 27 shape_mgr = icqsol_utils.get_shape_manager(input_format, args.input_dataset_type)
29 shape_mgr = ShapeManager(file_format=input_format, vtk_dataset_type=args.input_dataset_type)
30 else:
31 shape_mgr = ShapeManager(file_format=input_format)
32 28
33 # Get the vtk polydata from the input dataset. 29 # Get the vtk polydata from the input dataset.
34 vtk_poly_data = shape_mgr.loadAsVtkPolyData(args.input) 30 vtk_poly_data = shape_mgr.loadAsVtkPolyData(args.input)
35 31
36 # Only rotate if the axis has some non-zero coordinates. 32 # Only rotate if the axis has some non-zero coordinates.