[Paraview] vtkBandedPolyDataContourFilter

Jean M. Favre jfavre at cscs.ch
Thu, 11 Mar 2004 13:55:49 +0100


This is a multi-part message in MIME format.
--------------020402040503040807050006
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Patrick Brockmann wrote:

> * Is there a way to make isofilled countours ?
> I use the vtkBandedPolyDataContourFilter for this when I compute with 
> the VTK API
> but it is not available in paraview ?

Here is my solution. Writing the XML was not big deal. In fact, it is 
very similar to the Contour GUI panel. So I started from that, and added 
the options specific to BandedContour. The real difficulty was to 
understand why it did not allow selection of the cell-data in the 
Display->"Color by" option. This is due to a current limitation of the 
vtkBandedPolyDataContourFilter.cxx

The filter does not name the FloatArray used to store the new cell 
scalars. No name, means no display for ParaView. :-(

I added a name on line 292 of the source code, recompiled and it worked 
fine. Please note that I am working with the nightly CVS versions of VTK 
and ParaView.

One more thing: If GenerateContourEdges is OFF, everything works and you 
get cell-based coloring. If it is ON, then ParaView has mixed outputs 
and cannot generate the coloring. You need to use two ExtractParts, one 
to extract the first output and use cell-based display of the bands. The 
second one to extract the contour lines.

Note finally that the iso-contour lines have no scalars associated with 
them, thus a uniform color.

That's the most complete solution I could find.

I trust the VTK developpers will make that correction to 
vtkBandedPolyDataContourFilter.cxx

Cheers
-- 
Dr. Jean M. Favre,                            email:favre  at  cscs.ch
http://www.cscs.ch/people/Favre.html
CSCS, Swiss Center for Scientific Computing | Tel:  +41 (91) 610.82.40
Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82

--------------020402040503040807050006
Content-Type: text/xml;
 name="Filters.xml"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="Filters.xml"

<ModuleInterfaces>
  <Module name="BandedPolyDataContour"
          root_name="BandedContour"
          module_type="Filter"
          replace_input="0"
          long_help="Filled contours are bands of cells that all have the same cell scalar value, and can therefore be colored the same."
          short_help="Produces filled contours.">
    <Filter class="vtkBandedPolyDataContourFilter">
      <Input name="Input"
             class="vtkPolyData">
        <ArrayRequirement attribute="Point" components="1"/>
      </Input>
    </Filter>

    // Do not change the tracename of the input menu, it is used by vtkPVContour
    <InputMenu trace_name="Input"
               id="im"
               label="Input"
               input_name="Input"
               help="Set the input to this filter." />
    // Do not change the tracename of the array menu, it is used by vtkPVContour
    <ArrayMenu id="am"
               input_name="Input"
               attribute_type="Scalars"
               label="Scalars"
               trace_name="Scalars"
               input_menu="im"
               number_of_components="1"
               help="Choose which scalar array you want to contour."/>
    <ScalarRangeLabel id="srl"
                      trace_name="ScalarRangeLabel"
                      array_menu="am"/>
    <ContourEntry label="Contour Values"
                  trace_name="Contour Values"
                  array_menu="am"
                  set_number_command="SetNumberOfContours"
                  set_contour_command="SetValue"
                  help="List of current contour values." />
    <LabeledToggle label="Set Clipping"
                   variable="Clipping"
                   default_value="0"
                   trace_name="Set Clipping"
                   help="Select whether to clip outside the range specified by the user" />
    <LabeledToggle label="Generate Contour Edges"
                   variable="GenerateContourEdges"
                   default_value="0"
                   trace_name="Set Generate Contour Edges"
                   help="Select whether to compute contour edges"/>

    <SelectionList variable="ScalarMode"
                   trace_name="Set Scalar Mode"
                   label="Scalar Mode"
                   option_width="15"
                   help="Select whether the cell scalars are output as an integer index or a scalar value"
                   default_value="0">
          <Item name="Index"
                value="0"/>
          <Item name="Value"
                value="1"/>
        </SelectionList>
    <Documentation>
    </Documentation>
  </Module>
</ModuleInterfaces>

--------------020402040503040807050006--