Skip to content

Commit

Permalink
new attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-schuetz committed Jul 29, 2018
1 parent 86d7aaf commit 4e393bf
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion PotreeConverter/src/BINPointReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,19 @@ bool BINPointReader::readNextPoint(){
}else if(attribute == PointAttribute::CLASSIFICATION){
unsigned char* ucBuffer = reinterpret_cast<unsigned char*>(buffer+offset);
point.classification = ucBuffer[0];
}else if(attribute == PointAttribute::NORMAL_SPHEREMAPPED){
} else if (attribute == PointAttribute::RETURN_NUMBER) {
unsigned char* ucBuffer = reinterpret_cast<unsigned char*>(buffer + offset);
point.returnNumber = ucBuffer[0];
} else if (attribute == PointAttribute::NUMBER_OF_RETURNS) {
unsigned char* ucBuffer = reinterpret_cast<unsigned char*>(buffer + offset);
point.numberOfReturns = ucBuffer[0];
} else if (attribute == PointAttribute::SOURCE_ID) {
unsigned short* usBuffer = reinterpret_cast<unsigned short*>(buffer + offset);
point.pointSourceID = usBuffer[0];
} else if (attribute == PointAttribute::GPS_TIME) {
double* dBuffer = reinterpret_cast<double*>(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<unsigned char*>(buffer+offset);
unsigned char bx = ucBuffer[0];
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4e393bf

Please sign in to comment.