forked from brown-cs-224/Poisson-Stencil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoissonhelper.h
46 lines (35 loc) · 1.76 KB
/
poissonhelper.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
#ifndef POISSONHELPER_H
#define POISSONHELPER_H
#include <vector>
#include <Eigen/StdVector>
#include <Eigen/Sparse>
using namespace Eigen;
using namespace std;
class PoissonHelper
{
public:
PoissonHelper();
int cubeToRowIndex(int x, int y, int z, int gridWidth, int gridHeight);
float basis(float normalizedRadius);
void fillLookupTables(int gridWidth, int gridHeight, int gridDepth);
void loadPointsFromFile(const std::string &filePath, std::vector<Eigen::Vector3f> &positions, std::vector<Eigen::Vector3f> &normals);
void getGridDimensions(const std::vector<Vector3f> &positions, int &voxelGridWidth, int &voxelGridHeight,
int &voxelGridDepth, float &cellWidth, Vector3f &corner);
void marchingCubes(Eigen::VectorXf surface, float isoValue, int voxelGridWidth, int voxelGridHeight,
int voxelGridDepth, float cellWidth, Vector3f corner, Eigen::MatrixXf &V, Eigen::MatrixXi &F);
void saveAsMesh(const std::string &filePath,const MatrixXf &vertices,
const MatrixXi &faces);
float integral_f_dd_fPrime(float normalizedRadius);
float integral_f_d_fPrime(float normalizedRadius);
float integral_f_fPrime(float normalizedRadius);
std::map<int, std::map<int, float>> f_dot_fprime_x;
std::map<int, std::map<int, float>> f_dot_d_fprime_x;
std::map<int, std::map<int, float>> f_dot_dd_fprime_x;
std::map<int, std::map<int, float>> f_dot_fprime_y;
std::map<int, std::map<int, float>> f_dot_d_fprime_y;
std::map<int, std::map<int, float>> f_dot_dd_fprime_y;
std::map<int, std::map<int, float>> f_dot_fprime_z;
std::map<int, std::map<int, float>> f_dot_d_fprime_z;
std::map<int, std::map<int, float>> f_dot_dd_fprime_z;
};
#endif // POISSONHELPER_H