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

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

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

  ~OBResidue() {
    Dispose();
  }

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

  public OBResidue() : this(openbabelPINVOKE.new_OBResidue__SWIG_0(), true) {
  }

  public OBResidue(OBResidue arg0) : this(openbabelPINVOKE.new_OBResidue__SWIG_1(OBResidue.getCPtr(arg0)), true) {
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void AddAtom(OBAtom atom) {
    openbabelPINVOKE.OBResidue_AddAtom(swigCPtr, OBAtom.getCPtr(atom));
  }

  public void InsertAtom(OBAtom atom) {
    openbabelPINVOKE.OBResidue_InsertAtom(swigCPtr, OBAtom.getCPtr(atom));
  }

  public void RemoveAtom(OBAtom atom) {
    openbabelPINVOKE.OBResidue_RemoveAtom(swigCPtr, OBAtom.getCPtr(atom));
  }

  public void SetName(string resname) {
    openbabelPINVOKE.OBResidue_SetName(swigCPtr, resname);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetNum(uint resnum) {
    openbabelPINVOKE.OBResidue_SetNum__SWIG_0(swigCPtr, resnum);
  }

  public void SetNum(string resnum) {
    openbabelPINVOKE.OBResidue_SetNum__SWIG_1(swigCPtr, resnum);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetChain(char chain) {
    openbabelPINVOKE.OBResidue_SetChain(swigCPtr, chain);
  }

  public void SetChainNum(uint chainnum) {
    openbabelPINVOKE.OBResidue_SetChainNum(swigCPtr, chainnum);
  }

  public void SetIdx(uint idx) {
    openbabelPINVOKE.OBResidue_SetIdx(swigCPtr, idx);
  }

  public void SetAtomID(OBAtom atom, string id) {
    openbabelPINVOKE.OBResidue_SetAtomID(swigCPtr, OBAtom.getCPtr(atom), id);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetHetAtom(OBAtom atom, bool hetatm) {
    openbabelPINVOKE.OBResidue_SetHetAtom(swigCPtr, OBAtom.getCPtr(atom), hetatm);
  }

  public void SetSerialNum(OBAtom atom, uint sernum) {
    openbabelPINVOKE.OBResidue_SetSerialNum(swigCPtr, OBAtom.getCPtr(atom), sernum);
  }

  public string GetName() {
    string ret = openbabelPINVOKE.OBResidue_GetName(swigCPtr);
    return ret;
  }

  public uint GetNum() {
    uint ret = openbabelPINVOKE.OBResidue_GetNum(swigCPtr);
    return ret;
  }

  public string GetNumString() {
    string ret = openbabelPINVOKE.OBResidue_GetNumString(swigCPtr);
    return ret;
  }

  public uint GetNumAtoms() {
    uint ret = openbabelPINVOKE.OBResidue_GetNumAtoms(swigCPtr);
    return ret;
  }

  public char GetChain() {
    char ret = openbabelPINVOKE.OBResidue_GetChain(swigCPtr);
    return ret;
  }

  public uint GetChainNum() {
    uint ret = openbabelPINVOKE.OBResidue_GetChainNum(swigCPtr);
    return ret;
  }

  public uint GetIdx() {
    uint ret = openbabelPINVOKE.OBResidue_GetIdx(swigCPtr);
    return ret;
  }

  public uint GetResKey() {
    uint ret = openbabelPINVOKE.OBResidue_GetResKey(swigCPtr);
    return ret;
  }

  public SWIGTYPE_p_std__vectorT_OpenBabel__OBAtom_p_t GetAtoms() {
    SWIGTYPE_p_std__vectorT_OpenBabel__OBAtom_p_t ret = new SWIGTYPE_p_std__vectorT_OpenBabel__OBAtom_p_t(openbabelPINVOKE.OBResidue_GetAtoms(swigCPtr), true);
    return ret;
  }

  public SWIGTYPE_p_std__vectorT_OpenBabel__OBBond_p_t GetBonds(bool exterior) {
    SWIGTYPE_p_std__vectorT_OpenBabel__OBBond_p_t ret = new SWIGTYPE_p_std__vectorT_OpenBabel__OBBond_p_t(openbabelPINVOKE.OBResidue_GetBonds__SWIG_0(swigCPtr, exterior), true);
    return ret;
  }

  public SWIGTYPE_p_std__vectorT_OpenBabel__OBBond_p_t GetBonds() {
    SWIGTYPE_p_std__vectorT_OpenBabel__OBBond_p_t ret = new SWIGTYPE_p_std__vectorT_OpenBabel__OBBond_p_t(openbabelPINVOKE.OBResidue_GetBonds__SWIG_1(swigCPtr), true);
    return ret;
  }

  public string GetAtomID(OBAtom atom) {
    string ret = openbabelPINVOKE.OBResidue_GetAtomID(swigCPtr, OBAtom.getCPtr(atom));
    return ret;
  }

  public uint GetSerialNum(OBAtom atom) {
    uint ret = openbabelPINVOKE.OBResidue_GetSerialNum(swigCPtr, OBAtom.getCPtr(atom));
    return ret;
  }

  public bool GetAminoAcidProperty(int arg0) {
    bool ret = openbabelPINVOKE.OBResidue_GetAminoAcidProperty(swigCPtr, arg0);
    return ret;
  }

  public bool GetAtomProperty(OBAtom a, int arg1) {
    bool ret = openbabelPINVOKE.OBResidue_GetAtomProperty(swigCPtr, OBAtom.getCPtr(a), arg1);
    return ret;
  }

  public bool GetResidueProperty(int arg0) {
    bool ret = openbabelPINVOKE.OBResidue_GetResidueProperty(swigCPtr, arg0);
    return ret;
  }

  public bool IsHetAtom(OBAtom atom) {
    bool ret = openbabelPINVOKE.OBResidue_IsHetAtom(swigCPtr, OBAtom.getCPtr(atom));
    return ret;
  }

  public bool IsResidueType(int arg0) {
    bool ret = openbabelPINVOKE.OBResidue_IsResidueType(swigCPtr, arg0);
    return ret;
  }

  public SWIGTYPE_p_std__vectorT_OpenBabel__OBAtom_p_t__iterator BeginAtoms() {
    SWIGTYPE_p_std__vectorT_OpenBabel__OBAtom_p_t__iterator ret = new SWIGTYPE_p_std__vectorT_OpenBabel__OBAtom_p_t__iterator(openbabelPINVOKE.OBResidue_BeginAtoms(swigCPtr), true);
    return ret;
  }

  public SWIGTYPE_p_std__vectorT_OpenBabel__OBAtom_p_t__iterator EndAtoms() {
    SWIGTYPE_p_std__vectorT_OpenBabel__OBAtom_p_t__iterator ret = new SWIGTYPE_p_std__vectorT_OpenBabel__OBAtom_p_t__iterator(openbabelPINVOKE.OBResidue_EndAtoms(swigCPtr), true);
    return ret;
  }

  public OBAtom BeginAtom(SWIGTYPE_p_std__vectorT_OpenBabel__OBAtom_p_t__iterator i) {
    IntPtr cPtr = openbabelPINVOKE.OBResidue_BeginAtom(swigCPtr, SWIGTYPE_p_std__vectorT_OpenBabel__OBAtom_p_t__iterator.getCPtr(i));
    OBAtom ret = (cPtr == IntPtr.Zero) ? null : new OBAtom(cPtr, false);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public OBAtom NextAtom(SWIGTYPE_p_std__vectorT_OpenBabel__OBAtom_p_t__iterator i) {
    IntPtr cPtr = openbabelPINVOKE.OBResidue_NextAtom(swigCPtr, SWIGTYPE_p_std__vectorT_OpenBabel__OBAtom_p_t__iterator.getCPtr(i));
    OBAtom ret = (cPtr == IntPtr.Zero) ? null : new OBAtom(cPtr, false);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}
