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


using System;
using System.Runtime.InteropServices;

public class OBFingerprint : OBPlugin {
  private HandleRef swigCPtr;

  internal OBFingerprint(IntPtr cPtr, bool cMemoryOwn) : base(openbabelPINVOKE.OBFingerprintUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new HandleRef(this, cPtr);
  }

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

  ~OBFingerprint() {
    Dispose();
  }

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

  public static OBFingerprint Default() {
    IntPtr cPtr = openbabelPINVOKE.OBFingerprint_Default();
    OBFingerprint ret = (cPtr == IntPtr.Zero) ? null : new OBFingerprint(cPtr, false);
    return ret;
  }

  public static OBFingerprint FindType(string ID) {
    IntPtr cPtr = openbabelPINVOKE.OBFingerprint_FindType(ID);
    OBFingerprint ret = (cPtr == IntPtr.Zero) ? null : new OBFingerprint(cPtr, false);
    return ret;
  }

  public string TypeID() {
    string ret = openbabelPINVOKE.OBFingerprint_TypeID(swigCPtr);
    return ret;
  }

  public void SetBit(vectorUnsignedInt vec, uint n) {
    openbabelPINVOKE.OBFingerprint_SetBit(swigCPtr, vectorUnsignedInt.getCPtr(vec), n);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public bool GetBit(vectorUnsignedInt vec, uint n) {
    bool ret = openbabelPINVOKE.OBFingerprint_GetBit(swigCPtr, vectorUnsignedInt.getCPtr(vec), n);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public void Fold(vectorUnsignedInt vec, uint nbits) {
    openbabelPINVOKE.OBFingerprint_Fold(swigCPtr, vectorUnsignedInt.getCPtr(vec), nbits);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public virtual bool GetFingerprint(OBBase pOb, vectorUnsignedInt fp, int nbits) {
    bool ret = openbabelPINVOKE.OBFingerprint_GetFingerprint__SWIG_0(swigCPtr, OBBase.getCPtr(pOb), vectorUnsignedInt.getCPtr(fp), nbits);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual bool GetFingerprint(OBBase pOb, vectorUnsignedInt fp) {
    bool ret = openbabelPINVOKE.OBFingerprint_GetFingerprint__SWIG_1(swigCPtr, OBBase.getCPtr(pOb), vectorUnsignedInt.getCPtr(fp));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual uint Flags() {
    uint ret = openbabelPINVOKE.OBFingerprint_Flags(swigCPtr);
    return ret;
  }

  public virtual string DescribeBits(vectorUnsignedInt fp, bool bSet) {
    string ret = openbabelPINVOKE.OBFingerprint_DescribeBits__SWIG_0(swigCPtr, vectorUnsignedInt.getCPtr(fp), bSet);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual string DescribeBits(vectorUnsignedInt fp) {
    string ret = openbabelPINVOKE.OBFingerprint_DescribeBits__SWIG_1(swigCPtr, vectorUnsignedInt.getCPtr(fp));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double Tanimoto(vectorUnsignedInt vec1, vectorUnsignedInt vec2) {
    double ret = openbabelPINVOKE.OBFingerprint_Tanimoto__SWIG_0(vectorUnsignedInt.getCPtr(vec1), vectorUnsignedInt.getCPtr(vec2));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static double Tanimoto(vectorUnsignedInt vec1, SWIGTYPE_p_unsigned_int p2) {
    double ret = openbabelPINVOKE.OBFingerprint_Tanimoto__SWIG_1(vectorUnsignedInt.getCPtr(vec1), SWIGTYPE_p_unsigned_int.getCPtr(p2));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static uint Getbitsperint() {
    uint ret = openbabelPINVOKE.OBFingerprint_Getbitsperint();
    return ret;
  }

  public static OBFingerprint FindFingerprint(string ID) {
    IntPtr cPtr = openbabelPINVOKE.OBFingerprint_FindFingerprint(ID);
    OBFingerprint ret = (cPtr == IntPtr.Zero) ? null : new OBFingerprint(cPtr, false);
    return ret;
  }

  public enum FptFlag {
    FPT_UNIQUEBITS = 1
  }

}
