Skip to content

Commit

Permalink
Replace PointTable with ColumnPointTable in many places.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed May 28, 2020
1 parent b89e7a9 commit 4e0d156
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 37 deletions.
1 change: 0 additions & 1 deletion filters/IQRFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ namespace pdal
{

class ProgramArgs;
class PointTable;
class PointView;

class PDAL_DLL IQRFilter : public Filter
Expand Down
2 changes: 1 addition & 1 deletion filters/LloydKMeansFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void LloydKMeansFilter::filter(PointView& view)

// setup table with at least XYZ as required by KDIndex, plus any
// additional dimensions as specified via filter options
PointTable table;
ColumnPointTable table;
table.layout()->registerDims({Id::X, Id::Y, Id::Z});
table.layout()->registerDims(m_dimIdList);

Expand Down
1 change: 0 additions & 1 deletion filters/MADFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ namespace pdal
{

class ProgramArgs;
class PointTable;
class PointView;

class PDAL_DLL MADFilter : public Filter
Expand Down
4 changes: 2 additions & 2 deletions filters/NeighborClassifierFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ bool NeighborClassifierFilter::doOne(PointRef& point, PointRef &temp,


PointViewPtr NeighborClassifierFilter::loadSet(const std::string& filename,
PointTable& table)
PointTableRef table)
{
PipelineManager mgr;

Expand All @@ -181,7 +181,7 @@ void NeighborClassifierFilter::filter(PointView& view)
}
else
{ // NN comes from candidate file
PointTable candTable;
ColumnPointTable candTable;
PointViewPtr candView = loadSet(m_candidateFile, candTable);
KD3Index& kdiCand = candView->build3dIndex();
PointRef point_nn(*candView, 0);
Expand Down
5 changes: 3 additions & 2 deletions filters/NeighborClassifierFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ class PDAL_DLL NeighborClassifierFilter : public Filter
virtual void filter(PointView& view);
virtual void initialize();
void doOneNoDomain(PointRef &point, PointRef& temp, KD3Index &kdi);
PointViewPtr loadSet(const std::string &candFileName, PointTable &table);
NeighborClassifierFilter& operator=(const NeighborClassifierFilter&) = delete;
PointViewPtr loadSet(const std::string &candFileName, PointTableRef table);
NeighborClassifierFilter& operator=(
const NeighborClassifierFilter&) = delete;
NeighborClassifierFilter(const NeighborClassifierFilter&) = delete;
StringList m_domainSpec;
std::vector<DimRange> m_domain;
Expand Down
2 changes: 1 addition & 1 deletion io/LasReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ QuickInfo LasReader::inspect()
QuickInfo qi;
std::unique_ptr<PointLayout> layout(new PointLayout());

PointTable table;
RowPointTable table;
initialize(table);
addDimensions(layout.get());

Expand Down
2 changes: 1 addition & 1 deletion io/private/ept/TileContents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void TileContents::readLaszip()
std::string filename = m_info.dataDir() + key().toString() + ".laz";
auto handle = m_connector.getLocalHandle(filename);

m_table.reset(new PointTable);
m_table.reset(new ColumnPointTable);

Options options;
options.add("filename", handle.localPath());
Expand Down
6 changes: 3 additions & 3 deletions kernels/DeltaKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void DeltaKernel::addSwitches(ProgramArgs& args)


PointViewPtr DeltaKernel::loadSet(const std::string& filename,
PointTable& table)
PointTableRef table)
{
Stage& reader = makeReader(filename, m_driverOverride);
reader.prepare(table);
Expand All @@ -81,8 +81,8 @@ PointViewPtr DeltaKernel::loadSet(const std::string& filename,

int DeltaKernel::execute()
{
PointTable srcTable;
PointTable candTable;
ColumnPointTable srcTable;
ColumnPointTable candTable;
DimIndexMap dims;

PointViewPtr srcView = loadSet(m_sourceFile, srcTable);
Expand Down
6 changes: 1 addition & 5 deletions kernels/DeltaKernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class PDAL_DLL DeltaKernel : public Kernel

private:
void addSwitches(ProgramArgs& args);
PointViewPtr loadSet(const std::string& filename, PointTable& table);
PointViewPtr loadSet(const std::string& filename, PointTableRef table);
MetadataNode dump(PointViewPtr& srcView, PointViewPtr& candView,
KD3Index& index, DimIndexMap& dims);
MetadataNode dumpDetail(PointViewPtr& srcView, PointViewPtr& candView,
Expand All @@ -81,10 +81,6 @@ class PDAL_DLL DeltaKernel : public Kernel
std::string m_sourceFile;
std::string m_candidateFile;

/**
std::ostream* m_outputStream;
**/

bool m_detail;
bool m_allDims;
};
Expand Down
2 changes: 1 addition & 1 deletion kernels/GroundKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void GroundKernel::addSwitches(ProgramArgs& args)

int GroundKernel::execute()
{
PointTable table;
ColumnPointTable table;

Options assignOptions;
assignOptions.add("assignment", "Classification[:]=0");
Expand Down
6 changes: 3 additions & 3 deletions kernels/HausdorffKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void HausdorffKernel::addSwitches(ProgramArgs& args)


PointViewPtr HausdorffKernel::loadSet(const std::string& filename,
PointTable& table)
PointTableRef table)
{
Stage& reader = makeReader(filename, "");
reader.prepare(table);
Expand All @@ -80,10 +80,10 @@ PointViewPtr HausdorffKernel::loadSet(const std::string& filename,

int HausdorffKernel::execute()
{
PointTable srcTable;
ColumnPointTable srcTable;
PointViewPtr srcView = loadSet(m_sourceFile, srcTable);

PointTable candTable;
ColumnPointTable candTable;
PointViewPtr candView = loadSet(m_candidateFile, candTable);

double hausdorff = Utils::computeHausdorff(srcView, candView);
Expand Down
2 changes: 1 addition & 1 deletion kernels/HausdorffKernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class PDAL_DLL HausdorffKernel : public Kernel

private:
virtual void addSwitches(ProgramArgs& args);
PointViewPtr loadSet(const std::string& filename, PointTable& table);
PointViewPtr loadSet(const std::string& filename, PointTableRef table);

std::string m_sourceFile;
std::string m_candidateFile;
Expand Down
4 changes: 2 additions & 2 deletions kernels/MergeKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ void MergeKernel::validateSwitches(ProgramArgs& args)

int MergeKernel::execute()
{
PointTable table;

MergeFilter filter;

for (size_t i = 0; i < m_files.size(); ++i)
Expand All @@ -83,6 +81,8 @@ int MergeKernel::execute()
}

Stage& writer = makeWriter(m_outputFile, filter, "");

ColumnPointTable table;
writer.prepare(table);
writer.execute(table);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion kernels/RandomKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int RandomKernel::execute()
writerOptions.add("compression", true);
Stage& writer = makeWriter(m_outputFile, reader, "", writerOptions);

PointTable table;
ColumnPointTable table;
writer.prepare(table);
writer.execute(table);

Expand Down
2 changes: 1 addition & 1 deletion kernels/SortKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ int SortKernel::execute()
writerOptions.add("forward_metadata", true);
Stage& writer = makeWriter(m_outputFile, sortStage, "", writerOptions);

PointTable table;
ColumnPointTable table;
writer.prepare(table);
writer.execute(table);

Expand Down
4 changes: 2 additions & 2 deletions kernels/SplitKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ std::string makeFilename(const std::string& s, int i)

int SplitKernel::execute()
{
PointTable table;

Stage& reader = makeReader(m_inputFile, m_driverOverride);

Options filterOpts;
Expand All @@ -113,6 +111,8 @@ int SplitKernel::execute()
filterOpts.add("capacity", m_capacity);
}
Stage& f = makeFilter(driver, reader, filterOpts);

ColumnPointTable table;
f.prepare(table);
PointViewSet pvSet = f.execute(table);

Expand Down
4 changes: 2 additions & 2 deletions kernels/TIndexKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ void TIndexKernel::mergeFile()
catch (std::bad_cast&)
{}

PointTable table;
ColumnPointTable table;
writer.prepare(table);
writer.execute(table);
}
Expand Down Expand Up @@ -502,7 +502,7 @@ bool TIndexKernel::fastBoundary(Stage& reader, FileInfo& fileInfo)

bool TIndexKernel::slowBoundary(Stage& hexer, FileInfo& fileInfo)
{
PointTable table;
ColumnPointTable table;
hexer.prepare(table);
PointViewSet set = hexer.execute(table);

Expand Down
1 change: 0 additions & 1 deletion pdal/PointContainer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ namespace pdal

class PDAL_DLL PointContainer
{
friend class PointTable;
friend class PointView;
friend class PointRef;
private:
Expand Down
3 changes: 3 additions & 0 deletions pdal/PointRef.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ class PDAL_DLL PointRef
Everything e;
Dimension::Type type = m_layout->dimDetail(dim)->type();

// We don't hoist getFieldInternal() out of the switch stmt.
// because we don't want to call if the type is bad. We also
// don't want an extra check on type.
switch (type)
{
case Dimension::Type::Unsigned8:
Expand Down
6 changes: 3 additions & 3 deletions pdal/PointTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ void SimplePointTable::getFieldInternal(Dimension::Id id, PointId idx,
}


PointTable::~PointTable()
RowPointTable::~RowPointTable()
{
for (auto vi = m_blocks.begin(); vi != m_blocks.end(); ++vi)
delete [] *vi;
}

PointId PointTable::addPoint()
PointId RowPointTable::addPoint()
{
if (m_numPts % m_blockPtCnt == 0)
{
Expand All @@ -118,7 +118,7 @@ PointId PointTable::addPoint()
}


char *PointTable::getPoint(PointId idx)
char *RowPointTable::getPoint(PointId idx)
{
char *buf = m_blocks[idx / m_blockPtCnt];
return buf + pointsToBytes(idx % m_blockPtCnt);
Expand Down
7 changes: 4 additions & 3 deletions pdal/PointTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class PDAL_DLL SimplePointTable : public BasePointTable

// This provides a context for processing a set of points and allows the library
// to be used to process multiple point sets simultaneously.
class PDAL_DLL PointTable : public SimplePointTable
class PDAL_DLL RowPointTable : public SimplePointTable
{
private:
// Point storage.
Expand All @@ -152,9 +152,9 @@ class PDAL_DLL PointTable : public SimplePointTable
static const point_count_t m_blockPtCnt = 65536;

public:
PointTable() : SimplePointTable(m_layout), m_numPts(0)
RowPointTable() : SimplePointTable(m_layout), m_numPts(0)
{}
virtual ~PointTable();
virtual ~RowPointTable();
virtual bool supportsView() const
{ return true; }

Expand All @@ -167,6 +167,7 @@ class PDAL_DLL PointTable : public SimplePointTable

PointLayout m_layout;
};
using PointTable = RowPointTable;

// This provides a context for processing a set of points and allows the library
// to be used to process multiple point sets simultaneously.
Expand Down

0 comments on commit 4e0d156

Please sign in to comment.