/// <summary> /// Deletes a variable length record from the header for the given index. /// </summary> /// <param name="index">the index starting from 0 of the variable length record to delete</param> public void DeleteVariableLengthRecord(UInt32 index) { LASError error = CAPI.LASHeader_DeleteVLR(hHeader, index); if ((Int32)error != 0) { LASException e = new LASException("Exception in Header DeleteVariableLengthRecord."); throw e; } }
/// <summary> /// Set minimum values of extent of X, Y and Z coordinates. /// </summary> /// <param name="x">Set minimum value of extent of X coordinate.</param> /// <param name="y">Set minimum value of extent of Y coordinate.</param> /// <param name="z">Set minimum value of extent of Z coordinate.</param> public void SetMin(double x, double y, double z) { LASError error = CAPI.LASHeader_SetMin(hHeader, x, y, z); if ((Int32)error != 0) { LASException e = new LASException("Exception in Set Header SetMin."); throw e; } }
/// <summary> /// Adds a variable length record instance to the header. /// </summary> /// <param name="variableLengthRecord">variable Length record instance to add</param> public void AddVariableLengthRecord(LASVariableLengthRecord variableLengthRecord) { LASError error = CAPI.LASHeader_AddVLR(hHeader, variableLengthRecord.GetPointer()); if ((Int32)error != 0) { LASException e = new LASException("Exception in Header AddVariableLengthRecord."); throw e; } }
// /// Set values of 5-elements array of total point records per return. // /// \exception std::out_of_range - if index is bigger than 4. // /// \param index - subscript (0-4) of array element being updated. // /// \param v - new value to assign to array element identified by index. /// <summary> /// Sets the number of point records for a given return /// </summary> /// <param name="index">the return number to set the count for</param> /// <param name="value">the number of point records for the return </param> public void SetPointRecordsByReturnCount(int index, UInt32 value) { LASError error = CAPI.LASHeader_SetPointRecordsByReturnCount(hHeader, index, value); if ((Int32)error != 0) { LASException e = new LASException("Exception in Set Header SetPointRecordsByReturnCount."); throw e; } }
/// <summary> /// Set maximum values of extent of X, Y and Z coordinates. /// </summary> /// <param name="x">maximum value of extent of X coordinate.</param> /// <param name="y">maximum value of extent of Y coordinate.</param> /// <param name="z">maximum value of extent of Z coordinate.</param> public void SetMax(double x, double y, double z) { LASError error = NativeMethods.LASHeader_SetMax(hHeader, x, y, z); if ((Int32)error != 0) { LASException e = new LASException("Exception in Set Header SetMax."); throw e; } }
/// <summary> /// Gets the data stream for the variable length record as an array of bytes /// </summary> /// <param name="data">a empty array of bytes where place the array</param> public void GetData(out byte[] data) { LASError error = NativeMethods.LASVLR_GetData(hvlrh, out data); if ((Int32)error != 0) { LASException e = new LASException("Exception in VLR GetData."); throw e; } }
/// <summary> /// Write a new point in the LAS file /// </summary> /// <param name="point">LASPoint to write in the file</param> public void WritePoint(LASPoint point) { LASError error = NativeMethods.LASWriter_WritePoint(hwriter, point.GetPointer()); if ((Int32)error != 0) { LASException e = new LASException("Exception in Set Writer WritePoint."); throw e; } }
/// <summary> /// Sets the data stream for the variable length record as an array of bytes /// </summary> /// <param name="data">array of bytes</param> public void SetData(ref byte[] data) { UInt16 lenght = (UInt16)data.Length; LASError error = NativeMethods.LASVLR_SetData(hvlrh, ref data, lenght); if ((Int32)error != 0) { LASException e = new LASException("Exception in VLR SetData."); throw e; } }
/// <summary> /// /// </summary> /// <returns></returns> public bool Validate() { int error = CAPI.LASPoint_Validate(hPoint); if (error != 0) { LASException e = new LASException("Point data members out of range."); e.Data.Add("DataMemberFlag", error); throw e; } return(true); }
/// <summary> /// Set minimum values of extent of X, Y and Z coordinates. /// </summary> /// <param name="x">Set minimum value of extent of X coordinate.</param> /// <param name="y">Set minimum value of extent of Y coordinate.</param> /// <param name="z">Set minimum value of extent of Z coordinate.</param> public void SetMin(double x, double y, double z) { LASError error = NativeMethods.LASHeader_SetMin(hHeader, x, y, z); if ((Int32)error != 0) { LASException e = new LASException("Exception in Set Header SetMin."); throw e; } }
/// <summary> /// Write a new point in the LAS file /// </summary> /// <param name="point">LASPoint to write in the file</param> public void WritePoint(LASPoint point) { LASError error = CAPI.LASWriter_WritePoint(hwriter, point.GetPointer()); if ((Int32)error != 0) { LASException e = new LASException("Exception in Set Writer WritePoint."); throw e; } }
/// <summary> /// /// </summary> /// <returns></returns> public bool Validate() { int error = NativeMethods.LASPoint_Validate(hPoint); if (error != 0) { LASException e = new LASException("Point data members out of range."); e.Data.Add("DataMemberFlag", error); throw e; } return true; }
// /// Set values of 5-elements array of total point records per return. // /// \exception std::out_of_range - if index is bigger than 4. // /// \param index - subscript (0-4) of array element being updated. // /// \param v - new value to assign to array element identified by index. /// <summary> /// Sets the number of point records for a given return /// </summary> /// <param name="index">the return number to set the count for</param> /// <param name="value">the number of point records for the return </param> public void SetPointRecordsByReturnCount(int index, UInt32 value) { LASError error = NativeMethods.LASHeader_SetPointRecordsByReturnCount(hHeader, index, value); if ((Int32)error != 0) { LASException e = new LASException("Exception in Set Header SetPointRecordsByReturnCount."); throw e; } }
/// <summary> /// Deletes a variable length record from the header for the given index. /// </summary> /// <param name="index">the index starting from 0 of the variable length record to delete</param> public void DeleteVariableLengthRecord(UInt32 index) { LASError error = NativeMethods.LASHeader_DeleteVLR(hHeader, index); if ((Int32)error != 0) { LASException e = new LASException("Exception in Header DeleteVariableLengthRecord."); throw e; } }
/// <summary> /// Adds a variable length record instance to the header. /// </summary> /// <param name="variableLengthRecord">variable Length record instance to add</param> public void AddVariableLengthRecord(LASVariableLengthRecord variableLengthRecord) { LASError error = NativeMethods.LASHeader_AddVLR(hHeader, variableLengthRecord.GetPointer()); if ((Int32)error != 0) { LASException e = new LASException("Exception in Header AddVariableLengthRecord."); throw e; } }
/// <summary> /// Set maximum values of extent of X, Y and Z coordinates. /// </summary> /// <param name="x">maximum value of extent of X coordinate.</param> /// <param name="y">maximum value of extent of Y coordinate.</param> /// <param name="z">maximum value of extent of Z coordinate.</param> public void SetMax(double x, double y, double z) { LASError error = CAPI.LASHeader_SetMax(hHeader, x, y, z); if ((Int32)error != 0) { LASException e = new LASException("Exception in Set Header SetMax."); throw e; } }