001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.7
004 *
005 * Do not make changes to this file unless you know what you are doing--modify
006 * the SWIG interface file instead.
007 * ----------------------------------------------------------------------------- */
008
009package org.sbml.libsbml;
010
011/** 
012 * implementation of a 3D transformation matrix.
013 <p>
014 * The {@link Transformation} class represents a 3D transformation which normally is a 4x4 matrix.
015 * Since the last row is always 0 0 0 1 for affine transformations, we leave out those values
016 * and store the matrix as an array of 4x3 columns
017 */
018
019public class Transformation extends SBase {
020   private long swigCPtr;
021
022   protected Transformation(long cPtr, boolean cMemoryOwn)
023   {
024     super(libsbmlJNI.Transformation_SWIGUpcast(cPtr), cMemoryOwn);
025     swigCPtr = cPtr;
026   }
027
028   protected static long getCPtr(Transformation obj)
029   {
030     return (obj == null) ? 0 : obj.swigCPtr;
031   }
032
033   protected static long getCPtrAndDisown (Transformation obj)
034   {
035     long ptr = 0;
036
037     if (obj != null)
038     {
039       ptr             = obj.swigCPtr;
040       obj.swigCMemOwn = false;
041     }
042
043     return ptr;
044   }
045
046  protected void finalize() {
047    delete();
048  }
049
050  public synchronized void delete() {
051    if (swigCPtr != 0) {
052      if (swigCMemOwn) {
053        swigCMemOwn = false;
054        libsbmlJNI.delete_Transformation(swigCPtr);
055      }
056      swigCPtr = 0;
057    }
058    super.delete();
059  }
060
061  
062/**
063   * Returns a 3D identity matrix.
064   * The matrix contains 12 double values.
065   */ public
066 static SWIGTYPE_p_double getIdentityMatrix() {
067    long cPtr = libsbmlJNI.Transformation_getIdentityMatrix();
068    return (cPtr == 0) ? null : new SWIGTYPE_p_double(cPtr, false);
069  }
070
071  
072/**
073   * Sets the matrix to the values given in the array.
074   <p>
075   * @param m array with new values to be set for this {@link Transformation} object.
076   */ public
077 void setMatrix(SWIGTYPE_p_double m) {
078    libsbmlJNI.Transformation_setMatrix(swigCPtr, this, SWIGTYPE_p_double.getCPtr(m));
079  }
080
081  
082/**
083   * Returns the matrix which is an array of double values of length 12.
084   <p>
085   * @return a pointer to the array of numbers for the transformation.
086   */ public
087 SWIGTYPE_p_double getMatrix() {
088    long cPtr = libsbmlJNI.Transformation_getMatrix(swigCPtr, this);
089    return (cPtr == 0) ? null : new SWIGTYPE_p_double(cPtr, false);
090  }
091
092  
093/**
094   * Returns true if the matrix has been set or false otherwise.
095   * The matrix is considered as set if none of the values in the matrix is NaN.
096   <p>
097   * @return true or false depending on whether a NaN was found.
098   */ public
099 boolean isSetMatrix() {
100    return libsbmlJNI.Transformation_isSetMatrix(swigCPtr, this);
101  }
102
103}