def contour( num, min, max, options={} )
opacity = false
axes = false
options.each{ |key, val|
case key
when 'opacity'
opacity = val
when 'axes'
axes = val
else
raise "option (#{key}) is invalid"
end
}
contour = Vtk::ContourFilter.new
contour.SetInput( @grid )
contour.GenerateValues( num, min, max )
normals = Vtk::PolyDataNormals.new
normals.SetInput( contour.GetOutput )
mapper = Vtk::PolyDataMapper.new
mapper.SetInput( normals.GetOutput )
mapper.SetScalarRange( min, max )
if @lookupTable
mapper.SetLookupTable( @lookupTable )
else
@lookupTable = mapper.GetLookupTable
end
actor = Vtk::Actor.new
actor.SetMapper( mapper )
actor.GetProperty.SetOpacity( options['opacity'] ) if opacity
@ren.AddActor( actor )
draw_axes( contour, axes ) if axes
return nil
end