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.
22 /// Geometry is handle to an object that can be used to define a geometric elements.
24 /// <since_tizen> 3 </since_tizen>
25 public class Geometry : BaseHandle
27 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
30 /// Create an instance of Geometry.
32 /// <since_tizen> 3 </since_tizen>
33 public Geometry() : this(NDalicPINVOKE.Geometry_New(), true)
35 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
39 internal Geometry(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Geometry_SWIGUpcast(cPtr), cMemoryOwn)
41 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
45 /// Enumeration for the description of the type of geometry,
46 /// used to determine how the coordinates will be used.
48 /// <returns>Type of primitives this geometry contains.</returns>
49 /// <since_tizen> 3 </since_tizen>
53 /// Individual points.
58 /// Individual lines (made of 2 points each).
63 /// A strip of lines (made of 1 point each) which also joins the first and last point.
68 /// A strip of lines (made of 1 point each).
73 /// Individual triangles (made of 3 points each).
78 /// A fan of triangles around a centre point (after the first triangle, following triangles need only 1 point).
83 /// A strip of triangles (after the first triangle, following triangles need only 1 point).
89 /// Adds a PropertyBuffer to be used as source of geometry vertices.
91 /// <param name="vertexBuffer">PropertyBuffer to be used as source of geometry vertices.</param>
92 /// <returns>Index of the newly added buffer.</returns>
93 /// <since_tizen> 3 </since_tizen>
94 public uint AddVertexBuffer(PropertyBuffer vertexBuffer)
96 uint ret = NDalicPINVOKE.Geometry_AddVertexBuffer(swigCPtr, PropertyBuffer.getCPtr(vertexBuffer));
97 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102 /// Retrieves the number of vertex buffers that have been added to this geometry.
104 /// <returns>Number of vertex buffers that have been added to this geometry.</returns>
105 /// <since_tizen> 3 </since_tizen>
106 public uint GetNumberOfVertexBuffers()
108 uint ret = NDalicPINVOKE.Geometry_GetNumberOfVertexBuffers(swigCPtr);
109 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114 /// Removes a vertex buffer.
116 /// <param name="index">Index to the vertex buffer to remove.</param>
117 /// <since_tizen> 3 </since_tizen>
118 public void RemoveVertexBuffer(uint index)
120 NDalicPINVOKE.Geometry_RemoveVertexBuffer(swigCPtr, index);
121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125 /// Sets a the index data to be used as a source of indices for the geometry
126 /// Setting this buffer will cause the geometry to be rendered using indices.
128 /// <param name="indices">Array of indices.</param>
129 /// <param name="count">Number of indices in the array.</param>
130 /// <since_tizen> 3 </since_tizen>
131 public void SetIndexBuffer(ushort[] indices, uint count)
133 NDalicPINVOKE.Geometry_SetIndexBuffer(swigCPtr, indices, count);
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138 /// Sets the type of primitives this geometry contains.
140 /// <param name="geometryType">Array of indices.</param>
141 /// <since_tizen> 3 </since_tizen>
142 public void SetType(Geometry.Type geometryType)
144 NDalicPINVOKE.Geometry_SetType(swigCPtr, (int)geometryType);
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149 /// Gets the type of primitives this geometry contains.
151 /// <returns>Type of primitives this geometry contains.</returns>
152 /// <since_tizen> 3 </since_tizen>
153 public new Geometry.Type GetType()
155 Geometry.Type ret = (Geometry.Type)NDalicPINVOKE.Geometry_GetType(swigCPtr);
156 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
160 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Geometry obj)
162 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
168 /// <since_tizen> 3 </since_tizen>
169 protected override void Dispose(DisposeTypes type)
176 if (type == DisposeTypes.Explicit)
179 //Release your own managed resources here.
180 //You should release all of your own disposable objects here.
184 //Release your own unmanaged resources here.
185 //You should not access any managed member here except static instance.
186 //because the execution order of Finalizes is non-deterministic.
188 if (swigCPtr.Handle != global::System.IntPtr.Zero)
193 NDalicPINVOKE.delete_Geometry(swigCPtr);
195 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);