-
Notifications
You must be signed in to change notification settings - Fork 1
/
PotreeMetadata.cs
73 lines (62 loc) · 2.37 KB
/
PotreeMetadata.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using Fusee.Math.Core;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace PotreeSharp
{
public class PotreeSettingsHierarchy
{
public int FirstChunkSize { get; set; }
public int StepSize { get; set; }
public int Depth { get; set; }
}
public class PotreeSettingsBoundingBox
{
[JsonProperty(PropertyName = "min")]
public List<double> MinList { get; set; }
[JsonIgnore]
public double3 Min => new(MinList[0], MinList[1], MinList[2]);
[JsonProperty(PropertyName = "max")]
public List<double> MaxList { get; set; }
[JsonIgnore]
public double3 Max => new(MaxList[0], MaxList[1], MaxList[2]);
}
public class PotreeSettingsAttribute
{
public string Name { get; set; }
public string Description { get; set; }
public int Size { get; set; }
public int NumElements { get; set; }
public int ElementSize { get; set; }
public string Type { get; set; }
[JsonProperty(PropertyName = "min")]
public List<double> MinList { get; set; }
[JsonIgnore]
public double3 Min => new(MinList[0], MinList[1], MinList[2]);
[JsonProperty(PropertyName = "max")]
public List<double> MaxList { get; set; }
[JsonIgnore]
public double3 Max => new(MaxList[0], MaxList[1], MaxList[2]);
}
public class PotreeMetadata
{
public string Version { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public int Points { get; set; }
public string Projection { get; set; }
public PotreeSettingsHierarchy Hierarchy { get; set; }
[JsonProperty(PropertyName = "offset")]
public List<double> OffsetList { get; set; }
[JsonIgnore]
public double3 Offset => new(OffsetList[0], OffsetList[1], OffsetList[2]);
[JsonProperty(PropertyName = "scale")]
public List<double> ScaleList { get; set; }
[JsonIgnore]
public double3 Scale => new(ScaleList[0], ScaleList[1], ScaleList[2]);
public double Spacing { get; set; }
public PotreeSettingsBoundingBox BoundingBox { get; set; }
public string Encoding { get; set; }
public List<PotreeSettingsAttribute> Attributes { get; set; }
public int PointSize { get; set; }
}
}