Skip to content

Commit

Permalink
Merge pull request #226 from potree/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
m-schuetz authored Feb 12, 2017
2 parents 4b4455f + 0347b45 commit f5ba3a1
Show file tree
Hide file tree
Showing 156 changed files with 42,862 additions and 64,745 deletions.
2 changes: 0 additions & 2 deletions PotreeConverter/include/BINPointWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ namespace Potree{
class BINPointWriter : public PointWriter{

public:
string file;
int numPoints;
PointAttributes attributes;
ofstream *writer;
AABB aabb;
Expand Down
11 changes: 11 additions & 0 deletions PotreeConverter/include/CloudJS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class CloudJS{
double scale;
int hierarchyStepSize = -1;
long long numAccepted = 0;
string projection = "";

CloudJS() = default;

Expand All @@ -70,8 +71,16 @@ class CloudJS{
Value &vScale = d["scale"];
Value &vHierarchyStepSize = d["hierarchyStepSize"];



version = vVersion.GetString();
octreeDir = vOctreeDir.GetString();

if(d.HasMember("projection")){
Value &vProjection = d["projection"];
projection = vProjection.GetString();
}

numAccepted = vPoints.GetInt64();
boundingBox = AABB(
Vector3<double>(vBoundingBox["lx"].GetDouble(), vBoundingBox["ly"].GetDouble(), vBoundingBox["lz"].GetDouble()),
Expand Down Expand Up @@ -114,6 +123,7 @@ class CloudJS{

Value version(this->version.c_str(), (rapidjson::SizeType)this->version.size());
Value octreeDir("data");
Value projection(this->projection.c_str(), (rapidjson::SizeType)this->projection.size());
Value boundingBox(rapidjson::kObjectType);
{
//Value min(rapidjson::kArrayType);
Expand Down Expand Up @@ -179,6 +189,7 @@ class CloudJS{

d.AddMember("version", version, d.GetAllocator());
d.AddMember("octreeDir", octreeDir, d.GetAllocator());
d.AddMember("projection", projection, d.GetAllocator());
d.AddMember("points", (uint64_t)numAccepted, d.GetAllocator());
d.AddMember("boundingBox", boundingBox, d.GetAllocator());
d.AddMember("tightBoundingBox", tightBoundingBox, d.GetAllocator());
Expand Down
8 changes: 3 additions & 5 deletions PotreeConverter/include/LASPointReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class LIBLASReader{
laszip_BOOL request_reader = 1;
laszip_request_compatibility_mode(laszip_reader, request_reader);

{// read first 1000 points to find if color is 1 or 2 bytes
{// read first x points to find if color is 1 or 2 bytes
laszip_BOOL is_compressed = boost::iends_with(path, ".laz") ? 1 : 0;
laszip_open_reader(laszip_reader, path.c_str(), &is_compressed);

Expand All @@ -65,7 +65,7 @@ class LIBLASReader{
laszip_get_point_pointer(laszip_reader, &point);

colorScale = 1;
for(int i = 0; i < 1000 && i < npoints; i++){
for(int i = 0; i < 100000 && i < npoints; i++){
laszip_read_point(laszip_reader);

auto r = point->rgb[0];
Expand All @@ -75,9 +75,7 @@ class LIBLASReader{
if(r > 255 || g > 255 || b > 255){
colorScale = 256;
break;
}

i++;
};
}
}

Expand Down
5 changes: 3 additions & 2 deletions PotreeConverter/include/LASPointWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ namespace Potree{
class LASPointWriter : public PointWriter{

public:
string file;
int numPoints = 0;
AABB aabb;
laszip_POINTER writer = NULL;
laszip_header header;
Expand All @@ -51,6 +49,9 @@ class LASPointWriter : public PointWriter{
header.max_x = aabb.max.x;
header.max_y = aabb.max.y;
header.max_z = aabb.max.z;
header.x_offset = aabb.min.x;
header.y_offset = aabb.min.y;
header.z_offset = aabb.min.z;
header.x_scale_factor = scale;
header.y_scale_factor = scale;
header.z_scale_factor = scale;
Expand Down
2 changes: 1 addition & 1 deletion PotreeConverter/include/PointWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PointWriter{

public:
string file;
int numPoints;
int numPoints = 0;

virtual ~PointWriter(){};

Expand Down
8 changes: 8 additions & 0 deletions PotreeConverter/include/PotreeConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ class PotreeConverter{
vector<double> aabbValues;
string pageName = "";
StoreOption storeOption = StoreOption::ABORT_IF_EXISTS;
string projection = "";
bool sourceListingOnly = false;
ConversionQuality quality = ConversionQuality::DEFAULT;
string title = "PotreeViewer";
string description = "";
bool edlEnabled = false;
bool showSkybox = false;
string material = "RGB";

PotreeConverter(string workDir, vector<string> sources);

Expand Down
9 changes: 7 additions & 2 deletions PotreeConverter/include/PotreeWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,13 @@ class PotreeWriter{
vector<Point> store;
thread storeThread;
int pointsInMemory = 0;
string projection = "";
ConversionQuality quality = ConversionQuality::DEFAULT;


PotreeWriter(string workDir);
PotreeWriter(string workDir, ConversionQuality quality);

PotreeWriter(string workDir, AABB aabb, float spacing, int maxDepth, double scale, OutputFormat outputFormat, PointAttributes pointAttributes);
PotreeWriter(string workDir, AABB aabb, float spacing, int maxDepth, double scale, OutputFormat outputFormat, PointAttributes pointAttributes, ConversionQuality quality);

~PotreeWriter(){
close();
Expand All @@ -138,7 +140,10 @@ class PotreeWriter{
flush();
}

void setProjection(string projection);

void loadStateFromDisk();

private:

};
Expand Down
4 changes: 4 additions & 0 deletions PotreeConverter/include/SparseGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ class SparseGrid : public unordered_map<long long, GridCell*>{

bool isDistant(const Vector3<double> &p, GridCell *cell);

bool isDistant(const Vector3<double> &p, GridCell *cell, float &squaredSpacing);

bool willBeAccepted(const Vector3<double> &p);

bool willBeAccepted(const Vector3<double> &p, float &squaredSpacing);

bool add(Vector3<double> &p);

void addWithoutCheck(Vector3<double> &p);
Expand Down
6 changes: 6 additions & 0 deletions PotreeConverter/include/definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ enum class StoreOption{
INCREMENTAL
};

enum class ConversionQuality{
FAST,
DEFAULT,
NICE
};

}

#endif
2 changes: 2 additions & 0 deletions PotreeConverter/include/stuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ bool copyDir(fs::path source, fs::path destination);

float psign(float value);

string getExecutablePath();

}

#endif
55 changes: 0 additions & 55 deletions PotreeConverter/resources/page_template/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions PotreeConverter/resources/page_template/build/js/laslaz.js

This file was deleted.

10,229 changes: 0 additions & 10,229 deletions PotreeConverter/resources/page_template/build/js/potree.js

This file was deleted.

Loading

0 comments on commit f5ba3a1

Please sign in to comment.