mirror of
https://github.com/dgirardeau/q3DMASC.git
synced 2026-08-30 00:50:49 +08:00
Use overrides where needed (+encoding and header cleanup)
This commit is contained in:
+2
-2
@@ -24,7 +24,7 @@ namespace masc
|
||||
{
|
||||
int maxDepth = 25; //To be left as a parameter of the training plugin (default 25)
|
||||
int minSampleCount = 1; //To be left as a parameter of the training plugin (default 1)
|
||||
//int maxCategories = 0; //Normally not important as there’s no categorical variable
|
||||
//int maxCategories = 0; //Normally not important as there is no categorical variable
|
||||
int activeVarCount = 0; //Use 0 as the default parameter (works best)
|
||||
int maxTreeCount = 100; //Left as a parameter of the training plugin (default: 100)
|
||||
};
|
||||
@@ -35,4 +35,4 @@ namespace masc
|
||||
float testDataRatio = 0.2f; //percentage of test data
|
||||
};
|
||||
|
||||
}; //namespace masc
|
||||
}; //namespace masc
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <ScalarField.h>
|
||||
|
||||
//system
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
|
||||
void SFCollector::push(ccPointCloud* cloud, CCCoreLib::ScalarField* sf, Behavior behavior)
|
||||
{
|
||||
@@ -52,7 +52,7 @@ void SFCollector::releaseSFs(bool keepByDefault)
|
||||
//keep this SF
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
int sfIdx = desc.cloud->getScalarFieldIndexByName(sf->getName());
|
||||
if (sfIdx >= 0)
|
||||
{
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
//Qt
|
||||
#include <QMap>
|
||||
|
||||
//system
|
||||
#include <set>
|
||||
|
||||
class ccPointCloud;
|
||||
|
||||
namespace CCCoreLib
|
||||
|
||||
+20
-20
@@ -43,10 +43,10 @@ public:
|
||||
: m_sf(sf)
|
||||
{}
|
||||
|
||||
virtual inline double pointValue(unsigned index) const override { return m_sf->getValue(index); }
|
||||
virtual inline bool isValid() const { return m_sf != nullptr; }
|
||||
virtual inline QString getName() const { return QString::fromStdString(m_sf->getName()); }
|
||||
virtual size_t size() const override { return m_sf->size(); }
|
||||
inline double pointValue(unsigned index) const override { return m_sf->getValue(index); }
|
||||
inline bool isValid() const override { return m_sf != nullptr; }
|
||||
inline QString getName() const override { return QString::fromStdString(m_sf->getName()); }
|
||||
size_t size() const override { return m_sf->size(); }
|
||||
|
||||
protected:
|
||||
CCCoreLib::ScalarField* m_sf;
|
||||
@@ -61,16 +61,16 @@ public:
|
||||
, m_name(name)
|
||||
{}
|
||||
|
||||
virtual inline double pointValue(unsigned index) const override
|
||||
inline double pointValue(unsigned index) const override
|
||||
{
|
||||
ScalarType p = m_sfp->getValue(index);
|
||||
ScalarType q = m_sfq->getValue(index);
|
||||
ScalarType ratio = (std::abs(q) > std::numeric_limits<ScalarType>::epsilon() ? p / q : CCCoreLib::NAN_VALUE);
|
||||
return ratio;
|
||||
}
|
||||
virtual inline bool isValid() const { return (m_sfp != nullptr && m_sfq != nullptr); }
|
||||
virtual inline QString getName() const { return m_name; }
|
||||
virtual inline size_t size() const override { return std::min(m_sfp->size(), m_sfq->size()); }
|
||||
inline bool isValid() const override { return (m_sfp != nullptr && m_sfq != nullptr); }
|
||||
inline QString getName() const override { return m_name; }
|
||||
inline size_t size() const override { return std::min(m_sfp->size(), m_sfq->size()); }
|
||||
|
||||
protected:
|
||||
CCCoreLib::ScalarField *m_sfp, *m_sfq;
|
||||
@@ -94,9 +94,9 @@ public:
|
||||
ccNormalVectors::ConvertNormalToDipAndDipDir(N, dip_deg, dipDir_deg);
|
||||
return (m_mode == Dip ? dip_deg : dipDir_deg);
|
||||
}
|
||||
virtual inline bool isValid() const { return m_cloud != nullptr && m_cloud->hasNormals(); }
|
||||
virtual inline QString getName() const { static const char s_names[][14] = { "Norm dip", "Norm dip dir." }; return s_names[m_mode]; }
|
||||
virtual inline size_t size() const override { return m_cloud->size(); }
|
||||
inline bool isValid() const override { return m_cloud != nullptr && m_cloud->hasNormals(); }
|
||||
inline QString getName() const override { static const char s_names[][14] = { "Norm dip", "Norm dip dir." }; return s_names[m_mode]; }
|
||||
inline size_t size() const override { return m_cloud->size(); }
|
||||
|
||||
protected:
|
||||
const ccPointCloud* m_cloud;
|
||||
@@ -107,16 +107,16 @@ class DimScalarFieldWrapper : public IScalarFieldWrapper
|
||||
{
|
||||
public:
|
||||
enum Dim { DimX = 0, DimY = 1, DimZ = 2 };
|
||||
|
||||
|
||||
DimScalarFieldWrapper(const ccPointCloud* cloud, Dim dim)
|
||||
: m_cloud(cloud)
|
||||
, m_dim(dim)
|
||||
{}
|
||||
|
||||
virtual inline double pointValue(unsigned index) const override { return m_cloud->getPoint(index)->u[m_dim]; }
|
||||
virtual inline bool isValid() const { return m_cloud != nullptr; }
|
||||
virtual inline QString getName() const { static const char s_names[][5] = { "DimX", "DimY", "DimZ" }; return s_names[m_dim]; }
|
||||
virtual inline size_t size() const override { return m_cloud->size(); }
|
||||
inline double pointValue(unsigned index) const override { return m_cloud->getPoint(index)->u[m_dim]; }
|
||||
inline bool isValid() const override { return m_cloud != nullptr; }
|
||||
inline QString getName() const override { static const char s_names[][5] = { "DimX", "DimY", "DimZ" }; return s_names[m_dim]; }
|
||||
inline size_t size() const override { return m_cloud->size(); }
|
||||
|
||||
protected:
|
||||
const ccPointCloud* m_cloud;
|
||||
@@ -133,10 +133,10 @@ public:
|
||||
, m_band(band)
|
||||
{}
|
||||
|
||||
virtual inline double pointValue(unsigned index) const override { return m_cloud->getPointColor(index).rgba[m_band]; }
|
||||
virtual inline bool isValid() const { return m_cloud != nullptr && m_cloud->hasColors(); }
|
||||
virtual inline QString getName() const { static const char s_names[][6] = { "Red", "Green", "Blue" }; return s_names[m_band]; }
|
||||
virtual inline size_t size() const override { return m_cloud->size(); }
|
||||
inline double pointValue(unsigned index) const override { return m_cloud->getPointColor(index).rgba[m_band]; }
|
||||
inline bool isValid() const override{ return m_cloud != nullptr && m_cloud->hasColors(); }
|
||||
inline QString getName() const override { static const char s_names[][6] = { "Red", "Green", "Blue" }; return s_names[m_band]; }
|
||||
inline size_t size() const override { return m_cloud->size(); }
|
||||
|
||||
protected:
|
||||
const ccPointCloud* m_cloud;
|
||||
|
||||
+5
-5
@@ -42,7 +42,7 @@
|
||||
#include <QCoreApplication>
|
||||
|
||||
//system
|
||||
#include <assert.h>
|
||||
#include <cassert>
|
||||
|
||||
#if defined(_OPENMP)
|
||||
#include <omp.h>
|
||||
@@ -96,7 +96,7 @@ bool Tools::SaveClassifier( QString filename,
|
||||
{
|
||||
stream << "cloud: " << label << endl;
|
||||
}
|
||||
|
||||
|
||||
if (!corePointsRole.isEmpty())
|
||||
{
|
||||
stream << "# Core points (classified role)" << endl;
|
||||
@@ -686,7 +686,7 @@ static bool ReadCorePoints(const QString& command, const Tools::NamedClouds& clo
|
||||
|
||||
} //end of subsampling options
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -698,7 +698,7 @@ static bool ReadCloud(const QString& command, Tools::NamedClouds& clouds, const
|
||||
ccLog::Warning("Malformed file: expecting 2 tokens after 'cloud:' on line #" + QString::number(lineNumber));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
QString pcName = tokens[0].trimmed();
|
||||
QString pcFilename = defaultDir.absoluteFilePath(tokens[1].trimmed());
|
||||
//try to open the cloud
|
||||
@@ -1027,7 +1027,7 @@ CCCoreLib::ScalarField* Tools::RetrieveSF(const ccPointCloud* cloud, const QStri
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (sfIdx >= 0)
|
||||
{
|
||||
return cloud->getScalarField(sfIdx);
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
//System
|
||||
#include <assert.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
static const int FeatureImportanceColumn = 1;
|
||||
|
||||
Train3DMASCDialog::Train3DMASCDialog(QWidget* parent/*=nullptr*/)
|
||||
|
||||
Reference in New Issue
Block a user