comparison icqsol_add_texture.py @ 7:fbef32d5ded0 draft

Uploaded
author greg
date Mon, 11 Jan 2016 09:27:04 -0500
parents 1371f6eeb73c
children
comparison
equal deleted inserted replaced
6:4670fbcc16d7 7:fbef32d5ded0
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')
20 19
21 input_format, input_file_type = icqsol_utils.get_format_and_type(args.input_file_format_and_type) 20 input_format, input_file_type = icqsol_utils.get_format_and_type(args.input_file_format_and_type)
22 tmp_dir = icqsol_utils.get_temp_dir() 21 tmp_dir = icqsol_utils.get_temp_dir()
23 22
24 # Instantiate a ShapeManager for loading the input. 23 # Instantiate a ShapeManager for loading the input.
25 if input_format == icqsol_utils.VTK: 24 shape_mgr = icqsol_utils.get_shape_manager(input_format, args.input_dataset_type)
26 shape_mgr = ShapeManager(file_format=input_format, vtk_dataset_type=args.input_dataset_type)
27 else:
28 shape_mgr = ShapeManager(file_format=input_format)
29 25
30 # Get the vtk polydata from the input dataset. 26 # Get the vtk polydata from the input dataset.
31 vtk_poly_data = shape_mgr.loadAsVtkPolyData(args.input) 27 vtk_poly_data = shape_mgr.loadAsVtkPolyData(args.input)
32 28
33 # Apply the texture to the shape's surface. 29 # Apply the texture to the shape's surface.