Skip to content

Commit

Permalink
add flushlimit and storesize attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-schuetz committed Nov 4, 2018
1 parent 4e393bf commit 685ef56
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions PotreeConverter/include/PotreeConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class PotreeConverter{
bool showSkybox = false;
string material = "RGB";
string executablePath;
int storeSize = 20'000;
int flushLimit = 10'000'000;

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

Expand Down
3 changes: 2 additions & 1 deletion PotreeConverter/include/PotreeWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PWNode{
bool addCalledSinceLastFlush = false;
PotreeWriter *potreeWriter;
vector<Point> cache;
int storeLimit = 20'000;
//int storeLimit = 20'000;
vector<Point> store;
bool isInMemory = true;

Expand Down Expand Up @@ -115,6 +115,7 @@ class PotreeWriter{
int pointsInMemory = 0;
string projection = "";
ConversionQuality quality = ConversionQuality::DEFAULT;
int storeSize = 20'000;


PotreeWriter(string workDir, ConversionQuality quality);
Expand Down
4 changes: 3 additions & 1 deletion PotreeConverter/src/PotreeConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ void PotreeConverter::convert(){
return;
}

writer->storeSize = storeSize;

vector<AABB> boundingBoxes;
vector<int> numPoints;
vector<string> sourceFilenames;
Expand Down Expand Up @@ -445,7 +447,7 @@ void PotreeConverter::convert(){

cout << ssMessage.str() << endl;
}
if((pointsProcessed % (10'000'000)) == 0){
if((pointsProcessed % (flushLimit)) == 0){
cout << "FLUSHING: ";

auto start = high_resolution_clock::now();
Expand Down
2 changes: 1 addition & 1 deletion PotreeConverter/src/PotreeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ PWNode *PWNode::add(Point &point){

if(isLeafNode()){
store.push_back(point);
if(int(store.size()) >= storeLimit){
if(int(store.size()) >= potreeWriter->storeSize){
split();
}

Expand Down
8 changes: 8 additions & 0 deletions PotreeConverter/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ struct PotreeArguments {
bool showSkybox = false;
string material = "RGB";
string executablePath;
int storeSize;
int flushLimit;
};

PotreeArguments parseArguments(int argc, char **argv){
Expand Down Expand Up @@ -95,6 +97,8 @@ PotreeArguments parseArguments(int argc, char **argv){
args.addArgument("edl-enabled", "Enable Eye-Dome-Lighting.");
args.addArgument("show-skybox", "");
args.addArgument("material", "RGB, ELEVATION, INTENSITY, INTENSITY_GRADIENT, CLASSIFICATION, RETURN_NUMBER, SOURCE, LEVEL_OF_DETAIL");
args.addArgument("store-size", "A node is split once more than store-size points are added. Reduce for better results at cost of performance. Default is 20000");
args.addArgument("flush-limit", "Flush after X points. Default is 10000000");

PotreeArguments a;

Expand Down Expand Up @@ -125,6 +129,8 @@ PotreeArguments parseArguments(int argc, char **argv){
}
a.outdir = args.get("outdir").as<string>();
a.spacing = args.get("spacing").as<double>(0.0);
a.storeSize = args.get("store-size").as<int>(20'000);
a.flushLimit= args.get("flush-limit").as<int>(10'000'000);
a.diagonalFraction = args.get("d").as<double>(0.0);
a.levels = args.get("levels").as<int>(-1);
a.format = args.get("input-format").as<string>();
Expand Down Expand Up @@ -308,6 +314,8 @@ int main(int argc, char **argv){
pc.edlEnabled = a.edlEnabled;
pc.material = a.material;
pc.showSkybox = a.showSkybox;
pc.storeSize = a.storeSize;
pc.flushLimit = a.flushLimit;

pc.convert();
}catch(exception &e){
Expand Down

0 comments on commit 685ef56

Please sign in to comment.