19 #include <xmsgrid/geometry/geoms.h> 63 BSHP<xms::VecInt> tris(
new xms::VecInt());
66 BSHP<xms::VecPt3d> pts(
new xms::VecPt3d());
67 *pts = {{0, 0, 0}, {10, 0, 1}, {10, 10, 2}, {0, 10, 3}};
73 interp->SetPtsTris(pts, tris);
76 xms::Pt3d loc(5, 5, 0);
77 float val = interp->InterpToPt(loc);
81 TS_ASSERT_EQUALS(base, val);
92 BSHP<xms::VecPt3d> pts(
new xms::VecPt3d());
93 *pts = {{0, 0, 0}, {10, 0, 1}, {10, 10, 2}, {0, 10, 3}};
98 BSHP<xms::VecInt> tris(
new xms::VecInt());
99 *tris = {0, 1, 3, 1, 2, 3};
104 interp->SetPtsTris(pts, tris);
107 xms::Pt3d loc(2, 1, 0);
108 float val = interp->InterpToPt(loc);
112 TS_ASSERT_EQUALS(base, val);
122 BSHP<xms::VecPt3d> pts(
new xms::VecPt3d());
123 *pts = {{0, 0, 0}, {10, 0, 1}, {10, 10, 2}, {0, 10, 3}};
128 BSHP<xms::VecInt> tris(
new xms::VecInt());
129 *tris = {0, 1, 3, 1, 2, 3};
134 interp->SetPtsTris(pts, tris);
137 int nodalFuncOpt = 1;
139 bool blendWeights =
false;
140 BSHP<xms::Observer> progress;
142 interp->SetUseNatNeigh(
true, nodalFunc, nodalFuncOpt, nNearest, blendWeights, progress);
145 xms::Pt3d loc(2, 1, 0);
146 float val = interp->InterpToPt(loc);
150 TS_ASSERT_EQUALS(base, val);
161 xms::VecPt3d centerline = {{0, 0, 0}, {20, 0, 0}, {40, 20, 0}, {60, 20, 0}};
170 xms::VecPt3d interpolationPoints = {
201 bool pickClosest =
false;
202 interpolator->SetPoints(centerline, interpolationPoints, pickClosest);
209 interpolator->SetXScale(0.5);
213 interpolator->SetPower(3);
218 xms::VecPt3d snPoints;
219 interpolator->GetInterpolationPts(snPoints);
221 xms::VecPt3d expectedSnPoints = {
234 {17.071, 14.142, 80},
236 {17.071, -14.142, 80},
239 {24.142, 22.361, 70},
240 {24.142, 11.180, 50},
243 {22.374, -10.607, 70},
251 xms::Pt3d loc(20, 5, 0);
252 float val = interpolator->InterpToPt(loc);
253 float base(59.5313f);
254 TS_ASSERT_DELTA(base, val, 0.001);
259 xms::VecPt3d interpToPoints = {
260 {5, 5, 0}, {5, 0, 0}, {5, -5, 0},
263 {20, -5, 0}, {10, 20, 0}, {30, -5, 0}, {30, 30, 0},
264 {35, 20, 0}, {45, 25, 0}, {45, 15, 0},
265 {65, 20, 0}, {-5, 0, 0}};
270 xms::VecPt3d snInterpToPoints;
271 interpolator->GetTransformedPts(interpToPoints,
false, snInterpToPoints);
272 xms::VecPt3d expectedSnInterpToPoints = {
273 {2.5, 5, 0}, {2.5, 0, 0}, {2.5, -5, 0},
274 {10, 5, 0}, {11.768, 3.536, 0},
275 {10, 0, 0}, {10, 0, 0},
276 {10, -5, 0}, {5, 20, 0}, {13.536, 21.213, 0}, {11.768, -10.607, 0},
277 {24.142, 14.142, 0}, {22.374, 3.536, 0}, {26.642, 5, 0},
278 {24.142, -7.071, 0}, {26.642, -5, 0}};
282 xms::VecFlt interpValues;
283 interpolator->InterpToPts(interpToPoints, interpValues);
284 xms::VecFlt expectedInterpValues = {64.614f, 54.390f, 71.970f, 59.531f, 58.468f,
285 68.0917f, 81.688f, 76.032f, 53.130f, 35.413f,
static BSHP< InterpIdw > New()
Creates an InterpIdw class.
static BSHP< InterpLinear > New()
Creates an TriSearch class.
static BSHP< InterpAnisotropic > New()
Creates an InterpAnisotropic class.