Skip to content

Commit 685ef56

Browse files
committed
add flushlimit and storesize attributes
1 parent 4e393bf commit 685ef56

5 files changed

Lines changed: 16 additions & 3 deletions

File tree

PotreeConverter/include/PotreeConverter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ class PotreeConverter{
5656
bool showSkybox = false;
5757
string material = "RGB";
5858
string executablePath;
59+
int storeSize = 20'000;
60+
int flushLimit = 10'000'000;
5961

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

PotreeConverter/include/PotreeWriter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class PWNode{
3838
bool addCalledSinceLastFlush = false;
3939
PotreeWriter *potreeWriter;
4040
vector<Point> cache;
41-
int storeLimit = 20'000;
41+
//int storeLimit = 20'000;
4242
vector<Point> store;
4343
bool isInMemory = true;
4444

@@ -115,6 +115,7 @@ class PotreeWriter{
115115
int pointsInMemory = 0;
116116
string projection = "";
117117
ConversionQuality quality = ConversionQuality::DEFAULT;
118+
int storeSize = 20'000;
118119

119120

120121
PotreeWriter(string workDir, ConversionQuality quality);

PotreeConverter/src/PotreeConverter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ void PotreeConverter::convert(){
400400
return;
401401
}
402402

403+
writer->storeSize = storeSize;
404+
403405
vector<AABB> boundingBoxes;
404406
vector<int> numPoints;
405407
vector<string> sourceFilenames;
@@ -445,7 +447,7 @@ void PotreeConverter::convert(){
445447

446448
cout << ssMessage.str() << endl;
447449
}
448-
if((pointsProcessed % (10'000'000)) == 0){
450+
if((pointsProcessed % (flushLimit)) == 0){
449451
cout << "FLUSHING: ";
450452

451453
auto start = high_resolution_clock::now();

PotreeConverter/src/PotreeWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ PWNode *PWNode::add(Point &point){
171171

172172
if(isLeafNode()){
173173
store.push_back(point);
174-
if(int(store.size()) >= storeLimit){
174+
if(int(store.size()) >= potreeWriter->storeSize){
175175
split();
176176
}
177177

PotreeConverter/src/main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ struct PotreeArguments {
6464
bool showSkybox = false;
6565
string material = "RGB";
6666
string executablePath;
67+
int storeSize;
68+
int flushLimit;
6769
};
6870

6971
PotreeArguments parseArguments(int argc, char **argv){
@@ -95,6 +97,8 @@ PotreeArguments parseArguments(int argc, char **argv){
9597
args.addArgument("edl-enabled", "Enable Eye-Dome-Lighting.");
9698
args.addArgument("show-skybox", "");
9799
args.addArgument("material", "RGB, ELEVATION, INTENSITY, INTENSITY_GRADIENT, CLASSIFICATION, RETURN_NUMBER, SOURCE, LEVEL_OF_DETAIL");
100+
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");
101+
args.addArgument("flush-limit", "Flush after X points. Default is 10000000");
98102

99103
PotreeArguments a;
100104

@@ -125,6 +129,8 @@ PotreeArguments parseArguments(int argc, char **argv){
125129
}
126130
a.outdir = args.get("outdir").as<string>();
127131
a.spacing = args.get("spacing").as<double>(0.0);
132+
a.storeSize = args.get("store-size").as<int>(20'000);
133+
a.flushLimit= args.get("flush-limit").as<int>(10'000'000);
128134
a.diagonalFraction = args.get("d").as<double>(0.0);
129135
a.levels = args.get("levels").as<int>(-1);
130136
a.format = args.get("input-format").as<string>();
@@ -308,6 +314,8 @@ int main(int argc, char **argv){
308314
pc.edlEnabled = a.edlEnabled;
309315
pc.material = a.material;
310316
pc.showSkybox = a.showSkybox;
317+
pc.storeSize = a.storeSize;
318+
pc.flushLimit = a.flushLimit;
311319

312320
pc.convert();
313321
}catch(exception &e){

0 commit comments

Comments
 (0)