mirror of
https://github.com/farmakis/qVoxFall.git
synced 2026-08-29 16:00:25 +08:00
Fix linux compilation
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user