[vtkusers] Bug in vtkMaskFields ?

Roman Putanowicz putanowr at twins.pk.edu.pl
Tue Apr 6 03:12:50 EDT 2004


Hi, 

Being suspicious I checked for the same sort of comment which was
in vtkAssignAttribute (before it was fixed in CVS)

$ grep -r "data object's field data is passed by" .
./Graphics/vtkAssignAttribute.cxx:  // Pass all. (data object's field
data is passed by the
./Graphics/vtkMaskFields.cxx:  // Pass all. (data object's field data is
passed by the
./Graphics/vtkMergeFields.cxx:  // Pass all. (data object's field data
is passed by the
./Graphics/vtkRearrangeFields.cxx:  // Pass all. (data object's field
data is passed by the
./Graphics/vtkSplitField.cxx:  // Pass all. (data object's field data is
passed by the
./Parallel/vtkPassThroughFilter.cxx:  // Pass all. (data object's field
data is passed by the


Then I have checked the filter vtkMaskFields and vtkPassThroughFilter
(script and data in attachement).

Without any filter the pipeline output contains the following arrays:

Field data
  force 
  accel 
Point data
  velocity 
  meantemp 
Cell data
  density 
          

Inserting the vtkMaskFields and calling the method CopyAllOn()
(which as I understand copies all arrays unless the array has do
not copy flag set) changes the output to

Field data
Point data
  velocity 
  meantemp 
Cell data
  density 
      
Inserting vtkPassThroughFilter causes the output to contain no arrays.

Because this is very systematic and affect more than one class
either I do something stupid (like not setting some flags)
or this is the reincarnation of the same bug.

Any enlightenment will be greatly appreciated :-).

Regards

Romek
-------------- next part --------------
# 
import vtkpython

ureader = vtkpython.vtkUnstructuredGridReader()
ureader.SetFileName('assign_ugrid.vtk')
ureader.Update()

selector = vtkpython.vtkMaskFields()
selector.SetInput(ureader.GetOutput())
selector.CopyAllOn()
selector.Update()

passthrough = vtkpython.vtkPassThroughFilter()
passthrough.SetInput(ureader.GetOutput())

# To see the effect of vtkMaskFields or vtkPassThroughFilter uncoment 
# the appropriate line below
ugrid = selector.GetUnstructuredGridOutput()
#ugrid = passthrough.GetOutput()
#ugrid = ureader.GetOutput()

fielddata = ugrid.GetFieldData()

print "Field data"
for i in range(fielddata.GetNumberOfArrays()):
    print "  %s "% fielddata.GetArrayName(i)

pointdata = ugrid.GetPointData()
print "Point data"
for i in range(pointdata.GetNumberOfArrays()):
    print "  %s "% pointdata.GetArrayName(i)

celldata = ugrid.GetCellData()
print "Cell data"
for i in range(celldata.GetNumberOfArrays()):
    print "  %s "% celldata.GetArrayName(i)
-------------- next part --------------
# vtk DataFile Version 3.0
2D scalar data
ASCII
           
DATASET UNSTRUCTURED_GRID
POINTS 4 float 
0 0 0 
1 0 0
1 1 0
0 1 0

CELLS 2 8 
3 0 1 2
3 0 2 3

CELL_TYPES 2
5 5

FIELD pvec 2
force 2 4 float
1.0 0.0
1.0 1.0
1.0 1.0
1.0 0.0

accel 2 4 float
0.5 1.0
1.0 0.0
1.0 0.5
0.5 1.5

POINT_DATA 4
VECTORS velocity float 
 1.0  0.0  0.0
 1.0  0.5  0.0
 0.0  1.0  0.0
-0.5  1.0  0.0

VECTORS displacement float 
0.0 0.0 0.0
1.0 0.0 0.5
1.0 1.0 1.0
0.0 1.0 0.2

SCALARS meantemp float 1
LOOKUP_TABLE default
1.0 5.0 6.0 2.0

CELL_DATA 2
SCALARS density float 1
LOOKUP_TABLE default
2  1 

SCALARS resistance float 2
LOOKUP_TABLE default
1 2
3 4


More information about the vtkusers mailing list