<br><br><div class="gmail_quote">On Mon, Oct 12, 2009 at 7:50 PM, Andrew Maclean <span dir="ltr">&lt;<a href="mailto:andrew.amaclean@gmail.com">andrew.amaclean@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Could this script with appropriate modifications also be added to VTK?<br>
It strikes me as useful.<br></blockquote><div><br><br>Sure, that&#39;s just a change to the search paths (and a slight hack with &#39;find&#39; to get all the files, which might be a better solution in the itk version too; see the script details below).  Note that the file attribute on the script file is executable and I keep the script below in ${HOME}/bin/vtkSearchExamples.bash<br>
<br>This is an example run on my system (the script attached is suited to my install paths):<br><br><span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">$ vtkSearchExamples.bash &#39;vtkIdentityTransform&#39; &#39;vtkImageClip&#39;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Search term: vtkIdentityTransform</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Searching VTK files in: /opt/local/share/vtk/examples</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Searching VTK files in: /opt/local/share/vtk/testing</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/opt/local/share/vtk/testing/Graphics/Testing/Tcl/TransformPolyData.tcl</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Search term: vtkImageClip</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Searching VTK files in: /opt/local/share/vtk/examples</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/opt/local/share/vtk/examples/ImageProcessing/Tcl/HistogramWidget.tcl</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Searching VTK files in: /opt/local/share/vtk/testing</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/opt/local/share/vtk/testing/VolumeRendering/Testing/Cxx/TestMinIntensityRendering.cxx</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/opt/local/share/vtk/testing/Graphics/Testing/Tcl/contour2DAll.tcl</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/opt/local/share/vtk/testing/Graphics/Testing/Tcl/contour3DAll.tcl</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/opt/local/share/vtk/testing/Graphics/Testing/Tcl/imageMCAll.tcl</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/opt/local/share/vtk/testing/Graphics/Testing/Tcl/sync3dAll.tcl</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/opt/local/share/vtk/testing/Graphics/Testing/Tcl/testDataSetTriangleFilter.tcl</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/opt/local/share/vtk/testing/Imaging/Testing/Tcl/TestAccumulate.tcl</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/opt/local/share/vtk/testing/Imaging/Testing/Tcl/TestGradientMagnitude2.tcl</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/opt/local/share/vtk/testing/Imaging/Testing/Tcl/TestSkeleton2D.tcl</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/opt/local/share/vtk/testing/Parallel/Testing/Tcl/TestBranchExtentTranslator.tcl</span><br style="font-family: courier new,monospace;">
<br><br><br></div></div>#######BEGIN SCRIPT<br><span style="font-family: courier new,monospace;">#!/bin/bash</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">if [ $# -lt 1 ]; then</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    echo &quot;$0 &#39;search term&#39; [&#39;search term&#39; ...]&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    exit 1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">fi</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">vtkExamplePath=&quot;/opt/local/share/vtk/examples&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">vtkTestingPath=&quot;/opt/local/share/vtk/testing&quot;</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">for term in $@; do</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    echo</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    echo &quot;Search term: ${term}&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    for vtkPath in &quot;${vtkExamplePath}&quot; &quot;${vtkTestingPath}&quot; ; do</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        if [ ! -d ${vtkPath} ]; then</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">            echo &quot;Path not found: ${vtkPath}&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        fi</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        echo &quot;Searching VTK files in: ${vtkPath}&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        cxxFiles=$(find ${vtkPath} -name &quot;*.cxx&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        grep -l -E -e ${term} ${cxxFiles}</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        tclFiles=$(find ${vtkPath} -name &quot;*.tcl&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        grep -l -E -e ${term} ${tclFiles}</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        pyFiles=$(find ${vtkPath} -name &quot;*.py&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        grep -l -E -e ${term} ${pyFiles}</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    done</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">done</span><br>#######END SCRIPT<br>
<br><br>Again, feel free to incorporate this into the VTK cvs, with suitable open-source license that&#39;s compatible with vtk.<br><br>Take care,<br>Darren<br><br><br>