-
Notifications
You must be signed in to change notification settings - Fork 2
/
icqsol_add_texture.xml
74 lines (71 loc) · 3.27 KB
/
icqsol_add_texture.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version='1.0' encoding='UTF-8'?>
<tool id="icqsol_add_texture" name="Add texture" version="@[email protected]">
<description>to shape</description>
<macros>
<import>icqsol_macros.xml</import>
</macros>
<expand macro="requirements" />
<command>
<![CDATA[
python $__tool_directory__/icqsol_add_texture.py
--input "$input"
--input_file_format_and_type $input.ext
--input_dataset_type $input.metadata.dataset_type
--input_texture "$input_texture"
--input_texture_file_format $input_texture.ext
#if $refine_shape_cond.refine_shape == "yes":
--max_edge_length $refine_shape_cond.max_edge_length
#end if
--output "$output"
--output_vtk_type $output_vtk_type
]]>
</command>
<inputs>
<param name="input" type="data" format="vtkascii,vtkbinary" label="Shape" help="Format can be vtkascii or vtkbinary." />
<param name="input_texture" type="data" format="jpg,png" label="Texture image" help="Format can be jpg or png." />
<conditional name="refine_shape_cond">
<param name="refine_shape" type="select" label="Refine shape?" help="Points will be added to the shape's edges restricting their length to the maximum.">
<option value="no" selected="True">No</option>
<option value="yes">Yes</option>
</param>
<when value="no" />
<when value="yes">
<param name="max_edge_length" type="float" value="0.1" label="Maximum edge length" help="Refine shape by restricting edges to this length.">
<validator type="in_range" min="0" exclude_min="true" />
</param>
</when>
</conditional>
<expand macro="output_vtk_type_params" />
</inputs>
<outputs>
<data name="output" format="vtkascii">
<actions>
<action type="format">
<option type="from_param" name="output_vtk_type" />
</action>
</actions>
</data>
</outputs>
<tests>
<test>
<param name="input" value="shaft.vtkascii" ftype="vtkascii" />
<param name="input_file_format_and_type" value="vtkascii" />
<param name="input_dataset_type" value="POLYDATA" />
<param name="input_texture" value="sandstone.jpg" />
<param name="refine_shape" value="yes" />
<param name="max_edge_length" value="0.1" />
<output name="output" file="shaft_with_texture.vtkascii" ftype="vtkascii" />
<param name="output_vtk_type" value="vtkascii" />
</test>
</tests>
<help>
**What it does**
Adds a texture by applying an image to the surface of a shape. The shape is projected onto a bounding box
and the color is selected by flattening the box to fit the image. Refinement can be applied for a smoother
result.
* **Shape** - Shape for applying a surface texture.
* **Maximum edge length** - The shape's edges are smoothed by adding points to its edges that are longer than the defined maximum length.
* **Texture image** - Image to be applied to the shape's surface to create the texture.
</help>
<expand macro="citations" />
</tool>