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;
29 internal Geometry(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Geometry_SWIGUpcast(cPtr), cMemoryOwn)
31 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
34 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Geometry obj)
36 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
42 /// <since_tizen> 3 </since_tizen>
43 protected override void Dispose(DisposeTypes type)
50 if (type == DisposeTypes.Explicit)
53 //Release your own managed resources here.
54 //You should release all of your own disposable objects here.
58 //Release your own unmanaged resources here.
59 //You should not access any managed member here except static instance.
60 //because the execution order of Finalizes is non-deterministic.
62 if (swigCPtr.Handle != global::System.IntPtr.Zero)
67 NDalicPINVOKE.delete_Geometry(swigCPtr);
69 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
76 /// Create an instance of Geometry.
78 /// <since_tizen> 3 </since_tizen>
79 public Geometry() : this(NDalicPINVOKE.Geometry_New(), true)
81 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
86 /// Adds a PropertyBuffer to be used as source of geometry vertices.
88 /// <param name="vertexBuffer">PropertyBuffer to be used as source of geometry vertices.</param>
89 /// <returns>Index of the newly added buffer.</returns>
90 /// <since_tizen> 3 </since_tizen>
91 public uint AddVertexBuffer(PropertyBuffer vertexBuffer)
93 uint ret = NDalicPINVOKE.Geometry_AddVertexBuffer(swigCPtr, PropertyBuffer.getCPtr(vertexBuffer));
94 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99 /// Retrieves the number of vertex buffers that have been added to this geometry.
101 /// <returns>Number of vertex buffers that have been added to this geometry.</returns>
102 /// <since_tizen> 3 </since_tizen>
103 public uint GetNumberOfVertexBuffers()
105 uint ret = NDalicPINVOKE.Geometry_GetNumberOfVertexBuffers(swigCPtr);
106 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111 /// Removes a vertex buffer.
113 /// <param name="index">Index to the vertex buffer to remove.</param>
114 /// <since_tizen> 3 </since_tizen>
115 public void RemoveVertexBuffer(uint index)
117 NDalicPINVOKE.Geometry_RemoveVertexBuffer(swigCPtr, index);
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122 /// Sets a the index data to be used as a source of indices for the geometry
123 /// Setting this buffer will cause the geometry to be rendered using indices.
125 /// <param name="indices">Array of indices.</param>
126 /// <param name="count">Number of indices in the array.</param>
127 /// <since_tizen> 3 </since_tizen>
128 public void SetIndexBuffer(ushort[] indices, uint count)
130 NDalicPINVOKE.Geometry_SetIndexBuffer(swigCPtr, indices, count);
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 /// Sets the type of primitives this geometry contains.
137 /// <param name="geometryType">Array of indices.</param>
138 /// <since_tizen> 3 </since_tizen>
139 public void SetType(Geometry.Type geometryType)
141 NDalicPINVOKE.Geometry_SetType(swigCPtr, (int)geometryType);
142 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
146 /// Gets the type of primitives this geometry contains.
148 /// <returns>Type of primitives this geometry contains.</returns>
149 /// <since_tizen> 3 </since_tizen>
150 public new Geometry.Type GetType()
152 Geometry.Type ret = (Geometry.Type)NDalicPINVOKE.Geometry_GetType(swigCPtr);
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 /// Enumeration for the description of the type of geometry,
159 /// used to determine how the coordinates will be used.
161 /// <returns>Type of primitives this geometry contains.</returns>
162 /// <since_tizen> 3 </since_tizen>
166 /// Individual points.
171 /// Individual lines (made of 2 points each).
176 /// A strip of lines (made of 1 point each) which also joins the first and last point.
181 /// A strip of lines (made of 1 point each).
186 /// Individual triangles (made of 3 points each).
191 /// A fan of triangles around a centre point (after the first triangle, following triangles need only 1 point).
196 /// A strip of triangles (after the first triangle, following triangles need only 1 point).