view icqsol_add_texture.xml @ 2:eb0b9337e095 draft

Uploaded
author greg
date Sat, 12 Dec 2015 11:14:07 -0500
parents 0a94307d301c
children 34af65e1e8bf
line wrap: on
line source

<?xml version='1.0' encoding='UTF-8'?>
<tool id="icqsol_add_texture" name="Add texture" version="@WRAPPER_VERSION@.0">
    <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" label="Maximum edge length" help="Refine shape by restricting edges to this length (zero value results in no refinement).">
                    <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" ftype="jpg" />
            <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>