forked from shintadono/laszip.net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LASreadItemRaw_POINT10.cs
72 lines (67 loc) · 1.99 KB
/
LASreadItemRaw_POINT10.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
//===============================================================================
//
// FILE: lasreaditemraw_point10.cs
//
// CONTENTS:
//
// Implementation of LASreadItemRaw for POINT10 items.
//
// PROGRAMMERS:
//
// [email protected] - http://rapidlasso.com
//
// COPYRIGHT:
//
// (c) 2005-2012, martin isenburg, rapidlasso - tools to catch reality
// (c) of the C# port 2014 by Shinta <[email protected]>
//
// This is free software; you can redistribute and/or modify it under the
// terms of the GNU Lesser General Licence as published by the Free Software
// Foundation. See the COPYING file for more information.
//
// This software is distributed WITHOUT ANY WARRANTY and without even the
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// CHANGE HISTORY: omitted for easier Copy&Paste (pls see the original)
//
//===============================================================================
using System.IO;
using System.Runtime.InteropServices;
namespace laszip.net
{
class LASreadItemRaw_POINT10 : LASreadItemRaw
{
[StructLayout(LayoutKind.Sequential, Pack=1)]
struct LAStempReadPoint10
{
public int x;
public int y;
public int z;
public ushort intensity;
public byte flags;
public byte classification;
public sbyte scan_angle_rank;
public byte user_data;
public ushort point_source_ID;
}
public LASreadItemRaw_POINT10() { }
public unsafe override void read(laszip_point item)
{
if(instream.Read(buffer, 0, 20)!=20) throw new EndOfStreamException();
fixed(byte* pBuffer=buffer)
{
LAStempReadPoint10* p10=(LAStempReadPoint10*)pBuffer;
item.X=p10->x;
item.Y=p10->y;
item.Z=p10->z;
item.intensity=p10->intensity;
item.flags=p10->flags;
item.classification=p10->classification;
item.scan_angle_rank=p10->scan_angle_rank;
item.user_data=p10->user_data;
item.point_source_ID=p10->point_source_ID;
}
}
byte[] buffer=new byte[20];
}
}