/* ----------------------------------------------------------------------------
 * 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 PointSource : Object {
  private HandleRef swigCPtr;

  public PointSource(IntPtr cPtr, bool cMemoryOwn) : base(LidarDSDKPINVOKE.PointSource_SWIGUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new HandleRef(this, cPtr);
  }

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

  ~PointSource() {
    Dispose();
  }

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

  public virtual PointInfo getPointInfo() {
      IntPtr cPtr = LidarDSDKPINVOKE.PointSource_getPointInfo(swigCPtr);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
      PointInfo ret = null;
      if(cPtr != IntPtr.Zero)
      {
         ret = new PointInfo(cPtr, false);
         ret.setOwnerObject(this);
      }
      return ret;
   }

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

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

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

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

  public virtual long getNumPoints() {
    long ret = LidarDSDKPINVOKE.PointSource_getNumPoints(swigCPtr);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual string getWKT() {
    string ret = LidarDSDKPINVOKE.PointSource_getWKT(swigCPtr);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual void loadMetadata(Metadata metadata, bool sanitize) {
    LidarDSDKPINVOKE.PointSource_loadMetadata(swigCPtr, Metadata.getCPtr(metadata), sanitize);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
  }

  public virtual Bounds getBounds() {
    Bounds ret = new Bounds(LidarDSDKPINVOKE.PointSource_getBounds(swigCPtr), false);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double[] getScale() {
   IntPtr raw = LidarDSDKPINVOKE.PointSource_getScale(swigCPtr);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
   double[] ret = null;
   if(raw != IntPtr.Zero)
   {
      ret = new double[3];
      System.Runtime.InteropServices.Marshal.Copy(raw, ret, 0, 3);
   }
   return ret;
}

  public virtual double[] getOffset() {
   IntPtr raw = LidarDSDKPINVOKE.PointSource_getOffset(swigCPtr);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
   double[] ret = null;
   if(raw != IntPtr.Zero)
   {
      ret = new double[3];
      System.Runtime.InteropServices.Marshal.Copy(raw, ret, 0, 3);
   }
   return ret;
}

  public virtual uint getNumClassIdNames() {
    uint ret = LidarDSDKPINVOKE.PointSource_getNumClassIdNames(swigCPtr);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual string[] getClassIdNames() {
   IntPtr raw1 = LidarDSDKPINVOKE.PointSource_getClassIdNames(swigCPtr);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
   int length = (int)LidarDSDKPINVOKE.PointSource_getNumClassIdNames(swigCPtr);
   IntPtr[] raw2 = new IntPtr[length];
   System.Runtime.InteropServices.Marshal.Copy(raw1, raw2, 0, length);
   string[] ret = new string[length];
   for (uint i = 0; i < length; i += 1)
      ret[i] = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(raw2[i]);
   return ret;
}

  public virtual double getTotalWork(Bounds bounds, double fraction) {
    double ret = LidarDSDKPINVOKE.PointSource_getTotalWork(swigCPtr, Bounds.getCPtr(bounds), fraction);
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual PointIterator createIterator(Bounds bounds, double fraction, PointInfo pointInfo, ProgressDelegate arg3) {
      IntPtr cPtr = LidarDSDKPINVOKE.PointSource_createIterator(swigCPtr, Bounds.getCPtr(bounds), fraction, PointInfo.getCPtr(pointInfo), ProgressDelegate.getCPtr(arg3));
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
      PointIterator ret = null;
      if(cPtr != IntPtr.Zero)
      {
         ret = new PointIterator(cPtr, true);
         ret.setProgressDelegateRef(arg3);
      }
      return ret;
   }

  public uint read(Bounds bounds, PointData points, ProgressDelegate arg2) {
    uint ret = LidarDSDKPINVOKE.PointSource_read(swigCPtr, Bounds.getCPtr(bounds), PointData.getCPtr(points), ProgressDelegate.getCPtr(arg2));
    if (LidarDSDKPINVOKE.SWIGPendingException.Pending) throw LidarDSDKPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
