[vtkusers] Changes to active components

David Gobbi dgobbi at irus.rri.ca
Thu Jul 5 11:09:56 EDT 2001


On Thu, 5 Jul 2001, Berk Geveci wrote:

> I have been changing VTK by replacing vtkAttributeData and it's
> sub-classes with vtkDataArray and it's sub-classes
<snip>
> As part of this effort, I am moving the functionality that exist in the
> attributes to other classes. One of these is the active component in
> vtkScalars. I believe that the active component introduces complexity
> not justified by it's advantages.

I agree wholeheartedly.  People should not be tempted to call a
method that modifies the scalars just to extract data from a different
component.  It can mess up pipeline execution and isn't thread-safe.

> Furthermore, there are filters which
> do not support it, making things even more confusing. Therefore, I am
> not going to keep the active scalars. I am changing the filters to work
> on the first component of the scalars.

For some of the filters, a method could be added to allow the user to
specify which component the filter acts on.  All that's involved is
incrementing the scalar pointer before using it.  For most filters,
though, people are very unlikely to use multi-component scalars so
defaulting to the first component makes sense.

 - David

> It will be necessary to use
> vtkFieldDataToAttributeDataFilter or a similar filter (I am planning to
> write one with a simpler interface designed to extract components) in
> order
> to process anything but the first component in the scalars. These
> changes
> will effect the cvs tree, nightlies and VTK 4.0 (I already changed some
> of the filters and so far nothing broke).





More information about the vtkusers mailing list