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

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

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

  ~OBUnitCell() {
    Dispose();
  }

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

  public OBUnitCell() : this(openbabelPINVOKE.new_OBUnitCell__SWIG_0(), true) {
  }

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

  public void SetData(double a, double b, double c, double alpha, double beta, double gamma) {
    openbabelPINVOKE.OBUnitCell_SetData__SWIG_0(swigCPtr, a, b, c, alpha, beta, gamma);
  }

  public void SetData(vector3 v1, vector3 v2, vector3 v3) {
    openbabelPINVOKE.OBUnitCell_SetData__SWIG_1(swigCPtr, vector3.getCPtr(v1), vector3.getCPtr(v2), vector3.getCPtr(v3));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetOffset(vector3 v1) {
    openbabelPINVOKE.OBUnitCell_SetOffset(swigCPtr, vector3.getCPtr(v1));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetSpaceGroup(SpaceGroup sg) {
    openbabelPINVOKE.OBUnitCell_SetSpaceGroup__SWIG_0(swigCPtr, SpaceGroup.getCPtr(sg));
  }

  public void SetSpaceGroup(string sg) {
    openbabelPINVOKE.OBUnitCell_SetSpaceGroup__SWIG_1(swigCPtr, sg);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void SetSpaceGroup(int sg) {
    openbabelPINVOKE.OBUnitCell_SetSpaceGroup__SWIG_2(swigCPtr, sg);
  }

  public void SetLatticeType(OBUnitCell.LatticeType lt) {
    openbabelPINVOKE.OBUnitCell_SetLatticeType(swigCPtr, (int)lt);
  }

  public void FillUnitCell(OBMol arg0) {
    openbabelPINVOKE.OBUnitCell_FillUnitCell(swigCPtr, OBMol.getCPtr(arg0));
  }

  public double GetA() {
    double ret = openbabelPINVOKE.OBUnitCell_GetA(swigCPtr);
    return ret;
  }

  public double GetB() {
    double ret = openbabelPINVOKE.OBUnitCell_GetB(swigCPtr);
    return ret;
  }

  public double GetC() {
    double ret = openbabelPINVOKE.OBUnitCell_GetC(swigCPtr);
    return ret;
  }

  public double GetAlpha() {
    double ret = openbabelPINVOKE.OBUnitCell_GetAlpha(swigCPtr);
    return ret;
  }

  public double GetBeta() {
    double ret = openbabelPINVOKE.OBUnitCell_GetBeta(swigCPtr);
    return ret;
  }

  public double GetGamma() {
    double ret = openbabelPINVOKE.OBUnitCell_GetGamma(swigCPtr);
    return ret;
  }

  public vector3 GetOffset() {
    vector3 ret = new vector3(openbabelPINVOKE.OBUnitCell_GetOffset(swigCPtr), true);
    return ret;
  }

  public SpaceGroup GetSpaceGroup() {
    IntPtr cPtr = openbabelPINVOKE.OBUnitCell_GetSpaceGroup(swigCPtr);
    SpaceGroup ret = (cPtr == IntPtr.Zero) ? null : new SpaceGroup(cPtr, false);
    return ret;
  }

  public string GetSpaceGroupName() {
    string ret = openbabelPINVOKE.OBUnitCell_GetSpaceGroupName(swigCPtr);
    return ret;
  }

  public OBUnitCell.LatticeType GetLatticeType(int spacegroup) {
    OBUnitCell.LatticeType ret = (OBUnitCell.LatticeType)openbabelPINVOKE.OBUnitCell_GetLatticeType__SWIG_0(swigCPtr, spacegroup);
    return ret;
  }

  public OBUnitCell.LatticeType GetLatticeType() {
    OBUnitCell.LatticeType ret = (OBUnitCell.LatticeType)openbabelPINVOKE.OBUnitCell_GetLatticeType__SWIG_1(swigCPtr);
    return ret;
  }

  public vVector3 GetCellVectors() {
    vVector3 ret = new vVector3(openbabelPINVOKE.OBUnitCell_GetCellVectors(swigCPtr), true);
    return ret;
  }

  public matrix3x3 GetCellMatrix() {
    matrix3x3 ret = new matrix3x3(openbabelPINVOKE.OBUnitCell_GetCellMatrix(swigCPtr), true);
    return ret;
  }

  public matrix3x3 GetOrthoMatrix() {
    matrix3x3 ret = new matrix3x3(openbabelPINVOKE.OBUnitCell_GetOrthoMatrix(swigCPtr), true);
    return ret;
  }

  public matrix3x3 GetFractionalMatrix() {
    matrix3x3 ret = new matrix3x3(openbabelPINVOKE.OBUnitCell_GetFractionalMatrix(swigCPtr), true);
    return ret;
  }

  public int GetSpaceGroupNumber(string name) {
    int ret = openbabelPINVOKE.OBUnitCell_GetSpaceGroupNumber__SWIG_0(swigCPtr, name);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public int GetSpaceGroupNumber() {
    int ret = openbabelPINVOKE.OBUnitCell_GetSpaceGroupNumber__SWIG_1(swigCPtr);
    return ret;
  }

  public double GetCellVolume() {
    double ret = openbabelPINVOKE.OBUnitCell_GetCellVolume(swigCPtr);
    return ret;
  }

  public enum LatticeType {
    Undefined,
    Triclinic,
    Monoclinic,
    Orthorhombic,
    Tetragonal,
    Rhombohedral,
    Hexagonal,
    Cubic
  }

}
