2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 internal class Matrix3 : global::System.IDisposable
23 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
24 protected bool swigCMemOwn;
26 internal Matrix3(global::System.IntPtr cPtr, bool cMemoryOwn)
28 swigCMemOwn = cMemoryOwn;
29 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Matrix3 obj)
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37 //A Flag to check who called Dispose(). (By User or DisposeQueue)
38 private bool isDisposeQueued = false;
39 //A Flat to check if it is already disposed.
40 protected bool disposed = false;
47 isDisposeQueued = true;
48 DisposeQueue.Instance.Add(this);
54 //Throw excpetion if Dispose() is called in separate thread.
55 if (!Window.IsInstalled())
57 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
62 Dispose(DisposeTypes.Implicit);
66 Dispose(DisposeTypes.Explicit);
67 System.GC.SuppressFinalize(this);
71 protected virtual void Dispose(DisposeTypes type)
78 if (type == DisposeTypes.Explicit)
81 //Release your own managed resources here.
82 //You should release all of your own disposable objects here.
86 //Release your own unmanaged resources here.
87 //You should not access any managed member here except static instance.
88 //because the execution order of Finalizes is non-deterministic.
90 if (swigCPtr.Handle != global::System.IntPtr.Zero)
95 NDalicPINVOKE.delete_Matrix3(swigCPtr);
97 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
103 public static Matrix3 IDENTITY
107 global::System.IntPtr cPtr = NDalicPINVOKE.Matrix3_IDENTITY_get();
108 Matrix3 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Matrix3(cPtr, false);
109 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114 public Matrix3() : this(NDalicPINVOKE.new_Matrix3__SWIG_0(), true)
116 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119 public Matrix3(Matrix3 m) : this(NDalicPINVOKE.new_Matrix3__SWIG_1(Matrix3.getCPtr(m)), true)
121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124 public Matrix3(Matrix m) : this(NDalicPINVOKE.new_Matrix3__SWIG_2(Matrix.getCPtr(m)), true)
126 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
129 public Matrix3(float s00, float s01, float s02, float s10, float s11, float s12, float s20, float s21, float s22) : this(NDalicPINVOKE.new_Matrix3__SWIG_3(s00, s01, s02, s10, s11, s12, s20, s21, s22), true)
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134 public Matrix3 Assign(Matrix3 matrix)
136 Matrix3 ret = new Matrix3(NDalicPINVOKE.Matrix3_Assign__SWIG_0(swigCPtr, Matrix3.getCPtr(matrix)), false);
137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141 public Matrix3 Assign(Matrix matrix)
143 Matrix3 ret = new Matrix3(NDalicPINVOKE.Matrix3_Assign__SWIG_1(swigCPtr, Matrix.getCPtr(matrix)), false);
144 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148 public bool EqualTo(Matrix3 rhs)
150 bool ret = NDalicPINVOKE.Matrix3_EqualTo(swigCPtr, Matrix3.getCPtr(rhs));
151 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155 public bool NotEqualTo(Matrix3 rhs)
157 bool ret = NDalicPINVOKE.Matrix3_NotEqualTo(swigCPtr, Matrix3.getCPtr(rhs));
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 public void SetIdentity()
164 NDalicPINVOKE.Matrix3_SetIdentity(swigCPtr);
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 public SWIGTYPE_p_float AsFloat()
170 global::System.IntPtr cPtr = NDalicPINVOKE.Matrix3_AsFloat__SWIG_0(swigCPtr);
171 SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false);
172 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 bool ret = NDalicPINVOKE.Matrix3_Invert(swigCPtr);
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 public bool Transpose()
185 bool ret = NDalicPINVOKE.Matrix3_Transpose(swigCPtr);
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 public void Scale(float scale)
192 NDalicPINVOKE.Matrix3_Scale(swigCPtr, scale);
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 public float Magnitude()
198 float ret = NDalicPINVOKE.Matrix3_Magnitude(swigCPtr);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 public bool ScaledInverseTranspose()
205 bool ret = NDalicPINVOKE.Matrix3_ScaledInverseTranspose(swigCPtr);
206 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 public static void Multiply(Matrix3 result, Matrix3 lhs, Matrix3 rhs)
212 NDalicPINVOKE.Matrix3_Multiply(Matrix3.getCPtr(result), Matrix3.getCPtr(lhs), Matrix3.getCPtr(rhs));
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();