/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.8
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

namespace LizardTech.LidarSDK {

using System;
using System.Runtime.InteropServices;

public class PointData : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

  public PointData(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new HandleRef(this, cPtr);
  }

  public static HandleRef getCPtr(PointData obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~PointData() {
    Dispose();
  }

  public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          LidarDSDKPINVOKE.delete_PointData(swigCPtr);
        }
        swigCPtr = new HandleRef(null, IntPtr.Zero);
      }
      GC.SuppressFinalize(this);
    }
  }

  public PointData() : this(LidarDSDKPINVOKE.new_PointData(), true) {
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
  }

  public void init(PointInfo pointInfo, uint numSamples) {
    LidarDSDKPINVOKE.PointData_init(swigCPtr, PointInfo.getCPtr(pointInfo), numSamples);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
  }

  public uint getNumChannels() {
    uint ret = LidarDSDKPINVOKE.PointData_getNumChannels(swigCPtr);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public uint getNumSamples() {
    uint ret = LidarDSDKPINVOKE.PointData_getNumSamples(swigCPtr);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public ChannelData getChannel(uint idx) {
      IntPtr cPtr = LidarDSDKPINVOKE.PointData_getChannel__SWIG_0(swigCPtr, idx);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
      ChannelData ret = null;
      if(cPtr != IntPtr.Zero)
      {
         ret = new ChannelData(cPtr, false);
         ret.setOwnerObject(this);
      }
      return ret;
   }

  public bool hasChannel(string name) {
    bool ret = LidarDSDKPINVOKE.PointData_hasChannel(swigCPtr, name);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public ChannelData getChannel(string name) {
      IntPtr cPtr = LidarDSDKPINVOKE.PointData_getChannel__SWIG_2(swigCPtr, name);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
      ChannelData ret = null;
      if(cPtr != IntPtr.Zero)
      {
         ret = new ChannelData(cPtr, false);
         ret.setOwnerObject(this);
      }
      return ret;
   }

  public static void copy(PointData dst, uint dstOffset, PointData src, uint srcOffset, uint length) {
    LidarDSDKPINVOKE.PointData_copy(PointData.getCPtr(dst), dstOffset, PointData.getCPtr(src), srcOffset, length);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
  }

  public static void merge(PointData dst, uint dstNumPoints, PointData src, uint srcNumPoints) {
    LidarDSDKPINVOKE.PointData_merge(PointData.getCPtr(dst), dstNumPoints, PointData.getCPtr(src), srcNumPoints);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
  }

  public void resize(uint newNumSamples) {
    LidarDSDKPINVOKE.PointData_resize(swigCPtr, newNumSamples);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
  }

  public void setOffset(uint offset) {
    LidarDSDKPINVOKE.PointData_setOffset(swigCPtr, offset);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
  }

}

}
