You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

aiMaterial.cs 8.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.8
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. using System;
  9. using System.Runtime.InteropServices;
  10. public class aiMaterial : IDisposable {
  11. private HandleRef swigCPtr;
  12. protected bool swigCMemOwn;
  13. internal aiMaterial(IntPtr cPtr, bool cMemoryOwn) {
  14. swigCMemOwn = cMemoryOwn;
  15. swigCPtr = new HandleRef(this, cPtr);
  16. }
  17. internal static HandleRef getCPtr(aiMaterial obj) {
  18. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  19. }
  20. ~aiMaterial() {
  21. Dispose();
  22. }
  23. public virtual void Dispose() {
  24. lock(this) {
  25. if (swigCPtr.Handle != IntPtr.Zero) {
  26. if (swigCMemOwn) {
  27. swigCMemOwn = false;
  28. AssimpPINVOKE.delete_aiMaterial(swigCPtr);
  29. }
  30. swigCPtr = new HandleRef(null, IntPtr.Zero);
  31. }
  32. GC.SuppressFinalize(this);
  33. }
  34. }
  35. public aiColor4D Diffuse { get { var v = new aiColor4D(); return GetDiffuse(v)?v:DefaultDiffuse; } }
  36. public aiColor4D Specular { get { var v = new aiColor4D(); return GetSpecular(v)?v:DefaultSpecular; } }
  37. public aiColor4D Ambient { get { var v = new aiColor4D(); return GetAmbient(v)?v:DefaultAmbient; } }
  38. public aiColor4D Emissive { get { var v = new aiColor4D(); return GetEmissive(v)?v:DefaultEmissive; } }
  39. public float Opacity { get { float v = 0; return GetOpacity(ref v)?v:DefaultOpacity; } }
  40. public float ShininessStrength { get { float v = 0; return GetShininessStrength(ref v)?v:DefaultShininessStrength; } }
  41. public aiShadingMode ShadingModel { get { int v = 0; return GetShadingModel(ref v)?((aiShadingMode)v):DefaultShadingModel; } }
  42. public aiTextureFlags TexFlagsDiffuse0 { get { int v = 0; return GetTexFlagsDiffuse0(ref v)?((aiTextureFlags)v):DefaultTexFlagsDiffuse0; } }
  43. public aiTextureMapMode MappingModeUDiffuse0 { get { int v = 0; return GetMappingModeUDiffuse0(ref v)?((aiTextureMapMode)v):DefaultMappingModeUDiffuse0; } }
  44. public aiTextureMapMode MappingModeVDiffuse0 { get { int v = 0; return GetMappingModeVDiffuse0(ref v)?((aiTextureMapMode)v):DefaultMappingModeVDiffuse0; } }
  45. public string TextureDiffuse0 { get { var v = new aiString(); return GetTextureDiffuse0(v)?v.ToString():DefaultTextureDiffuse; } }
  46. public bool TwoSided { get { int v = 0; return GetTwoSided(ref v)?(v!=0):DefaultTwoSided; } }
  47. // These values are returned if the value material property isn't set
  48. // Override these if you don't want to check for null
  49. public static aiColor4D DefaultDiffuse = new aiColor4D(1.0f, 1.0f, 1.0f, 1.0f);
  50. public static aiColor4D DefaultSpecular = new aiColor4D(1.0f, 1.0f, 1.0f, 1.0f);
  51. public static aiColor4D DefaultAmbient = new aiColor4D(0.0f, 0.0f, 0.0f, 1.0f);
  52. public static aiColor4D DefaultEmissive = new aiColor4D(0.0f, 0.0f, 0.0f, 1.0f);
  53. public static float DefaultShininessStrength = 1.0f;
  54. public static float DefaultOpacity = 1.0f;
  55. public static aiShadingMode DefaultShadingModel = (aiShadingMode)0;
  56. public static aiTextureFlags DefaultTexFlagsDiffuse0 = (aiTextureFlags)0;
  57. public static aiTextureMapMode DefaultMappingModeUDiffuse0 = aiTextureMapMode.aiTextureMapMode_Wrap;
  58. public static aiTextureMapMode DefaultMappingModeVDiffuse0 = aiTextureMapMode.aiTextureMapMode_Wrap;
  59. public static string DefaultTextureDiffuse = null;
  60. public static bool DefaultTwoSided = false;
  61. public aiMaterial() : this(AssimpPINVOKE.new_aiMaterial(), true) {
  62. }
  63. public uint GetTextureCount(aiTextureType type) {
  64. uint ret = AssimpPINVOKE.aiMaterial_GetTextureCount(swigCPtr, (int)type);
  65. return ret;
  66. }
  67. public aiReturn AddBinaryProperty(SWIGTYPE_p_void pInput, uint pSizeInBytes, string pKey, uint type, uint index, aiPropertyTypeInfo pType) {
  68. aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_AddBinaryProperty(swigCPtr, SWIGTYPE_p_void.getCPtr(pInput), pSizeInBytes, pKey, type, index, (int)pType);
  69. return ret;
  70. }
  71. public aiReturn AddProperty(aiString pInput, string pKey, uint type, uint index) {
  72. aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_AddProperty__SWIG_0(swigCPtr, aiString.getCPtr(pInput), pKey, type, index);
  73. return ret;
  74. }
  75. public aiReturn AddProperty(aiString pInput, string pKey, uint type) {
  76. aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_AddProperty__SWIG_1(swigCPtr, aiString.getCPtr(pInput), pKey, type);
  77. return ret;
  78. }
  79. public aiReturn AddProperty(aiString pInput, string pKey) {
  80. aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_AddProperty__SWIG_2(swigCPtr, aiString.getCPtr(pInput), pKey);
  81. return ret;
  82. }
  83. public aiReturn RemoveProperty(string pKey, uint type, uint index) {
  84. aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_RemoveProperty__SWIG_0(swigCPtr, pKey, type, index);
  85. return ret;
  86. }
  87. public aiReturn RemoveProperty(string pKey, uint type) {
  88. aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_RemoveProperty__SWIG_1(swigCPtr, pKey, type);
  89. return ret;
  90. }
  91. public aiReturn RemoveProperty(string pKey) {
  92. aiReturn ret = (aiReturn)AssimpPINVOKE.aiMaterial_RemoveProperty__SWIG_2(swigCPtr, pKey);
  93. return ret;
  94. }
  95. public void Clear() {
  96. AssimpPINVOKE.aiMaterial_Clear(swigCPtr);
  97. }
  98. public static void CopyPropertyList(aiMaterial pcDest, aiMaterial pcSrc) {
  99. AssimpPINVOKE.aiMaterial_CopyPropertyList(aiMaterial.getCPtr(pcDest), aiMaterial.getCPtr(pcSrc));
  100. }
  101. public bool GetDiffuse(aiColor4D INOUT) {
  102. bool ret = AssimpPINVOKE.aiMaterial_GetDiffuse(swigCPtr, aiColor4D.getCPtr(INOUT));
  103. return ret;
  104. }
  105. public bool GetSpecular(aiColor4D INOUT) {
  106. bool ret = AssimpPINVOKE.aiMaterial_GetSpecular(swigCPtr, aiColor4D.getCPtr(INOUT));
  107. return ret;
  108. }
  109. public bool GetAmbient(aiColor4D INOUT) {
  110. bool ret = AssimpPINVOKE.aiMaterial_GetAmbient(swigCPtr, aiColor4D.getCPtr(INOUT));
  111. return ret;
  112. }
  113. public bool GetEmissive(aiColor4D INOUT) {
  114. bool ret = AssimpPINVOKE.aiMaterial_GetEmissive(swigCPtr, aiColor4D.getCPtr(INOUT));
  115. return ret;
  116. }
  117. public bool GetOpacity(ref float INOUT) {
  118. bool ret = AssimpPINVOKE.aiMaterial_GetOpacity(swigCPtr, ref INOUT);
  119. return ret;
  120. }
  121. public bool GetShininessStrength(ref float INOUT) {
  122. bool ret = AssimpPINVOKE.aiMaterial_GetShininessStrength(swigCPtr, ref INOUT);
  123. return ret;
  124. }
  125. public bool GetShadingModel(ref int INOUT) {
  126. bool ret = AssimpPINVOKE.aiMaterial_GetShadingModel(swigCPtr, ref INOUT);
  127. return ret;
  128. }
  129. public bool GetTexFlagsDiffuse0(ref int INOUT) {
  130. bool ret = AssimpPINVOKE.aiMaterial_GetTexFlagsDiffuse0(swigCPtr, ref INOUT);
  131. return ret;
  132. }
  133. public bool GetMappingModeUDiffuse0(ref int INOUT) {
  134. bool ret = AssimpPINVOKE.aiMaterial_GetMappingModeUDiffuse0(swigCPtr, ref INOUT);
  135. return ret;
  136. }
  137. public bool GetMappingModeVDiffuse0(ref int INOUT) {
  138. bool ret = AssimpPINVOKE.aiMaterial_GetMappingModeVDiffuse0(swigCPtr, ref INOUT);
  139. return ret;
  140. }
  141. public bool GetTextureDiffuse0(aiString INOUT) {
  142. bool ret = AssimpPINVOKE.aiMaterial_GetTextureDiffuse0(swigCPtr, aiString.getCPtr(INOUT));
  143. return ret;
  144. }
  145. public bool GetTextureSpecular0(aiString INOUT) {
  146. bool ret = AssimpPINVOKE.aiMaterial_GetTextureSpecular0(swigCPtr, aiString.getCPtr(INOUT));
  147. return ret;
  148. }
  149. public bool GetTextureOpacity0(aiString INOUT) {
  150. bool ret = AssimpPINVOKE.aiMaterial_GetTextureOpacity0(swigCPtr, aiString.getCPtr(INOUT));
  151. return ret;
  152. }
  153. public bool GetTextureAmbient0(aiString INOUT) {
  154. bool ret = AssimpPINVOKE.aiMaterial_GetTextureAmbient0(swigCPtr, aiString.getCPtr(INOUT));
  155. return ret;
  156. }
  157. public bool GetTextureEmissive0(aiString INOUT) {
  158. bool ret = AssimpPINVOKE.aiMaterial_GetTextureEmissive0(swigCPtr, aiString.getCPtr(INOUT));
  159. return ret;
  160. }
  161. public bool GetTextureShininess0(aiString INOUT) {
  162. bool ret = AssimpPINVOKE.aiMaterial_GetTextureShininess0(swigCPtr, aiString.getCPtr(INOUT));
  163. return ret;
  164. }
  165. public bool GetTextureLightmap0(aiString INOUT) {
  166. bool ret = AssimpPINVOKE.aiMaterial_GetTextureLightmap0(swigCPtr, aiString.getCPtr(INOUT));
  167. return ret;
  168. }
  169. public bool GetTextureNormals0(aiString INOUT) {
  170. bool ret = AssimpPINVOKE.aiMaterial_GetTextureNormals0(swigCPtr, aiString.getCPtr(INOUT));
  171. return ret;
  172. }
  173. public bool GetTextureHeight0(aiString INOUT) {
  174. bool ret = AssimpPINVOKE.aiMaterial_GetTextureHeight0(swigCPtr, aiString.getCPtr(INOUT));
  175. return ret;
  176. }
  177. public bool GetGlobalBackgroundImage(aiString INOUT) {
  178. bool ret = AssimpPINVOKE.aiMaterial_GetGlobalBackgroundImage(swigCPtr, aiString.getCPtr(INOUT));
  179. return ret;
  180. }
  181. public bool GetTwoSided(ref int INOUT) {
  182. bool ret = AssimpPINVOKE.aiMaterial_GetTwoSided(swigCPtr, ref INOUT);
  183. return ret;
  184. }
  185. }