/// <summary> Initializes a new instance of the Meta.PointCloudMetaData class. </summary> /// <param name="pointCloudInteropMetaData"> /// Information describing the point cloud interop /// meta. /// </param> public PointCloudMetaData(PointCloudInteropMetaData pointCloudInteropMetaData) { fieldType = new char[pointCloudInteropMetaData.fieldLength]; fieldSize = new int[pointCloudInteropMetaData.fieldLength]; fieldCount = new int[pointCloudInteropMetaData.fieldLength]; numFields = pointCloudInteropMetaData.fieldLength; maxSize = pointCloudInteropMetaData.maxSize; Array.Copy(pointCloudInteropMetaData.fieldType, fieldType, pointCloudInteropMetaData.fieldLength); Array.Copy(pointCloudInteropMetaData.fieldSize, fieldSize, pointCloudInteropMetaData.fieldLength); Array.Copy(pointCloudInteropMetaData.fieldCount, fieldCount, pointCloudInteropMetaData.fieldLength); string input = new string(pointCloudInteropMetaData.fieldName); fieldName = Regex.Split(input, " "); //hack field = PointCloudDataType.XYZCONFIDENCE; //todo: actually make it generic //end hack //todo: Make this a generic funtion for (int i = 0; i < numFields; i++) { pointSize += fieldCount[i] * fieldSize[i]; } }
/// <summary> /// Returns a print friendly format syntax. /// </summary> public static string FieldToOutputFormat(PointCloudDataType field) { switch (field) { case PointCloudDataType.XYZ: return("x y z"); case PointCloudDataType.XYZRGB: return("x y z rgb"); case PointCloudDataType.XYZRGBA: return("x y z rgba"); case PointCloudDataType.XYZCONFIDENCE: return("x y z confidence"); case PointCloudDataType.XYZNORMALS: return("x y z normal_x normal_y normal_z"); } return(null); }