21 #include <QApplication>
22 #include <QMainWindow>
23 #include <QProgressDialog>
24 #include <QtConcurrentMap>
27 float qVoxFallTransform::GetRotationAngle(
double azimuth) {
28 double azimuthRadians = azimuth * 3.14159 / 180;
30 std::vector<double> direction = {sin(azimuthRadians), cos(azimuthRadians)};
31 std::vector<double> xyView = {0, 1};
34 double dotProduct = 0;
35 for (
int i = 0; i < direction.size(); i++) {
36 direction[i] = direction[i] / sqrt(direction[0] * direction[0] +
37 direction[1] * direction[1]);
39 xyView[i] / sqrt(xyView[0] * xyView[0] + xyView[1] * xyView[1]);
40 dotProduct += direction[i] * xyView[i];
51 CCVector3 dims = {voxelSize, voxelSize, voxelSize};
52 QString
name = QString(
"voxel#%1").arg(voxelIdx);
66 bool facetsOnly =
false) {
67 std::vector<Tuple3i> set;
68 std::vector<std::vector<int>> adjacencyMatrix;
71 adjacencyMatrix = {{1, 0, 0}, {-1, 0, 0}, {0, 1, 0}, {0, -1, 0},
72 {0, 0, 1}, {0, 0, -1}, {1, 1, 0}, {-1, 1, 0},
73 {1, -1, 0}, {-1, -1, 0}, {0, 1, 1}, {0, 1, -1},
74 {0, -1, 1}, {0, -1, -1}, {1, 0, 1}, {1, 0, -1},
75 {-1, 0, 1}, {-1, 0, -1}, {1, 1, 1}, {-1, -1, -1},
76 {1, 1, -1}, {1, -1, 1}, {-1, 1, 1}, {1, -1, -1},
77 {-1, -1, 1}, {-1, 1, -1}};
80 {1, 0, 0}, {-1, 0, 0}, {0, 1, 0},
81 {0, -1, 0}, {0, 0, 1}, {0, 0, -1},
85 for (
unsigned n = 0; n < adjacencyMatrix.size(); n++) {
86 int x = int(V.
x) + adjacencyMatrix[n][0];
87 int y = int(V.
y) + adjacencyMatrix[n][1];
88 int z = int(V.
z) + adjacencyMatrix[n][2];
90 if (x < 0 || y < 0 || z < 0 || x >=
int(steps.
x) || y >=
int(steps.
y) ||
95 set.push_back({x, y, z});
106 int index = (i) + (j *
int(steps.
x)) + (k *
int(steps.
x) * int(steps.
y));
111 int k =
std::floor(index / (
int(steps.
y) *
int(steps.
x)));
112 int remain = index - (int(steps.
y) * int(steps.
x) * k);
114 int i = remain - (int(steps.
x) * j);
116 Tuple3i V(
static_cast<int>(i),
static_cast<int>(j),
static_cast<int>(k));
Float version of ccGLMatrixTpl.
bool computePerTriangleNormals()
Computes per-triangle normals.
MiniVec< float, N > floor(const MiniVec< float, N > &a)