-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathnni.h
101 lines (83 loc) · 2.29 KB
/
nni.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
// vi:set ts=4 sts=4 sw=4 noet :
/*
* TerraNNI: Natural neighbor interpolation in 2D and 3D for large datasets
* Copyright (C) 2010, 2011: Pankaj K. Agarwal, Alex Beutel & Thomas Mølhave
*
* This file is part of TerraNNI.
*
* TerraNNI is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TerraNNI is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TerraNNI. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBNNI_H
#define LIBNNI_H
#include "tpie_config.h"
#include <tpie/stream.h>
#include <vector>
#include <tpie/cpu_timer.h>
namespace nni {
struct Point3D {
double p[3]; //x,y,z
Point3D(double x,double y,double z, double t = 0) {
p[0]=x;
p[1]=y;
p[2]=z;
}
Point3D() {}
};
struct Point4D : public Point3D {
int t;
Point4D(double x, double y, double z, int time =0) {
p[0]=x;
p[1]=y;
p[2]=z;
t = time;
}
Point4D() {}
};
struct OutPoint {
int i,j;
float h;
OutPoint(int x, int y, float z) {
i=x;
j=y;
h=z;
}
OutPoint() {}
};
struct WorkPackage {
float origin_x,origin_y; //grid offset
float grid_origin_x, grid_origin_y;
int nrows,ncols;
};
struct Settings {
int scale;
float cell_size; //cell dimension
int nrows,ncols;
float site_radius;
double query_radius;
int algorithm;
int pointMin;
int multiplier;
};
void cleanup();
int init(const Settings& s);
void setRenderbuffers(int w_width, int w_height, int tC = 1);
void printTimes();
void setupRun(const WorkPackage& wp, int pixel_offset = -1, int timeCount = 1);
void performNNI(const WorkPackage& wp, tpie::ami::stream<OutPoint>& out,
tpie::ami::stream<nni::Point4D>& vec, float timeRadius, float curTime,
bool useDelta, bool debug = false);
void clearRenderbuffers();
}
#endif