|
@@ -1,9 +1,10 @@
|
|
|
+
|
|
|
/**
|
|
|
* Some types of possible point attribute data formats
|
|
|
*
|
|
|
* @class
|
|
|
*/
|
|
|
- const PointAttributeTypes = {
|
|
|
+const PointAttributeTypes = {
|
|
|
DATA_TYPE_DOUBLE: {ordinal: 0, name: "double", size: 8},
|
|
|
DATA_TYPE_FLOAT: {ordinal: 1, name: "float", size: 4},
|
|
|
DATA_TYPE_INT8: {ordinal: 2, name: "int8", size: 1},
|
|
@@ -37,28 +38,12 @@ class PointAttribute{
|
|
|
}
|
|
|
|
|
|
};
|
|
|
-//add
|
|
|
-const replacements = {
|
|
|
- "COLOR_PACKED": "rgba",
|
|
|
- "RGBA": "rgba",
|
|
|
- "INTENSITY": "intensity",
|
|
|
- "CLASSIFICATION": "classification",
|
|
|
- "GPS_TIME": "gps-time",
|
|
|
-};
|
|
|
-const replaceOldNames = (old) => {
|
|
|
- if(replacements[old]){
|
|
|
- return replacements[old];
|
|
|
- }else{
|
|
|
- return old;
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
|
|
|
PointAttribute.POSITION_CARTESIAN = new PointAttribute(
|
|
|
"POSITION_CARTESIAN", PointAttributeTypes.DATA_TYPE_FLOAT, 3);
|
|
|
|
|
|
PointAttribute.RGBA_PACKED = new PointAttribute(
|
|
|
- replaceOldNames("COLOR_PACKED"), PointAttributeTypes.DATA_TYPE_INT8, 4);
|
|
|
+ "COLOR_PACKED", PointAttributeTypes.DATA_TYPE_INT8, 4);
|
|
|
|
|
|
PointAttribute.COLOR_PACKED = PointAttribute.RGBA_PACKED;
|
|
|
|
|
@@ -69,10 +54,10 @@ PointAttribute.NORMAL_FLOATS = new PointAttribute(
|
|
|
"NORMAL_FLOATS", PointAttributeTypes.DATA_TYPE_FLOAT, 3);
|
|
|
|
|
|
PointAttribute.INTENSITY = new PointAttribute(
|
|
|
- replaceOldNames("INTENSITY"), PointAttributeTypes.DATA_TYPE_UINT16, 1);
|
|
|
+ "INTENSITY", PointAttributeTypes.DATA_TYPE_UINT16, 1);
|
|
|
|
|
|
PointAttribute.CLASSIFICATION = new PointAttribute(
|
|
|
- replaceOldNames("CLASSIFICATION"), PointAttributeTypes.DATA_TYPE_UINT8, 1);
|
|
|
+ "CLASSIFICATION", PointAttributeTypes.DATA_TYPE_UINT8, 1);
|
|
|
|
|
|
PointAttribute.NORMAL_SPHEREMAPPED = new PointAttribute(
|
|
|
"NORMAL_SPHEREMAPPED", PointAttributeTypes.DATA_TYPE_UINT8, 2);
|
|
@@ -99,7 +84,7 @@ PointAttribute.SPACING = new PointAttribute(
|
|
|
"SPACING", PointAttributeTypes.DATA_TYPE_FLOAT, 1);
|
|
|
|
|
|
PointAttribute.GPS_TIME = new PointAttribute(
|
|
|
- replaceOldNames("GPS_TIME"), PointAttributeTypes.DATA_TYPE_DOUBLE, 1);
|
|
|
+ "GPS_TIME", PointAttributeTypes.DATA_TYPE_DOUBLE, 1);
|
|
|
|
|
|
export {PointAttribute};
|
|
|
|
|
@@ -148,4 +133,4 @@ export class PointAttributes{
|
|
|
return false;
|
|
|
};
|
|
|
|
|
|
-}
|
|
|
+}
|