ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
qVoxFallTools.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // cloudViewer
12 
13 // local
14 #include "qVoxFallDialog.h"
15 
16 // qCC_db
17 #include <ecvBox.h>
18 #include <ecvGLMatrix.h>
19 #include <ecvMesh.h>
20 #include <ecvPointCloud.h>
21 #include <ecvScalarField.h>
22 
23 #include <unordered_map>
24 
26  double az;
27  float zRot;
28 
29 public:
32  qVoxFallTransform(double azimuth) {
33  az = azimuth;
34  zRot = GetRotationAngle(azimuth);
35 
36  const Vector3Tpl<float> X(std::cos(zRot), std::sin(zRot), 0);
37  const Vector3Tpl<float> Y(-std::sin(zRot), std::cos(zRot), 0);
38  const Vector3Tpl<float> Z(0, 0, 1);
39  const Vector3Tpl<float> Tr(0, 0, 0);
40  matrix = ccGLMatrix(X, Y, Z, Tr);
41 
42  const Vector3Tpl<float> rX(std::cos(-zRot), std::sin(-zRot), 0);
43  const Vector3Tpl<float> rY(-std::sin(-zRot), std::cos(-zRot), 0);
44  const Vector3Tpl<float> rZ(0, 0, 1);
45  const Vector3Tpl<float> rTr(0, 0, 0);
46  inverse = ccGLMatrix(rX, rY, rZ, rTr);
47  }
48 
49  static ccBox* CreateVoxelMesh(CCVector3 V, float voxelSize, int voxelIdx);
50 
51 private:
52  static float GetRotationAngle(double azimuth);
53 };
54 
56 public:
57  static std::vector<Tuple3i> FindAdjacents(Tuple3i V,
58  CCVector3 steps,
59  bool facetsOnly);
60 
61  static int Grid2Index(Tuple3i n, CCVector3 steps);
62 
63  static Tuple3i Index2Grid(unsigned index, CCVector3 steps);
64 };
void * X
Definition: SmallVector.cpp:45
Box (primitive)
Definition: ecvBox.h:16
Float version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:19
static std::vector< Tuple3i > FindAdjacents(Tuple3i V, CCVector3 steps, bool facetsOnly)
static int Grid2Index(Tuple3i n, CCVector3 steps)
static Tuple3i Index2Grid(unsigned index, CCVector3 steps)
ccGLMatrix matrix
Definition: qVoxFallTools.h:30
qVoxFallTransform(double azimuth)
Definition: qVoxFallTools.h:32
ccGLMatrix inverse
Definition: qVoxFallTools.h:31
static ccBox * CreateVoxelMesh(CCVector3 V, float voxelSize, int voxelIdx)