001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.12
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  
104/**
105   * Returns the value of the 'name' attribute of this {@link Transformation}.
106   <p>
107   * @return the name of the {@link Transformation}
108   */ public
109 String getName() {
110    return libsbmlJNI.Transformation_getName(swigCPtr, this);
111  }
112
113  
114/**
115   * Predicate returning <code>true</code> or <code>false</code> depending on whether this
116   * {@link Transformation}'s 'name' attribute has been set.
117   <p>
118   * @return returns true or false depending on whether the name on the 
119   * {@link Transformation} has been set.
120   */ public
121 boolean isSetName() {
122    return libsbmlJNI.Transformation_isSetName(swigCPtr, this);
123  }
124
125  
126/**
127   * Sets the value of the 'name' attribute of this {@link Transformation}.
128   <p>
129   * @param name the new name for the {@link Transformation} 
130   <p>
131   * @return status if the operation succeeded
132   */ public
133 int setName(String name) {
134    return libsbmlJNI.Transformation_setName(swigCPtr, this, name);
135  }
136
137  
138/**
139   * Unsets the value of the 'name' attribute of this {@link Transformation}.
140   */ public
141 int unsetName() {
142    return libsbmlJNI.Transformation_unsetName(swigCPtr, this);
143  }
144
145  
146/** * @internal */ public
147 void readAttributes(XMLAttributes attributes, SWIGTYPE_p_ExpectedAttributes expectedAttributes) {
148    libsbmlJNI.Transformation_readAttributes(swigCPtr, this, XMLAttributes.getCPtr(attributes), attributes, SWIGTYPE_p_ExpectedAttributes.getCPtr(expectedAttributes));
149  }
150
151}