/* ----------------------------------------------------------------------------
 * 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 vector3 : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

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

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

  ~vector3() {
    Dispose();
  }

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

  public vector3(double inX, double inY, double inZ) : this(openbabelPINVOKE.new_vector3__SWIG_0(inX, inY, inZ), true) {
  }

  public vector3(double inX, double inY) : this(openbabelPINVOKE.new_vector3__SWIG_1(inX, inY), true) {
  }

  public vector3(double inX) : this(openbabelPINVOKE.new_vector3__SWIG_2(inX), true) {
  }

  public vector3() : this(openbabelPINVOKE.new_vector3__SWIG_3(), true) {
  }

  public vector3(SWIGTYPE_p_double inV) : this(openbabelPINVOKE.new_vector3__SWIG_4(SWIGTYPE_p_double.getCPtr(inV)), true) {
  }

  public vector3(vector3 v) : this(openbabelPINVOKE.new_vector3__SWIG_5(vector3.getCPtr(v)), true) {
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public void Set(double inX, double inY, double inZ) {
    openbabelPINVOKE.vector3_Set__SWIG_0(swigCPtr, inX, inY, inZ);
  }

  public void Set(SWIGTYPE_p_double c) {
    openbabelPINVOKE.vector3_Set__SWIG_1(swigCPtr, SWIGTYPE_p_double.getCPtr(c));
  }

  public void SetX(double inX) {
    openbabelPINVOKE.vector3_SetX(swigCPtr, inX);
  }

  public void SetY(double inY) {
    openbabelPINVOKE.vector3_SetY(swigCPtr, inY);
  }

  public void SetZ(double inZ) {
    openbabelPINVOKE.vector3_SetZ(swigCPtr, inZ);
  }

  public void Get(SWIGTYPE_p_double c) {
    openbabelPINVOKE.vector3_Get(swigCPtr, SWIGTYPE_p_double.getCPtr(c));
  }

  public SWIGTYPE_p_double AsArray() {
    IntPtr cPtr = openbabelPINVOKE.vector3_AsArray(swigCPtr);
    SWIGTYPE_p_double ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_double(cPtr, false);
    return ret;
  }

  public void randomUnitVector(OBRandom oeRand) {
    openbabelPINVOKE.vector3_randomUnitVector__SWIG_0(swigCPtr, OBRandom.getCPtr(oeRand));
  }

  public void randomUnitVector() {
    openbabelPINVOKE.vector3_randomUnitVector__SWIG_1(swigCPtr);
  }

  public vector3 normalize() {
    vector3 ret = new vector3(openbabelPINVOKE.vector3_normalize(swigCPtr), false);
    return ret;
  }

  public bool CanBeNormalized() {
    bool ret = openbabelPINVOKE.vector3_CanBeNormalized(swigCPtr);
    return ret;
  }

  public double length_2() {
    double ret = openbabelPINVOKE.vector3_length_2(swigCPtr);
    return ret;
  }

  public double length() {
    double ret = openbabelPINVOKE.vector3_length(swigCPtr);
    return ret;
  }

  public double x() {
    double ret = openbabelPINVOKE.vector3_x__SWIG_0(swigCPtr);
    return ret;
  }

  public double y() {
    double ret = openbabelPINVOKE.vector3_y__SWIG_0(swigCPtr);
    return ret;
  }

  public double z() {
    double ret = openbabelPINVOKE.vector3_z__SWIG_0(swigCPtr);
    return ret;
  }

  public bool IsApprox(vector3 other, double precision) {
    bool ret = openbabelPINVOKE.vector3_IsApprox(swigCPtr, vector3.getCPtr(other), precision);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public double distSq(vector3 vv) {
    double ret = openbabelPINVOKE.vector3_distSq(swigCPtr, vector3.getCPtr(vv));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool createOrthoVector(vector3 v) {
    bool ret = openbabelPINVOKE.vector3_createOrthoVector(swigCPtr, vector3.getCPtr(v));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}
