Files
pubgeo/src/common/PointCloud.h
Bradley J Chambers fef97f6275 Add PDAL plugin
SHR3D is available as writers.shr3d and can be appended to any PDAL pipeline.
PDAL will not be altered to infer writers.shr3d (many writers could write a
TIF), so users will have to specify writers.shr3d explicitly.

ALIGN3D is available as filters.align3d and can be inserted into any PDAL
pipeline. ALIGN3D will take the first incoming PointView as the fixed or
reference PointView, and will register all subsequent PointViews to this
reference view.

Minor changes: Ignore build directory for in-source builds. Add clang-format
config file (the plugin code adheres to this).

PubGeo common code updated to read directly from PDAL PointViews. Common code
also updated to silence a bunch of warnings.
2017-09-19 22:05:06 -04:00

71 lines
1.9 KiB
C++

// Copyright 2017 The Johns Hopkins University Applied Physics Laboratory.
// Licensed under the MIT License. See LICENSE.txt in the project root for full license information.
//
// Created by almess1 on 4/20/17.
// This file was created in order to adapt the SHR3D and ALIGN3D to open source IO.
//
#ifndef PUBGEO_NOT_POINT_SETS_H
#define PUBGEO_NOT_POINT_SETS_H
#include <pdal/PointView.hpp>
#include <pdal/PipelineExecutor.hpp>
namespace pubgeo {
struct MinMaxXYZ {
double xMin;
double xMax;
double yMin;
double yMax;
double zMin;
double zMax;
};
class PointCloud {
public:
PointCloud();
~PointCloud();
static bool TransformPointCloud(const char *inputFileName, const char *outputFileName,
float translateX, float translateY, float translateZ);
bool Read(const char *fileName);
bool Read(pdal::PointViewPtr view);
MinMaxXYZ bounds;
int zone;
unsigned long numPoints;
int xOff;
int yOff;
int zOff;
inline float x(int i) {
if (pv != nullptr)
return (float) (pv->getFieldAs<double>(pdal::Dimension::Id::X, i) - xOff);
throw "Point set has not be initialized.";
}
inline float y(int i) {
if (pv != nullptr)
return (float) (pv->getFieldAs<double>(pdal::Dimension::Id::Y, i) - yOff);
throw "Point set has not be initialized.";
}
inline float z(int i) {
if (pv != nullptr)
return (float) (pv->getFieldAs<double>(pdal::Dimension::Id::Z, i) - zOff);
throw "Point set has not be initialized.";
}
private:
pdal::PipelineExecutor *executor;
pdal::PointView *pv;
void CleanupPdalPointers();
};
}
#endif //PUBGEO_NOT_POINT_SETS_H