diff --git a/include/qVoxFallTools.h b/include/qVoxFallTools.h index ee7e486..0ef4788 100644 --- a/include/qVoxFallTools.h +++ b/include/qVoxFallTools.h @@ -41,8 +41,8 @@ class qVoxFallTransform float zRot; public: - ccGLMatrix* matrix; - ccGLMatrix* inverse; + ccGLMatrix matrix; + ccGLMatrix inverse; qVoxFallTransform(double azimuth) { az = azimuth; @@ -52,13 +52,13 @@ public: const Vector3Tpl Y(-std::sin(zRot), std::cos(zRot), 0); const Vector3Tpl Z(0, 0, 1); const Vector3Tpl Tr(0, 0, 0); - matrix = new ccGLMatrix(X, Y, Z, Tr); + matrix = ccGLMatrix(X, Y, Z, Tr); const Vector3Tpl rX(std::cos(-zRot), std::sin(-zRot), 0); const Vector3Tpl rY(-std::sin(-zRot), std::cos(-zRot), 0); const Vector3Tpl rZ(0, 0, 1); const Vector3Tpl rTr(0, 0, 0); - inverse = new ccGLMatrix(rX, rY, rZ, rTr); + inverse = ccGLMatrix(rX, rY, rZ, rTr); } static ccBox* CreateVoxelMesh(CCVector3 V, float voxelSize, int voxelIdx); diff --git a/src/qVoxFallProcess.cpp b/src/qVoxFallProcess.cpp index 36e4cb6..92aeea9 100644 --- a/src/qVoxFallProcess.cpp +++ b/src/qVoxFallProcess.cpp @@ -408,8 +408,8 @@ bool qVoxFallProcess::Compute(const qVoxFallDialog& dlg, QString& errorMessage, mesh->merge(mesh2, false); auto transform = qVoxFallTransform(azimuth); - mesh->applyGLTransformation_recursive(transform.matrix); - mesh1->applyGLTransformation_recursive(transform.matrix); + mesh->applyGLTransformation_recursive(&transform.matrix); + mesh1->applyGLTransformation_recursive(&transform.matrix); mesh1->setEnabled(false); @@ -684,7 +684,7 @@ bool qVoxFallProcess::Compute(const qVoxFallDialog& dlg, QString& errorMessage, } indices.clear(); } - ccGroup->applyGLTransformation_recursive(transform.inverse); + ccGroup->applyGLTransformation_recursive(&transform.inverse); ccGroup->setVisible(true); app->addToDB(ccGroup); @@ -733,8 +733,8 @@ bool qVoxFallProcess::Compute(const qVoxFallDialog& dlg, QString& errorMessage, } //prepare export cloud - mesh1->applyGLTransformation_recursive(transform.inverse); - s_VoxFallParams.voxfall->applyGLTransformation_recursive(transform.inverse); + mesh1->applyGLTransformation_recursive(&transform.inverse); + s_VoxFallParams.voxfall->applyGLTransformation_recursive(&transform.inverse); sfIdx = s_VoxFallParams.voxfall->getScalarFieldIndexByName(CLUSTER_SF_NAME); s_VoxFallParams.voxfall->setCurrentDisplayedScalarField(sfIdx);; s_VoxFallParams.voxfall->showSF(true); diff --git a/src/qVoxFallTools.cpp b/src/qVoxFallTools.cpp index f296a60..e949654 100644 --- a/src/qVoxFallTools.cpp +++ b/src/qVoxFallTools.cpp @@ -67,9 +67,9 @@ ccBox* qVoxFallTransform::CreateVoxelMesh(CCVector3 V, float voxelSize, int voxe const Vector3Tpl X(1, 0, 0); const Vector3Tpl Y(0, 1, 0); const Vector3Tpl Z(0, 0, 1); - ccGLMatrix* matrix = new ccGLMatrix(X, Y, Z, V); + const ccGLMatrix matrix(X, Y, Z, V); - ccBox* voxel = new ccBox(dims, matrix, name); + ccBox* voxel = new ccBox(dims, &matrix, name); voxel->computePerTriangleNormals(); return voxel; }