Skip to content

Commit e477c18

Browse files
committed
save
1 parent eecfd2d commit e477c18

File tree

4 files changed

+44
-7
lines changed

4 files changed

+44
-7
lines changed

MainWindow.xaml.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
using System.Threading;
1111
using System.Windows;
1212

13+
// PointCloudConverter.exe -input="D:\Unity\PRODUCTS\GIT\PointCloudViewerPro\Assets\GITIGNORE\LAS\batch/" -randomize=true -gridsize=250 -flip:true -minpoints=5000 -version:3 -offset=true -exportformat=pcroot -output="D:/Unity/PRODUCTS/GIT/PointCloudViewerPro/Assets/StreamingAssets/form/x.pcroot"
14+
1315
namespace PointCloudConverter
1416
{
1517
public partial class MainWindow : Window
@@ -56,8 +58,6 @@ private void Main()
5658
// check args, null here because we get the args later
5759
var importSettings = ArgParser.Parse(null, rootFolder);
5860

59-
60-
6161
// if have files, process them
6262
if (importSettings != null)
6363
{
@@ -98,6 +98,7 @@ private static void ProcessAllFiles(System.Object importSettingsObject)
9898
for (int i = 0, len = importSettings.maxFiles; i < len; i++)
9999
{
100100
Console.WriteLine("\nReading file (" + i + "/" + (len - 1) + ") : " + importSettings.inputFiles[i] + " (" + Tools.HumanReadableFileSize(new FileInfo(importSettings.inputFiles[i]).Length) + ")");
101+
Debug.WriteLine("\nReading file (" + i + "/" + (len - 1) + ") : " + importSettings.inputFiles[i] + " (" + Tools.HumanReadableFileSize(new FileInfo(importSettings.inputFiles[i]).Length) + ")");
101102

102103
//if (abort==true)
103104

@@ -224,7 +225,6 @@ static void ParseFile(ImportSettings importSettings, int fileIndex)
224225
// get point color
225226
Color rgb = importSettings.reader.GetRGB();
226227

227-
228228
// collect this point XYZ and RGB into node
229229
importSettings.writer.AddPoint(i, (float)point.x, (float)point.y, (float)point.z, rgb.r, rgb.g, rgb.b);
230230
}
@@ -325,8 +325,6 @@ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs
325325

326326
private void btnBrowseInput_Click(object sender, RoutedEventArgs e)
327327
{
328-
// TODO browse for folder, not file
329-
330328
// select single file
331329
var dialog = new OpenFileDialog();
332330
dialog.Title = "Select file to import";

Structs/ImportSettings.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,38 @@ public class ImportSettings
5050
public float manualOffsetX = 0;
5151
public float manualOffsetY = 0;
5252
public float manualOffsetZ = 0;
53+
54+
public override string ToString()
55+
{
56+
string t = "";
57+
t += " useScale=" + useScale;
58+
t += "\n scale=" + scale;
59+
t += "\n inputFiles=" + inputFiles;
60+
t += "\n outputFile=" + outputFile;
61+
t += "\n swapYZ=" + swapYZ;
62+
t += "\n readRGB=" + readRGB;
63+
t += "\n useAutoOffset=" + useAutoOffset;
64+
t += "\n offsetX=" + offsetX;
65+
t += "\n offsetY=" + offsetY;
66+
t += "\n offsetZ=" + offsetZ;
67+
t += "\n useLimit=" + useLimit;
68+
t += "\n limit=" + limit;
69+
t += "\n randomize=" + randomize;
70+
t += "\n gridSize=" + gridSize;
71+
t += "\n minimumPointCount=" + minimumPointCount;
72+
t += "\n packColors=" + packColors;
73+
t += "\n packMagicValue=" + packMagicValue;
74+
t += "\n skipPoints=" + skipPoints;
75+
t += "\n skipEveryN=" + skipEveryN;
76+
t += "\n keepPoints=" + keepPoints;
77+
t += "\n keepEveryN=" + keepEveryN;
78+
t += "\n maxFiles=" + maxFiles;
79+
t += "\n batch=" + batch;
80+
t += "\n useManualOffset=" + useManualOffset;
81+
t += "\n manualOffsetX=" + manualOffsetX;
82+
t += "\n manualOffsetX=" + manualOffsetX;
83+
t += "\n manualOffsetX=" + manualOffsetX;
84+
return t;
85+
}
5386
}
5487
}

Writers/PCROOT.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ bool IWriter.InitWriter(ImportSettings _importSettings, int _pointCount)
4545
nodeG.Clear();
4646
nodeB.Clear();
4747

48+
cloudMinX = float.PositiveInfinity;
49+
cloudMinY = float.PositiveInfinity;
50+
cloudMinZ = float.PositiveInfinity;
51+
cloudMaxX = float.NegativeInfinity;
52+
cloudMaxY = float.NegativeInfinity;
53+
cloudMaxZ = float.NegativeInfinity;
54+
4855
importSettings = _importSettings;
4956

5057
return res;

Writers/UCPC.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ void IWriter.WriteRGB(float r, float g, float b)
143143
writerColorsV2.Write(r);
144144
writerColorsV2.Write(g);
145145
writerColorsV2.Write(b);
146-
147146
}
148147
}
149148

@@ -280,7 +279,6 @@ void IWriter.Cleanup(int fileIndex)
280279
pointsTempFile = pointsTempFile.Replace("/", "\\");
281280
colorsTempFile = colorsTempFile.Replace("/", "\\");
282281

283-
// combine files using commandline binary append
284282
string outputFile = "";
285283
if (Directory.Exists(importSettings.outputFile)) // its output folder, take filename from source
286284
{
@@ -299,6 +297,7 @@ void IWriter.Cleanup(int fileIndex)
299297
}
300298
}
301299

300+
// combine files using commandline binary append
302301
string args = "";
303302
if (importSettings.packColors == true)
304303
{

0 commit comments

Comments
 (0)