FbxMesh.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. //------------------------------------------------------------------------------
  2. // <auto-generated />
  3. //
  4. // This file was automatically generated by SWIG (http://www.swig.org).
  5. // Version 3.0.12
  6. //
  7. // Do not make changes to this file unless you know what you are doing--modify
  8. // the SWIG interface file instead.
  9. //------------------------------------------------------------------------------
  10. namespace Autodesk.Fbx {
  11. public class FbxMesh : FbxGeometry {
  12. internal FbxMesh(global::System.IntPtr cPtr, bool ignored) : base(cPtr, ignored) { }
  13. // override void Dispose() {base.Dispose();}
  14. public new static FbxMesh Create(FbxManager pManager, string pName) {
  15. global::System.IntPtr cPtr = NativeMethods.FbxMesh_Create__SWIG_0(FbxManager.getCPtr(pManager), pName);
  16. FbxMesh ret = (cPtr == global::System.IntPtr.Zero) ? null : new FbxMesh(cPtr, false);
  17. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  18. return ret;
  19. }
  20. public new static FbxMesh Create(FbxObject pContainer, string pName) {
  21. global::System.IntPtr cPtr = NativeMethods.FbxMesh_Create__SWIG_1(FbxObject.getCPtr(pContainer), pName);
  22. FbxMesh ret = (cPtr == global::System.IntPtr.Zero) ? null : new FbxMesh(cPtr, false);
  23. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  24. return ret;
  25. }
  26. private void BeginPolygonUnchecked(int pMaterial, int pTexture, int pGroup, bool pLegacy) {
  27. NativeMethods.FbxMesh_BeginPolygonUnchecked(swigCPtr, pMaterial, pTexture, pGroup, pLegacy);
  28. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  29. }
  30. private void AddPolygonUnchecked(int pIndex, int pTextureUVIndex) {
  31. NativeMethods.FbxMesh_AddPolygonUnchecked(swigCPtr, pIndex, pTextureUVIndex);
  32. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  33. }
  34. private void EndPolygonUnchecked() {
  35. NativeMethods.FbxMesh_EndPolygonUnchecked(swigCPtr);
  36. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  37. }
  38. public int GetPolygonCount() {
  39. int ret = NativeMethods.FbxMesh_GetPolygonCount(swigCPtr);
  40. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  41. return ret;
  42. }
  43. public int GetPolygonSize(int pPolygonIndex) {
  44. int ret = NativeMethods.FbxMesh_GetPolygonSize(swigCPtr, pPolygonIndex);
  45. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  46. return ret;
  47. }
  48. public int GetPolygonVertex(int pPolygonIndex, int pPositionInPolygon) {
  49. int ret = NativeMethods.FbxMesh_GetPolygonVertex(swigCPtr, pPolygonIndex, pPositionInPolygon);
  50. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  51. return ret;
  52. }
  53. public int GetPolygonVertexCount() {
  54. int ret = NativeMethods.FbxMesh_GetPolygonVertexCount(swigCPtr);
  55. if (NativeMethods.SWIGPendingException.Pending) throw NativeMethods.SWIGPendingException.Retrieve();
  56. return ret;
  57. }
  58. public override int GetHashCode(){
  59. return swigCPtr.Handle.GetHashCode();
  60. }
  61. public bool Equals(FbxMesh other) {
  62. if (object.ReferenceEquals(other, null)) { return false; }
  63. return this.swigCPtr.Handle.Equals (other.swigCPtr.Handle);
  64. }
  65. public override bool Equals(object obj){
  66. if (object.ReferenceEquals(obj, null)) { return false; }
  67. /* is obj a subclass of this type; if so use our Equals */
  68. var typed = obj as FbxMesh;
  69. if (!object.ReferenceEquals(typed, null)) {
  70. return this.Equals(typed);
  71. }
  72. /* are we a subclass of the other type; if so use their Equals */
  73. if (typeof(FbxMesh).IsSubclassOf(obj.GetType())) {
  74. return obj.Equals(this);
  75. }
  76. /* types are unrelated; can't be a match */
  77. return false;
  78. }
  79. public static bool operator == (FbxMesh a, FbxMesh b) {
  80. if (object.ReferenceEquals(a, b)) { return true; }
  81. if (object.ReferenceEquals(a, null) || object.ReferenceEquals(b, null)) { return false; }
  82. return a.Equals(b);
  83. }
  84. public static bool operator != (FbxMesh a, FbxMesh b) {
  85. return !(a == b);
  86. }
  87. [System.SerializableAttribute]
  88. public class BadBracketingException : System.NotSupportedException {
  89. public BadBracketingException() : base() { }
  90. public BadBracketingException(string message, System.Exception innerException) : base("Improper bracketing of Begin/Add/EndPolygon: " + message, innerException) { }
  91. public BadBracketingException(string message) : base("Improper bracketing of Begin/Add/EndPolygon: " + message) { }
  92. protected BadBracketingException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
  93. }
  94. bool m_isAddingPolygon = false;
  95. public void BeginPolygon(int pMaterial=-1, int pTexture=-1, int pGroup=-1, bool pLegacy=true) {
  96. if (m_isAddingPolygon) { throw new BadBracketingException("BeginPolygon while already building a polygon"); }
  97. BeginPolygonUnchecked(pMaterial, pTexture, pGroup, pLegacy);
  98. m_isAddingPolygon = true;
  99. }
  100. public void AddPolygon(int pIndex, int pTextureUVIndex = -1) {
  101. if (!m_isAddingPolygon) { throw new BadBracketingException("AddPolygon without matching BeginPolygon"); }
  102. if (pIndex < 0) { throw new System.ArgumentOutOfRangeException("pIndex"); }
  103. AddPolygonUnchecked(pIndex, pTextureUVIndex);
  104. }
  105. public void EndPolygon() {
  106. if (!m_isAddingPolygon) { throw new BadBracketingException("EndPolygon without matching BeginPolygon"); }
  107. m_isAddingPolygon = false;
  108. EndPolygonUnchecked();
  109. }
  110. }
  111. }