VTK
dox/Common/vtkArrayInterpolate.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkArrayInterpolate.h
00005 
00006 -------------------------------------------------------------------------
00007   Copyright 2008 Sandia Corporation.
00008   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00009   the U.S. Government retains certain rights in this software.
00010 -------------------------------------------------------------------------
00011 
00012   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00013   All rights reserved.
00014   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00015 
00016      This software is distributed WITHOUT ANY WARRANTY; without even
00017      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00018      PURPOSE.  See the above copyright notice for more information.
00019 
00020 =========================================================================*/
00021 
00022 // .SECTION Thanks
00023 // Developed by Timothy M. Shead (tshead@sandia.gov) at Sandia National
00024 // Laboratories.
00025 
00026 #ifndef __vtkArrayInterpolate_h
00027 #define __vtkArrayInterpolate_h
00028 
00029 #include "vtkTypedArray.h"
00030 
00031 class vtkArrayExtents;
00032 class vtkArraySlices;
00033 class vtkArrayWeights;
00034 
00035 // Description:
00036 // Computes the weighted sum of a collection of slices from a source
00037 // array, and stores the results in a slice of a target array.  Note that
00038 // the number of source slices and weights must match, and the extents of
00039 // each source slice must match the extents of the target slice.
00040 //
00041 // Note: The implementation assumes that operator*(T, double) is defined,
00042 // and that there is an implicit conversion from its result back to T.
00043 //
00044 // If you need to interpolate arrays of T other than double, you will
00045 // likely want to create your own specialization of this function.
00046 //
00047 // The implementation should produce correct results for dense and sparse
00048 // arrays, but may perform poorly on sparse.
00049 
00050 template<typename T>
00051 void vtkInterpolate(
00052   vtkTypedArray<T>* source_array,
00053   const vtkArraySlices& source_slices,
00054   const vtkArrayWeights& source_weights,
00055   const vtkArrayExtents& target_slice,
00056   vtkTypedArray<T>* target_array);
00057 
00058 #include "vtkArrayInterpolate.txx"
00059 
00060 #endif
00061