diff --git a/CMakeLists.txt b/CMakeLists.txt index 437cc1a..7b1f8e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,10 @@ option( INSTALL_Q3DMASC_PLUGIN "Check to install q3DMASC plugin" OFF ) if (INSTALL_Q3DMASC_PLUGIN) -#New classification plugin (Dimitri Lague/OSUR) -project( Q3DMASC_PLUGIN ) + #New classification plugin (Dimitri Lague/OSUR) + project( Q3DMASC_PLUGIN ) + + AddPlugin( NAME ${PROJECT_NAME} ) include( CMakePolicies NO_POLICY_SCOPE ) @@ -20,15 +22,41 @@ project( Q3DMASC_PLUGIN ) include_directories( ${CloudCompare_SOURCE_DIR} ) #include_directories( ${OpenCV_INCLUDE_DIR} ) - #we need the "order choice" dialog - file( GLOB CC_PLUGIN_CUSTOM_HEADER_LIST ${CloudCompare_SOURCE_DIR}/ccOrderChoiceDlg*.h ) - file( GLOB CC_PLUGIN_CUSTOM_SOURCE_LIST ${CloudCompare_SOURCE_DIR}/ccOrderChoiceDlg*.cpp ) - - #don't forget associated widgets(.ui) - set( CC_PLUGIN_CUSTOM_UI_LIST ${CloudCompare_SOURCE_DIR}/ui_templates/roleChoiceDlg.ui ) - - include( ../../CMakePluginTpl.cmake ) + file( GLOB PLUGIN_HDR_LIST ${CMAKE_CURRENT_SOURCE_DIR}/*.h ) + file( GLOB PLUGIN_SRC_LIST ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ) + file( GLOB PLUGIN_UI_LIST ${CMAKE_CURRENT_SOURCE_DIR}/*.ui ) + #we need the "order choice" dialog + file( GLOB CC_HDR_LIST ${CloudCompare_SOURCE_DIR}/ccOrderChoiceDlg*.h ) + file( GLOB CC_SRC_LIST ${CloudCompare_SOURCE_DIR}/ccOrderChoiceDlg*.cpp ) + set( CC_UI_LIST ${CloudCompare_SOURCE_DIR}/ui_templates/roleChoiceDlg.ui ) + + # add source files + target_sources( ${PROJECT_NAME} + PRIVATE + ${PLUGIN_HDR_LIST} + ${PLUGIN_SRC_LIST} + ${PLUGIN_UI_LIST} + ${CC_HDR_LIST} + ${CC_SRC_LIST} + ${CC_UI_LIST} + ) + + #include( CMakePluginTemplate ) + #include( ../../CMakePluginTpl.cmake ) + + set_target_properties( ${PROJECT_NAME} PROPERTIES + # FIXME Remove after everything has moved to targets + AUTOUIC_SEARCH_PATHS "${CloudCompare_SOURCE_DIR}/ui_templates;${CMAKE_CURRENT_SOURCE_DIR}/ui" + ) + + # FIXME These are required becaue we have dependencies outside of the api + target_include_directories( ${PROJECT_NAME} + PRIVATE + ${CloudCompare_SOURCE_DIR} + ${CloudCompare_SOURCE_DIR}/../common + ) + target_link_libraries( ${PROJECT_NAME} ${OpenCV_LIBS} ) endif() diff --git a/ContextBasedFeature.cpp b/ContextBasedFeature.cpp index 712bcbd..74952ce 100644 --- a/ContextBasedFeature.cpp +++ b/ContextBasedFeature.cpp @@ -48,7 +48,7 @@ bool ContextBasedFeature::checkValidity(QString corePointRole, QString &error) c return false; } - CCLib::ScalarField* classifSF = Tools::GetClassificationSF(cloud2); + CCCoreLib::ScalarField* classifSF = Tools::GetClassificationSF(cloud2); if (!classifSF) { error = QString("Context cloud (%1) has no classification field").arg(cloud2Label); @@ -71,7 +71,7 @@ bool ContextBasedFeature::checkValidity(QString corePointRole, QString &error) c bool ContextBasedFeature::prepare( const CorePoints& corePoints, QString& errorMessage, - CCLib::GenericProgressCallback* progressCb/*=nullptr*/, + CCCoreLib::GenericProgressCallback* progressCb/*=nullptr*/, SFCollector* generatedScalarFields/*=nullptr*/) { if (!cloud1 || !corePoints.cloud) @@ -96,7 +96,7 @@ bool ContextBasedFeature::prepare( const CorePoints& corePoints, return false; } - CCLib::ScalarField* classifSF = Tools::GetClassificationSF(cloud2); + CCCoreLib::ScalarField* classifSF = Tools::GetClassificationSF(cloud2); if (!classifSF || classifSF->size() < cloud2->size()) { assert(false); @@ -177,7 +177,7 @@ bool ContextBasedFeature::prepare( const CorePoints& corePoints, progressCb->setInfo(qPrintable(logMessage)); } ccLog::Print(logMessage); - CCLib::NormalizedProgress nProgress(progressCb, pointCount); + CCCoreLib::NormalizedProgress nProgress(progressCb, pointCount); QMutex mutex; double meanNeighborhoodSize = 0; @@ -191,10 +191,10 @@ bool ContextBasedFeature::prepare( const CorePoints& corePoints, for (int i = 0; i < static_cast(pointCount); ++i) { const CCVector3* P = corePoints.cloud->getPoint(i); - CCLib::ReferenceCloud Yk(&classCloud); + CCCoreLib::ReferenceCloud Yk(&classCloud); double maxSquareDist = 0; - ScalarType s = NAN_VALUE; + ScalarType s = CCCoreLib::NAN_VALUE; int neighborhoodSize = 0; if (classOctree->findPointNeighbourhood(P, &Yk, static_cast(kNN), octreeLevel, maxSquareDist, 0, &neighborhoodSize) >= static_cast(kNN)) @@ -221,7 +221,7 @@ bool ContextBasedFeature::prepare( const CorePoints& corePoints, double density = meanNeighborhoodSize / tenth; if (density < 1.1) { - if (octreeLevel + 1 < CCLib::DgmOctree::MAX_OCTREE_LEVEL) + if (octreeLevel + 1 < CCCoreLib::DgmOctree::MAX_OCTREE_LEVEL) ++octreeLevel; } else while (density > 2.9) @@ -280,13 +280,13 @@ bool ContextBasedFeature::prepare( const CorePoints& corePoints, return true; } -bool ContextBasedFeature::computeValue(CCLib::DgmOctree::NeighboursSet& pointsInNeighbourhood, const CCVector3& queryPoint, ScalarType& outputValue) const +bool ContextBasedFeature::computeValue(CCCoreLib::DgmOctree::NeighboursSet& pointsInNeighbourhood, const CCVector3& queryPoint, ScalarType& outputValue) const { const ScalarType fClass = static_cast(ctxClassLabel); CCVector3d sumQ(0, 0, 0); unsigned validCount = 0; - for (CCLib::DgmOctree::PointDescriptor& Pd : pointsInNeighbourhood) + for (CCCoreLib::DgmOctree::PointDescriptor& Pd : pointsInNeighbourhood) { //we only consider points with the right class!!! if (cloud2->getPointScalarValue(Pd.pointIndex) != fClass) @@ -297,7 +297,7 @@ bool ContextBasedFeature::computeValue(CCLib::DgmOctree::NeighboursSet& pointsIn if (validCount == 0) { - outputValue = NAN_VALUE; + outputValue = CCCoreLib::NAN_VALUE; return true; } @@ -311,7 +311,7 @@ bool ContextBasedFeature::computeValue(CCLib::DgmOctree::NeighboursSet& pointsIn break; default: assert(false); - outputValue = NAN_VALUE; + outputValue = CCCoreLib::NAN_VALUE; return false; } diff --git a/ContextBasedFeature.h b/ContextBasedFeature.h index f56bd2e..70b78d0 100644 --- a/ContextBasedFeature.h +++ b/ContextBasedFeature.h @@ -82,13 +82,13 @@ namespace masc //inherited from Feature virtual Type getType() const override { return Type::ContextBasedFeature; } virtual Feature::Shared clone() const override { return Feature::Shared(new ContextBasedFeature(*this)); } - virtual bool prepare(const CorePoints& corePoints, QString& error, CCLib::GenericProgressCallback* progressCb = nullptr, SFCollector* generatedScalarFields = nullptr) override; + virtual bool prepare(const CorePoints& corePoints, QString& error, CCCoreLib::GenericProgressCallback* progressCb = nullptr, SFCollector* generatedScalarFields = nullptr) override; virtual bool finish(const CorePoints& corePoints, QString& error) override; virtual bool checkValidity(QString corePointRole, QString &error) const override; virtual QString toString() const override; //! Compute the feature value on a set of points - bool computeValue(CCLib::DgmOctree::NeighboursSet& pointsInNeighbourhood, const CCVector3& queryPoint, ScalarType& outputValue) const; + bool computeValue(CCCoreLib::DgmOctree::NeighboursSet& pointsInNeighbourhood, const CCVector3& queryPoint, ScalarType& outputValue) const; public: //members @@ -102,6 +102,6 @@ namespace masc //! Context class (label) int ctxClassLabel; //! The computed scalar - CCLib::ScalarField* sf; + CCCoreLib::ScalarField* sf; }; } \ No newline at end of file diff --git a/CorePoints.cpp b/CorePoints.cpp index 0dd7f75..da3cfcc 100644 --- a/CorePoints.cpp +++ b/CorePoints.cpp @@ -28,7 +28,7 @@ using namespace masc; -bool CorePoints::prepare(CCLib::GenericProgressCallback* progressCb/*=nullptr*/) +bool CorePoints::prepare(CCCoreLib::GenericProgressCallback* progressCb/*=nullptr*/) { if (!origin) { @@ -43,7 +43,7 @@ bool CorePoints::prepare(CCLib::GenericProgressCallback* progressCb/*=nullptr*/) } //now we can compute the subsampled version - CCLib::ReferenceCloud* ref = nullptr; + CCCoreLib::ReferenceCloud* ref = nullptr; switch (selectionMethod) { case SPATIAL: @@ -58,9 +58,9 @@ bool CorePoints::prepare(CCLib::GenericProgressCallback* progressCb/*=nullptr*/) } } - CCLib::CloudSamplingTools::SFModulationParams modParams; + CCCoreLib::CloudSamplingTools::SFModulationParams modParams; modParams.enabled = false; - ref = CCLib::CloudSamplingTools::resampleCloudSpatially( + ref = CCCoreLib::CloudSamplingTools::resampleCloudSpatially( origin, static_cast(selectionParam), modParams, @@ -78,7 +78,7 @@ bool CorePoints::prepare(CCLib::GenericProgressCallback* progressCb/*=nullptr*/) return false; } int targetCount = static_cast(origin->size() * selectionParam); - ref = CCLib::CloudSamplingTools::subsampleCloudRandomly(origin, targetCount, progressCb); + ref = CCCoreLib::CloudSamplingTools::subsampleCloudRandomly(origin, targetCount, progressCb); break; } diff --git a/CorePoints.h b/CorePoints.h index ee43555..456a2ac 100644 --- a/CorePoints.h +++ b/CorePoints.h @@ -47,13 +47,13 @@ namespace masc inline unsigned originIndex(unsigned i) const { return selection ? selection->getPointGlobalIndex(i) : i; } //selection (if any) - QSharedPointer selection; + QSharedPointer selection; enum SubSamplingMethod { NONE, RANDOM, SPATIAL }; SubSamplingMethod selectionMethod = NONE; double selectionParam = std::numeric_limits::quiet_NaN(); //! Prepares the selection (must be called once) - bool prepare(CCLib::GenericProgressCallback* progressCb = nullptr); + bool prepare(CCCoreLib::GenericProgressCallback* progressCb = nullptr); }; }; //namespace masc diff --git a/DualCloudFeature.cpp b/DualCloudFeature.cpp index 74ab863..e791e85 100644 --- a/DualCloudFeature.cpp +++ b/DualCloudFeature.cpp @@ -21,7 +21,7 @@ using namespace masc; bool DualCloudFeature::prepare( const CorePoints& corePoints, QString& error, - CCLib::GenericProgressCallback* progressCb/*=nullptr*/, + CCCoreLib::GenericProgressCallback* progressCb/*=nullptr*/, SFCollector* generatedScalarFields/*=nullptr*/) { //TODO diff --git a/DualCloudFeature.h b/DualCloudFeature.h index ac6af48..fbbb6db 100644 --- a/DualCloudFeature.h +++ b/DualCloudFeature.h @@ -67,7 +67,7 @@ namespace masc //inherited from Feature virtual Type getType() const override { return Type::DualCloudFeature; } virtual Feature::Shared clone() const override { return Feature::Shared(new DualCloudFeature(*this)); } - virtual bool prepare(const CorePoints& corePoints, QString& error, CCLib::GenericProgressCallback* progressCb = nullptr, SFCollector* generatedScalarFields = nullptr) override; + virtual bool prepare(const CorePoints& corePoints, QString& error, CCCoreLib::GenericProgressCallback* progressCb = nullptr, SFCollector* generatedScalarFields = nullptr) override; virtual bool checkValidity(QString corePointRole, QString &error) const override; virtual QString toString() const override; diff --git a/FeaturesInterface.cpp b/FeaturesInterface.cpp index dab69c7..9cbe2ab 100644 --- a/FeaturesInterface.cpp +++ b/FeaturesInterface.cpp @@ -25,7 +25,7 @@ using namespace masc; -CCLib::ScalarField* Feature::PrepareSF(ccPointCloud* cloud, const char* resultSFName, SFCollector* generatedScalarFields/*=nullptr*/, SFCollector::Behavior behavior/*=SFCollector::CAN_REMOVE*/) +CCCoreLib::ScalarField* Feature::PrepareSF(ccPointCloud* cloud, const char* resultSFName, SFCollector* generatedScalarFields/*=nullptr*/, SFCollector::Behavior behavior/*=SFCollector::CAN_REMOVE*/) { if (!cloud || !resultSFName) { @@ -34,7 +34,7 @@ CCLib::ScalarField* Feature::PrepareSF(ccPointCloud* cloud, const char* resultSF return nullptr; } - CCLib::ScalarField* resultSF = nullptr; + CCCoreLib::ScalarField* resultSF = nullptr; int sfIdx = cloud->getScalarFieldIndexByName(resultSFName); if (sfIdx >= 0) { @@ -62,14 +62,14 @@ CCLib::ScalarField* Feature::PrepareSF(ccPointCloud* cloud, const char* resultSF } assert(resultSF); - resultSF->fill(NAN_VALUE); + resultSF->fill(CCCoreLib::NAN_VALUE); return resultSF; } ScalarType Feature::PerformMathOp(double s1, double s2, Operation op) { - ScalarType s = NAN_VALUE; + ScalarType s = CCCoreLib::NAN_VALUE; switch (op) { case Feature::MINUS: @@ -92,7 +92,7 @@ ScalarType Feature::PerformMathOp(double s1, double s2, Operation op) return s; } -bool Feature::PerformMathOp(CCLib::ScalarField* sf1, const CCLib::ScalarField* sf2, Feature::Operation op) +bool Feature::PerformMathOp(CCCoreLib::ScalarField* sf1, const CCCoreLib::ScalarField* sf2, Feature::Operation op) { if (!sf1 || !sf2 || sf1->size() != sf2->size() || op == Feature::NO_OPERATION) { @@ -113,7 +113,7 @@ bool Feature::PerformMathOp(CCLib::ScalarField* sf1, const CCLib::ScalarField* s return true; } -bool Feature::PerformMathOp(const IScalarFieldWrapper& sf1, const IScalarFieldWrapper& sf2, Operation op, CCLib::ScalarField* outSF) +bool Feature::PerformMathOp(const IScalarFieldWrapper& sf1, const IScalarFieldWrapper& sf2, Operation op, CCCoreLib::ScalarField* outSF) { if (!outSF || sf1.size() != sf2.size() || sf1.size() != outSF->size() || op == Feature::NO_OPERATION) { diff --git a/FeaturesInterface.h b/FeaturesInterface.h index 7dd158a..83ebb52 100644 --- a/FeaturesInterface.h +++ b/FeaturesInterface.h @@ -174,7 +174,7 @@ namespace masc virtual Feature::Shared clone() const = 0; //! Prepares the feature (compute the scalar field, etc.) - virtual bool prepare(const CorePoints& corePoints, QString& error, CCLib::GenericProgressCallback* progressCb = nullptr, SFCollector* generatedScalarFields = nullptr) = 0; + virtual bool prepare(const CorePoints& corePoints, QString& error, CCCoreLib::GenericProgressCallback* progressCb = nullptr, SFCollector* generatedScalarFields = nullptr) = 0; //! Finishes the feature preparation (update the scalar field, etc.) virtual bool finish(const CorePoints& corePoints, QString& error) { /* does nothing by default*/return true; } @@ -210,16 +210,16 @@ namespace masc public: //helpers //! Creates (or resets) a scalar field with the given name on the input core points cloud - static CCLib::ScalarField* PrepareSF(ccPointCloud* cloud, const char* resultSFName, SFCollector* generatedScalarFields/*= nullptr*/, SFCollector::Behavior behavior); + static CCCoreLib::ScalarField* PrepareSF(ccPointCloud* cloud, const char* resultSFName, SFCollector* generatedScalarFields/*= nullptr*/, SFCollector::Behavior behavior); //! Performs a mathematical operation between two scalars static ScalarType PerformMathOp(double s1, double s2, Operation op); //! Performs a mathematical operation between two scalar fields (they must have the same size!) - static bool PerformMathOp(CCLib::ScalarField* sf1, const CCLib::ScalarField* sf2, Operation op); + static bool PerformMathOp(CCCoreLib::ScalarField* sf1, const CCCoreLib::ScalarField* sf2, Operation op); //! Performs a mathematical operation between two scalar fields (they must have the same size!) - static bool PerformMathOp(const IScalarFieldWrapper& sf1, const IScalarFieldWrapper& sf2, Operation op, CCLib::ScalarField* outSF); + static bool PerformMathOp(const IScalarFieldWrapper& sf1, const IScalarFieldWrapper& sf2, Operation op, CCCoreLib::ScalarField* outSF); public: //members @@ -234,4 +234,4 @@ namespace masc Stat stat; //only considered if a scale is defined Operation op; //only considered if 2 clouds are defined }; -} \ No newline at end of file +} diff --git a/NeighborhoodFeature.cpp b/NeighborhoodFeature.cpp index 87c33ac..1b3aa5f 100644 --- a/NeighborhoodFeature.cpp +++ b/NeighborhoodFeature.cpp @@ -19,6 +19,7 @@ //CCLib #include +#include #include using namespace masc; @@ -60,7 +61,7 @@ bool NeighborhoodFeature::checkValidity(QString corePointRole, QString &error) c bool NeighborhoodFeature::prepare( const CorePoints& corePoints, QString& error, - CCLib::GenericProgressCallback* progressCb/*=nullptr*/, + CCCoreLib::GenericProgressCallback* progressCb/*=nullptr*/, SFCollector* generatedScalarFields/*=nullptr*/) { if (!cloud1 || !corePoints.cloud) @@ -194,7 +195,7 @@ QString NeighborhoodFeature::toString() const return description; } -bool NeighborhoodFeature::computeValue(CCLib::DgmOctree::NeighboursSet& pointsInNeighbourhood, const CCVector3& queryPoint, double& outputValue) const +bool NeighborhoodFeature::computeValue(CCCoreLib::DgmOctree::NeighboursSet& pointsInNeighbourhood, const CCVector3& queryPoint, double& outputValue) const { outputValue = std::numeric_limits::quiet_NaN(); @@ -215,26 +216,26 @@ bool NeighborhoodFeature::computeValue(CCLib::DgmOctree::NeighboursSet& pointsIn case LINEA: case PLANA: { - CCLib::Neighbourhood::GeomFeature f; + CCCoreLib::Neighbourhood::GeomFeature f; switch (type) { case PCA1: - f = CCLib::Neighbourhood::PCA1; + f = CCCoreLib::Neighbourhood::PCA1; break; case PCA2: - f = CCLib::Neighbourhood::PCA2; + f = CCCoreLib::Neighbourhood::PCA2; break; case PCA3: - f = CCLib::Neighbourhood::SurfaceVariation; + f = CCCoreLib::Neighbourhood::SurfaceVariation; break; case SPHER: - f = CCLib::Neighbourhood::Sphericity; + f = CCCoreLib::Neighbourhood::Sphericity; break; case LINEA: - f = CCLib::Neighbourhood::Linearity; + f = CCCoreLib::Neighbourhood::Linearity; break; case PLANA: - f = CCLib::Neighbourhood::Planarity; + f = CCCoreLib::Neighbourhood::Planarity; break; default: //impossible @@ -242,16 +243,16 @@ bool NeighborhoodFeature::computeValue(CCLib::DgmOctree::NeighboursSet& pointsIn return false; } - CCLib::DgmOctreeReferenceCloud neighboursCloud(&pointsInNeighbourhood, static_cast(kNN)); - CCLib::Neighbourhood Z(&neighboursCloud); + CCCoreLib::DgmOctreeReferenceCloud neighboursCloud(&pointsInNeighbourhood, static_cast(kNN)); + CCCoreLib::Neighbourhood Z(&neighboursCloud); outputValue = Z.computeFeature(f); } break; case FOM: { - CCLib::DgmOctreeReferenceCloud neighboursCloud(&pointsInNeighbourhood, static_cast(kNN)); - CCLib::Neighbourhood Z(&neighboursCloud); + CCCoreLib::DgmOctreeReferenceCloud neighboursCloud(&pointsInNeighbourhood, static_cast(kNN)); + CCCoreLib::Neighbourhood Z(&neighboursCloud); outputValue = Z.computeMomentOrder1(queryPoint); } break; @@ -260,13 +261,13 @@ bool NeighborhoodFeature::computeValue(CCLib::DgmOctree::NeighboursSet& pointsIn case DipDir: if (kNN >= 3) { - CCLib::DgmOctreeReferenceCloud neighboursCloud(&pointsInNeighbourhood, static_cast(kNN)); - CCLib::Neighbourhood Z(&neighboursCloud); + CCCoreLib::DgmOctreeReferenceCloud neighboursCloud(&pointsInNeighbourhood, static_cast(kNN)); + CCCoreLib::Neighbourhood Z(&neighboursCloud); const CCVector3* N = Z.getLSPlaneNormal(); if (N) { //force +Z - CCVector3 Np = (N->z < 0 ? -PC_ONE * *N : *N); + CCVector3 Np = (N->z < 0 ? -CCCoreLib::PC_ONE * *N : *N); PointCoordinateType dip_deg, dipDir_deg; ccNormalVectors::ConvertNormalToDipAndDipDir(Np, dip_deg, dipDir_deg); outputValue = (type == Dip ? dip_deg : dipDir_deg); @@ -280,17 +281,17 @@ bool NeighborhoodFeature::computeValue(CCLib::DgmOctree::NeighboursSet& pointsIn case ROUGH: { - CCLib::DgmOctreeReferenceCloud neighboursCloud(&pointsInNeighbourhood, static_cast(kNN)); - CCLib::Neighbourhood Z(&neighboursCloud); + CCCoreLib::DgmOctreeReferenceCloud neighboursCloud(&pointsInNeighbourhood, static_cast(kNN)); + CCCoreLib::Neighbourhood Z(&neighboursCloud); outputValue = Z.computeRoughness(queryPoint); } break; case CURV: { - CCLib::DgmOctreeReferenceCloud neighboursCloud(&pointsInNeighbourhood, static_cast(kNN)); - CCLib::Neighbourhood Z(&neighboursCloud); - outputValue = Z.computeCurvature(queryPoint, CCLib::Neighbourhood::MEAN_CURV); //TODO: is it really the default one? + CCCoreLib::DgmOctreeReferenceCloud neighboursCloud(&pointsInNeighbourhood, static_cast(kNN)); + CCCoreLib::Neighbourhood Z(&neighboursCloud); + outputValue = Z.computeCurvature(queryPoint, CCCoreLib::Neighbourhood::MEAN_CURV); //TODO: is it really the default one? } break; @@ -331,8 +332,8 @@ bool NeighborhoodFeature::computeValue(CCLib::DgmOctree::NeighboursSet& pointsIn case ANISO: if (kNN >= 3) { - CCLib::DgmOctreeReferenceCloud neighboursCloud(&pointsInNeighbourhood, static_cast(kNN)); - CCLib::Neighbourhood Z(&neighboursCloud); + CCCoreLib::DgmOctreeReferenceCloud neighboursCloud(&pointsInNeighbourhood, static_cast(kNN)); + CCCoreLib::Neighbourhood Z(&neighboursCloud); const CCVector3* G = Z.getGravityCenter(); if (G) { diff --git a/NeighborhoodFeature.h b/NeighborhoodFeature.h index b26aca1..cab58e2 100644 --- a/NeighborhoodFeature.h +++ b/NeighborhoodFeature.h @@ -158,13 +158,13 @@ namespace masc //inherited from Feature virtual Type getType() const override { return Type::NeighborhoodFeature; } virtual Feature::Shared clone() const override { return Feature::Shared(new NeighborhoodFeature(*this)); } - virtual bool prepare(const CorePoints& corePoints, QString& error, CCLib::GenericProgressCallback* progressCb = nullptr, SFCollector* generatedScalarFields = nullptr) override; + virtual bool prepare(const CorePoints& corePoints, QString& error, CCCoreLib::GenericProgressCallback* progressCb = nullptr, SFCollector* generatedScalarFields = nullptr) override; virtual bool finish(const CorePoints& corePoints, QString& error) override; virtual bool checkValidity(QString corePointRole, QString &error) const override; virtual QString toString() const override; //! Compute the feature value on a set of points - bool computeValue(CCLib::DgmOctree::NeighboursSet& pointsInNeighbourhood, const CCVector3& queryPoint, double& outputValue) const; + bool computeValue(CCCoreLib::DgmOctree::NeighboursSet& pointsInNeighbourhood, const CCVector3& queryPoint, double& outputValue) const; public: //members @@ -174,7 +174,7 @@ namespace masc NeighborhoodFeatureType type; //! Feature values - CCLib::ScalarField *sf1, *sf2; + CCCoreLib::ScalarField *sf1, *sf2; bool keepSF2; }; } \ No newline at end of file diff --git a/PointFeature.cpp b/PointFeature.cpp index f5c508d..7b18233 100644 --- a/PointFeature.cpp +++ b/PointFeature.cpp @@ -21,7 +21,7 @@ #include "q3DMASCTools.h" //qPDALIO -#include "../../core/IO/qPDALIO/src/LASFields.h" +#include "../../core/IO/qPDALIO/include/LASFields.h" //qCC_db #include @@ -199,7 +199,7 @@ IScalarFieldWrapper::Shared PointFeature::retrieveField(ccPointCloud* cloud, QSt { case PointFeature::Intensity: { - CCLib::ScalarField* sf = Tools::RetrieveSF(cloud, LAS_FIELD_NAMES[LAS_INTENSITY], false); + CCCoreLib::ScalarField* sf = Tools::RetrieveSF(cloud, LAS_FIELD_NAMES[LAS_INTENSITY], false); if (!sf) { error = "Cloud has no 'intensity' scalar field"; @@ -215,7 +215,7 @@ IScalarFieldWrapper::Shared PointFeature::retrieveField(ccPointCloud* cloud, QSt return IScalarFieldWrapper::Shared(new DimScalarFieldWrapper(cloud, DimScalarFieldWrapper::DimZ)); case PointFeature::NbRet: { - CCLib::ScalarField* sf = Tools::RetrieveSF(cloud, LAS_FIELD_NAMES[LAS_NUMBER_OF_RETURNS], false); + CCCoreLib::ScalarField* sf = Tools::RetrieveSF(cloud, LAS_FIELD_NAMES[LAS_NUMBER_OF_RETURNS], false); if (!sf) { error = "Cloud has no 'number of returns' scalar field"; @@ -225,7 +225,7 @@ IScalarFieldWrapper::Shared PointFeature::retrieveField(ccPointCloud* cloud, QSt } case PointFeature::RetNb: { - CCLib::ScalarField* sf = Tools::RetrieveSF(cloud, LAS_FIELD_NAMES[LAS_RETURN_NUMBER], false); + CCCoreLib::ScalarField* sf = Tools::RetrieveSF(cloud, LAS_FIELD_NAMES[LAS_RETURN_NUMBER], false); if (!sf) { error = "Cloud has no 'return number' scalar field"; @@ -236,13 +236,13 @@ IScalarFieldWrapper::Shared PointFeature::retrieveField(ccPointCloud* cloud, QSt case PointFeature::EchoRat: { //retrieve the two scalar fields 'p/q' - CCLib::ScalarField* numberOfRetSF = Tools::RetrieveSF(cloud, LAS_FIELD_NAMES[LAS_NUMBER_OF_RETURNS], false); + CCCoreLib::ScalarField* numberOfRetSF = Tools::RetrieveSF(cloud, LAS_FIELD_NAMES[LAS_NUMBER_OF_RETURNS], false); if (!numberOfRetSF) { error = "Can't compute the 'echo ratio' field: no 'Number of Return' SF available"; return nullptr; } - CCLib::ScalarField* retNumberSF = Tools::RetrieveSF(cloud, LAS_FIELD_NAMES[LAS_RETURN_NUMBER], false); + CCCoreLib::ScalarField* retNumberSF = Tools::RetrieveSF(cloud, LAS_FIELD_NAMES[LAS_RETURN_NUMBER], false); if (!retNumberSF) { error = "Can't compute the 'echo ratio' field: no 'Return number' SF available"; @@ -263,7 +263,7 @@ IScalarFieldWrapper::Shared PointFeature::retrieveField(ccPointCloud* cloud, QSt return IScalarFieldWrapper::Shared(new ColorScalarFieldWrapper(cloud, ColorScalarFieldWrapper::Blue)); case PointFeature::NIR: { - CCLib::ScalarField* sf = Tools::RetrieveSF(cloud, s_NIRSFName, false); + CCCoreLib::ScalarField* sf = Tools::RetrieveSF(cloud, s_NIRSFName, false); if (!sf) { error = "Cloud has no 'NIR' scalar field"; @@ -284,7 +284,7 @@ IScalarFieldWrapper::Shared PointFeature::retrieveField(ccPointCloud* cloud, QSt } case PointFeature::M3C2: { - CCLib::ScalarField* sf = Tools::RetrieveSF(cloud, s_M3C2SFName, true); + CCCoreLib::ScalarField* sf = Tools::RetrieveSF(cloud, s_M3C2SFName, true); if (!sf) { error = "Cloud has no 'm3c2 distance' scalar field"; @@ -294,7 +294,7 @@ IScalarFieldWrapper::Shared PointFeature::retrieveField(ccPointCloud* cloud, QSt } case PointFeature::PCV: { - CCLib::ScalarField* sf = Tools::RetrieveSF(cloud, s_PCVSFName, true); + CCCoreLib::ScalarField* sf = Tools::RetrieveSF(cloud, s_PCVSFName, true); if (!sf) { error = "Cloud has no 'PCV/Illuminance' scalar field"; @@ -319,12 +319,12 @@ IScalarFieldWrapper::Shared PointFeature::retrieveField(ccPointCloud* cloud, QSt static bool ComputeMathOpWithNearestNeighbor( const CorePoints& corePoints, const IScalarFieldWrapper& field1, - CCLib::ScalarField* outSF, + CCCoreLib::ScalarField* outSF, ccPointCloud& cloud2, const IScalarFieldWrapper& field2, masc::Feature::Operation op, QString& error, - CCLib::GenericProgressCallback* progressCb = nullptr) + CCCoreLib::GenericProgressCallback* progressCb = nullptr) { if (op == masc::Feature::NO_OPERATION || !outSF || outSF->size() != corePoints.size()) { @@ -357,7 +357,7 @@ static bool ComputeMathOpWithNearestNeighbor( const CorePoints& corePoints, progressCb->setInfo(qPrintable(logMessage)); } ccLog::Print(logMessage); - CCLib::NormalizedProgress nProgress(progressCb, pointCount); + CCCoreLib::NormalizedProgress nProgress(progressCb, pointCount); QMutex mutex; double meanNeighborhoodSize = 0; @@ -371,10 +371,10 @@ static bool ComputeMathOpWithNearestNeighbor( const CorePoints& corePoints, for (int i = 0; i < static_cast(pointCount); ++i) { const CCVector3* P = corePoints.cloud->getPoint(i); - CCLib::ReferenceCloud Yk(&cloud2); + CCCoreLib::ReferenceCloud Yk(&cloud2); double maxSquareDist = 0; - ScalarType s = NAN_VALUE; + ScalarType s = CCCoreLib::NAN_VALUE; int neighborhoodSize = 0; if (octree->findPointNeighbourhood(P, &Yk, 1, octreeLevel, maxSquareDist, 0.0, &neighborhoodSize) >= 1) @@ -391,7 +391,7 @@ static bool ComputeMathOpWithNearestNeighbor( const CorePoints& corePoints, double density = meanNeighborhoodSize / tenth; if (density < 1.1) { - if (octreeLevel + 1 < CCLib::DgmOctree::MAX_OCTREE_LEVEL) + if (octreeLevel + 1 < CCCoreLib::DgmOctree::MAX_OCTREE_LEVEL) ++octreeLevel; } else while (density > 2.9) @@ -435,7 +435,7 @@ static bool ComputeMathOpWithNearestNeighbor( const CorePoints& corePoints, bool PointFeature::prepare( const CorePoints& corePoints, QString& error, - CCLib::GenericProgressCallback* progressCb/*=nullptr*/, + CCCoreLib::GenericProgressCallback* progressCb/*=nullptr*/, SFCollector* generatedScalarFields/*=nullptr*/) { if (!cloud1 || !corePoints.cloud) @@ -553,7 +553,7 @@ bool PointFeature::prepare( const CorePoints& corePoints, //retrieve/create a SF to host the result int sfIdx = corePoints.cloud->getScalarFieldIndexByName(qPrintable(resultSFName)); - CCLib::ScalarField* resultSF = nullptr; + CCCoreLib::ScalarField* resultSF = nullptr; if (sfIdx >= 0) { //reuse the existing field @@ -613,7 +613,7 @@ bool PointFeature::prepare( const CorePoints& corePoints, } } -bool PointFeature::computeStat(const CCLib::DgmOctree::NeighboursSet& pointsInNeighbourhood, const IScalarFieldWrapper::Shared& sourceField, double& outputValue) const +bool PointFeature::computeStat(const CCCoreLib::DgmOctree::NeighboursSet& pointsInNeighbourhood, const IScalarFieldWrapper::Shared& sourceField, double& outputValue) const { outputValue = std::numeric_limits::quiet_NaN(); @@ -666,7 +666,7 @@ bool PointFeature::computeStat(const CCLib::DgmOctree::NeighboursSet& pointsInNe double sum = 0.0; double sum2 = 0.0; - CCLib::WeibullDistribution::ScalarContainer values; + CCCoreLib::WeibullDistribution::ScalarContainer values; if (storeValues) { try @@ -708,7 +708,7 @@ bool PointFeature::computeStat(const CCLib::DgmOctree::NeighboursSet& pointsInNe case Feature::MODE: { - CCLib::WeibullDistribution w; + CCCoreLib::WeibullDistribution w; if (w.computeParameters(values)) outputValue = w.computeMode(); } @@ -737,7 +737,7 @@ bool PointFeature::computeStat(const CCLib::DgmOctree::NeighboursSet& pointsInNe case Feature::SKEW: { - CCLib::WeibullDistribution w; + CCCoreLib::WeibullDistribution w; if (w.computeParameters(values)) outputValue = w.computeSkewness(); } diff --git a/PointFeature.h b/PointFeature.h index 6ed7821..c5864ad 100644 --- a/PointFeature.h +++ b/PointFeature.h @@ -180,13 +180,13 @@ namespace masc //inherited from Feature virtual Type getType() const override { return Type::PointFeature; } virtual Feature::Shared clone() const override { return Feature::Shared(new PointFeature(*this)); } - virtual bool prepare(const CorePoints& corePoints, QString& error, CCLib::GenericProgressCallback* progressCb = nullptr, SFCollector* generatedScalarFields = nullptr) override; + virtual bool prepare(const CorePoints& corePoints, QString& error, CCCoreLib::GenericProgressCallback* progressCb = nullptr, SFCollector* generatedScalarFields = nullptr) override; virtual bool finish(const CorePoints& corePoints, QString& error) override; virtual bool checkValidity(QString corePointRole, QString &error) const override; virtual QString toString() const override; //! Compute the associated 'stat' on a set of points (and with a given field) - bool computeStat(const CCLib::DgmOctree::NeighboursSet& pointsInNeighbourhood, const IScalarFieldWrapper::Shared& sourceField, double& outputValue) const; + bool computeStat(const CCCoreLib::DgmOctree::NeighboursSet& pointsInNeighbourhood, const IScalarFieldWrapper::Shared& sourceField, double& outputValue) const; protected: //methods @@ -210,7 +210,7 @@ namespace masc IScalarFieldWrapper::Shared field2; //! For scaled features - CCLib::ScalarField *statSF1, *statSF2; + CCCoreLib::ScalarField *statSF1, *statSF2; //bool keepStatSF2; }; diff --git a/ScalarFieldCollector.cpp b/ScalarFieldCollector.cpp index 869dbc7..92120d5 100644 --- a/ScalarFieldCollector.cpp +++ b/ScalarFieldCollector.cpp @@ -26,7 +26,7 @@ //system #include -void SFCollector::push(ccPointCloud* cloud, CCLib::ScalarField* sf, Behavior behavior) +void SFCollector::push(ccPointCloud* cloud, CCCoreLib::ScalarField* sf, Behavior behavior) { assert(!scalarFields.contains(sf)); SFDesc desc; @@ -46,7 +46,7 @@ void SFCollector::releaseSFs(bool keepByDefault) continue; } - CCLib::ScalarField* sf = it.key(); + CCCoreLib::ScalarField* sf = it.key(); int sfIdx = desc.cloud->getScalarFieldIndexByName(sf->getName()); if (sfIdx >= 0) { diff --git a/ScalarFieldCollector.h b/ScalarFieldCollector.h index 9aa1a73..6d00b80 100644 --- a/ScalarFieldCollector.h +++ b/ScalarFieldCollector.h @@ -25,7 +25,7 @@ class ccPointCloud; -namespace CCLib +namespace CCCoreLib { class ScalarField; }; @@ -39,17 +39,17 @@ class SFCollector enum Behavior { ALWAYS_KEEP, CAN_REMOVE, ALWAYS_REMOVE }; - void push(ccPointCloud* cloud, CCLib::ScalarField* sf, Behavior behavior); + void push(ccPointCloud* cloud, CCCoreLib::ScalarField* sf, Behavior behavior); void releaseSFs(bool keepByDefault); struct SFDesc { ccPointCloud* cloud = nullptr; - CCLib::ScalarField* sf = nullptr; + CCCoreLib::ScalarField* sf = nullptr; Behavior behavior = CAN_REMOVE; }; - using Map = QMap< CCLib::ScalarField*, SFDesc >; + using Map = QMap< CCCoreLib::ScalarField*, SFDesc >; Map scalarFields; }; diff --git a/ScalarFieldWrappers.h b/ScalarFieldWrappers.h index 678be90..236e954 100644 --- a/ScalarFieldWrappers.h +++ b/ScalarFieldWrappers.h @@ -38,7 +38,7 @@ public: class ScalarFieldWrapper : public IScalarFieldWrapper { public: - ScalarFieldWrapper(CCLib::ScalarField* sf) + ScalarFieldWrapper(CCCoreLib::ScalarField* sf) : m_sf(sf) {} @@ -48,13 +48,13 @@ public: virtual size_t size() const override { return m_sf->size(); } protected: - CCLib::ScalarField* m_sf; + CCCoreLib::ScalarField* m_sf; }; class ScalarFieldRatioWrapper : public IScalarFieldWrapper { public: - ScalarFieldRatioWrapper(CCLib::ScalarField* sfp, CCLib::ScalarField* sfq, QString name) + ScalarFieldRatioWrapper(CCCoreLib::ScalarField* sfp, CCCoreLib::ScalarField* sfq, QString name) : m_sfp(sfp) , m_sfq(sfq) , m_name(name) @@ -64,7 +64,7 @@ public: { ScalarType p = m_sfp->getValue(index); ScalarType q = m_sfq->getValue(index); - ScalarType ratio = (std::abs(q) > std::numeric_limits::epsilon() ? p / q : NAN_VALUE); + ScalarType ratio = (std::abs(q) > std::numeric_limits::epsilon() ? p / q : CCCoreLib::NAN_VALUE); return ratio; } virtual inline bool isValid() const { return (m_sfp != nullptr && m_sfq != nullptr); } @@ -72,7 +72,7 @@ public: virtual inline size_t size() const override { return std::min(m_sfp->size(), m_sfq->size()); } protected: - CCLib::ScalarField *m_sfp, *m_sfq; + CCCoreLib::ScalarField *m_sfp, *m_sfq; QString m_name; }; diff --git a/q3DMASC.cpp b/q3DMASC.cpp index 35acb70..727923b 100644 --- a/q3DMASC.cpp +++ b/q3DMASC.cpp @@ -439,7 +439,7 @@ void q3DMASCPlugin::doTrainAction() } //train / test subsets - QSharedPointer trainSubset, testSubset; + QSharedPointer trainSubset, testSubset; float previousTestSubsetRatio = -1.0f; SFCollector generatedScalarFields, generatedScalarFieldsTest; @@ -519,11 +519,11 @@ void q3DMASCPlugin::doTrainAction() else if (previousTestSubsetRatio != testDataRatio) { if (!trainSubset) - trainSubset.reset(new CCLib::ReferenceCloud(corePoints.cloud)); + trainSubset.reset(new CCCoreLib::ReferenceCloud(corePoints.cloud)); trainSubset->clear(); if (!testSubset) - testSubset.reset(new CCLib::ReferenceCloud(corePoints.cloud)); + testSubset.reset(new CCCoreLib::ReferenceCloud(corePoints.cloud)); testSubset->clear(); //randomly select the training points diff --git a/q3DMASC.h b/q3DMASC.h index 4f8e7f0..1bdb518 100644 --- a/q3DMASC.h +++ b/q3DMASC.h @@ -1,3 +1,5 @@ +#pragma once + //########################################################################## //# # //# CLOUDCOMPARE PLUGIN: q3DMASC # @@ -15,33 +17,28 @@ //# # //########################################################################## -#ifndef Q_3DMASC_PLUGIN_HEADER -#define Q_3DMASC_PLUGIN_HEADER - //qCC #include -//qCC_db -#include - //! 3DMASC plugin /** 3D Multi-cloud, multi-Attribute, multi-Scale, multi-Class classification **/ class q3DMASCPlugin : public QObject, public ccStdPluginInterface { Q_OBJECT - Q_INTERFACES(ccStdPluginInterface) + Q_INTERFACES(ccPluginInterface ccStdPluginInterface) + Q_PLUGIN_METADATA(IID "cccorp.cloudcompare.plugin.q3DMASC" FILE "info.json") public: //! Default constructor - q3DMASCPlugin(QObject* parent = nullptr); + explicit q3DMASCPlugin(QObject* parent = nullptr); //inherited from ccStdPluginInterface void onNewSelection(const ccHObject::Container& selectedEntities) override; - virtual QList getActions() override; - virtual void registerCommands(ccCommandLineInterface* cmd) override; + QList getActions() override; + void registerCommands(ccCommandLineInterface* cmd) override; protected slots: @@ -50,7 +47,7 @@ protected slots: protected: - //! Calssift action + //! Calssify action QAction* m_classifyAction; //! Train action QAction* m_trainAction; @@ -58,5 +55,3 @@ protected: //! Currently selected entities ccHObject::Container m_selectedEntities; }; - -#endif //Q_3DMASC_PLUGIN_HEADER diff --git a/q3DMASCClassifier.cpp b/q3DMASCClassifier.cpp index 9dbf43e..cb852e8 100644 --- a/q3DMASCClassifier.cpp +++ b/q3DMASCClassifier.cpp @@ -28,7 +28,7 @@ #include //qPDALIO -#include "../../core/IO/qPDALIO/src/LASFields.h" +#include "../../core/IO/qPDALIO/include/LASFields.h" //qCC_plugins #include @@ -121,7 +121,7 @@ bool Classifier::classify( const Feature::Source::Set& featureSources, } //look for the classification field - CCLib::ScalarField* classificationSF = Tools::GetClassificationSF(cloud); + CCCoreLib::ScalarField* classificationSF = Tools::GetClassificationSF(cloud); if (classificationSF) { @@ -190,7 +190,7 @@ bool Classifier::classify( const Feature::Source::Set& featureSources, pDlg->show(); QCoreApplication::processEvents(); } - CCLib::NormalizedProgress nProgress(pDlg.data(), cloud->size()); + CCCoreLib::NormalizedProgress nProgress(pDlg.data(), cloud->size()); bool success = true; #ifndef _DEBUG @@ -264,7 +264,7 @@ bool Classifier::evaluate(const Feature::Source::Set& featureSources, ccPointCloud* testCloud, AccuracyMetrics& metrics, QString& errorMessage, - CCLib::ReferenceCloud* testSubset/*=nullptr=*/, + CCCoreLib::ReferenceCloud* testSubset/*=nullptr=*/, QString outputSFName/*=QString()*/, QWidget* parentWidget/*=nullptr*/) { @@ -296,7 +296,7 @@ bool Classifier::evaluate(const Feature::Source::Set& featureSources, } //look for the classification field - CCLib::ScalarField* classifSF = Tools::GetClassificationSF(testCloud); + CCCoreLib::ScalarField* classifSF = Tools::GetClassificationSF(testCloud); if (!classifSF || classifSF->size() < testCloud->size()) { assert(false); @@ -304,7 +304,7 @@ bool Classifier::evaluate(const Feature::Source::Set& featureSources, return false; } - CCLib::ScalarField* outputSF = nullptr; + CCCoreLib::ScalarField* outputSF = nullptr; if (!outputSFName.isEmpty()) { int outSFIndex = testCloud->getScalarFieldIndexByName(qPrintable(outputSFName)); @@ -324,7 +324,7 @@ bool Classifier::evaluate(const Feature::Source::Set& featureSources, { outputSF = testCloud->getScalarField(outSFIndex); } - outputSF->fill(NAN_VALUE); + outputSF->fill(CCCoreLib::NAN_VALUE); outputSF->computeMinAndMax(); } @@ -353,7 +353,7 @@ bool Classifier::evaluate(const Feature::Source::Set& featureSources, pDlg->show(); QCoreApplication::processEvents(); } - CCLib::NormalizedProgress nProgress(pDlg.data(), testSampleCount); + CCCoreLib::NormalizedProgress nProgress(pDlg.data(), testSampleCount); //fill the data matrix for (int fIndex = 0; fIndex < attributesPerSample; ++fIndex) @@ -422,7 +422,7 @@ bool Classifier::train( const ccPointCloud* cloud, const RandomTreesParams& params, const Feature::Source::Set& featureSources, QString& errorMessage, - CCLib::ReferenceCloud* trainSubset/*=nullptr*/, + CCCoreLib::ReferenceCloud* trainSubset/*=nullptr*/, ccMainAppInterface* app/*=nullptr*/, QWidget* parentWidget/*=nullptr*/) { @@ -444,7 +444,7 @@ bool Classifier::train( const ccPointCloud* cloud, } //look for the classification field - CCLib::ScalarField* classifSF = Tools::GetClassificationSF(cloud); + CCCoreLib::ScalarField* classifSF = Tools::GetClassificationSF(cloud); if (!classifSF || classifSF->size() < cloud->size()) { assert(false); diff --git a/q3DMASCClassifier.h b/q3DMASCClassifier.h index b8dd0b2..356363a 100644 --- a/q3DMASCClassifier.h +++ b/q3DMASCClassifier.h @@ -48,7 +48,7 @@ namespace masc const RandomTreesParams& params, const Feature::Source::Set& featureSources, QString& errorMessage, - CCLib::ReferenceCloud* trainSubset = nullptr, + CCCoreLib::ReferenceCloud* trainSubset = nullptr, ccMainAppInterface* app = nullptr, QWidget* parentWidget = nullptr); @@ -65,7 +65,7 @@ namespace masc ccPointCloud* testCloud, AccuracyMetrics& metrics, QString& errorMessage, - CCLib::ReferenceCloud* testSubset = nullptr, + CCCoreLib::ReferenceCloud* testSubset = nullptr, QString outputSFName = QString(), QWidget* parentWidget = nullptr); diff --git a/q3DMASCCommands.h b/q3DMASCCommands.h index 7bf4a20..ad7fdbc 100644 --- a/q3DMASCCommands.h +++ b/q3DMASCCommands.h @@ -18,7 +18,7 @@ //########################################################################## //CloudCompare -#include "../../ccCommandLineInterface.h" +#include //Local #include "q3DMASCTools.h" @@ -28,6 +28,7 @@ //Qt #include +#include static const char COMMAND_3DMASC_CLASSIFY[] = "3DMASC_CLASSIFY"; static const char COMMAND_3DMASC_KEEP_ATTRIBS[] = "KEEP_ATTRIBUTES"; diff --git a/q3DMASCTools.cpp b/q3DMASCTools.cpp index 3903fdb..8d8c562 100644 --- a/q3DMASCTools.cpp +++ b/q3DMASCTools.cpp @@ -30,7 +30,7 @@ #include //qPDALIO -#include "../../core/IO/qPDALIO/src/LASFields.h" +#include "../../core/IO/qPDALIO/include/LASFields.h" //Qt #include @@ -908,7 +908,7 @@ bool Tools::LoadTrainingFile( QString filename, } } -CCLib::ScalarField* Tools::RetrieveSF(const ccPointCloud* cloud, const QString& sfName, bool caseSensitive/*=true*/) +CCCoreLib::ScalarField* Tools::RetrieveSF(const ccPointCloud* cloud, const QString& sfName, bool caseSensitive/*=true*/) { if (!cloud) { @@ -952,7 +952,7 @@ struct FeaturesAndScales QMap > contextBasedFeaturesPerScale; }; -bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features, QString& errorStr, CCLib::GenericProgressCallback* progressCb/*=nullptr*/, SFCollector* generatedScalarFields/*=nullptr*/) +bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features, QString& errorStr, CCCoreLib::GenericProgressCallback* progressCb/*=nullptr*/, SFCollector* generatedScalarFields/*=nullptr*/) { if (features.empty() || !corePoints.origin) { @@ -1116,7 +1116,7 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features progressCb->setInfo(qPrintable(logMessage)); } ccLog::Print(logMessage); - CCLib::NormalizedProgress nProgress(progressCb, pointCount); + CCCoreLib::NormalizedProgress nProgress(progressCb, pointCount); QMutex mutex; #ifndef _DEBUG @@ -1127,7 +1127,7 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features for (int i = 0; i < static_cast(pointCount); ++i) { //spherical neighborhood extraction structure - CCLib::DgmOctree::NearestNeighboursSphericalSearchStruct nNSS; + CCCoreLib::DgmOctree::NearestNeighboursSphericalSearchStruct nNSS; { nNSS.level = octreeLevel; nNSS.queryPoint = *corePoints.cloud->getPoint(i); @@ -1294,7 +1294,7 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features return success; } -bool Tools::RandomSubset(ccPointCloud* cloud, float ratio, CCLib::ReferenceCloud* inRatioSubset, CCLib::ReferenceCloud* outRatioSubset) +bool Tools::RandomSubset(ccPointCloud* cloud, float ratio, CCCoreLib::ReferenceCloud* inRatioSubset, CCCoreLib::ReferenceCloud* outRatioSubset) { if (!cloud) { @@ -1379,7 +1379,7 @@ bool Tools::RandomSubset(ccPointCloud* cloud, float ratio, CCLib::ReferenceCloud return true; } -CCLib::ScalarField* Tools::GetClassificationSF(const ccPointCloud* cloud) +CCCoreLib::ScalarField* Tools::GetClassificationSF(const ccPointCloud* cloud) { if (!cloud) { diff --git a/q3DMASCTools.h b/q3DMASCTools.h index 318a790..ed25468 100644 --- a/q3DMASCTools.h +++ b/q3DMASCTools.h @@ -55,14 +55,14 @@ namespace masc static bool SaveClassifier(QString filename, const Feature::Set& features, const QString corePointsRole, const masc::Classifier& classifier, QWidget* parent = nullptr); - static bool PrepareFeatures(const CorePoints& corePoints, Feature::Set& features, QString& error, CCLib::GenericProgressCallback* progressCb = nullptr, SFCollector* generatedScalarFields = nullptr); + static bool PrepareFeatures(const CorePoints& corePoints, Feature::Set& features, QString& error, CCCoreLib::GenericProgressCallback* progressCb = nullptr, SFCollector* generatedScalarFields = nullptr); - static bool RandomSubset(ccPointCloud* cloud, float ratio, CCLib::ReferenceCloud* inRatioSubset, CCLib::ReferenceCloud* outRatioSubset); + static bool RandomSubset(ccPointCloud* cloud, float ratio, CCCoreLib::ReferenceCloud* inRatioSubset, CCCoreLib::ReferenceCloud* outRatioSubset); - static CCLib::ScalarField* RetrieveSF(const ccPointCloud* cloud, const QString& sfName, bool caseSensitive = true); + static CCCoreLib::ScalarField* RetrieveSF(const ccPointCloud* cloud, const QString& sfName, bool caseSensitive = true); //! Helper: returns the classification SF associated to a cloud (if any) - static CCLib::ScalarField* GetClassificationSF(const ccPointCloud* cloud); + static CCCoreLib::ScalarField* GetClassificationSF(const ccPointCloud* cloud); }; }; //namespace masc diff --git a/qClassify3DMASCDialog.cpp b/qClassify3DMASCDialog.cpp index 008e635..fd6d340 100644 --- a/qClassify3DMASCDialog.cpp +++ b/qClassify3DMASCDialog.cpp @@ -18,7 +18,7 @@ #include "qClassify3DMASCDialog.h" //qCC_plugins -#include "../../ccMainAppInterface.h" +#include //qCC_db #include