Skip to content

Commit 3c93c25

Browse files
committed
Merge branch 'dev2'
* dev2: update version test long pointcount (previously int) memory optimization test
2 parents af0e4a4 + bd00337 commit 3c93c25

File tree

9 files changed

+240
-205
lines changed

9 files changed

+240
-205
lines changed

Interfaces/IWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public interface IWriter
66
{
77
// create output filestream, called before looping through points
88
//bool InitWriter<TSettings>(TSettings importSettings, int pointCount);
9-
bool InitWriter(dynamic importSettings, int pointCount, ILogger logger);
9+
bool InitWriter(dynamic importSettings, long pointCount, ILogger logger);
1010
// optional: if need to create special file header
1111
void CreateHeader(int pointCount);
1212
// output point X,Y,Z values to file

MainWindow.xaml.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace PointCloudConverter
3030
{
3131
public partial class MainWindow : Window
3232
{
33-
static readonly string version = "18.05.2025";
33+
static readonly string version = "27.08.2025";
3434
static readonly string appname = "PointCloud Converter - " + version;
3535
static readonly string rootFolder = AppDomain.CurrentDomain.BaseDirectory;
3636

@@ -291,7 +291,7 @@ private static async Task ProcessAllFiles(object workerParamsObject)
291291

292292
if ((importSettings.useAutoOffset == true && importSettings.importMetadataOnly == false) || ((importSettings.importIntensity == true || importSettings.importClassification == true) && importSettings.importRGB == true && importSettings.packColors == true && importSettings.importMetadataOnly == false))
293293
{
294-
int iterations = importSettings.offsetMode == "min" ? importSettings.maxFiles : 1; // 1 for legacy mode
294+
int iterations = importSettings.offsetMode == "min" ? importSettings.maxFiles : 1; // 1 for legacy mode (first cloud only)
295295

296296
for (int i = 0, len = iterations; i < len; i++)
297297
{
@@ -604,8 +604,8 @@ static void StartProgressTimer()
604604
public class ProgressInfo
605605
{
606606
public int Index { get; internal set; } // Index of the ProgressBar in the UI
607-
public int CurrentValue { get; internal set; } // Current progress value
608-
public int MaxValue { get; internal set; } // Maximum value for the progress
607+
public long CurrentValue { get; internal set; } // Current progress value
608+
public long MaxValue { get; internal set; } // Maximum value for the progress
609609
public string FilePath { get; internal set; }
610610
public bool UseJsonLog { get; internal set; }
611611
}
@@ -675,8 +675,8 @@ static void ProgressTick(object sender, EventArgs e)
675675
foreach (var progressInfo in progressInfos)
676676
{
677677
int index = progressInfo.Index;
678-
int currentValue = progressInfo.CurrentValue;
679-
int maxValue = progressInfo.MaxValue;
678+
long currentValue = progressInfo.CurrentValue;
679+
long maxValue = progressInfo.MaxValue;
680680

681681
// Access ProgressBar directly from the StackPanel.Children using its index
682682
if (index >= 0 && index < mainWindowStatic.ProgressBarsContainer.Children.Count)
@@ -783,8 +783,8 @@ static bool ParseFile(ImportSettings importSettings, int fileIndex, int? taskId,
783783

784784
if (importSettings.importMetadataOnly == false)
785785
{
786-
int fullPointCount = taskReader.GetPointCount();
787-
int pointCount = fullPointCount;
786+
long fullPointCount = taskReader.GetPointCount();
787+
long pointCount = fullPointCount;
788788

789789
// show stats for decimations
790790
if (importSettings.skipPoints == true)
@@ -874,14 +874,14 @@ static bool ParseFile(ImportSettings importSettings, int fileIndex, int? taskId,
874874

875875
Log.Write(jsonString, LogEvent.File);
876876

877-
int checkCancelEvery = fullPointCount / 128;
877+
long checkCancelEvery = fullPointCount / 128;
878878

879879
// detect is 0-255 or 0-65535 range
880880
bool isCustomIntensityRange = false;
881881

882882
// Loop all points
883883
// FIXME: would be nicer, if use different STEP value for skip, keep and limit..(to collect points all over the file, not just start)
884-
int maxPointIterations = importSettings.useLimit ? pointCount : fullPointCount;
884+
long maxPointIterations = importSettings.useLimit ? pointCount : fullPointCount;
885885
for (int i = 0; i < maxPointIterations; i++)
886886
{
887887
// check for cancel every 1% of points

Readers/E57.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ public Bounds GetBounds()
117117
};
118118
}
119119

120-
public int GetPointCount()
120+
public long GetPointCount()
121121
{
122-
return (int)(header?.E57Root?.Data3D?[0]?.Points?.RecordCount ?? 0);
122+
return header?.E57Root?.Data3D?[0]?.Points?.RecordCount ?? 0;
123123
}
124124

125125
public Float3 GetXYZ()

Readers/IReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public interface IReader
88
// open filestream
99
bool InitReader(ImportSettings importSettings, int fileIndex);
1010
// returns total point count, this is required to correctly read all points
11-
int GetPointCount();
11+
long GetPointCount();
1212
// bounds are used for AutoOffset
1313
Bounds GetBounds();
1414
// retrieve single point X,Y,Z coordinates (float)

Readers/LAZ.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ Bounds IReader.GetBounds()
347347
return b;
348348
}
349349

350-
int IReader.GetPointCount()
350+
long IReader.GetPointCount()
351351
{
352352
// get gps week offset from header
353353

@@ -356,7 +356,7 @@ int IReader.GetPointCount()
356356
// check alternative point counts
357357
if (count == 0) count = (int)lazReader.header.extended_number_of_point_records;
358358
if (count == 0) count = lazReader.header.number_of_point_records;
359-
return (int)count;
359+
return count;
360360
}
361361

362362
Color IReader.GetRGB()

Readers/PLY.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class PLY : IReader, IDisposable
1515
{
1616
private PlyParser.Dataset dataset;
1717
private int pointIndex;
18-
private int pointCount;
18+
private long pointCount;
1919

2020
private List<ElementData> vertexChunks;
2121
private int currentChunkIndex;
@@ -66,7 +66,7 @@ public bool InitReader(ImportSettings importSettings, int fileIndex)
6666

6767
}
6868

69-
public int GetPointCount() => pointCount;
69+
public long GetPointCount() => pointCount;
7070

7171
public Bounds GetBounds() => bounds;
7272

0 commit comments

Comments
 (0)