From 4e393bff030c3cf89a8fb581a2bebff28bded799 Mon Sep 17 00:00:00 2001 From: m-schuetz Date: Sun, 29 Jul 2018 18:15:46 +0200 Subject: [PATCH] new attributes --- PotreeConverter/src/BINPointReader.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/PotreeConverter/src/BINPointReader.cpp b/PotreeConverter/src/BINPointReader.cpp index ce4d684c..f380eb55 100644 --- a/PotreeConverter/src/BINPointReader.cpp +++ b/PotreeConverter/src/BINPointReader.cpp @@ -104,7 +104,19 @@ bool BINPointReader::readNextPoint(){ }else if(attribute == PointAttribute::CLASSIFICATION){ unsigned char* ucBuffer = reinterpret_cast(buffer+offset); point.classification = ucBuffer[0]; - }else if(attribute == PointAttribute::NORMAL_SPHEREMAPPED){ + } else if (attribute == PointAttribute::RETURN_NUMBER) { + unsigned char* ucBuffer = reinterpret_cast(buffer + offset); + point.returnNumber = ucBuffer[0]; + } else if (attribute == PointAttribute::NUMBER_OF_RETURNS) { + unsigned char* ucBuffer = reinterpret_cast(buffer + offset); + point.numberOfReturns = ucBuffer[0]; + } else if (attribute == PointAttribute::SOURCE_ID) { + unsigned short* usBuffer = reinterpret_cast(buffer + offset); + point.pointSourceID = usBuffer[0]; + } else if (attribute == PointAttribute::GPS_TIME) { + double* dBuffer = reinterpret_cast(buffer + offset); + point.gpsTime = dBuffer[0]; + } else if(attribute == PointAttribute::NORMAL_SPHEREMAPPED){ // see http://aras-p.info/texts/CompactNormalStorage.html unsigned char* ucBuffer = reinterpret_cast(buffer+offset); unsigned char bx = ucBuffer[0]; @@ -164,6 +176,9 @@ bool BINPointReader::readNextPoint(){ point.normal.x = fBuffer[0]; point.normal.y = fBuffer[1]; point.normal.z = fBuffer[2]; + } else { + cout << "ERROR: attribute reader not implemented: " << attribute.name << endl; + exit(1); } offset += attribute.byteSize;