vtkCardinalSpline.h 2.02 KB
Newer Older
Bill Lorensen's avatar
Bill Lorensen committed
1 2 3 4 5
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkCardinalSpline.h

6
  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 8
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
Bill Lorensen's avatar
Bill Lorensen committed
9

10 11
     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
     PURPOSE.  See the above copyright notice for more information.
Bill Lorensen's avatar
Bill Lorensen committed
13 14 15 16

=========================================================================*/
// .NAME vtkCardinalSpline - computes an interpolating spline using a
// a Cardinal basis.
Ken Martin's avatar
Ken Martin committed
17

Bill Lorensen's avatar
Bill Lorensen committed
18
// .SECTION Description
19 20
// vtkCardinalSpline is a concrete implementation of vtkSpline using a
// Cardinal basis.
Ken Martin's avatar
Ken Martin committed
21

Bill Lorensen's avatar
Bill Lorensen committed
22
// .SECTION See Also
23
// vtkSpline vtkKochanekSpline
Bill Lorensen's avatar
Bill Lorensen committed
24 25


26 27
#ifndef vtkCardinalSpline_h
#define vtkCardinalSpline_h
Bill Lorensen's avatar
Bill Lorensen committed
28

29
#include "vtkCommonComputationalGeometryModule.h" // For export macro
Bill Lorensen's avatar
Bill Lorensen committed
30 31
#include "vtkSpline.h"

32
class VTKCOMMONCOMPUTATIONALGEOMETRY_EXPORT vtkCardinalSpline : public vtkSpline
Bill Lorensen's avatar
Bill Lorensen committed
33 34
{
public:
35
  static vtkCardinalSpline *New();
36

37
  vtkTypeMacro(vtkCardinalSpline,vtkSpline);
38
  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
Bill Lorensen's avatar
Bill Lorensen committed
39

Ken Martin's avatar
Ken Martin committed
40 41
  // Description
  // Compute Cardinal Splines for each dependent variable
42
  void Compute () VTK_OVERRIDE;
Bill Lorensen's avatar
Bill Lorensen committed
43

44 45
  // Description:
  // Evaluate a 1D cardinal spline.
46
  double Evaluate (double t) VTK_OVERRIDE;
47 48 49

  // Description:
  // Deep copy of cardinal spline data.
50
  void DeepCopy(vtkSpline *s) VTK_OVERRIDE;
51

Bill Lorensen's avatar
Bill Lorensen committed
52
protected:
53
  vtkCardinalSpline();
54
  ~vtkCardinalSpline() VTK_OVERRIDE {}
55

Ken Martin's avatar
Ken Martin committed
56
  void Fit1D (int n, double *x, double *y, double *w, double coefficients[][4],
57
              int leftConstraint, double leftValue, int rightConstraint,
Ken Martin's avatar
Ken Martin committed
58
              double rightValue);
59

60
  void FitClosed1D (int n, double *x, double *y, double *w,
Ken Martin's avatar
Ken Martin committed
61
                    double coefficients[][4]);
62

63
private:
64
  vtkCardinalSpline(const vtkCardinalSpline&) VTK_DELETE_FUNCTION;
65
  void operator=(const vtkCardinalSpline&) VTK_DELETE_FUNCTION;
Bill Lorensen's avatar
Bill Lorensen committed
66 67 68 69
};

#endif