VTK
vtkArrayInterpolate.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkArrayInterpolate.h
5 
6 -------------------------------------------------------------------------
7  Copyright 2008 Sandia Corporation.
8  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9  the U.S. Government retains certain rights in this software.
10 -------------------------------------------------------------------------
11 
12  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13  All rights reserved.
14  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
15 
16  This software is distributed WITHOUT ANY WARRANTY; without even
17  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18  PURPOSE. See the above copyright notice for more information.
19 
20 =========================================================================*/
21 
22 // .SECTION Thanks
23 // Developed by Timothy M. Shead (tshead@sandia.gov) at Sandia National
24 // Laboratories.
25 
26 #ifndef __vtkArrayInterpolate_h
27 #define __vtkArrayInterpolate_h
28 
29 #include "vtkTypedArray.h"
30 
31 class vtkArrayExtents;
32 class vtkArraySlices;
33 class vtkArrayWeights;
34 
35 // Description:
36 // Computes the weighted sum of a collection of slices from a source
37 // array, and stores the results in a slice of a target array. Note that
38 // the number of source slices and weights must match, and the extents of
39 // each source slice must match the extents of the target slice.
40 //
41 // Note: The implementation assumes that operator*(T, double) is defined,
42 // and that there is an implicit conversion from its result back to T.
43 //
44 // If you need to interpolate arrays of T other than double, you will
45 // likely want to create your own specialization of this function.
46 //
47 // The implementation should produce correct results for dense and sparse
48 // arrays, but may perform poorly on sparse.
49 
50 template<typename T>
51 void vtkInterpolate(
52  vtkTypedArray<T>* source_array,
53  const vtkArraySlices& source_slices,
54  const vtkArrayWeights& source_weights,
55  const vtkArrayExtents& target_slice,
56  vtkTypedArray<T>* target_array);
57 
58 #include "vtkArrayInterpolate.txx"
59 
60 #endif
61 
Stores the number of dimensions and valid coordinate ranges along each dimension for vtkArray...
void vtkInterpolate(vtkTypedArray< T > *source_array, const vtkArraySlices &source_slices, const vtkArrayWeights &source_weights, const vtkArrayExtents &target_slice, vtkTypedArray< T > *target_array)
Provides a type-specific interface to N-way arrays.
Definition: vtkTypedArray.h:58
Stores a collection of weighting factors.