17#ifndef THINPLATESPLINE_H_INCLUDED
18#define THINPLATESPLINE_H_INCLUDED
27 VIZ_GEOREF_SPLINE_ZERO_POINTS,
28 VIZ_GEOREF_SPLINE_ONE_POINT,
29 VIZ_GEOREF_SPLINE_TWO_POINTS,
30 VIZ_GEOREF_SPLINE_ONE_DIMENSIONAL,
31 VIZ_GEOREF_SPLINE_FULL,
33 VIZ_GEOREF_SPLINE_POINT_WAS_ADDED,
34 VIZ_GEOREF_SPLINE_POINT_WAS_DELETED
38#define VIZGEOREF_MAX_VARS 2
40class VizGeorefSpline2D
45 explicit VizGeorefSpline2D(
int nof_vars = 1)
46 : type(VIZ_GEOREF_SPLINE_ZERO_POINTS), _nof_vars(nof_vars),
47 _nof_points(0), _max_nof_points(0), _nof_eqs(0),
53 _dx(0.0), _dy(0.0), x(nullptr), y(nullptr), u(nullptr),
54 unused(nullptr), index(nullptr), x_mean(0), y_mean(0)
56 for (
int i = 0; i < VIZGEOREF_MAX_VARS; i++)
72 for (
int i = 0; i < _nof_vars; i++)
84 void set_toler(
double tx,
double ty ){
89 void get_toler(
double& tx,
double& ty) {
94 vizGeorefInterType get_interpolation_type ( ){
98 void dump_data_points()
100 for (
int i = 0; i < _nof_points; i++ )
102 fprintf(stderr,
"X = %f Y = %f Vars = ", x[i], y[i]);
103 for (
int v = 0; v < _nof_vars; v++ )
104 fprintf(stderr,
"%f ", rhs[v][i+3]);
105 fprintf(stderr,
"\n");
112 type = VIZ_GEOREF_SPLINE_ZERO_POINTS;
127 bool add_point(
const double Px,
const double Py,
const double *Pvars);
128 int get_point(
const double Px,
const double Py,
double *Pvars);
130 int delete_point(
const double Px,
const double Py );
131 bool get_xy(
int index,
double& x,
double& y);
132 bool change_point(
int index,
double x,
double y,
double* Pvars);
133 void reset(
void) { _nof_points = 0; }
138 vizGeorefInterType type;
158 double *rhs[VIZGEOREF_MAX_VARS];
159 double *coef[VIZGEOREF_MAX_VARS];
Various convenience functions for CPL.
#define CPLFree
Alias of VSIFree()
Definition: cpl_conv.h:82
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition: cpl_port.h:1030
Public (C callable) GDAL algorithm entry points, and definitions.