Fix linux compilation

This commit is contained in:
Romain Janvier
2024-09-29 10:27:39 +02:00
parent 971ccdde99
commit 9a5ef82e56
4 changed files with 16 additions and 11 deletions
+4 -4
View File
@@ -53,10 +53,10 @@ public:
//! Returns the max number of threads to use
int getMaxThreadCount() const;
void qVoxFallDialog::loadParamsFromPersistentSettings();
void qVoxFallDialog::loadParamsFrom(const QSettings& settings);
void qVoxFallDialog::saveParamsToPersistentSettings();
void qVoxFallDialog::saveParamsTo(QSettings& settings);
void loadParamsFromPersistentSettings();
void loadParamsFrom(const QSettings& settings);
void saveParamsToPersistentSettings();
void saveParamsTo(QSettings& settings);
protected:
+4 -2
View File
@@ -29,6 +29,8 @@
#include <ccPointCloud.h>
#include <ccScalarField.h>
#include <ccBox.h>
#include <ccGLMatrix.h>
#include <unordered_map>
@@ -50,13 +52,13 @@ public:
const Vector3Tpl<float> Y(-std::sin(zRot), std::cos(zRot), 0);
const Vector3Tpl<float> Z(0, 0, 1);
const Vector3Tpl<float> Tr(0, 0, 0);
matrix = &ccGLMatrix::ccGLMatrix(X, Y, Z, Tr);
matrix = new ccGLMatrix(X, Y, Z, Tr);
const Vector3Tpl<float> rX(std::cos(-zRot), std::sin(-zRot), 0);
const Vector3Tpl<float> rY(-std::sin(-zRot), std::cos(-zRot), 0);
const Vector3Tpl<float> rZ(0, 0, 1);
const Vector3Tpl<float> rTr(0, 0, 0);
inverse = &ccGLMatrix::ccGLMatrix(rX, rY, rZ, rTr);
inverse = new ccGLMatrix(rX, rY, rZ, rTr);
}
static ccBox* CreateVoxelMesh(CCVector3 V, float voxelSize, int voxelIdx);
+7 -4
View File
@@ -18,6 +18,7 @@
#include "qVoxFallProcess.h"
//system
#include <atomic>
#include <unordered_set>
//local
@@ -287,7 +288,7 @@ bool ClusterEmptySpace(int maxThreads, int voxelCount, GenericProgressCallback*
bool ComputeClusterVolume(int maxThreads, int clusterCount, ccHObject* clusterGroup = nullptr)
{
bool error = false;
std::atomic<bool> error(false);
CCVector3 minBound = s_VoxFallParams.maxBound;
CCVector3 maxBound = s_VoxFallParams.minBound;
int count = 0;
@@ -303,6 +304,10 @@ bool ComputeClusterVolume(int maxThreads, int clusterCount, ccHObject* clusterGr
{
int index = s_VoxFallParams.clusterIndices[i];
if(error) {
continue;
}
std::unordered_set<unsigned int> nbs_next(s_VoxFallParams.nbs[index].begin(), s_VoxFallParams.nbs[index].end());
while (!nbs_next.empty())
{
@@ -346,9 +351,7 @@ bool ComputeClusterVolume(int maxThreads, int clusterCount, ccHObject* clusterGr
if (!s_VoxFallParams.nProgress->oneStep())
{
error = true;
break;
}
if (error) break;
}
if (s_VoxFallParams.exportLossGain)
@@ -439,7 +442,7 @@ bool qVoxFallProcess::Compute(const qVoxFallDialog& dlg, QString& errorMessage,
s_VoxFallParams.isEmptyBefore.resize(voxelGrid.innerCellCount(), true);
if (s_VoxFallParams.exportBlocksAsMeshes)
{
s_VoxFallParams.clusters.resize(voxelGrid.innerCellCount(), NULL);
s_VoxFallParams.clusters.resize(voxelGrid.innerCellCount(), 0);
}
//allocate cluster ID SF
+1 -1
View File
@@ -67,7 +67,7 @@ ccBox* qVoxFallTransform::CreateVoxelMesh(CCVector3 V, float voxelSize, int voxe
const Vector3Tpl<float> X(1, 0, 0);
const Vector3Tpl<float> Y(0, 1, 0);
const Vector3Tpl<float> Z(0, 0, 1);
ccGLMatrix* matrix = &ccGLMatrix::ccGLMatrix(X, Y, Z, V);
ccGLMatrix* matrix = new ccGLMatrix(X, Y, Z, V);
ccBox* voxel = new ccBox(dims, matrix, name);
voxel->computePerTriangleNormals();