Lib3MF.cs 215 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143
  1. using System;
  2. using System.Text;
  3. using System.Runtime.InteropServices;
  4. namespace Lib3MF {
  5. public enum ePropertyType {
  6. NoPropertyType = 0,
  7. BaseMaterial = 1,
  8. TexCoord = 2,
  9. Colors = 3,
  10. Composite = 4,
  11. Multi = 5
  12. };
  13. public enum eSlicesMeshResolution {
  14. Fullres = 0,
  15. Lowres = 1
  16. };
  17. public enum eModelUnit {
  18. MicroMeter = 0,
  19. MilliMeter = 1,
  20. CentiMeter = 2,
  21. Inch = 3,
  22. Foot = 4,
  23. Meter = 5
  24. };
  25. public enum eObjectType {
  26. Other = 0,
  27. Model = 1,
  28. Support = 2,
  29. SolidSupport = 3
  30. };
  31. public enum eTextureType {
  32. Unknown = 0,
  33. PNG = 1,
  34. JPEG = 2
  35. };
  36. public enum eTextureTileStyle {
  37. Wrap = 0,
  38. Mirror = 1,
  39. Clamp = 2,
  40. NoTileStyle = 3
  41. };
  42. public enum eTextureFilter {
  43. Auto = 0,
  44. Linear = 1,
  45. Nearest = 2
  46. };
  47. public enum eBeamLatticeCapMode {
  48. Sphere = 0,
  49. HemiSphere = 1,
  50. Butt = 2
  51. };
  52. public enum eBeamLatticeClipMode {
  53. NoClipMode = 0,
  54. Inside = 1,
  55. Outside = 2
  56. };
  57. public enum eBeamLatticeBallMode {
  58. None = 0,
  59. Mixed = 1,
  60. All = 2
  61. };
  62. public enum eProgressIdentifier {
  63. QUERYCANCELED = 0,
  64. DONE = 1,
  65. CLEANUP = 2,
  66. READSTREAM = 3,
  67. EXTRACTOPCPACKAGE = 4,
  68. READNONROOTMODELS = 5,
  69. READROOTMODEL = 6,
  70. READRESOURCES = 7,
  71. READMESH = 8,
  72. READSLICES = 9,
  73. READBUILD = 10,
  74. READCUSTOMATTACHMENT = 11,
  75. READTEXTURETACHMENTS = 12,
  76. CREATEOPCPACKAGE = 13,
  77. WRITEMODELSTOSTREAM = 14,
  78. WRITEROOTMODEL = 15,
  79. WRITENONROOTMODELS = 16,
  80. WRITEATTACHMENTS = 17,
  81. WRITECONTENTTYPES = 18,
  82. WRITENOBJECTS = 19,
  83. WRITENODES = 20,
  84. WRITETRIANGLES = 21,
  85. WRITESLICES = 22,
  86. WRITEKEYSTORE = 23
  87. };
  88. public enum eBlendMethod {
  89. NoBlendMethod = 0,
  90. Mix = 1,
  91. Multiply = 2
  92. };
  93. public enum eEncryptionAlgorithm {
  94. AES256_GCM = 1
  95. };
  96. public enum eWrappingAlgorithm {
  97. RSA_OAEP = 0
  98. };
  99. public enum eMgfAlgorithm {
  100. MGF1_SHA1 = 160,
  101. MGF1_SHA224 = 224,
  102. MGF1_SHA256 = 256,
  103. MGF1_SHA384 = 384,
  104. MGF1_SHA512 = 512
  105. };
  106. public enum eDigestMethod {
  107. SHA1 = 160,
  108. SHA256 = 256
  109. };
  110. public enum eCompression {
  111. NoCompression = 0,
  112. Deflate = 1
  113. };
  114. public struct sTriangle
  115. {
  116. public UInt32[] Indices;
  117. }
  118. public struct sTriangleProperties
  119. {
  120. public UInt32 ResourceID;
  121. public UInt32[] PropertyIDs;
  122. }
  123. public struct sPosition
  124. {
  125. public Single[] Coordinates;
  126. }
  127. public struct sPosition2D
  128. {
  129. public Single[] Coordinates;
  130. }
  131. public struct sCompositeConstituent
  132. {
  133. public UInt32 PropertyID;
  134. public Double MixingRatio;
  135. }
  136. public struct sMultiPropertyLayer
  137. {
  138. public UInt32 ResourceID;
  139. public eBlendMethod TheBlendMethod;
  140. }
  141. public struct sTex2Coord
  142. {
  143. public Double U;
  144. public Double V;
  145. }
  146. public struct sTransform
  147. {
  148. public Single[][] Fields;
  149. }
  150. public struct sBox
  151. {
  152. public Single[] MinCoordinate;
  153. public Single[] MaxCoordinate;
  154. }
  155. public struct sColor
  156. {
  157. public Byte Red;
  158. public Byte Green;
  159. public Byte Blue;
  160. public Byte Alpha;
  161. }
  162. public struct sBeam
  163. {
  164. public UInt32[] Indices;
  165. public Double[] Radii;
  166. public eBeamLatticeCapMode[] CapModes;
  167. }
  168. public struct sBall
  169. {
  170. public UInt32 Index;
  171. public Double Radius;
  172. }
  173. namespace Internal {
  174. [StructLayout(LayoutKind.Explicit, Size=12)]
  175. public unsafe struct InternalTriangle
  176. {
  177. [FieldOffset(0)] public fixed UInt32 Indices[3];
  178. }
  179. [StructLayout(LayoutKind.Explicit, Size=16)]
  180. public unsafe struct InternalTriangleProperties
  181. {
  182. [FieldOffset(0)] public UInt32 ResourceID;
  183. [FieldOffset(4)] public fixed UInt32 PropertyIDs[3];
  184. }
  185. [StructLayout(LayoutKind.Explicit, Size=12)]
  186. public unsafe struct InternalPosition
  187. {
  188. [FieldOffset(0)] public fixed Single Coordinates[3];
  189. }
  190. [StructLayout(LayoutKind.Explicit, Size=8)]
  191. public unsafe struct InternalPosition2D
  192. {
  193. [FieldOffset(0)] public fixed Single Coordinates[2];
  194. }
  195. [StructLayout(LayoutKind.Explicit, Size=12)]
  196. public unsafe struct InternalCompositeConstituent
  197. {
  198. [FieldOffset(0)] public UInt32 PropertyID;
  199. [FieldOffset(4)] public Double MixingRatio;
  200. }
  201. [StructLayout(LayoutKind.Explicit, Size=8)]
  202. public unsafe struct InternalMultiPropertyLayer
  203. {
  204. [FieldOffset(0)] public UInt32 ResourceID;
  205. [FieldOffset(4)] public Int32 TheBlendMethod;
  206. }
  207. [StructLayout(LayoutKind.Explicit, Size=16)]
  208. public unsafe struct InternalTex2Coord
  209. {
  210. [FieldOffset(0)] public Double U;
  211. [FieldOffset(8)] public Double V;
  212. }
  213. [StructLayout(LayoutKind.Explicit, Size=48)]
  214. public unsafe struct InternalTransform
  215. {
  216. [FieldOffset(0)] public fixed Single Fields[12];
  217. }
  218. [StructLayout(LayoutKind.Explicit, Size=24)]
  219. public unsafe struct InternalBox
  220. {
  221. [FieldOffset(0)] public fixed Single MinCoordinate[3];
  222. [FieldOffset(12)] public fixed Single MaxCoordinate[3];
  223. }
  224. [StructLayout(LayoutKind.Explicit, Size=4)]
  225. public unsafe struct InternalColor
  226. {
  227. [FieldOffset(0)] public Byte Red;
  228. [FieldOffset(1)] public Byte Green;
  229. [FieldOffset(2)] public Byte Blue;
  230. [FieldOffset(3)] public Byte Alpha;
  231. }
  232. [StructLayout(LayoutKind.Explicit, Size=32)]
  233. public unsafe struct InternalBeam
  234. {
  235. [FieldOffset(0)] public fixed UInt32 Indices[2];
  236. [FieldOffset(8)] public fixed Double Radii[2];
  237. [FieldOffset(24)] public fixed Int32 CapModes[2];
  238. }
  239. [StructLayout(LayoutKind.Explicit, Size=12)]
  240. public unsafe struct InternalBall
  241. {
  242. [FieldOffset(0)] public UInt32 Index;
  243. [FieldOffset(4)] public Double Radius;
  244. }
  245. public class Lib3MFWrapper
  246. {
  247. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_writetofile", CallingConvention=CallingConvention.Cdecl)]
  248. public unsafe extern static Int32 Writer_WriteToFile (IntPtr Handle, byte[] AFilename);
  249. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_getstreamsize", CallingConvention=CallingConvention.Cdecl)]
  250. public unsafe extern static Int32 Writer_GetStreamSize (IntPtr Handle, out UInt64 AStreamSize);
  251. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_writetobuffer", CallingConvention=CallingConvention.Cdecl)]
  252. public unsafe extern static Int32 Writer_WriteToBuffer (IntPtr Handle, UInt64 sizeBuffer, out UInt64 neededBuffer, IntPtr dataBuffer);
  253. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_writetocallback", CallingConvention=CallingConvention.Cdecl)]
  254. public unsafe extern static Int32 Writer_WriteToCallback (IntPtr Handle, IntPtr ATheWriteCallback, IntPtr ATheSeekCallback, UInt64 AUserData);
  255. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_setprogresscallback", CallingConvention=CallingConvention.Cdecl)]
  256. public unsafe extern static Int32 Writer_SetProgressCallback (IntPtr Handle, IntPtr AProgressCallback, UInt64 AUserData);
  257. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_getdecimalprecision", CallingConvention=CallingConvention.Cdecl)]
  258. public unsafe extern static Int32 Writer_GetDecimalPrecision (IntPtr Handle, out UInt32 ADecimalPrecision);
  259. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_setdecimalprecision", CallingConvention=CallingConvention.Cdecl)]
  260. public unsafe extern static Int32 Writer_SetDecimalPrecision (IntPtr Handle, UInt32 ADecimalPrecision);
  261. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_setstrictmodeactive", CallingConvention=CallingConvention.Cdecl)]
  262. public unsafe extern static Int32 Writer_SetStrictModeActive (IntPtr Handle, Byte AStrictModeActive);
  263. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_getstrictmodeactive", CallingConvention=CallingConvention.Cdecl)]
  264. public unsafe extern static Int32 Writer_GetStrictModeActive (IntPtr Handle, out Byte AStrictModeActive);
  265. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_getwarning", CallingConvention=CallingConvention.Cdecl)]
  266. public unsafe extern static Int32 Writer_GetWarning (IntPtr Handle, UInt32 AIndex, out UInt32 AErrorCode, UInt32 sizeWarning, out UInt32 neededWarning, IntPtr dataWarning);
  267. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_getwarningcount", CallingConvention=CallingConvention.Cdecl)]
  268. public unsafe extern static Int32 Writer_GetWarningCount (IntPtr Handle, out UInt32 ACount);
  269. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_addkeywrappingcallback", CallingConvention=CallingConvention.Cdecl)]
  270. public unsafe extern static Int32 Writer_AddKeyWrappingCallback (IntPtr Handle, byte[] AConsumerID, IntPtr ATheCallback, UInt64 AUserData);
  271. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_writer_setcontentencryptioncallback", CallingConvention=CallingConvention.Cdecl)]
  272. public unsafe extern static Int32 Writer_SetContentEncryptionCallback (IntPtr Handle, IntPtr ATheCallback, UInt64 AUserData);
  273. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_readfromfile", CallingConvention=CallingConvention.Cdecl)]
  274. public unsafe extern static Int32 Reader_ReadFromFile (IntPtr Handle, byte[] AFilename);
  275. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_readfrombuffer", CallingConvention=CallingConvention.Cdecl)]
  276. public unsafe extern static Int32 Reader_ReadFromBuffer (IntPtr Handle, UInt64 sizeBuffer, IntPtr dataBuffer);
  277. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_readfromcallback", CallingConvention=CallingConvention.Cdecl)]
  278. public unsafe extern static Int32 Reader_ReadFromCallback (IntPtr Handle, IntPtr ATheReadCallback, UInt64 AStreamSize, IntPtr ATheSeekCallback, UInt64 AUserData);
  279. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_setprogresscallback", CallingConvention=CallingConvention.Cdecl)]
  280. public unsafe extern static Int32 Reader_SetProgressCallback (IntPtr Handle, IntPtr AProgressCallback, UInt64 AUserData);
  281. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_addrelationtoread", CallingConvention=CallingConvention.Cdecl)]
  282. public unsafe extern static Int32 Reader_AddRelationToRead (IntPtr Handle, byte[] ARelationShipType);
  283. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_removerelationtoread", CallingConvention=CallingConvention.Cdecl)]
  284. public unsafe extern static Int32 Reader_RemoveRelationToRead (IntPtr Handle, byte[] ARelationShipType);
  285. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_setstrictmodeactive", CallingConvention=CallingConvention.Cdecl)]
  286. public unsafe extern static Int32 Reader_SetStrictModeActive (IntPtr Handle, Byte AStrictModeActive);
  287. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_getstrictmodeactive", CallingConvention=CallingConvention.Cdecl)]
  288. public unsafe extern static Int32 Reader_GetStrictModeActive (IntPtr Handle, out Byte AStrictModeActive);
  289. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_getwarning", CallingConvention=CallingConvention.Cdecl)]
  290. public unsafe extern static Int32 Reader_GetWarning (IntPtr Handle, UInt32 AIndex, out UInt32 AErrorCode, UInt32 sizeWarning, out UInt32 neededWarning, IntPtr dataWarning);
  291. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_getwarningcount", CallingConvention=CallingConvention.Cdecl)]
  292. public unsafe extern static Int32 Reader_GetWarningCount (IntPtr Handle, out UInt32 ACount);
  293. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_addkeywrappingcallback", CallingConvention=CallingConvention.Cdecl)]
  294. public unsafe extern static Int32 Reader_AddKeyWrappingCallback (IntPtr Handle, byte[] AConsumerID, IntPtr ATheCallback, UInt64 AUserData);
  295. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_reader_setcontentencryptioncallback", CallingConvention=CallingConvention.Cdecl)]
  296. public unsafe extern static Int32 Reader_SetContentEncryptionCallback (IntPtr Handle, IntPtr ATheCallback, UInt64 AUserData);
  297. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_packagepart_getpath", CallingConvention=CallingConvention.Cdecl)]
  298. public unsafe extern static Int32 PackagePart_GetPath (IntPtr Handle, UInt32 sizePath, out UInt32 neededPath, IntPtr dataPath);
  299. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_packagepart_setpath", CallingConvention=CallingConvention.Cdecl)]
  300. public unsafe extern static Int32 PackagePart_SetPath (IntPtr Handle, byte[] APath);
  301. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resource_getresourceid", CallingConvention=CallingConvention.Cdecl)]
  302. public unsafe extern static Int32 Resource_GetResourceID (IntPtr Handle, out UInt32 AUniqueResourceID);
  303. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resource_getuniqueresourceid", CallingConvention=CallingConvention.Cdecl)]
  304. public unsafe extern static Int32 Resource_GetUniqueResourceID (IntPtr Handle, out UInt32 AUniqueResourceID);
  305. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resource_packagepart", CallingConvention=CallingConvention.Cdecl)]
  306. public unsafe extern static Int32 Resource_PackagePart (IntPtr Handle, out IntPtr APackagePart);
  307. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resource_setpackagepart", CallingConvention=CallingConvention.Cdecl)]
  308. public unsafe extern static Int32 Resource_SetPackagePart (IntPtr Handle, IntPtr APackagePart);
  309. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resource_getmodelresourceid", CallingConvention=CallingConvention.Cdecl)]
  310. public unsafe extern static Int32 Resource_GetModelResourceID (IntPtr Handle, out UInt32 AModelResourceId);
  311. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourceiterator_movenext", CallingConvention=CallingConvention.Cdecl)]
  312. public unsafe extern static Int32 ResourceIterator_MoveNext (IntPtr Handle, out Byte AHasNext);
  313. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourceiterator_moveprevious", CallingConvention=CallingConvention.Cdecl)]
  314. public unsafe extern static Int32 ResourceIterator_MovePrevious (IntPtr Handle, out Byte AHasPrevious);
  315. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourceiterator_getcurrent", CallingConvention=CallingConvention.Cdecl)]
  316. public unsafe extern static Int32 ResourceIterator_GetCurrent (IntPtr Handle, out IntPtr AResource);
  317. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourceiterator_clone", CallingConvention=CallingConvention.Cdecl)]
  318. public unsafe extern static Int32 ResourceIterator_Clone (IntPtr Handle, out IntPtr AOutResourceIterator);
  319. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourceiterator_count", CallingConvention=CallingConvention.Cdecl)]
  320. public unsafe extern static Int32 ResourceIterator_Count (IntPtr Handle, out UInt64 ACount);
  321. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slicestackiterator_getcurrentslicestack", CallingConvention=CallingConvention.Cdecl)]
  322. public unsafe extern static Int32 SliceStackIterator_GetCurrentSliceStack (IntPtr Handle, out IntPtr AResource);
  323. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_objectiterator_getcurrentobject", CallingConvention=CallingConvention.Cdecl)]
  324. public unsafe extern static Int32 ObjectIterator_GetCurrentObject (IntPtr Handle, out IntPtr AResource);
  325. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobjectiterator_getcurrentmeshobject", CallingConvention=CallingConvention.Cdecl)]
  326. public unsafe extern static Int32 MeshObjectIterator_GetCurrentMeshObject (IntPtr Handle, out IntPtr AResource);
  327. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_componentsobjectiterator_getcurrentcomponentsobject", CallingConvention=CallingConvention.Cdecl)]
  328. public unsafe extern static Int32 ComponentsObjectIterator_GetCurrentComponentsObject (IntPtr Handle, out IntPtr AResource);
  329. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2diterator_getcurrenttexture2d", CallingConvention=CallingConvention.Cdecl)]
  330. public unsafe extern static Int32 Texture2DIterator_GetCurrentTexture2D (IntPtr Handle, out IntPtr AResource);
  331. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_basematerialgroupiterator_getcurrentbasematerialgroup", CallingConvention=CallingConvention.Cdecl)]
  332. public unsafe extern static Int32 BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup (IntPtr Handle, out IntPtr AResource);
  333. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_colorgroupiterator_getcurrentcolorgroup", CallingConvention=CallingConvention.Cdecl)]
  334. public unsafe extern static Int32 ColorGroupIterator_GetCurrentColorGroup (IntPtr Handle, out IntPtr AResource);
  335. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2dgroupiterator_getcurrenttexture2dgroup", CallingConvention=CallingConvention.Cdecl)]
  336. public unsafe extern static Int32 Texture2DGroupIterator_GetCurrentTexture2DGroup (IntPtr Handle, out IntPtr AResource);
  337. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_compositematerialsiterator_getcurrentcompositematerials", CallingConvention=CallingConvention.Cdecl)]
  338. public unsafe extern static Int32 CompositeMaterialsIterator_GetCurrentCompositeMaterials (IntPtr Handle, out IntPtr AResource);
  339. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_multipropertygroupiterator_getcurrentmultipropertygroup", CallingConvention=CallingConvention.Cdecl)]
  340. public unsafe extern static Int32 MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup (IntPtr Handle, out IntPtr AResource);
  341. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadata_getnamespace", CallingConvention=CallingConvention.Cdecl)]
  342. public unsafe extern static Int32 MetaData_GetNameSpace (IntPtr Handle, UInt32 sizeNameSpace, out UInt32 neededNameSpace, IntPtr dataNameSpace);
  343. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadata_setnamespace", CallingConvention=CallingConvention.Cdecl)]
  344. public unsafe extern static Int32 MetaData_SetNameSpace (IntPtr Handle, byte[] ANameSpace);
  345. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadata_getname", CallingConvention=CallingConvention.Cdecl)]
  346. public unsafe extern static Int32 MetaData_GetName (IntPtr Handle, UInt32 sizeName, out UInt32 neededName, IntPtr dataName);
  347. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadata_setname", CallingConvention=CallingConvention.Cdecl)]
  348. public unsafe extern static Int32 MetaData_SetName (IntPtr Handle, byte[] AName);
  349. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadata_getkey", CallingConvention=CallingConvention.Cdecl)]
  350. public unsafe extern static Int32 MetaData_GetKey (IntPtr Handle, UInt32 sizeKey, out UInt32 neededKey, IntPtr dataKey);
  351. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadata_getmustpreserve", CallingConvention=CallingConvention.Cdecl)]
  352. public unsafe extern static Int32 MetaData_GetMustPreserve (IntPtr Handle, out Byte AMustPreserve);
  353. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadata_setmustpreserve", CallingConvention=CallingConvention.Cdecl)]
  354. public unsafe extern static Int32 MetaData_SetMustPreserve (IntPtr Handle, Byte AMustPreserve);
  355. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadata_gettype", CallingConvention=CallingConvention.Cdecl)]
  356. public unsafe extern static Int32 MetaData_GetType (IntPtr Handle, UInt32 sizeType, out UInt32 neededType, IntPtr dataType);
  357. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadata_settype", CallingConvention=CallingConvention.Cdecl)]
  358. public unsafe extern static Int32 MetaData_SetType (IntPtr Handle, byte[] AType);
  359. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadata_getvalue", CallingConvention=CallingConvention.Cdecl)]
  360. public unsafe extern static Int32 MetaData_GetValue (IntPtr Handle, UInt32 sizeValue, out UInt32 neededValue, IntPtr dataValue);
  361. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadata_setvalue", CallingConvention=CallingConvention.Cdecl)]
  362. public unsafe extern static Int32 MetaData_SetValue (IntPtr Handle, byte[] AValue);
  363. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadatagroup_getmetadatacount", CallingConvention=CallingConvention.Cdecl)]
  364. public unsafe extern static Int32 MetaDataGroup_GetMetaDataCount (IntPtr Handle, out UInt32 ACount);
  365. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadatagroup_getmetadata", CallingConvention=CallingConvention.Cdecl)]
  366. public unsafe extern static Int32 MetaDataGroup_GetMetaData (IntPtr Handle, UInt32 AIndex, out IntPtr AMetaData);
  367. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadatagroup_getmetadatabykey", CallingConvention=CallingConvention.Cdecl)]
  368. public unsafe extern static Int32 MetaDataGroup_GetMetaDataByKey (IntPtr Handle, byte[] ANameSpace, byte[] AName, out IntPtr AMetaData);
  369. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadatagroup_removemetadatabyindex", CallingConvention=CallingConvention.Cdecl)]
  370. public unsafe extern static Int32 MetaDataGroup_RemoveMetaDataByIndex (IntPtr Handle, UInt32 AIndex);
  371. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadatagroup_removemetadata", CallingConvention=CallingConvention.Cdecl)]
  372. public unsafe extern static Int32 MetaDataGroup_RemoveMetaData (IntPtr Handle, IntPtr ATheMetaData);
  373. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_metadatagroup_addmetadata", CallingConvention=CallingConvention.Cdecl)]
  374. public unsafe extern static Int32 MetaDataGroup_AddMetaData (IntPtr Handle, byte[] ANameSpace, byte[] AName, byte[] AValue, byte[] AType, Byte AMustPreserve, out IntPtr AMetaData);
  375. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_gettype", CallingConvention=CallingConvention.Cdecl)]
  376. public unsafe extern static Int32 Object_GetType (IntPtr Handle, out Int32 AObjectType);
  377. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_settype", CallingConvention=CallingConvention.Cdecl)]
  378. public unsafe extern static Int32 Object_SetType (IntPtr Handle, Int32 AObjectType);
  379. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_getname", CallingConvention=CallingConvention.Cdecl)]
  380. public unsafe extern static Int32 Object_GetName (IntPtr Handle, UInt32 sizeName, out UInt32 neededName, IntPtr dataName);
  381. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_setname", CallingConvention=CallingConvention.Cdecl)]
  382. public unsafe extern static Int32 Object_SetName (IntPtr Handle, byte[] AName);
  383. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_getpartnumber", CallingConvention=CallingConvention.Cdecl)]
  384. public unsafe extern static Int32 Object_GetPartNumber (IntPtr Handle, UInt32 sizePartNumber, out UInt32 neededPartNumber, IntPtr dataPartNumber);
  385. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_setpartnumber", CallingConvention=CallingConvention.Cdecl)]
  386. public unsafe extern static Int32 Object_SetPartNumber (IntPtr Handle, byte[] APartNumber);
  387. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_ismeshobject", CallingConvention=CallingConvention.Cdecl)]
  388. public unsafe extern static Int32 Object_IsMeshObject (IntPtr Handle, out Byte AIsMeshObject);
  389. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_iscomponentsobject", CallingConvention=CallingConvention.Cdecl)]
  390. public unsafe extern static Int32 Object_IsComponentsObject (IntPtr Handle, out Byte AIsComponentsObject);
  391. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_isvalid", CallingConvention=CallingConvention.Cdecl)]
  392. public unsafe extern static Int32 Object_IsValid (IntPtr Handle, out Byte AIsValid);
  393. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_setattachmentasthumbnail", CallingConvention=CallingConvention.Cdecl)]
  394. public unsafe extern static Int32 Object_SetAttachmentAsThumbnail (IntPtr Handle, IntPtr AAttachment);
  395. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_getthumbnailattachment", CallingConvention=CallingConvention.Cdecl)]
  396. public unsafe extern static Int32 Object_GetThumbnailAttachment (IntPtr Handle, out IntPtr AAttachment);
  397. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_clearthumbnailattachment", CallingConvention=CallingConvention.Cdecl)]
  398. public unsafe extern static Int32 Object_ClearThumbnailAttachment (IntPtr Handle);
  399. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_getoutbox", CallingConvention=CallingConvention.Cdecl)]
  400. public unsafe extern static Int32 Object_GetOutbox (IntPtr Handle, out InternalBox AOutbox);
  401. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_getuuid", CallingConvention=CallingConvention.Cdecl)]
  402. public unsafe extern static Int32 Object_GetUUID (IntPtr Handle, out Byte AHasUUID, UInt32 sizeUUID, out UInt32 neededUUID, IntPtr dataUUID);
  403. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_setuuid", CallingConvention=CallingConvention.Cdecl)]
  404. public unsafe extern static Int32 Object_SetUUID (IntPtr Handle, byte[] AUUID);
  405. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_getmetadatagroup", CallingConvention=CallingConvention.Cdecl)]
  406. public unsafe extern static Int32 Object_GetMetaDataGroup (IntPtr Handle, out IntPtr AMetaDataGroup);
  407. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_setslicesmeshresolution", CallingConvention=CallingConvention.Cdecl)]
  408. public unsafe extern static Int32 Object_SetSlicesMeshResolution (IntPtr Handle, Int32 AMeshResolution);
  409. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_getslicesmeshresolution", CallingConvention=CallingConvention.Cdecl)]
  410. public unsafe extern static Int32 Object_GetSlicesMeshResolution (IntPtr Handle, out Int32 AMeshResolution);
  411. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_hasslices", CallingConvention=CallingConvention.Cdecl)]
  412. public unsafe extern static Int32 Object_HasSlices (IntPtr Handle, Byte ARecursive, out Byte AHasSlices);
  413. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_clearslicestack", CallingConvention=CallingConvention.Cdecl)]
  414. public unsafe extern static Int32 Object_ClearSliceStack (IntPtr Handle);
  415. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_getslicestack", CallingConvention=CallingConvention.Cdecl)]
  416. public unsafe extern static Int32 Object_GetSliceStack (IntPtr Handle, out IntPtr ASliceStackInstance);
  417. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_object_assignslicestack", CallingConvention=CallingConvention.Cdecl)]
  418. public unsafe extern static Int32 Object_AssignSliceStack (IntPtr Handle, IntPtr ASliceStackInstance);
  419. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_getvertexcount", CallingConvention=CallingConvention.Cdecl)]
  420. public unsafe extern static Int32 MeshObject_GetVertexCount (IntPtr Handle, out UInt32 AVertexCount);
  421. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_gettrianglecount", CallingConvention=CallingConvention.Cdecl)]
  422. public unsafe extern static Int32 MeshObject_GetTriangleCount (IntPtr Handle, out UInt32 AVertexCount);
  423. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_getvertex", CallingConvention=CallingConvention.Cdecl)]
  424. public unsafe extern static Int32 MeshObject_GetVertex (IntPtr Handle, UInt32 AIndex, out InternalPosition ACoordinates);
  425. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_setvertex", CallingConvention=CallingConvention.Cdecl)]
  426. public unsafe extern static Int32 MeshObject_SetVertex (IntPtr Handle, UInt32 AIndex, InternalPosition ACoordinates);
  427. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_addvertex", CallingConvention=CallingConvention.Cdecl)]
  428. public unsafe extern static Int32 MeshObject_AddVertex (IntPtr Handle, InternalPosition ACoordinates, out UInt32 ANewIndex);
  429. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_getvertices", CallingConvention=CallingConvention.Cdecl)]
  430. public unsafe extern static Int32 MeshObject_GetVertices (IntPtr Handle, UInt64 sizeVertices, out UInt64 neededVertices, IntPtr dataVertices);
  431. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_gettriangle", CallingConvention=CallingConvention.Cdecl)]
  432. public unsafe extern static Int32 MeshObject_GetTriangle (IntPtr Handle, UInt32 AIndex, out InternalTriangle AIndices);
  433. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_settriangle", CallingConvention=CallingConvention.Cdecl)]
  434. public unsafe extern static Int32 MeshObject_SetTriangle (IntPtr Handle, UInt32 AIndex, InternalTriangle AIndices);
  435. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_addtriangle", CallingConvention=CallingConvention.Cdecl)]
  436. public unsafe extern static Int32 MeshObject_AddTriangle (IntPtr Handle, InternalTriangle AIndices, out UInt32 ANewIndex);
  437. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_gettriangleindices", CallingConvention=CallingConvention.Cdecl)]
  438. public unsafe extern static Int32 MeshObject_GetTriangleIndices (IntPtr Handle, UInt64 sizeIndices, out UInt64 neededIndices, IntPtr dataIndices);
  439. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_setobjectlevelproperty", CallingConvention=CallingConvention.Cdecl)]
  440. public unsafe extern static Int32 MeshObject_SetObjectLevelProperty (IntPtr Handle, UInt32 AUniqueResourceID, UInt32 APropertyID);
  441. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_getobjectlevelproperty", CallingConvention=CallingConvention.Cdecl)]
  442. public unsafe extern static Int32 MeshObject_GetObjectLevelProperty (IntPtr Handle, out UInt32 AUniqueResourceID, out UInt32 APropertyID, out Byte AHasObjectLevelProperty);
  443. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_settriangleproperties", CallingConvention=CallingConvention.Cdecl)]
  444. public unsafe extern static Int32 MeshObject_SetTriangleProperties (IntPtr Handle, UInt32 AIndex, InternalTriangleProperties AProperties);
  445. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_gettriangleproperties", CallingConvention=CallingConvention.Cdecl)]
  446. public unsafe extern static Int32 MeshObject_GetTriangleProperties (IntPtr Handle, UInt32 AIndex, out InternalTriangleProperties AProperty);
  447. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_setalltriangleproperties", CallingConvention=CallingConvention.Cdecl)]
  448. public unsafe extern static Int32 MeshObject_SetAllTriangleProperties (IntPtr Handle, UInt64 sizePropertiesArray, IntPtr dataPropertiesArray);
  449. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_getalltriangleproperties", CallingConvention=CallingConvention.Cdecl)]
  450. public unsafe extern static Int32 MeshObject_GetAllTriangleProperties (IntPtr Handle, UInt64 sizePropertiesArray, out UInt64 neededPropertiesArray, IntPtr dataPropertiesArray);
  451. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_clearallproperties", CallingConvention=CallingConvention.Cdecl)]
  452. public unsafe extern static Int32 MeshObject_ClearAllProperties (IntPtr Handle);
  453. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_setgeometry", CallingConvention=CallingConvention.Cdecl)]
  454. public unsafe extern static Int32 MeshObject_SetGeometry (IntPtr Handle, UInt64 sizeVertices, IntPtr dataVertices, UInt64 sizeIndices, IntPtr dataIndices);
  455. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_ismanifoldandoriented", CallingConvention=CallingConvention.Cdecl)]
  456. public unsafe extern static Int32 MeshObject_IsManifoldAndOriented (IntPtr Handle, out Byte AIsManifoldAndOriented);
  457. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_meshobject_beamlattice", CallingConvention=CallingConvention.Cdecl)]
  458. public unsafe extern static Int32 MeshObject_BeamLattice (IntPtr Handle, out IntPtr ATheBeamLattice);
  459. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getminlength", CallingConvention=CallingConvention.Cdecl)]
  460. public unsafe extern static Int32 BeamLattice_GetMinLength (IntPtr Handle, out Double AMinLength);
  461. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_setminlength", CallingConvention=CallingConvention.Cdecl)]
  462. public unsafe extern static Int32 BeamLattice_SetMinLength (IntPtr Handle, Double AMinLength);
  463. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getclipping", CallingConvention=CallingConvention.Cdecl)]
  464. public unsafe extern static Int32 BeamLattice_GetClipping (IntPtr Handle, out Int32 AClipMode, out UInt32 AUniqueResourceID);
  465. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_setclipping", CallingConvention=CallingConvention.Cdecl)]
  466. public unsafe extern static Int32 BeamLattice_SetClipping (IntPtr Handle, Int32 AClipMode, UInt32 AUniqueResourceID);
  467. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getrepresentation", CallingConvention=CallingConvention.Cdecl)]
  468. public unsafe extern static Int32 BeamLattice_GetRepresentation (IntPtr Handle, out Byte AHasRepresentation, out UInt32 AUniqueResourceID);
  469. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_setrepresentation", CallingConvention=CallingConvention.Cdecl)]
  470. public unsafe extern static Int32 BeamLattice_SetRepresentation (IntPtr Handle, UInt32 AUniqueResourceID);
  471. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getballoptions", CallingConvention=CallingConvention.Cdecl)]
  472. public unsafe extern static Int32 BeamLattice_GetBallOptions (IntPtr Handle, out Int32 ABallMode, out Double ABallRadius);
  473. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_setballoptions", CallingConvention=CallingConvention.Cdecl)]
  474. public unsafe extern static Int32 BeamLattice_SetBallOptions (IntPtr Handle, Int32 ABallMode, Double ABallRadius);
  475. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getbeamcount", CallingConvention=CallingConvention.Cdecl)]
  476. public unsafe extern static Int32 BeamLattice_GetBeamCount (IntPtr Handle, out UInt32 ACount);
  477. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getbeam", CallingConvention=CallingConvention.Cdecl)]
  478. public unsafe extern static Int32 BeamLattice_GetBeam (IntPtr Handle, UInt32 AIndex, out InternalBeam ABeamInfo);
  479. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_addbeam", CallingConvention=CallingConvention.Cdecl)]
  480. public unsafe extern static Int32 BeamLattice_AddBeam (IntPtr Handle, InternalBeam ABeamInfo, out UInt32 AIndex);
  481. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_setbeam", CallingConvention=CallingConvention.Cdecl)]
  482. public unsafe extern static Int32 BeamLattice_SetBeam (IntPtr Handle, UInt32 AIndex, InternalBeam ABeamInfo);
  483. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_setbeams", CallingConvention=CallingConvention.Cdecl)]
  484. public unsafe extern static Int32 BeamLattice_SetBeams (IntPtr Handle, UInt64 sizeBeamInfo, IntPtr dataBeamInfo);
  485. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getbeams", CallingConvention=CallingConvention.Cdecl)]
  486. public unsafe extern static Int32 BeamLattice_GetBeams (IntPtr Handle, UInt64 sizeBeamInfo, out UInt64 neededBeamInfo, IntPtr dataBeamInfo);
  487. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getballcount", CallingConvention=CallingConvention.Cdecl)]
  488. public unsafe extern static Int32 BeamLattice_GetBallCount (IntPtr Handle, out UInt32 ACount);
  489. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getball", CallingConvention=CallingConvention.Cdecl)]
  490. public unsafe extern static Int32 BeamLattice_GetBall (IntPtr Handle, UInt32 AIndex, out InternalBall ABallInfo);
  491. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_addball", CallingConvention=CallingConvention.Cdecl)]
  492. public unsafe extern static Int32 BeamLattice_AddBall (IntPtr Handle, InternalBall ABallInfo, out UInt32 AIndex);
  493. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_setball", CallingConvention=CallingConvention.Cdecl)]
  494. public unsafe extern static Int32 BeamLattice_SetBall (IntPtr Handle, UInt32 AIndex, InternalBall ABallInfo);
  495. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_setballs", CallingConvention=CallingConvention.Cdecl)]
  496. public unsafe extern static Int32 BeamLattice_SetBalls (IntPtr Handle, UInt64 sizeBallInfo, IntPtr dataBallInfo);
  497. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getballs", CallingConvention=CallingConvention.Cdecl)]
  498. public unsafe extern static Int32 BeamLattice_GetBalls (IntPtr Handle, UInt64 sizeBallInfo, out UInt64 neededBallInfo, IntPtr dataBallInfo);
  499. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getbeamsetcount", CallingConvention=CallingConvention.Cdecl)]
  500. public unsafe extern static Int32 BeamLattice_GetBeamSetCount (IntPtr Handle, out UInt32 ACount);
  501. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_addbeamset", CallingConvention=CallingConvention.Cdecl)]
  502. public unsafe extern static Int32 BeamLattice_AddBeamSet (IntPtr Handle, out IntPtr ABeamSet);
  503. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getbeamset", CallingConvention=CallingConvention.Cdecl)]
  504. public unsafe extern static Int32 BeamLattice_GetBeamSet (IntPtr Handle, UInt32 AIndex, out IntPtr ABeamSet);
  505. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_component_getobjectresource", CallingConvention=CallingConvention.Cdecl)]
  506. public unsafe extern static Int32 Component_GetObjectResource (IntPtr Handle, out IntPtr AObjectResource);
  507. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_component_getobjectresourceid", CallingConvention=CallingConvention.Cdecl)]
  508. public unsafe extern static Int32 Component_GetObjectResourceID (IntPtr Handle, out UInt32 AUniqueResourceID);
  509. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_component_getuuid", CallingConvention=CallingConvention.Cdecl)]
  510. public unsafe extern static Int32 Component_GetUUID (IntPtr Handle, out Byte AHasUUID, UInt32 sizeUUID, out UInt32 neededUUID, IntPtr dataUUID);
  511. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_component_setuuid", CallingConvention=CallingConvention.Cdecl)]
  512. public unsafe extern static Int32 Component_SetUUID (IntPtr Handle, byte[] AUUID);
  513. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_component_hastransform", CallingConvention=CallingConvention.Cdecl)]
  514. public unsafe extern static Int32 Component_HasTransform (IntPtr Handle, out Byte AHasTransform);
  515. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_component_gettransform", CallingConvention=CallingConvention.Cdecl)]
  516. public unsafe extern static Int32 Component_GetTransform (IntPtr Handle, out InternalTransform ATransform);
  517. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_component_settransform", CallingConvention=CallingConvention.Cdecl)]
  518. public unsafe extern static Int32 Component_SetTransform (IntPtr Handle, InternalTransform ATransform);
  519. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_componentsobject_addcomponent", CallingConvention=CallingConvention.Cdecl)]
  520. public unsafe extern static Int32 ComponentsObject_AddComponent (IntPtr Handle, IntPtr AObjectResource, InternalTransform ATransform, out IntPtr AComponentInstance);
  521. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_componentsobject_getcomponent", CallingConvention=CallingConvention.Cdecl)]
  522. public unsafe extern static Int32 ComponentsObject_GetComponent (IntPtr Handle, UInt32 AIndex, out IntPtr AComponentInstance);
  523. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_componentsobject_getcomponentcount", CallingConvention=CallingConvention.Cdecl)]
  524. public unsafe extern static Int32 ComponentsObject_GetComponentCount (IntPtr Handle, out UInt32 ACount);
  525. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamset_setname", CallingConvention=CallingConvention.Cdecl)]
  526. public unsafe extern static Int32 BeamSet_SetName (IntPtr Handle, byte[] AName);
  527. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamset_getname", CallingConvention=CallingConvention.Cdecl)]
  528. public unsafe extern static Int32 BeamSet_GetName (IntPtr Handle, UInt32 sizeName, out UInt32 neededName, IntPtr dataName);
  529. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamset_setidentifier", CallingConvention=CallingConvention.Cdecl)]
  530. public unsafe extern static Int32 BeamSet_SetIdentifier (IntPtr Handle, byte[] AIdentifier);
  531. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamset_getidentifier", CallingConvention=CallingConvention.Cdecl)]
  532. public unsafe extern static Int32 BeamSet_GetIdentifier (IntPtr Handle, UInt32 sizeIdentifier, out UInt32 neededIdentifier, IntPtr dataIdentifier);
  533. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamset_getreferencecount", CallingConvention=CallingConvention.Cdecl)]
  534. public unsafe extern static Int32 BeamSet_GetReferenceCount (IntPtr Handle, out UInt32 ACount);
  535. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamset_setreferences", CallingConvention=CallingConvention.Cdecl)]
  536. public unsafe extern static Int32 BeamSet_SetReferences (IntPtr Handle, UInt64 sizeReferences, IntPtr dataReferences);
  537. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamset_getreferences", CallingConvention=CallingConvention.Cdecl)]
  538. public unsafe extern static Int32 BeamSet_GetReferences (IntPtr Handle, UInt64 sizeReferences, out UInt64 neededReferences, IntPtr dataReferences);
  539. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamset_getballreferencecount", CallingConvention=CallingConvention.Cdecl)]
  540. public unsafe extern static Int32 BeamSet_GetBallReferenceCount (IntPtr Handle, out UInt32 ACount);
  541. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamset_setballreferences", CallingConvention=CallingConvention.Cdecl)]
  542. public unsafe extern static Int32 BeamSet_SetBallReferences (IntPtr Handle, UInt64 sizeBallReferences, IntPtr dataBallReferences);
  543. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamset_getballreferences", CallingConvention=CallingConvention.Cdecl)]
  544. public unsafe extern static Int32 BeamSet_GetBallReferences (IntPtr Handle, UInt64 sizeBallReferences, out UInt64 neededBallReferences, IntPtr dataBallReferences);
  545. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_basematerialgroup_getcount", CallingConvention=CallingConvention.Cdecl)]
  546. public unsafe extern static Int32 BaseMaterialGroup_GetCount (IntPtr Handle, out UInt32 ACount);
  547. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_basematerialgroup_getallpropertyids", CallingConvention=CallingConvention.Cdecl)]
  548. public unsafe extern static Int32 BaseMaterialGroup_GetAllPropertyIDs (IntPtr Handle, UInt64 sizePropertyIDs, out UInt64 neededPropertyIDs, IntPtr dataPropertyIDs);
  549. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_basematerialgroup_addmaterial", CallingConvention=CallingConvention.Cdecl)]
  550. public unsafe extern static Int32 BaseMaterialGroup_AddMaterial (IntPtr Handle, byte[] AName, InternalColor ADisplayColor, out UInt32 APropertyID);
  551. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_basematerialgroup_removematerial", CallingConvention=CallingConvention.Cdecl)]
  552. public unsafe extern static Int32 BaseMaterialGroup_RemoveMaterial (IntPtr Handle, UInt32 APropertyID);
  553. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_basematerialgroup_getname", CallingConvention=CallingConvention.Cdecl)]
  554. public unsafe extern static Int32 BaseMaterialGroup_GetName (IntPtr Handle, UInt32 APropertyID, UInt32 sizeName, out UInt32 neededName, IntPtr dataName);
  555. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_basematerialgroup_setname", CallingConvention=CallingConvention.Cdecl)]
  556. public unsafe extern static Int32 BaseMaterialGroup_SetName (IntPtr Handle, UInt32 APropertyID, byte[] AName);
  557. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_basematerialgroup_setdisplaycolor", CallingConvention=CallingConvention.Cdecl)]
  558. public unsafe extern static Int32 BaseMaterialGroup_SetDisplayColor (IntPtr Handle, UInt32 APropertyID, InternalColor ATheColor);
  559. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_basematerialgroup_getdisplaycolor", CallingConvention=CallingConvention.Cdecl)]
  560. public unsafe extern static Int32 BaseMaterialGroup_GetDisplayColor (IntPtr Handle, UInt32 APropertyID, out InternalColor ATheColor);
  561. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_colorgroup_getcount", CallingConvention=CallingConvention.Cdecl)]
  562. public unsafe extern static Int32 ColorGroup_GetCount (IntPtr Handle, out UInt32 ACount);
  563. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_colorgroup_getallpropertyids", CallingConvention=CallingConvention.Cdecl)]
  564. public unsafe extern static Int32 ColorGroup_GetAllPropertyIDs (IntPtr Handle, UInt64 sizePropertyIDs, out UInt64 neededPropertyIDs, IntPtr dataPropertyIDs);
  565. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_colorgroup_addcolor", CallingConvention=CallingConvention.Cdecl)]
  566. public unsafe extern static Int32 ColorGroup_AddColor (IntPtr Handle, InternalColor ATheColor, out UInt32 APropertyID);
  567. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_colorgroup_removecolor", CallingConvention=CallingConvention.Cdecl)]
  568. public unsafe extern static Int32 ColorGroup_RemoveColor (IntPtr Handle, UInt32 APropertyID);
  569. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_colorgroup_setcolor", CallingConvention=CallingConvention.Cdecl)]
  570. public unsafe extern static Int32 ColorGroup_SetColor (IntPtr Handle, UInt32 APropertyID, InternalColor ATheColor);
  571. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_colorgroup_getcolor", CallingConvention=CallingConvention.Cdecl)]
  572. public unsafe extern static Int32 ColorGroup_GetColor (IntPtr Handle, UInt32 APropertyID, out InternalColor ATheColor);
  573. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2dgroup_getcount", CallingConvention=CallingConvention.Cdecl)]
  574. public unsafe extern static Int32 Texture2DGroup_GetCount (IntPtr Handle, out UInt32 ACount);
  575. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2dgroup_getallpropertyids", CallingConvention=CallingConvention.Cdecl)]
  576. public unsafe extern static Int32 Texture2DGroup_GetAllPropertyIDs (IntPtr Handle, UInt64 sizePropertyIDs, out UInt64 neededPropertyIDs, IntPtr dataPropertyIDs);
  577. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2dgroup_addtex2coord", CallingConvention=CallingConvention.Cdecl)]
  578. public unsafe extern static Int32 Texture2DGroup_AddTex2Coord (IntPtr Handle, InternalTex2Coord AUVCoordinate, out UInt32 APropertyID);
  579. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2dgroup_gettex2coord", CallingConvention=CallingConvention.Cdecl)]
  580. public unsafe extern static Int32 Texture2DGroup_GetTex2Coord (IntPtr Handle, UInt32 APropertyID, out InternalTex2Coord AUVCoordinate);
  581. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2dgroup_removetex2coord", CallingConvention=CallingConvention.Cdecl)]
  582. public unsafe extern static Int32 Texture2DGroup_RemoveTex2Coord (IntPtr Handle, UInt32 APropertyID);
  583. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2dgroup_gettexture2d", CallingConvention=CallingConvention.Cdecl)]
  584. public unsafe extern static Int32 Texture2DGroup_GetTexture2D (IntPtr Handle, out IntPtr ATexture2DInstance);
  585. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_compositematerials_getcount", CallingConvention=CallingConvention.Cdecl)]
  586. public unsafe extern static Int32 CompositeMaterials_GetCount (IntPtr Handle, out UInt32 ACount);
  587. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_compositematerials_getallpropertyids", CallingConvention=CallingConvention.Cdecl)]
  588. public unsafe extern static Int32 CompositeMaterials_GetAllPropertyIDs (IntPtr Handle, UInt64 sizePropertyIDs, out UInt64 neededPropertyIDs, IntPtr dataPropertyIDs);
  589. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_compositematerials_getbasematerialgroup", CallingConvention=CallingConvention.Cdecl)]
  590. public unsafe extern static Int32 CompositeMaterials_GetBaseMaterialGroup (IntPtr Handle, out IntPtr ABaseMaterialGroupInstance);
  591. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_compositematerials_addcomposite", CallingConvention=CallingConvention.Cdecl)]
  592. public unsafe extern static Int32 CompositeMaterials_AddComposite (IntPtr Handle, UInt64 sizeComposite, IntPtr dataComposite, out UInt32 APropertyID);
  593. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_compositematerials_removecomposite", CallingConvention=CallingConvention.Cdecl)]
  594. public unsafe extern static Int32 CompositeMaterials_RemoveComposite (IntPtr Handle, UInt32 APropertyID);
  595. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_compositematerials_getcomposite", CallingConvention=CallingConvention.Cdecl)]
  596. public unsafe extern static Int32 CompositeMaterials_GetComposite (IntPtr Handle, UInt32 APropertyID, UInt64 sizeComposite, out UInt64 neededComposite, IntPtr dataComposite);
  597. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_multipropertygroup_getcount", CallingConvention=CallingConvention.Cdecl)]
  598. public unsafe extern static Int32 MultiPropertyGroup_GetCount (IntPtr Handle, out UInt32 ACount);
  599. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_multipropertygroup_getallpropertyids", CallingConvention=CallingConvention.Cdecl)]
  600. public unsafe extern static Int32 MultiPropertyGroup_GetAllPropertyIDs (IntPtr Handle, UInt64 sizePropertyIDs, out UInt64 neededPropertyIDs, IntPtr dataPropertyIDs);
  601. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_multipropertygroup_addmultiproperty", CallingConvention=CallingConvention.Cdecl)]
  602. public unsafe extern static Int32 MultiPropertyGroup_AddMultiProperty (IntPtr Handle, UInt64 sizePropertyIDs, IntPtr dataPropertyIDs, out UInt32 APropertyID);
  603. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_multipropertygroup_setmultiproperty", CallingConvention=CallingConvention.Cdecl)]
  604. public unsafe extern static Int32 MultiPropertyGroup_SetMultiProperty (IntPtr Handle, UInt32 APropertyID, UInt64 sizePropertyIDs, IntPtr dataPropertyIDs);
  605. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_multipropertygroup_getmultiproperty", CallingConvention=CallingConvention.Cdecl)]
  606. public unsafe extern static Int32 MultiPropertyGroup_GetMultiProperty (IntPtr Handle, UInt32 APropertyID, UInt64 sizePropertyIDs, out UInt64 neededPropertyIDs, IntPtr dataPropertyIDs);
  607. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_multipropertygroup_removemultiproperty", CallingConvention=CallingConvention.Cdecl)]
  608. public unsafe extern static Int32 MultiPropertyGroup_RemoveMultiProperty (IntPtr Handle, UInt32 APropertyID);
  609. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_multipropertygroup_getlayercount", CallingConvention=CallingConvention.Cdecl)]
  610. public unsafe extern static Int32 MultiPropertyGroup_GetLayerCount (IntPtr Handle, out UInt32 ACount);
  611. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_multipropertygroup_addlayer", CallingConvention=CallingConvention.Cdecl)]
  612. public unsafe extern static Int32 MultiPropertyGroup_AddLayer (IntPtr Handle, InternalMultiPropertyLayer ATheLayer, out UInt32 ALayerIndex);
  613. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_multipropertygroup_getlayer", CallingConvention=CallingConvention.Cdecl)]
  614. public unsafe extern static Int32 MultiPropertyGroup_GetLayer (IntPtr Handle, UInt32 ALayerIndex, out InternalMultiPropertyLayer ATheLayer);
  615. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_multipropertygroup_removelayer", CallingConvention=CallingConvention.Cdecl)]
  616. public unsafe extern static Int32 MultiPropertyGroup_RemoveLayer (IntPtr Handle, UInt32 ALayerIndex);
  617. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_attachment_getpath", CallingConvention=CallingConvention.Cdecl)]
  618. public unsafe extern static Int32 Attachment_GetPath (IntPtr Handle, UInt32 sizePath, out UInt32 neededPath, IntPtr dataPath);
  619. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_attachment_setpath", CallingConvention=CallingConvention.Cdecl)]
  620. public unsafe extern static Int32 Attachment_SetPath (IntPtr Handle, byte[] APath);
  621. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_attachment_packagepart", CallingConvention=CallingConvention.Cdecl)]
  622. public unsafe extern static Int32 Attachment_PackagePart (IntPtr Handle, out IntPtr APackagePart);
  623. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_attachment_getrelationshiptype", CallingConvention=CallingConvention.Cdecl)]
  624. public unsafe extern static Int32 Attachment_GetRelationShipType (IntPtr Handle, UInt32 sizePath, out UInt32 neededPath, IntPtr dataPath);
  625. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_attachment_setrelationshiptype", CallingConvention=CallingConvention.Cdecl)]
  626. public unsafe extern static Int32 Attachment_SetRelationShipType (IntPtr Handle, byte[] APath);
  627. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_attachment_writetofile", CallingConvention=CallingConvention.Cdecl)]
  628. public unsafe extern static Int32 Attachment_WriteToFile (IntPtr Handle, byte[] AFileName);
  629. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_attachment_readfromfile", CallingConvention=CallingConvention.Cdecl)]
  630. public unsafe extern static Int32 Attachment_ReadFromFile (IntPtr Handle, byte[] AFileName);
  631. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_attachment_getstreamsize", CallingConvention=CallingConvention.Cdecl)]
  632. public unsafe extern static Int32 Attachment_GetStreamSize (IntPtr Handle, out UInt64 AStreamSize);
  633. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_attachment_writetobuffer", CallingConvention=CallingConvention.Cdecl)]
  634. public unsafe extern static Int32 Attachment_WriteToBuffer (IntPtr Handle, UInt64 sizeBuffer, out UInt64 neededBuffer, IntPtr dataBuffer);
  635. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_attachment_readfrombuffer", CallingConvention=CallingConvention.Cdecl)]
  636. public unsafe extern static Int32 Attachment_ReadFromBuffer (IntPtr Handle, UInt64 sizeBuffer, IntPtr dataBuffer);
  637. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2d_getattachment", CallingConvention=CallingConvention.Cdecl)]
  638. public unsafe extern static Int32 Texture2D_GetAttachment (IntPtr Handle, out IntPtr AAttachment);
  639. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2d_setattachment", CallingConvention=CallingConvention.Cdecl)]
  640. public unsafe extern static Int32 Texture2D_SetAttachment (IntPtr Handle, IntPtr AAttachment);
  641. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2d_getcontenttype", CallingConvention=CallingConvention.Cdecl)]
  642. public unsafe extern static Int32 Texture2D_GetContentType (IntPtr Handle, out Int32 AContentType);
  643. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2d_setcontenttype", CallingConvention=CallingConvention.Cdecl)]
  644. public unsafe extern static Int32 Texture2D_SetContentType (IntPtr Handle, Int32 AContentType);
  645. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2d_gettilestyleuv", CallingConvention=CallingConvention.Cdecl)]
  646. public unsafe extern static Int32 Texture2D_GetTileStyleUV (IntPtr Handle, out Int32 ATileStyleU, out Int32 ATileStyleV);
  647. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2d_settilestyleuv", CallingConvention=CallingConvention.Cdecl)]
  648. public unsafe extern static Int32 Texture2D_SetTileStyleUV (IntPtr Handle, Int32 ATileStyleU, Int32 ATileStyleV);
  649. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2d_getfilter", CallingConvention=CallingConvention.Cdecl)]
  650. public unsafe extern static Int32 Texture2D_GetFilter (IntPtr Handle, out Int32 AFilter);
  651. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_texture2d_setfilter", CallingConvention=CallingConvention.Cdecl)]
  652. public unsafe extern static Int32 Texture2D_SetFilter (IntPtr Handle, Int32 AFilter);
  653. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditem_getobjectresource", CallingConvention=CallingConvention.Cdecl)]
  654. public unsafe extern static Int32 BuildItem_GetObjectResource (IntPtr Handle, out IntPtr AObjectResource);
  655. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditem_getuuid", CallingConvention=CallingConvention.Cdecl)]
  656. public unsafe extern static Int32 BuildItem_GetUUID (IntPtr Handle, out Byte AHasUUID, UInt32 sizeUUID, out UInt32 neededUUID, IntPtr dataUUID);
  657. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditem_setuuid", CallingConvention=CallingConvention.Cdecl)]
  658. public unsafe extern static Int32 BuildItem_SetUUID (IntPtr Handle, byte[] AUUID);
  659. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditem_getobjectresourceid", CallingConvention=CallingConvention.Cdecl)]
  660. public unsafe extern static Int32 BuildItem_GetObjectResourceID (IntPtr Handle, out UInt32 AUniqueResourceID);
  661. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditem_hasobjecttransform", CallingConvention=CallingConvention.Cdecl)]
  662. public unsafe extern static Int32 BuildItem_HasObjectTransform (IntPtr Handle, out Byte AHasTransform);
  663. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditem_getobjecttransform", CallingConvention=CallingConvention.Cdecl)]
  664. public unsafe extern static Int32 BuildItem_GetObjectTransform (IntPtr Handle, out InternalTransform ATransform);
  665. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditem_setobjecttransform", CallingConvention=CallingConvention.Cdecl)]
  666. public unsafe extern static Int32 BuildItem_SetObjectTransform (IntPtr Handle, InternalTransform ATransform);
  667. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditem_getpartnumber", CallingConvention=CallingConvention.Cdecl)]
  668. public unsafe extern static Int32 BuildItem_GetPartNumber (IntPtr Handle, UInt32 sizePartNumber, out UInt32 neededPartNumber, IntPtr dataPartNumber);
  669. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditem_setpartnumber", CallingConvention=CallingConvention.Cdecl)]
  670. public unsafe extern static Int32 BuildItem_SetPartNumber (IntPtr Handle, byte[] ASetPartnumber);
  671. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditem_getmetadatagroup", CallingConvention=CallingConvention.Cdecl)]
  672. public unsafe extern static Int32 BuildItem_GetMetaDataGroup (IntPtr Handle, out IntPtr AMetaDataGroup);
  673. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditem_getoutbox", CallingConvention=CallingConvention.Cdecl)]
  674. public unsafe extern static Int32 BuildItem_GetOutbox (IntPtr Handle, out InternalBox AOutbox);
  675. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditemiterator_movenext", CallingConvention=CallingConvention.Cdecl)]
  676. public unsafe extern static Int32 BuildItemIterator_MoveNext (IntPtr Handle, out Byte AHasNext);
  677. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditemiterator_moveprevious", CallingConvention=CallingConvention.Cdecl)]
  678. public unsafe extern static Int32 BuildItemIterator_MovePrevious (IntPtr Handle, out Byte AHasPrevious);
  679. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditemiterator_getcurrent", CallingConvention=CallingConvention.Cdecl)]
  680. public unsafe extern static Int32 BuildItemIterator_GetCurrent (IntPtr Handle, out IntPtr ABuildItem);
  681. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditemiterator_clone", CallingConvention=CallingConvention.Cdecl)]
  682. public unsafe extern static Int32 BuildItemIterator_Clone (IntPtr Handle, out IntPtr AOutBuildItemIterator);
  683. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_builditemiterator_count", CallingConvention=CallingConvention.Cdecl)]
  684. public unsafe extern static Int32 BuildItemIterator_Count (IntPtr Handle, out UInt64 ACount);
  685. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slice_setvertices", CallingConvention=CallingConvention.Cdecl)]
  686. public unsafe extern static Int32 Slice_SetVertices (IntPtr Handle, UInt64 sizeVertices, IntPtr dataVertices);
  687. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slice_getvertices", CallingConvention=CallingConvention.Cdecl)]
  688. public unsafe extern static Int32 Slice_GetVertices (IntPtr Handle, UInt64 sizeVertices, out UInt64 neededVertices, IntPtr dataVertices);
  689. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slice_getvertexcount", CallingConvention=CallingConvention.Cdecl)]
  690. public unsafe extern static Int32 Slice_GetVertexCount (IntPtr Handle, out UInt64 ACount);
  691. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slice_addpolygon", CallingConvention=CallingConvention.Cdecl)]
  692. public unsafe extern static Int32 Slice_AddPolygon (IntPtr Handle, UInt64 sizeIndices, IntPtr dataIndices, out UInt64 AIndex);
  693. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slice_getpolygoncount", CallingConvention=CallingConvention.Cdecl)]
  694. public unsafe extern static Int32 Slice_GetPolygonCount (IntPtr Handle, out UInt64 ACount);
  695. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slice_setpolygonindices", CallingConvention=CallingConvention.Cdecl)]
  696. public unsafe extern static Int32 Slice_SetPolygonIndices (IntPtr Handle, UInt64 AIndex, UInt64 sizeIndices, IntPtr dataIndices);
  697. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slice_getpolygonindices", CallingConvention=CallingConvention.Cdecl)]
  698. public unsafe extern static Int32 Slice_GetPolygonIndices (IntPtr Handle, UInt64 AIndex, UInt64 sizeIndices, out UInt64 neededIndices, IntPtr dataIndices);
  699. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slice_getpolygonindexcount", CallingConvention=CallingConvention.Cdecl)]
  700. public unsafe extern static Int32 Slice_GetPolygonIndexCount (IntPtr Handle, UInt64 AIndex, out UInt64 ACount);
  701. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slice_getztop", CallingConvention=CallingConvention.Cdecl)]
  702. public unsafe extern static Int32 Slice_GetZTop (IntPtr Handle, out Double AZTop);
  703. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slicestack_getbottomz", CallingConvention=CallingConvention.Cdecl)]
  704. public unsafe extern static Int32 SliceStack_GetBottomZ (IntPtr Handle, out Double AZBottom);
  705. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slicestack_getslicecount", CallingConvention=CallingConvention.Cdecl)]
  706. public unsafe extern static Int32 SliceStack_GetSliceCount (IntPtr Handle, out UInt64 ACount);
  707. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slicestack_getslice", CallingConvention=CallingConvention.Cdecl)]
  708. public unsafe extern static Int32 SliceStack_GetSlice (IntPtr Handle, UInt64 ASliceIndex, out IntPtr ATheSlice);
  709. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slicestack_addslice", CallingConvention=CallingConvention.Cdecl)]
  710. public unsafe extern static Int32 SliceStack_AddSlice (IntPtr Handle, Double AZTop, out IntPtr ATheSlice);
  711. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slicestack_getslicerefcount", CallingConvention=CallingConvention.Cdecl)]
  712. public unsafe extern static Int32 SliceStack_GetSliceRefCount (IntPtr Handle, out UInt64 ACount);
  713. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slicestack_addslicestackreference", CallingConvention=CallingConvention.Cdecl)]
  714. public unsafe extern static Int32 SliceStack_AddSliceStackReference (IntPtr Handle, IntPtr ATheSliceStack);
  715. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slicestack_getslicestackreference", CallingConvention=CallingConvention.Cdecl)]
  716. public unsafe extern static Int32 SliceStack_GetSliceStackReference (IntPtr Handle, UInt64 ASliceRefIndex, out IntPtr ATheSliceStack);
  717. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slicestack_collapseslicereferences", CallingConvention=CallingConvention.Cdecl)]
  718. public unsafe extern static Int32 SliceStack_CollapseSliceReferences (IntPtr Handle);
  719. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slicestack_setownpath", CallingConvention=CallingConvention.Cdecl)]
  720. public unsafe extern static Int32 SliceStack_SetOwnPath (IntPtr Handle, byte[] APath);
  721. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_slicestack_getownpath", CallingConvention=CallingConvention.Cdecl)]
  722. public unsafe extern static Int32 SliceStack_GetOwnPath (IntPtr Handle, UInt32 sizePath, out UInt32 neededPath, IntPtr dataPath);
  723. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_consumer_getconsumerid", CallingConvention=CallingConvention.Cdecl)]
  724. public unsafe extern static Int32 Consumer_GetConsumerID (IntPtr Handle, UInt32 sizeConsumerID, out UInt32 neededConsumerID, IntPtr dataConsumerID);
  725. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_consumer_getkeyid", CallingConvention=CallingConvention.Cdecl)]
  726. public unsafe extern static Int32 Consumer_GetKeyID (IntPtr Handle, UInt32 sizeKeyID, out UInt32 neededKeyID, IntPtr dataKeyID);
  727. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_consumer_getkeyvalue", CallingConvention=CallingConvention.Cdecl)]
  728. public unsafe extern static Int32 Consumer_GetKeyValue (IntPtr Handle, UInt32 sizeKeyValue, out UInt32 neededKeyValue, IntPtr dataKeyValue);
  729. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_accessright_getconsumer", CallingConvention=CallingConvention.Cdecl)]
  730. public unsafe extern static Int32 AccessRight_GetConsumer (IntPtr Handle, out IntPtr AConsumer);
  731. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_accessright_getwrappingalgorithm", CallingConvention=CallingConvention.Cdecl)]
  732. public unsafe extern static Int32 AccessRight_GetWrappingAlgorithm (IntPtr Handle, out Int32 AAlgorithm);
  733. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_accessright_getmgfalgorithm", CallingConvention=CallingConvention.Cdecl)]
  734. public unsafe extern static Int32 AccessRight_GetMgfAlgorithm (IntPtr Handle, out Int32 AAlgorithm);
  735. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_accessright_getdigestmethod", CallingConvention=CallingConvention.Cdecl)]
  736. public unsafe extern static Int32 AccessRight_GetDigestMethod (IntPtr Handle, out Int32 AAlgorithm);
  737. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_contentencryptionparams_getencryptionalgorithm", CallingConvention=CallingConvention.Cdecl)]
  738. public unsafe extern static Int32 ContentEncryptionParams_GetEncryptionAlgorithm (IntPtr Handle, out Int32 AAlgorithm);
  739. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_contentencryptionparams_getkey", CallingConvention=CallingConvention.Cdecl)]
  740. public unsafe extern static Int32 ContentEncryptionParams_GetKey (IntPtr Handle, UInt64 sizeByteData, out UInt64 neededByteData, IntPtr dataByteData);
  741. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_contentencryptionparams_getinitializationvector", CallingConvention=CallingConvention.Cdecl)]
  742. public unsafe extern static Int32 ContentEncryptionParams_GetInitializationVector (IntPtr Handle, UInt64 sizeByteData, out UInt64 neededByteData, IntPtr dataByteData);
  743. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_contentencryptionparams_getauthenticationtag", CallingConvention=CallingConvention.Cdecl)]
  744. public unsafe extern static Int32 ContentEncryptionParams_GetAuthenticationTag (IntPtr Handle, UInt64 sizeByteData, out UInt64 neededByteData, IntPtr dataByteData);
  745. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_contentencryptionparams_setauthenticationtag", CallingConvention=CallingConvention.Cdecl)]
  746. public unsafe extern static Int32 ContentEncryptionParams_SetAuthenticationTag (IntPtr Handle, UInt64 sizeByteData, IntPtr dataByteData);
  747. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_contentencryptionparams_getadditionalauthenticationdata", CallingConvention=CallingConvention.Cdecl)]
  748. public unsafe extern static Int32 ContentEncryptionParams_GetAdditionalAuthenticationData (IntPtr Handle, UInt64 sizeByteData, out UInt64 neededByteData, IntPtr dataByteData);
  749. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_contentencryptionparams_getdescriptor", CallingConvention=CallingConvention.Cdecl)]
  750. public unsafe extern static Int32 ContentEncryptionParams_GetDescriptor (IntPtr Handle, out UInt64 ADescriptor);
  751. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_contentencryptionparams_getkeyuuid", CallingConvention=CallingConvention.Cdecl)]
  752. public unsafe extern static Int32 ContentEncryptionParams_GetKeyUUID (IntPtr Handle, UInt32 sizeUUID, out UInt32 neededUUID, IntPtr dataUUID);
  753. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourcedata_getpath", CallingConvention=CallingConvention.Cdecl)]
  754. public unsafe extern static Int32 ResourceData_GetPath (IntPtr Handle, out IntPtr APath);
  755. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourcedata_getencryptionalgorithm", CallingConvention=CallingConvention.Cdecl)]
  756. public unsafe extern static Int32 ResourceData_GetEncryptionAlgorithm (IntPtr Handle, out Int32 AEncryptionAlgorithm);
  757. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourcedata_getcompression", CallingConvention=CallingConvention.Cdecl)]
  758. public unsafe extern static Int32 ResourceData_GetCompression (IntPtr Handle, out Int32 ACompression);
  759. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourcedata_getadditionalauthenticationdata", CallingConvention=CallingConvention.Cdecl)]
  760. public unsafe extern static Int32 ResourceData_GetAdditionalAuthenticationData (IntPtr Handle, UInt64 sizeByteData, out UInt64 neededByteData, IntPtr dataByteData);
  761. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourcedatagroup_getkeyuuid", CallingConvention=CallingConvention.Cdecl)]
  762. public unsafe extern static Int32 ResourceDataGroup_GetKeyUUID (IntPtr Handle, UInt32 sizeUUID, out UInt32 neededUUID, IntPtr dataUUID);
  763. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourcedatagroup_addaccessright", CallingConvention=CallingConvention.Cdecl)]
  764. public unsafe extern static Int32 ResourceDataGroup_AddAccessRight (IntPtr Handle, IntPtr AConsumer, Int32 AWrappingAlgorithm, Int32 AMgfAlgorithm, Int32 ADigestMethod, out IntPtr ATheAccessRight);
  765. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourcedatagroup_findaccessrightbyconsumer", CallingConvention=CallingConvention.Cdecl)]
  766. public unsafe extern static Int32 ResourceDataGroup_FindAccessRightByConsumer (IntPtr Handle, IntPtr AConsumer, out IntPtr ATheAccessRight);
  767. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_resourcedatagroup_removeaccessright", CallingConvention=CallingConvention.Cdecl)]
  768. public unsafe extern static Int32 ResourceDataGroup_RemoveAccessRight (IntPtr Handle, IntPtr AConsumer);
  769. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_addconsumer", CallingConvention=CallingConvention.Cdecl)]
  770. public unsafe extern static Int32 KeyStore_AddConsumer (IntPtr Handle, byte[] AConsumerID, byte[] AKeyID, byte[] AKeyValue, out IntPtr AConsumer);
  771. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_getconsumercount", CallingConvention=CallingConvention.Cdecl)]
  772. public unsafe extern static Int32 KeyStore_GetConsumerCount (IntPtr Handle, out UInt64 ACount);
  773. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_getconsumer", CallingConvention=CallingConvention.Cdecl)]
  774. public unsafe extern static Int32 KeyStore_GetConsumer (IntPtr Handle, UInt64 AConsumerIndex, out IntPtr AConsumer);
  775. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_removeconsumer", CallingConvention=CallingConvention.Cdecl)]
  776. public unsafe extern static Int32 KeyStore_RemoveConsumer (IntPtr Handle, IntPtr AConsumer);
  777. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_findconsumer", CallingConvention=CallingConvention.Cdecl)]
  778. public unsafe extern static Int32 KeyStore_FindConsumer (IntPtr Handle, byte[] AConsumerID, out IntPtr AConsumer);
  779. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_getresourcedatagroupcount", CallingConvention=CallingConvention.Cdecl)]
  780. public unsafe extern static Int32 KeyStore_GetResourceDataGroupCount (IntPtr Handle, out UInt64 ACount);
  781. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_addresourcedatagroup", CallingConvention=CallingConvention.Cdecl)]
  782. public unsafe extern static Int32 KeyStore_AddResourceDataGroup (IntPtr Handle, out IntPtr AResourceDataGroup);
  783. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_getresourcedatagroup", CallingConvention=CallingConvention.Cdecl)]
  784. public unsafe extern static Int32 KeyStore_GetResourceDataGroup (IntPtr Handle, UInt64 AResourceDataIndex, out IntPtr AResourceDataGroup);
  785. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_removeresourcedatagroup", CallingConvention=CallingConvention.Cdecl)]
  786. public unsafe extern static Int32 KeyStore_RemoveResourceDataGroup (IntPtr Handle, IntPtr AResourceDataGroup);
  787. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_findresourcedatagroup", CallingConvention=CallingConvention.Cdecl)]
  788. public unsafe extern static Int32 KeyStore_FindResourceDataGroup (IntPtr Handle, IntPtr APartPath, out IntPtr AResourceDataGroup);
  789. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_addresourcedata", CallingConvention=CallingConvention.Cdecl)]
  790. public unsafe extern static Int32 KeyStore_AddResourceData (IntPtr Handle, IntPtr AResourceDataGroup, IntPtr APartPath, Int32 AAlgorithm, Int32 ACompression, UInt64 sizeAdditionalAuthenticationData, IntPtr dataAdditionalAuthenticationData, out IntPtr AResourceData);
  791. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_removeresourcedata", CallingConvention=CallingConvention.Cdecl)]
  792. public unsafe extern static Int32 KeyStore_RemoveResourceData (IntPtr Handle, IntPtr AResourceData);
  793. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_findresourcedata", CallingConvention=CallingConvention.Cdecl)]
  794. public unsafe extern static Int32 KeyStore_FindResourceData (IntPtr Handle, IntPtr AResourcePath, out IntPtr AResourceData);
  795. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_getresourcedatacount", CallingConvention=CallingConvention.Cdecl)]
  796. public unsafe extern static Int32 KeyStore_GetResourceDataCount (IntPtr Handle, out UInt64 ACount);
  797. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_getresourcedata", CallingConvention=CallingConvention.Cdecl)]
  798. public unsafe extern static Int32 KeyStore_GetResourceData (IntPtr Handle, UInt64 AResourceDataIndex, out IntPtr AResourceData);
  799. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_getuuid", CallingConvention=CallingConvention.Cdecl)]
  800. public unsafe extern static Int32 KeyStore_GetUUID (IntPtr Handle, out Byte AHasUUID, UInt32 sizeUUID, out UInt32 neededUUID, IntPtr dataUUID);
  801. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_keystore_setuuid", CallingConvention=CallingConvention.Cdecl)]
  802. public unsafe extern static Int32 KeyStore_SetUUID (IntPtr Handle, byte[] AUUID);
  803. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_rootmodelpart", CallingConvention=CallingConvention.Cdecl)]
  804. public unsafe extern static Int32 Model_RootModelPart (IntPtr Handle, out IntPtr ARootModelPart);
  805. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_findorcreatepackagepart", CallingConvention=CallingConvention.Cdecl)]
  806. public unsafe extern static Int32 Model_FindOrCreatePackagePart (IntPtr Handle, byte[] AAbsolutePath, out IntPtr AModelPart);
  807. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_setunit", CallingConvention=CallingConvention.Cdecl)]
  808. public unsafe extern static Int32 Model_SetUnit (IntPtr Handle, Int32 AUnit);
  809. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getunit", CallingConvention=CallingConvention.Cdecl)]
  810. public unsafe extern static Int32 Model_GetUnit (IntPtr Handle, out Int32 AUnit);
  811. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getlanguage", CallingConvention=CallingConvention.Cdecl)]
  812. public unsafe extern static Int32 Model_GetLanguage (IntPtr Handle, UInt32 sizeLanguage, out UInt32 neededLanguage, IntPtr dataLanguage);
  813. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_setlanguage", CallingConvention=CallingConvention.Cdecl)]
  814. public unsafe extern static Int32 Model_SetLanguage (IntPtr Handle, byte[] ALanguage);
  815. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_querywriter", CallingConvention=CallingConvention.Cdecl)]
  816. public unsafe extern static Int32 Model_QueryWriter (IntPtr Handle, byte[] AWriterClass, out IntPtr AWriterInstance);
  817. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_queryreader", CallingConvention=CallingConvention.Cdecl)]
  818. public unsafe extern static Int32 Model_QueryReader (IntPtr Handle, byte[] AReaderClass, out IntPtr AReaderInstance);
  819. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_gettexture2dbyid", CallingConvention=CallingConvention.Cdecl)]
  820. public unsafe extern static Int32 Model_GetTexture2DByID (IntPtr Handle, UInt32 AUniqueResourceID, out IntPtr ATextureInstance);
  821. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getpropertytypebyid", CallingConvention=CallingConvention.Cdecl)]
  822. public unsafe extern static Int32 Model_GetPropertyTypeByID (IntPtr Handle, UInt32 AUniqueResourceID, out Int32 AThePropertyType);
  823. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getbasematerialgroupbyid", CallingConvention=CallingConvention.Cdecl)]
  824. public unsafe extern static Int32 Model_GetBaseMaterialGroupByID (IntPtr Handle, UInt32 AUniqueResourceID, out IntPtr ABaseMaterialGroupInstance);
  825. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_gettexture2dgroupbyid", CallingConvention=CallingConvention.Cdecl)]
  826. public unsafe extern static Int32 Model_GetTexture2DGroupByID (IntPtr Handle, UInt32 AUniqueResourceID, out IntPtr ATexture2DGroupInstance);
  827. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getcompositematerialsbyid", CallingConvention=CallingConvention.Cdecl)]
  828. public unsafe extern static Int32 Model_GetCompositeMaterialsByID (IntPtr Handle, UInt32 AUniqueResourceID, out IntPtr ACompositeMaterialsInstance);
  829. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getmultipropertygroupbyid", CallingConvention=CallingConvention.Cdecl)]
  830. public unsafe extern static Int32 Model_GetMultiPropertyGroupByID (IntPtr Handle, UInt32 AUniqueResourceID, out IntPtr AMultiPropertyGroupInstance);
  831. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getmeshobjectbyid", CallingConvention=CallingConvention.Cdecl)]
  832. public unsafe extern static Int32 Model_GetMeshObjectByID (IntPtr Handle, UInt32 AUniqueResourceID, out IntPtr AMeshObjectInstance);
  833. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getcomponentsobjectbyid", CallingConvention=CallingConvention.Cdecl)]
  834. public unsafe extern static Int32 Model_GetComponentsObjectByID (IntPtr Handle, UInt32 AUniqueResourceID, out IntPtr AComponentsObjectInstance);
  835. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getcolorgroupbyid", CallingConvention=CallingConvention.Cdecl)]
  836. public unsafe extern static Int32 Model_GetColorGroupByID (IntPtr Handle, UInt32 AUniqueResourceID, out IntPtr AColorGroupInstance);
  837. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getslicestackbyid", CallingConvention=CallingConvention.Cdecl)]
  838. public unsafe extern static Int32 Model_GetSliceStackByID (IntPtr Handle, UInt32 AUniqueResourceID, out IntPtr ASliceStacInstance);
  839. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getbuilduuid", CallingConvention=CallingConvention.Cdecl)]
  840. public unsafe extern static Int32 Model_GetBuildUUID (IntPtr Handle, out Byte AHasUUID, UInt32 sizeUUID, out UInt32 neededUUID, IntPtr dataUUID);
  841. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_setbuilduuid", CallingConvention=CallingConvention.Cdecl)]
  842. public unsafe extern static Int32 Model_SetBuildUUID (IntPtr Handle, byte[] AUUID);
  843. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getbuilditems", CallingConvention=CallingConvention.Cdecl)]
  844. public unsafe extern static Int32 Model_GetBuildItems (IntPtr Handle, out IntPtr ABuildItemIterator);
  845. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getoutbox", CallingConvention=CallingConvention.Cdecl)]
  846. public unsafe extern static Int32 Model_GetOutbox (IntPtr Handle, out InternalBox AOutbox);
  847. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getresources", CallingConvention=CallingConvention.Cdecl)]
  848. public unsafe extern static Int32 Model_GetResources (IntPtr Handle, out IntPtr AResourceIterator);
  849. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getobjects", CallingConvention=CallingConvention.Cdecl)]
  850. public unsafe extern static Int32 Model_GetObjects (IntPtr Handle, out IntPtr AResourceIterator);
  851. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getmeshobjects", CallingConvention=CallingConvention.Cdecl)]
  852. public unsafe extern static Int32 Model_GetMeshObjects (IntPtr Handle, out IntPtr AResourceIterator);
  853. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getcomponentsobjects", CallingConvention=CallingConvention.Cdecl)]
  854. public unsafe extern static Int32 Model_GetComponentsObjects (IntPtr Handle, out IntPtr AResourceIterator);
  855. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_gettexture2ds", CallingConvention=CallingConvention.Cdecl)]
  856. public unsafe extern static Int32 Model_GetTexture2Ds (IntPtr Handle, out IntPtr AResourceIterator);
  857. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getbasematerialgroups", CallingConvention=CallingConvention.Cdecl)]
  858. public unsafe extern static Int32 Model_GetBaseMaterialGroups (IntPtr Handle, out IntPtr AResourceIterator);
  859. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getcolorgroups", CallingConvention=CallingConvention.Cdecl)]
  860. public unsafe extern static Int32 Model_GetColorGroups (IntPtr Handle, out IntPtr AResourceIterator);
  861. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_gettexture2dgroups", CallingConvention=CallingConvention.Cdecl)]
  862. public unsafe extern static Int32 Model_GetTexture2DGroups (IntPtr Handle, out IntPtr AResourceIterator);
  863. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getcompositematerials", CallingConvention=CallingConvention.Cdecl)]
  864. public unsafe extern static Int32 Model_GetCompositeMaterials (IntPtr Handle, out IntPtr AResourceIterator);
  865. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getmultipropertygroups", CallingConvention=CallingConvention.Cdecl)]
  866. public unsafe extern static Int32 Model_GetMultiPropertyGroups (IntPtr Handle, out IntPtr AResourceIterator);
  867. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getslicestacks", CallingConvention=CallingConvention.Cdecl)]
  868. public unsafe extern static Int32 Model_GetSliceStacks (IntPtr Handle, out IntPtr AResourceIterator);
  869. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_mergetomodel", CallingConvention=CallingConvention.Cdecl)]
  870. public unsafe extern static Int32 Model_MergeToModel (IntPtr Handle, out IntPtr AMergedModelInstance);
  871. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addmeshobject", CallingConvention=CallingConvention.Cdecl)]
  872. public unsafe extern static Int32 Model_AddMeshObject (IntPtr Handle, out IntPtr AMeshObjectInstance);
  873. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addcomponentsobject", CallingConvention=CallingConvention.Cdecl)]
  874. public unsafe extern static Int32 Model_AddComponentsObject (IntPtr Handle, out IntPtr AComponentsObjectInstance);
  875. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addslicestack", CallingConvention=CallingConvention.Cdecl)]
  876. public unsafe extern static Int32 Model_AddSliceStack (IntPtr Handle, Double AZBottom, out IntPtr ASliceStackInstance);
  877. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addtexture2dfromattachment", CallingConvention=CallingConvention.Cdecl)]
  878. public unsafe extern static Int32 Model_AddTexture2DFromAttachment (IntPtr Handle, IntPtr ATextureAttachment, out IntPtr ATexture2DInstance);
  879. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addbasematerialgroup", CallingConvention=CallingConvention.Cdecl)]
  880. public unsafe extern static Int32 Model_AddBaseMaterialGroup (IntPtr Handle, out IntPtr ABaseMaterialGroupInstance);
  881. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addcolorgroup", CallingConvention=CallingConvention.Cdecl)]
  882. public unsafe extern static Int32 Model_AddColorGroup (IntPtr Handle, out IntPtr AColorGroupInstance);
  883. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addtexture2dgroup", CallingConvention=CallingConvention.Cdecl)]
  884. public unsafe extern static Int32 Model_AddTexture2DGroup (IntPtr Handle, IntPtr ATexture2DInstance, out IntPtr ATexture2DGroupInstance);
  885. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addcompositematerials", CallingConvention=CallingConvention.Cdecl)]
  886. public unsafe extern static Int32 Model_AddCompositeMaterials (IntPtr Handle, IntPtr ABaseMaterialGroupInstance, out IntPtr ACompositeMaterialsInstance);
  887. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addmultipropertygroup", CallingConvention=CallingConvention.Cdecl)]
  888. public unsafe extern static Int32 Model_AddMultiPropertyGroup (IntPtr Handle, out IntPtr AMultiPropertyGroupInstance);
  889. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addbuilditem", CallingConvention=CallingConvention.Cdecl)]
  890. public unsafe extern static Int32 Model_AddBuildItem (IntPtr Handle, IntPtr AObject, InternalTransform ATransform, out IntPtr ABuildItemInstance);
  891. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_removebuilditem", CallingConvention=CallingConvention.Cdecl)]
  892. public unsafe extern static Int32 Model_RemoveBuildItem (IntPtr Handle, IntPtr ABuildItemInstance);
  893. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getmetadatagroup", CallingConvention=CallingConvention.Cdecl)]
  894. public unsafe extern static Int32 Model_GetMetaDataGroup (IntPtr Handle, out IntPtr ATheMetaDataGroup);
  895. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addattachment", CallingConvention=CallingConvention.Cdecl)]
  896. public unsafe extern static Int32 Model_AddAttachment (IntPtr Handle, byte[] AURI, byte[] ARelationShipType, out IntPtr AAttachmentInstance);
  897. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_removeattachment", CallingConvention=CallingConvention.Cdecl)]
  898. public unsafe extern static Int32 Model_RemoveAttachment (IntPtr Handle, IntPtr AAttachmentInstance);
  899. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getattachment", CallingConvention=CallingConvention.Cdecl)]
  900. public unsafe extern static Int32 Model_GetAttachment (IntPtr Handle, UInt32 AIndex, out IntPtr AAttachmentInstance);
  901. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_findattachment", CallingConvention=CallingConvention.Cdecl)]
  902. public unsafe extern static Int32 Model_FindAttachment (IntPtr Handle, byte[] AURI, out IntPtr AAttachmentInstance);
  903. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getattachmentcount", CallingConvention=CallingConvention.Cdecl)]
  904. public unsafe extern static Int32 Model_GetAttachmentCount (IntPtr Handle, out UInt32 AAttachmentCount);
  905. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_haspackagethumbnailattachment", CallingConvention=CallingConvention.Cdecl)]
  906. public unsafe extern static Int32 Model_HasPackageThumbnailAttachment (IntPtr Handle, out Byte AHasThumbnail);
  907. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_createpackagethumbnailattachment", CallingConvention=CallingConvention.Cdecl)]
  908. public unsafe extern static Int32 Model_CreatePackageThumbnailAttachment (IntPtr Handle, out IntPtr AAttachment);
  909. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getpackagethumbnailattachment", CallingConvention=CallingConvention.Cdecl)]
  910. public unsafe extern static Int32 Model_GetPackageThumbnailAttachment (IntPtr Handle, out IntPtr AAttachment);
  911. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_removepackagethumbnailattachment", CallingConvention=CallingConvention.Cdecl)]
  912. public unsafe extern static Int32 Model_RemovePackageThumbnailAttachment (IntPtr Handle);
  913. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_addcustomcontenttype", CallingConvention=CallingConvention.Cdecl)]
  914. public unsafe extern static Int32 Model_AddCustomContentType (IntPtr Handle, byte[] AExtension, byte[] AContentType);
  915. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_removecustomcontenttype", CallingConvention=CallingConvention.Cdecl)]
  916. public unsafe extern static Int32 Model_RemoveCustomContentType (IntPtr Handle, byte[] AExtension);
  917. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_setrandomnumbercallback", CallingConvention=CallingConvention.Cdecl)]
  918. public unsafe extern static Int32 Model_SetRandomNumberCallback (IntPtr Handle, IntPtr ATheCallback, UInt64 AUserData);
  919. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_model_getkeystore", CallingConvention=CallingConvention.Cdecl)]
  920. public unsafe extern static Int32 Model_GetKeyStore (IntPtr Handle, out IntPtr AKeyStore);
  921. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_getlibraryversion", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  922. public extern static Int32 GetLibraryVersion (out UInt32 AMajor, out UInt32 AMinor, out UInt32 AMicro);
  923. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_getprereleaseinformation", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  924. public extern static Int32 GetPrereleaseInformation (out Byte AHasPrereleaseInfo, UInt32 sizePrereleaseInfo, out UInt32 neededPrereleaseInfo, IntPtr dataPrereleaseInfo);
  925. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_getbuildinformation", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  926. public extern static Int32 GetBuildInformation (out Byte AHasBuildInfo, UInt32 sizeBuildInformation, out UInt32 neededBuildInformation, IntPtr dataBuildInformation);
  927. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_getspecificationversion", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  928. public extern static Int32 GetSpecificationVersion (byte[] ASpecificationURL, out Byte AIsSupported, out UInt32 AMajor, out UInt32 AMinor, out UInt32 AMicro);
  929. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_createmodel", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  930. public extern static Int32 CreateModel (out IntPtr AModel);
  931. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_release", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  932. public extern static Int32 Release (IntPtr AInstance);
  933. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_acquire", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  934. public extern static Int32 Acquire (IntPtr AInstance);
  935. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_setjournal", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  936. public extern static Int32 SetJournal (byte[] AJournalPath);
  937. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_getlasterror", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  938. public extern static Int32 GetLastError (IntPtr AInstance, UInt32 sizeLastErrorString, out UInt32 neededLastErrorString, IntPtr dataLastErrorString, out Byte AHasLastError);
  939. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_retrieveprogressmessage", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  940. public extern static Int32 RetrieveProgressMessage (Int32 ATheProgressIdentifier, UInt32 sizeProgressMessage, out UInt32 neededProgressMessage, IntPtr dataProgressMessage);
  941. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_rgbatocolor", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  942. public extern static Int32 RGBAToColor (Byte ARed, Byte AGreen, Byte ABlue, Byte AAlpha, out InternalColor ATheColor);
  943. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_floatrgbatocolor", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  944. public extern static Int32 FloatRGBAToColor (Single ARed, Single AGreen, Single ABlue, Single AAlpha, out InternalColor ATheColor);
  945. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_colortorgba", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  946. public extern static Int32 ColorToRGBA (InternalColor ATheColor, out Byte ARed, out Byte AGreen, out Byte ABlue, out Byte AAlpha);
  947. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_colortofloatrgba", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  948. public extern static Int32 ColorToFloatRGBA (InternalColor ATheColor, out Single ARed, out Single AGreen, out Single ABlue, out Single AAlpha);
  949. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_getidentitytransform", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  950. public extern static Int32 GetIdentityTransform (out InternalTransform ATransform);
  951. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_getuniformscaletransform", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  952. public extern static Int32 GetUniformScaleTransform (Single AFactor, out InternalTransform ATransform);
  953. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_getscaletransform", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  954. public extern static Int32 GetScaleTransform (Single AFactorX, Single AFactorY, Single AFactorZ, out InternalTransform ATransform);
  955. [DllImport("lib3mf.dll", EntryPoint = "lib3mf_gettranslationtransform", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.Cdecl)]
  956. public extern static Int32 GetTranslationTransform (Single AVectorX, Single AVectorY, Single AVectorZ, out InternalTransform ATransform);
  957. public unsafe static sTriangle convertInternalToStruct_Triangle (InternalTriangle intTriangle)
  958. {
  959. sTriangle Triangle;
  960. Triangle.Indices = new UInt32[3];
  961. for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
  962. Triangle.Indices[rowIndex] = intTriangle.Indices[rowIndex];
  963. }
  964. return Triangle;
  965. }
  966. public unsafe static InternalTriangle convertStructToInternal_Triangle (sTriangle Triangle)
  967. {
  968. InternalTriangle intTriangle;
  969. for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
  970. intTriangle.Indices[rowIndex] = Triangle.Indices[rowIndex];
  971. }
  972. return intTriangle;
  973. }
  974. public unsafe static sTriangleProperties convertInternalToStruct_TriangleProperties (InternalTriangleProperties intTriangleProperties)
  975. {
  976. sTriangleProperties TriangleProperties;
  977. TriangleProperties.ResourceID = intTriangleProperties.ResourceID;
  978. TriangleProperties.PropertyIDs = new UInt32[3];
  979. for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
  980. TriangleProperties.PropertyIDs[rowIndex] = intTriangleProperties.PropertyIDs[rowIndex];
  981. }
  982. return TriangleProperties;
  983. }
  984. public unsafe static InternalTriangleProperties convertStructToInternal_TriangleProperties (sTriangleProperties TriangleProperties)
  985. {
  986. InternalTriangleProperties intTriangleProperties;
  987. intTriangleProperties.ResourceID = TriangleProperties.ResourceID;
  988. for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
  989. intTriangleProperties.PropertyIDs[rowIndex] = TriangleProperties.PropertyIDs[rowIndex];
  990. }
  991. return intTriangleProperties;
  992. }
  993. public unsafe static sPosition convertInternalToStruct_Position (InternalPosition intPosition)
  994. {
  995. sPosition Position;
  996. Position.Coordinates = new Single[3];
  997. for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
  998. Position.Coordinates[rowIndex] = intPosition.Coordinates[rowIndex];
  999. }
  1000. return Position;
  1001. }
  1002. public unsafe static InternalPosition convertStructToInternal_Position (sPosition Position)
  1003. {
  1004. InternalPosition intPosition;
  1005. for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
  1006. intPosition.Coordinates[rowIndex] = Position.Coordinates[rowIndex];
  1007. }
  1008. return intPosition;
  1009. }
  1010. public unsafe static sPosition2D convertInternalToStruct_Position2D (InternalPosition2D intPosition2D)
  1011. {
  1012. sPosition2D Position2D;
  1013. Position2D.Coordinates = new Single[2];
  1014. for (int rowIndex = 0; rowIndex < 2; rowIndex++) {
  1015. Position2D.Coordinates[rowIndex] = intPosition2D.Coordinates[rowIndex];
  1016. }
  1017. return Position2D;
  1018. }
  1019. public unsafe static InternalPosition2D convertStructToInternal_Position2D (sPosition2D Position2D)
  1020. {
  1021. InternalPosition2D intPosition2D;
  1022. for (int rowIndex = 0; rowIndex < 2; rowIndex++) {
  1023. intPosition2D.Coordinates[rowIndex] = Position2D.Coordinates[rowIndex];
  1024. }
  1025. return intPosition2D;
  1026. }
  1027. public unsafe static sCompositeConstituent convertInternalToStruct_CompositeConstituent (InternalCompositeConstituent intCompositeConstituent)
  1028. {
  1029. sCompositeConstituent CompositeConstituent;
  1030. CompositeConstituent.PropertyID = intCompositeConstituent.PropertyID;
  1031. CompositeConstituent.MixingRatio = intCompositeConstituent.MixingRatio;
  1032. return CompositeConstituent;
  1033. }
  1034. public unsafe static InternalCompositeConstituent convertStructToInternal_CompositeConstituent (sCompositeConstituent CompositeConstituent)
  1035. {
  1036. InternalCompositeConstituent intCompositeConstituent;
  1037. intCompositeConstituent.PropertyID = CompositeConstituent.PropertyID;
  1038. intCompositeConstituent.MixingRatio = CompositeConstituent.MixingRatio;
  1039. return intCompositeConstituent;
  1040. }
  1041. public unsafe static sMultiPropertyLayer convertInternalToStruct_MultiPropertyLayer (InternalMultiPropertyLayer intMultiPropertyLayer)
  1042. {
  1043. sMultiPropertyLayer MultiPropertyLayer;
  1044. MultiPropertyLayer.ResourceID = intMultiPropertyLayer.ResourceID;
  1045. MultiPropertyLayer.TheBlendMethod = (eBlendMethod) intMultiPropertyLayer.TheBlendMethod;
  1046. return MultiPropertyLayer;
  1047. }
  1048. public unsafe static InternalMultiPropertyLayer convertStructToInternal_MultiPropertyLayer (sMultiPropertyLayer MultiPropertyLayer)
  1049. {
  1050. InternalMultiPropertyLayer intMultiPropertyLayer;
  1051. intMultiPropertyLayer.ResourceID = MultiPropertyLayer.ResourceID;
  1052. intMultiPropertyLayer.TheBlendMethod = (Int32) MultiPropertyLayer.TheBlendMethod;
  1053. return intMultiPropertyLayer;
  1054. }
  1055. public unsafe static sTex2Coord convertInternalToStruct_Tex2Coord (InternalTex2Coord intTex2Coord)
  1056. {
  1057. sTex2Coord Tex2Coord;
  1058. Tex2Coord.U = intTex2Coord.U;
  1059. Tex2Coord.V = intTex2Coord.V;
  1060. return Tex2Coord;
  1061. }
  1062. public unsafe static InternalTex2Coord convertStructToInternal_Tex2Coord (sTex2Coord Tex2Coord)
  1063. {
  1064. InternalTex2Coord intTex2Coord;
  1065. intTex2Coord.U = Tex2Coord.U;
  1066. intTex2Coord.V = Tex2Coord.V;
  1067. return intTex2Coord;
  1068. }
  1069. public unsafe static sTransform convertInternalToStruct_Transform (InternalTransform intTransform)
  1070. {
  1071. sTransform Transform;
  1072. Transform.Fields = new Single[4][];
  1073. for (int colIndex = 0; colIndex < 4; colIndex++) {
  1074. Transform.Fields[colIndex] = new Single[3];
  1075. for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
  1076. Transform.Fields[colIndex][rowIndex] = intTransform.Fields[colIndex * 3 + rowIndex];
  1077. }
  1078. }
  1079. return Transform;
  1080. }
  1081. public unsafe static InternalTransform convertStructToInternal_Transform (sTransform Transform)
  1082. {
  1083. InternalTransform intTransform;
  1084. for (int colIndex = 0; colIndex < 4; colIndex++) {
  1085. for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
  1086. intTransform.Fields[colIndex * 3 + rowIndex] = Transform.Fields[colIndex][rowIndex];
  1087. }
  1088. }
  1089. return intTransform;
  1090. }
  1091. public unsafe static sBox convertInternalToStruct_Box (InternalBox intBox)
  1092. {
  1093. sBox Box;
  1094. Box.MinCoordinate = new Single[3];
  1095. for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
  1096. Box.MinCoordinate[rowIndex] = intBox.MinCoordinate[rowIndex];
  1097. }
  1098. Box.MaxCoordinate = new Single[3];
  1099. for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
  1100. Box.MaxCoordinate[rowIndex] = intBox.MaxCoordinate[rowIndex];
  1101. }
  1102. return Box;
  1103. }
  1104. public unsafe static InternalBox convertStructToInternal_Box (sBox Box)
  1105. {
  1106. InternalBox intBox;
  1107. for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
  1108. intBox.MinCoordinate[rowIndex] = Box.MinCoordinate[rowIndex];
  1109. }
  1110. for (int rowIndex = 0; rowIndex < 3; rowIndex++) {
  1111. intBox.MaxCoordinate[rowIndex] = Box.MaxCoordinate[rowIndex];
  1112. }
  1113. return intBox;
  1114. }
  1115. public unsafe static sColor convertInternalToStruct_Color (InternalColor intColor)
  1116. {
  1117. sColor Color;
  1118. Color.Red = intColor.Red;
  1119. Color.Green = intColor.Green;
  1120. Color.Blue = intColor.Blue;
  1121. Color.Alpha = intColor.Alpha;
  1122. return Color;
  1123. }
  1124. public unsafe static InternalColor convertStructToInternal_Color (sColor Color)
  1125. {
  1126. InternalColor intColor;
  1127. intColor.Red = Color.Red;
  1128. intColor.Green = Color.Green;
  1129. intColor.Blue = Color.Blue;
  1130. intColor.Alpha = Color.Alpha;
  1131. return intColor;
  1132. }
  1133. public unsafe static sBeam convertInternalToStruct_Beam (InternalBeam intBeam)
  1134. {
  1135. sBeam Beam;
  1136. Beam.Indices = new UInt32[2];
  1137. for (int rowIndex = 0; rowIndex < 2; rowIndex++) {
  1138. Beam.Indices[rowIndex] = intBeam.Indices[rowIndex];
  1139. }
  1140. Beam.Radii = new Double[2];
  1141. for (int rowIndex = 0; rowIndex < 2; rowIndex++) {
  1142. Beam.Radii[rowIndex] = intBeam.Radii[rowIndex];
  1143. }
  1144. Beam.CapModes = new eBeamLatticeCapMode[2];
  1145. for (int rowIndex = 0; rowIndex < 2; rowIndex++) {
  1146. Beam.CapModes[rowIndex] = (eBeamLatticeCapMode) intBeam.CapModes[rowIndex];
  1147. }
  1148. return Beam;
  1149. }
  1150. public unsafe static InternalBeam convertStructToInternal_Beam (sBeam Beam)
  1151. {
  1152. InternalBeam intBeam;
  1153. for (int rowIndex = 0; rowIndex < 2; rowIndex++) {
  1154. intBeam.Indices[rowIndex] = Beam.Indices[rowIndex];
  1155. }
  1156. for (int rowIndex = 0; rowIndex < 2; rowIndex++) {
  1157. intBeam.Radii[rowIndex] = Beam.Radii[rowIndex];
  1158. }
  1159. for (int rowIndex = 0; rowIndex < 2; rowIndex++) {
  1160. intBeam.CapModes[rowIndex] = (Int32) Beam.CapModes[rowIndex];
  1161. }
  1162. return intBeam;
  1163. }
  1164. public unsafe static sBall convertInternalToStruct_Ball (InternalBall intBall)
  1165. {
  1166. sBall Ball;
  1167. Ball.Index = intBall.Index;
  1168. Ball.Radius = intBall.Radius;
  1169. return Ball;
  1170. }
  1171. public unsafe static InternalBall convertStructToInternal_Ball (sBall Ball)
  1172. {
  1173. InternalBall intBall;
  1174. intBall.Index = Ball.Index;
  1175. intBall.Radius = Ball.Radius;
  1176. return intBall;
  1177. }
  1178. public static void ThrowError(IntPtr Handle, Int32 errorCode)
  1179. {
  1180. String sMessage = "Lib3MF Error";
  1181. if (Handle != IntPtr.Zero) {
  1182. UInt32 sizeMessage = 0;
  1183. UInt32 neededMessage = 0;
  1184. Byte hasLastError = 0;
  1185. Int32 resultCode1 = GetLastError (Handle, sizeMessage, out neededMessage, IntPtr.Zero, out hasLastError);
  1186. if ((resultCode1 == 0) && (hasLastError != 0)) {
  1187. sizeMessage = neededMessage;
  1188. byte[] bytesMessage = new byte[sizeMessage];
  1189. GCHandle dataMessage = GCHandle.Alloc(bytesMessage, GCHandleType.Pinned);
  1190. Int32 resultCode2 = GetLastError(Handle, sizeMessage, out neededMessage, dataMessage.AddrOfPinnedObject(), out hasLastError);
  1191. dataMessage.Free();
  1192. if ((resultCode2 == 0) && (hasLastError != 0)) {
  1193. sMessage = sMessage + ": " + Encoding.UTF8.GetString(bytesMessage).TrimEnd(char.MinValue);
  1194. }
  1195. }
  1196. }
  1197. throw new Exception(sMessage + "(# " + errorCode + ")");
  1198. }
  1199. }
  1200. }
  1201. public class CBase
  1202. {
  1203. protected IntPtr Handle;
  1204. public CBase (IntPtr NewHandle)
  1205. {
  1206. Handle = NewHandle;
  1207. }
  1208. ~CBase ()
  1209. {
  1210. if (Handle != IntPtr.Zero) {
  1211. Internal.Lib3MFWrapper.Release (Handle);
  1212. Handle = IntPtr.Zero;
  1213. }
  1214. }
  1215. protected void CheckError (Int32 errorCode)
  1216. {
  1217. if (errorCode != 0) {
  1218. Internal.Lib3MFWrapper.ThrowError (Handle, errorCode);
  1219. }
  1220. }
  1221. public IntPtr GetHandle ()
  1222. {
  1223. return Handle;
  1224. }
  1225. }
  1226. public class CWriter : CBase
  1227. {
  1228. public CWriter (IntPtr NewHandle) : base (NewHandle)
  1229. {
  1230. }
  1231. public void WriteToFile (String AFilename)
  1232. {
  1233. byte[] byteFilename = Encoding.UTF8.GetBytes(AFilename + char.MinValue);
  1234. CheckError(Internal.Lib3MFWrapper.Writer_WriteToFile (Handle, byteFilename));
  1235. }
  1236. public UInt64 GetStreamSize ()
  1237. {
  1238. UInt64 resultStreamSize = 0;
  1239. CheckError(Internal.Lib3MFWrapper.Writer_GetStreamSize (Handle, out resultStreamSize));
  1240. return resultStreamSize;
  1241. }
  1242. public void WriteToBuffer (out Byte[] ABuffer)
  1243. {
  1244. UInt64 sizeBuffer = 0;
  1245. UInt64 neededBuffer = 0;
  1246. CheckError(Internal.Lib3MFWrapper.Writer_WriteToBuffer (Handle, sizeBuffer, out neededBuffer, IntPtr.Zero));
  1247. sizeBuffer = neededBuffer;
  1248. ABuffer = new Byte[sizeBuffer];
  1249. GCHandle dataBuffer = GCHandle.Alloc(ABuffer, GCHandleType.Pinned);
  1250. CheckError(Internal.Lib3MFWrapper.Writer_WriteToBuffer (Handle, sizeBuffer, out neededBuffer, dataBuffer.AddrOfPinnedObject()));
  1251. dataBuffer.Free();
  1252. }
  1253. public void WriteToCallback (IntPtr ATheWriteCallback, IntPtr ATheSeekCallback, UInt64 AUserData)
  1254. {
  1255. CheckError(Internal.Lib3MFWrapper.Writer_WriteToCallback (Handle, IntPtr.Zero, IntPtr.Zero, AUserData));
  1256. }
  1257. public void SetProgressCallback (IntPtr AProgressCallback, UInt64 AUserData)
  1258. {
  1259. CheckError(Internal.Lib3MFWrapper.Writer_SetProgressCallback (Handle, IntPtr.Zero, AUserData));
  1260. }
  1261. public UInt32 GetDecimalPrecision ()
  1262. {
  1263. UInt32 resultDecimalPrecision = 0;
  1264. CheckError(Internal.Lib3MFWrapper.Writer_GetDecimalPrecision (Handle, out resultDecimalPrecision));
  1265. return resultDecimalPrecision;
  1266. }
  1267. public void SetDecimalPrecision (UInt32 ADecimalPrecision)
  1268. {
  1269. CheckError(Internal.Lib3MFWrapper.Writer_SetDecimalPrecision (Handle, ADecimalPrecision));
  1270. }
  1271. public void SetStrictModeActive (bool AStrictModeActive)
  1272. {
  1273. CheckError(Internal.Lib3MFWrapper.Writer_SetStrictModeActive (Handle, (Byte)( AStrictModeActive ? 1 : 0 )));
  1274. }
  1275. public bool GetStrictModeActive ()
  1276. {
  1277. Byte resultStrictModeActive = 0;
  1278. CheckError(Internal.Lib3MFWrapper.Writer_GetStrictModeActive (Handle, out resultStrictModeActive));
  1279. return (resultStrictModeActive != 0);
  1280. }
  1281. public String GetWarning (UInt32 AIndex, out UInt32 AErrorCode)
  1282. {
  1283. UInt32 sizeWarning = 0;
  1284. UInt32 neededWarning = 0;
  1285. CheckError(Internal.Lib3MFWrapper.Writer_GetWarning (Handle, AIndex, out AErrorCode, sizeWarning, out neededWarning, IntPtr.Zero));
  1286. sizeWarning = neededWarning;
  1287. byte[] bytesWarning = new byte[sizeWarning];
  1288. GCHandle dataWarning = GCHandle.Alloc(bytesWarning, GCHandleType.Pinned);
  1289. CheckError(Internal.Lib3MFWrapper.Writer_GetWarning (Handle, AIndex, out AErrorCode, sizeWarning, out neededWarning, dataWarning.AddrOfPinnedObject()));
  1290. dataWarning.Free();
  1291. return Encoding.UTF8.GetString(bytesWarning).TrimEnd(char.MinValue);
  1292. }
  1293. public UInt32 GetWarningCount ()
  1294. {
  1295. UInt32 resultCount = 0;
  1296. CheckError(Internal.Lib3MFWrapper.Writer_GetWarningCount (Handle, out resultCount));
  1297. return resultCount;
  1298. }
  1299. public void AddKeyWrappingCallback (String AConsumerID, IntPtr ATheCallback, UInt64 AUserData)
  1300. {
  1301. byte[] byteConsumerID = Encoding.UTF8.GetBytes(AConsumerID + char.MinValue);
  1302. CheckError(Internal.Lib3MFWrapper.Writer_AddKeyWrappingCallback (Handle, byteConsumerID, IntPtr.Zero, AUserData));
  1303. }
  1304. public void SetContentEncryptionCallback (IntPtr ATheCallback, UInt64 AUserData)
  1305. {
  1306. CheckError(Internal.Lib3MFWrapper.Writer_SetContentEncryptionCallback (Handle, IntPtr.Zero, AUserData));
  1307. }
  1308. }
  1309. public class CReader : CBase
  1310. {
  1311. public CReader (IntPtr NewHandle) : base (NewHandle)
  1312. {
  1313. }
  1314. public void ReadFromFile (String AFilename)
  1315. {
  1316. byte[] byteFilename = Encoding.UTF8.GetBytes(AFilename + char.MinValue);
  1317. CheckError(Internal.Lib3MFWrapper.Reader_ReadFromFile (Handle, byteFilename));
  1318. }
  1319. public void ReadFromBuffer (Byte[] ABuffer)
  1320. {
  1321. GCHandle dataBuffer = GCHandle.Alloc(ABuffer, GCHandleType.Pinned);
  1322. CheckError(Internal.Lib3MFWrapper.Reader_ReadFromBuffer (Handle, (UInt64) ABuffer.Length, dataBuffer.AddrOfPinnedObject()));
  1323. dataBuffer.Free ();
  1324. }
  1325. public void ReadFromCallback (IntPtr ATheReadCallback, UInt64 AStreamSize, IntPtr ATheSeekCallback, UInt64 AUserData)
  1326. {
  1327. CheckError(Internal.Lib3MFWrapper.Reader_ReadFromCallback (Handle, IntPtr.Zero, AStreamSize, IntPtr.Zero, AUserData));
  1328. }
  1329. public void SetProgressCallback (IntPtr AProgressCallback, UInt64 AUserData)
  1330. {
  1331. CheckError(Internal.Lib3MFWrapper.Reader_SetProgressCallback (Handle, IntPtr.Zero, AUserData));
  1332. }
  1333. public void AddRelationToRead (String ARelationShipType)
  1334. {
  1335. byte[] byteRelationShipType = Encoding.UTF8.GetBytes(ARelationShipType + char.MinValue);
  1336. CheckError(Internal.Lib3MFWrapper.Reader_AddRelationToRead (Handle, byteRelationShipType));
  1337. }
  1338. public void RemoveRelationToRead (String ARelationShipType)
  1339. {
  1340. byte[] byteRelationShipType = Encoding.UTF8.GetBytes(ARelationShipType + char.MinValue);
  1341. CheckError(Internal.Lib3MFWrapper.Reader_RemoveRelationToRead (Handle, byteRelationShipType));
  1342. }
  1343. public void SetStrictModeActive (bool AStrictModeActive)
  1344. {
  1345. CheckError(Internal.Lib3MFWrapper.Reader_SetStrictModeActive (Handle, (Byte)( AStrictModeActive ? 1 : 0 )));
  1346. }
  1347. public bool GetStrictModeActive ()
  1348. {
  1349. Byte resultStrictModeActive = 0;
  1350. CheckError(Internal.Lib3MFWrapper.Reader_GetStrictModeActive (Handle, out resultStrictModeActive));
  1351. return (resultStrictModeActive != 0);
  1352. }
  1353. public String GetWarning (UInt32 AIndex, out UInt32 AErrorCode)
  1354. {
  1355. UInt32 sizeWarning = 0;
  1356. UInt32 neededWarning = 0;
  1357. CheckError(Internal.Lib3MFWrapper.Reader_GetWarning (Handle, AIndex, out AErrorCode, sizeWarning, out neededWarning, IntPtr.Zero));
  1358. sizeWarning = neededWarning;
  1359. byte[] bytesWarning = new byte[sizeWarning];
  1360. GCHandle dataWarning = GCHandle.Alloc(bytesWarning, GCHandleType.Pinned);
  1361. CheckError(Internal.Lib3MFWrapper.Reader_GetWarning (Handle, AIndex, out AErrorCode, sizeWarning, out neededWarning, dataWarning.AddrOfPinnedObject()));
  1362. dataWarning.Free();
  1363. return Encoding.UTF8.GetString(bytesWarning).TrimEnd(char.MinValue);
  1364. }
  1365. public UInt32 GetWarningCount ()
  1366. {
  1367. UInt32 resultCount = 0;
  1368. CheckError(Internal.Lib3MFWrapper.Reader_GetWarningCount (Handle, out resultCount));
  1369. return resultCount;
  1370. }
  1371. public void AddKeyWrappingCallback (String AConsumerID, IntPtr ATheCallback, UInt64 AUserData)
  1372. {
  1373. byte[] byteConsumerID = Encoding.UTF8.GetBytes(AConsumerID + char.MinValue);
  1374. CheckError(Internal.Lib3MFWrapper.Reader_AddKeyWrappingCallback (Handle, byteConsumerID, IntPtr.Zero, AUserData));
  1375. }
  1376. public void SetContentEncryptionCallback (IntPtr ATheCallback, UInt64 AUserData)
  1377. {
  1378. CheckError(Internal.Lib3MFWrapper.Reader_SetContentEncryptionCallback (Handle, IntPtr.Zero, AUserData));
  1379. }
  1380. }
  1381. public class CPackagePart : CBase
  1382. {
  1383. public CPackagePart (IntPtr NewHandle) : base (NewHandle)
  1384. {
  1385. }
  1386. public String GetPath ()
  1387. {
  1388. UInt32 sizePath = 0;
  1389. UInt32 neededPath = 0;
  1390. CheckError(Internal.Lib3MFWrapper.PackagePart_GetPath (Handle, sizePath, out neededPath, IntPtr.Zero));
  1391. sizePath = neededPath;
  1392. byte[] bytesPath = new byte[sizePath];
  1393. GCHandle dataPath = GCHandle.Alloc(bytesPath, GCHandleType.Pinned);
  1394. CheckError(Internal.Lib3MFWrapper.PackagePart_GetPath (Handle, sizePath, out neededPath, dataPath.AddrOfPinnedObject()));
  1395. dataPath.Free();
  1396. return Encoding.UTF8.GetString(bytesPath).TrimEnd(char.MinValue);
  1397. }
  1398. public void SetPath (String APath)
  1399. {
  1400. byte[] bytePath = Encoding.UTF8.GetBytes(APath + char.MinValue);
  1401. CheckError(Internal.Lib3MFWrapper.PackagePart_SetPath (Handle, bytePath));
  1402. }
  1403. }
  1404. public class CResource : CBase
  1405. {
  1406. public CResource (IntPtr NewHandle) : base (NewHandle)
  1407. {
  1408. }
  1409. public UInt32 GetResourceID ()
  1410. {
  1411. UInt32 resultUniqueResourceID = 0;
  1412. CheckError(Internal.Lib3MFWrapper.Resource_GetResourceID (Handle, out resultUniqueResourceID));
  1413. return resultUniqueResourceID;
  1414. }
  1415. public UInt32 GetUniqueResourceID ()
  1416. {
  1417. UInt32 resultUniqueResourceID = 0;
  1418. CheckError(Internal.Lib3MFWrapper.Resource_GetUniqueResourceID (Handle, out resultUniqueResourceID));
  1419. return resultUniqueResourceID;
  1420. }
  1421. public CPackagePart PackagePart ()
  1422. {
  1423. IntPtr newPackagePart = IntPtr.Zero;
  1424. CheckError(Internal.Lib3MFWrapper.Resource_PackagePart (Handle, out newPackagePart));
  1425. return new CPackagePart (newPackagePart );
  1426. }
  1427. public void SetPackagePart (CPackagePart APackagePart)
  1428. {
  1429. CheckError(Internal.Lib3MFWrapper.Resource_SetPackagePart (Handle, APackagePart.GetHandle()));
  1430. }
  1431. public UInt32 GetModelResourceID ()
  1432. {
  1433. UInt32 resultModelResourceId = 0;
  1434. CheckError(Internal.Lib3MFWrapper.Resource_GetModelResourceID (Handle, out resultModelResourceId));
  1435. return resultModelResourceId;
  1436. }
  1437. }
  1438. public class CResourceIterator : CBase
  1439. {
  1440. public CResourceIterator (IntPtr NewHandle) : base (NewHandle)
  1441. {
  1442. }
  1443. public bool MoveNext ()
  1444. {
  1445. Byte resultHasNext = 0;
  1446. CheckError(Internal.Lib3MFWrapper.ResourceIterator_MoveNext (Handle, out resultHasNext));
  1447. return (resultHasNext != 0);
  1448. }
  1449. public bool MovePrevious ()
  1450. {
  1451. Byte resultHasPrevious = 0;
  1452. CheckError(Internal.Lib3MFWrapper.ResourceIterator_MovePrevious (Handle, out resultHasPrevious));
  1453. return (resultHasPrevious != 0);
  1454. }
  1455. public CResource GetCurrent ()
  1456. {
  1457. IntPtr newResource = IntPtr.Zero;
  1458. CheckError(Internal.Lib3MFWrapper.ResourceIterator_GetCurrent (Handle, out newResource));
  1459. return new CResource (newResource );
  1460. }
  1461. public CResourceIterator Clone ()
  1462. {
  1463. IntPtr newOutResourceIterator = IntPtr.Zero;
  1464. CheckError(Internal.Lib3MFWrapper.ResourceIterator_Clone (Handle, out newOutResourceIterator));
  1465. return new CResourceIterator (newOutResourceIterator );
  1466. }
  1467. public UInt64 Count ()
  1468. {
  1469. UInt64 resultCount = 0;
  1470. CheckError(Internal.Lib3MFWrapper.ResourceIterator_Count (Handle, out resultCount));
  1471. return resultCount;
  1472. }
  1473. }
  1474. public class CSliceStackIterator : CResourceIterator
  1475. {
  1476. public CSliceStackIterator (IntPtr NewHandle) : base (NewHandle)
  1477. {
  1478. }
  1479. public CSliceStack GetCurrentSliceStack ()
  1480. {
  1481. IntPtr newResource = IntPtr.Zero;
  1482. CheckError(Internal.Lib3MFWrapper.SliceStackIterator_GetCurrentSliceStack (Handle, out newResource));
  1483. return new CSliceStack (newResource );
  1484. }
  1485. }
  1486. public class CObjectIterator : CResourceIterator
  1487. {
  1488. public CObjectIterator (IntPtr NewHandle) : base (NewHandle)
  1489. {
  1490. }
  1491. public CObject GetCurrentObject ()
  1492. {
  1493. IntPtr newResource = IntPtr.Zero;
  1494. CheckError(Internal.Lib3MFWrapper.ObjectIterator_GetCurrentObject (Handle, out newResource));
  1495. return new CObject (newResource );
  1496. }
  1497. }
  1498. public class CMeshObjectIterator : CResourceIterator
  1499. {
  1500. public CMeshObjectIterator (IntPtr NewHandle) : base (NewHandle)
  1501. {
  1502. }
  1503. public CMeshObject GetCurrentMeshObject ()
  1504. {
  1505. IntPtr newResource = IntPtr.Zero;
  1506. CheckError(Internal.Lib3MFWrapper.MeshObjectIterator_GetCurrentMeshObject (Handle, out newResource));
  1507. return new CMeshObject (newResource );
  1508. }
  1509. }
  1510. public class CComponentsObjectIterator : CResourceIterator
  1511. {
  1512. public CComponentsObjectIterator (IntPtr NewHandle) : base (NewHandle)
  1513. {
  1514. }
  1515. public CComponentsObject GetCurrentComponentsObject ()
  1516. {
  1517. IntPtr newResource = IntPtr.Zero;
  1518. CheckError(Internal.Lib3MFWrapper.ComponentsObjectIterator_GetCurrentComponentsObject (Handle, out newResource));
  1519. return new CComponentsObject (newResource );
  1520. }
  1521. }
  1522. public class CTexture2DIterator : CResourceIterator
  1523. {
  1524. public CTexture2DIterator (IntPtr NewHandle) : base (NewHandle)
  1525. {
  1526. }
  1527. public CTexture2D GetCurrentTexture2D ()
  1528. {
  1529. IntPtr newResource = IntPtr.Zero;
  1530. CheckError(Internal.Lib3MFWrapper.Texture2DIterator_GetCurrentTexture2D (Handle, out newResource));
  1531. return new CTexture2D (newResource );
  1532. }
  1533. }
  1534. public class CBaseMaterialGroupIterator : CResourceIterator
  1535. {
  1536. public CBaseMaterialGroupIterator (IntPtr NewHandle) : base (NewHandle)
  1537. {
  1538. }
  1539. public CBaseMaterialGroup GetCurrentBaseMaterialGroup ()
  1540. {
  1541. IntPtr newResource = IntPtr.Zero;
  1542. CheckError(Internal.Lib3MFWrapper.BaseMaterialGroupIterator_GetCurrentBaseMaterialGroup (Handle, out newResource));
  1543. return new CBaseMaterialGroup (newResource );
  1544. }
  1545. }
  1546. public class CColorGroupIterator : CResourceIterator
  1547. {
  1548. public CColorGroupIterator (IntPtr NewHandle) : base (NewHandle)
  1549. {
  1550. }
  1551. public CColorGroup GetCurrentColorGroup ()
  1552. {
  1553. IntPtr newResource = IntPtr.Zero;
  1554. CheckError(Internal.Lib3MFWrapper.ColorGroupIterator_GetCurrentColorGroup (Handle, out newResource));
  1555. return new CColorGroup (newResource );
  1556. }
  1557. }
  1558. public class CTexture2DGroupIterator : CResourceIterator
  1559. {
  1560. public CTexture2DGroupIterator (IntPtr NewHandle) : base (NewHandle)
  1561. {
  1562. }
  1563. public CTexture2DGroup GetCurrentTexture2DGroup ()
  1564. {
  1565. IntPtr newResource = IntPtr.Zero;
  1566. CheckError(Internal.Lib3MFWrapper.Texture2DGroupIterator_GetCurrentTexture2DGroup (Handle, out newResource));
  1567. return new CTexture2DGroup (newResource );
  1568. }
  1569. }
  1570. public class CCompositeMaterialsIterator : CResourceIterator
  1571. {
  1572. public CCompositeMaterialsIterator (IntPtr NewHandle) : base (NewHandle)
  1573. {
  1574. }
  1575. public CCompositeMaterials GetCurrentCompositeMaterials ()
  1576. {
  1577. IntPtr newResource = IntPtr.Zero;
  1578. CheckError(Internal.Lib3MFWrapper.CompositeMaterialsIterator_GetCurrentCompositeMaterials (Handle, out newResource));
  1579. return new CCompositeMaterials (newResource );
  1580. }
  1581. }
  1582. public class CMultiPropertyGroupIterator : CResourceIterator
  1583. {
  1584. public CMultiPropertyGroupIterator (IntPtr NewHandle) : base (NewHandle)
  1585. {
  1586. }
  1587. public CMultiPropertyGroup GetCurrentMultiPropertyGroup ()
  1588. {
  1589. IntPtr newResource = IntPtr.Zero;
  1590. CheckError(Internal.Lib3MFWrapper.MultiPropertyGroupIterator_GetCurrentMultiPropertyGroup (Handle, out newResource));
  1591. return new CMultiPropertyGroup (newResource );
  1592. }
  1593. }
  1594. public class CMetaData : CBase
  1595. {
  1596. public CMetaData (IntPtr NewHandle) : base (NewHandle)
  1597. {
  1598. }
  1599. public String GetNameSpace ()
  1600. {
  1601. UInt32 sizeNameSpace = 0;
  1602. UInt32 neededNameSpace = 0;
  1603. CheckError(Internal.Lib3MFWrapper.MetaData_GetNameSpace (Handle, sizeNameSpace, out neededNameSpace, IntPtr.Zero));
  1604. sizeNameSpace = neededNameSpace;
  1605. byte[] bytesNameSpace = new byte[sizeNameSpace];
  1606. GCHandle dataNameSpace = GCHandle.Alloc(bytesNameSpace, GCHandleType.Pinned);
  1607. CheckError(Internal.Lib3MFWrapper.MetaData_GetNameSpace (Handle, sizeNameSpace, out neededNameSpace, dataNameSpace.AddrOfPinnedObject()));
  1608. dataNameSpace.Free();
  1609. return Encoding.UTF8.GetString(bytesNameSpace).TrimEnd(char.MinValue);
  1610. }
  1611. public void SetNameSpace (String ANameSpace)
  1612. {
  1613. byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue);
  1614. CheckError(Internal.Lib3MFWrapper.MetaData_SetNameSpace (Handle, byteNameSpace));
  1615. }
  1616. public String GetName ()
  1617. {
  1618. UInt32 sizeName = 0;
  1619. UInt32 neededName = 0;
  1620. CheckError(Internal.Lib3MFWrapper.MetaData_GetName (Handle, sizeName, out neededName, IntPtr.Zero));
  1621. sizeName = neededName;
  1622. byte[] bytesName = new byte[sizeName];
  1623. GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned);
  1624. CheckError(Internal.Lib3MFWrapper.MetaData_GetName (Handle, sizeName, out neededName, dataName.AddrOfPinnedObject()));
  1625. dataName.Free();
  1626. return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue);
  1627. }
  1628. public void SetName (String AName)
  1629. {
  1630. byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue);
  1631. CheckError(Internal.Lib3MFWrapper.MetaData_SetName (Handle, byteName));
  1632. }
  1633. public String GetKey ()
  1634. {
  1635. UInt32 sizeKey = 0;
  1636. UInt32 neededKey = 0;
  1637. CheckError(Internal.Lib3MFWrapper.MetaData_GetKey (Handle, sizeKey, out neededKey, IntPtr.Zero));
  1638. sizeKey = neededKey;
  1639. byte[] bytesKey = new byte[sizeKey];
  1640. GCHandle dataKey = GCHandle.Alloc(bytesKey, GCHandleType.Pinned);
  1641. CheckError(Internal.Lib3MFWrapper.MetaData_GetKey (Handle, sizeKey, out neededKey, dataKey.AddrOfPinnedObject()));
  1642. dataKey.Free();
  1643. return Encoding.UTF8.GetString(bytesKey).TrimEnd(char.MinValue);
  1644. }
  1645. public bool GetMustPreserve ()
  1646. {
  1647. Byte resultMustPreserve = 0;
  1648. CheckError(Internal.Lib3MFWrapper.MetaData_GetMustPreserve (Handle, out resultMustPreserve));
  1649. return (resultMustPreserve != 0);
  1650. }
  1651. public void SetMustPreserve (bool AMustPreserve)
  1652. {
  1653. CheckError(Internal.Lib3MFWrapper.MetaData_SetMustPreserve (Handle, (Byte)( AMustPreserve ? 1 : 0 )));
  1654. }
  1655. public String GetType ()
  1656. {
  1657. UInt32 sizeType = 0;
  1658. UInt32 neededType = 0;
  1659. CheckError(Internal.Lib3MFWrapper.MetaData_GetType (Handle, sizeType, out neededType, IntPtr.Zero));
  1660. sizeType = neededType;
  1661. byte[] bytesType = new byte[sizeType];
  1662. GCHandle dataType = GCHandle.Alloc(bytesType, GCHandleType.Pinned);
  1663. CheckError(Internal.Lib3MFWrapper.MetaData_GetType (Handle, sizeType, out neededType, dataType.AddrOfPinnedObject()));
  1664. dataType.Free();
  1665. return Encoding.UTF8.GetString(bytesType).TrimEnd(char.MinValue);
  1666. }
  1667. public void SetType (String AType)
  1668. {
  1669. byte[] byteType = Encoding.UTF8.GetBytes(AType + char.MinValue);
  1670. CheckError(Internal.Lib3MFWrapper.MetaData_SetType (Handle, byteType));
  1671. }
  1672. public String GetValue ()
  1673. {
  1674. UInt32 sizeValue = 0;
  1675. UInt32 neededValue = 0;
  1676. CheckError(Internal.Lib3MFWrapper.MetaData_GetValue (Handle, sizeValue, out neededValue, IntPtr.Zero));
  1677. sizeValue = neededValue;
  1678. byte[] bytesValue = new byte[sizeValue];
  1679. GCHandle dataValue = GCHandle.Alloc(bytesValue, GCHandleType.Pinned);
  1680. CheckError(Internal.Lib3MFWrapper.MetaData_GetValue (Handle, sizeValue, out neededValue, dataValue.AddrOfPinnedObject()));
  1681. dataValue.Free();
  1682. return Encoding.UTF8.GetString(bytesValue).TrimEnd(char.MinValue);
  1683. }
  1684. public void SetValue (String AValue)
  1685. {
  1686. byte[] byteValue = Encoding.UTF8.GetBytes(AValue + char.MinValue);
  1687. CheckError(Internal.Lib3MFWrapper.MetaData_SetValue (Handle, byteValue));
  1688. }
  1689. }
  1690. public class CMetaDataGroup : CBase
  1691. {
  1692. public CMetaDataGroup (IntPtr NewHandle) : base (NewHandle)
  1693. {
  1694. }
  1695. public UInt32 GetMetaDataCount ()
  1696. {
  1697. UInt32 resultCount = 0;
  1698. CheckError(Internal.Lib3MFWrapper.MetaDataGroup_GetMetaDataCount (Handle, out resultCount));
  1699. return resultCount;
  1700. }
  1701. public CMetaData GetMetaData (UInt32 AIndex)
  1702. {
  1703. IntPtr newMetaData = IntPtr.Zero;
  1704. CheckError(Internal.Lib3MFWrapper.MetaDataGroup_GetMetaData (Handle, AIndex, out newMetaData));
  1705. return new CMetaData (newMetaData );
  1706. }
  1707. public CMetaData GetMetaDataByKey (String ANameSpace, String AName)
  1708. {
  1709. byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue);
  1710. byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue);
  1711. IntPtr newMetaData = IntPtr.Zero;
  1712. CheckError(Internal.Lib3MFWrapper.MetaDataGroup_GetMetaDataByKey (Handle, byteNameSpace, byteName, out newMetaData));
  1713. return new CMetaData (newMetaData );
  1714. }
  1715. public void RemoveMetaDataByIndex (UInt32 AIndex)
  1716. {
  1717. CheckError(Internal.Lib3MFWrapper.MetaDataGroup_RemoveMetaDataByIndex (Handle, AIndex));
  1718. }
  1719. public void RemoveMetaData (CMetaData ATheMetaData)
  1720. {
  1721. CheckError(Internal.Lib3MFWrapper.MetaDataGroup_RemoveMetaData (Handle, ATheMetaData.GetHandle()));
  1722. }
  1723. public CMetaData AddMetaData (String ANameSpace, String AName, String AValue, String AType, bool AMustPreserve)
  1724. {
  1725. byte[] byteNameSpace = Encoding.UTF8.GetBytes(ANameSpace + char.MinValue);
  1726. byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue);
  1727. byte[] byteValue = Encoding.UTF8.GetBytes(AValue + char.MinValue);
  1728. byte[] byteType = Encoding.UTF8.GetBytes(AType + char.MinValue);
  1729. IntPtr newMetaData = IntPtr.Zero;
  1730. CheckError(Internal.Lib3MFWrapper.MetaDataGroup_AddMetaData (Handle, byteNameSpace, byteName, byteValue, byteType, (Byte)( AMustPreserve ? 1 : 0 ), out newMetaData));
  1731. return new CMetaData (newMetaData );
  1732. }
  1733. }
  1734. public class CObject : CResource
  1735. {
  1736. public CObject (IntPtr NewHandle) : base (NewHandle)
  1737. {
  1738. }
  1739. public eObjectType GetType ()
  1740. {
  1741. Int32 resultObjectType = 0;
  1742. CheckError(Internal.Lib3MFWrapper.Object_GetType (Handle, out resultObjectType));
  1743. return (eObjectType) (resultObjectType);
  1744. }
  1745. public void SetType (eObjectType AObjectType)
  1746. {
  1747. Int32 enumObjectType = (Int32) AObjectType;
  1748. CheckError(Internal.Lib3MFWrapper.Object_SetType (Handle, enumObjectType));
  1749. }
  1750. public String GetName ()
  1751. {
  1752. UInt32 sizeName = 0;
  1753. UInt32 neededName = 0;
  1754. CheckError(Internal.Lib3MFWrapper.Object_GetName (Handle, sizeName, out neededName, IntPtr.Zero));
  1755. sizeName = neededName;
  1756. byte[] bytesName = new byte[sizeName];
  1757. GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned);
  1758. CheckError(Internal.Lib3MFWrapper.Object_GetName (Handle, sizeName, out neededName, dataName.AddrOfPinnedObject()));
  1759. dataName.Free();
  1760. return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue);
  1761. }
  1762. public void SetName (String AName)
  1763. {
  1764. byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue);
  1765. CheckError(Internal.Lib3MFWrapper.Object_SetName (Handle, byteName));
  1766. }
  1767. public String GetPartNumber ()
  1768. {
  1769. UInt32 sizePartNumber = 0;
  1770. UInt32 neededPartNumber = 0;
  1771. CheckError(Internal.Lib3MFWrapper.Object_GetPartNumber (Handle, sizePartNumber, out neededPartNumber, IntPtr.Zero));
  1772. sizePartNumber = neededPartNumber;
  1773. byte[] bytesPartNumber = new byte[sizePartNumber];
  1774. GCHandle dataPartNumber = GCHandle.Alloc(bytesPartNumber, GCHandleType.Pinned);
  1775. CheckError(Internal.Lib3MFWrapper.Object_GetPartNumber (Handle, sizePartNumber, out neededPartNumber, dataPartNumber.AddrOfPinnedObject()));
  1776. dataPartNumber.Free();
  1777. return Encoding.UTF8.GetString(bytesPartNumber).TrimEnd(char.MinValue);
  1778. }
  1779. public void SetPartNumber (String APartNumber)
  1780. {
  1781. byte[] bytePartNumber = Encoding.UTF8.GetBytes(APartNumber + char.MinValue);
  1782. CheckError(Internal.Lib3MFWrapper.Object_SetPartNumber (Handle, bytePartNumber));
  1783. }
  1784. public bool IsMeshObject ()
  1785. {
  1786. Byte resultIsMeshObject = 0;
  1787. CheckError(Internal.Lib3MFWrapper.Object_IsMeshObject (Handle, out resultIsMeshObject));
  1788. return (resultIsMeshObject != 0);
  1789. }
  1790. public bool IsComponentsObject ()
  1791. {
  1792. Byte resultIsComponentsObject = 0;
  1793. CheckError(Internal.Lib3MFWrapper.Object_IsComponentsObject (Handle, out resultIsComponentsObject));
  1794. return (resultIsComponentsObject != 0);
  1795. }
  1796. public bool IsValid ()
  1797. {
  1798. Byte resultIsValid = 0;
  1799. CheckError(Internal.Lib3MFWrapper.Object_IsValid (Handle, out resultIsValid));
  1800. return (resultIsValid != 0);
  1801. }
  1802. public void SetAttachmentAsThumbnail (CAttachment AAttachment)
  1803. {
  1804. CheckError(Internal.Lib3MFWrapper.Object_SetAttachmentAsThumbnail (Handle, AAttachment.GetHandle()));
  1805. }
  1806. public CAttachment GetThumbnailAttachment ()
  1807. {
  1808. IntPtr newAttachment = IntPtr.Zero;
  1809. CheckError(Internal.Lib3MFWrapper.Object_GetThumbnailAttachment (Handle, out newAttachment));
  1810. return new CAttachment (newAttachment );
  1811. }
  1812. public void ClearThumbnailAttachment ()
  1813. {
  1814. CheckError(Internal.Lib3MFWrapper.Object_ClearThumbnailAttachment (Handle));
  1815. }
  1816. public sBox GetOutbox ()
  1817. {
  1818. Internal.InternalBox intresultOutbox;
  1819. CheckError(Internal.Lib3MFWrapper.Object_GetOutbox (Handle, out intresultOutbox));
  1820. return Internal.Lib3MFWrapper.convertInternalToStruct_Box (intresultOutbox);
  1821. }
  1822. public String GetUUID (out bool AHasUUID)
  1823. {
  1824. Byte resultHasUUID = 0;
  1825. UInt32 sizeUUID = 0;
  1826. UInt32 neededUUID = 0;
  1827. CheckError(Internal.Lib3MFWrapper.Object_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, IntPtr.Zero));
  1828. sizeUUID = neededUUID;
  1829. byte[] bytesUUID = new byte[sizeUUID];
  1830. GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned);
  1831. CheckError(Internal.Lib3MFWrapper.Object_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject()));
  1832. AHasUUID = (resultHasUUID != 0);
  1833. dataUUID.Free();
  1834. return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue);
  1835. }
  1836. public void SetUUID (String AUUID)
  1837. {
  1838. byte[] byteUUID = Encoding.UTF8.GetBytes(AUUID + char.MinValue);
  1839. CheckError(Internal.Lib3MFWrapper.Object_SetUUID (Handle, byteUUID));
  1840. }
  1841. public CMetaDataGroup GetMetaDataGroup ()
  1842. {
  1843. IntPtr newMetaDataGroup = IntPtr.Zero;
  1844. CheckError(Internal.Lib3MFWrapper.Object_GetMetaDataGroup (Handle, out newMetaDataGroup));
  1845. return new CMetaDataGroup (newMetaDataGroup );
  1846. }
  1847. public void SetSlicesMeshResolution (eSlicesMeshResolution AMeshResolution)
  1848. {
  1849. Int32 enumMeshResolution = (Int32) AMeshResolution;
  1850. CheckError(Internal.Lib3MFWrapper.Object_SetSlicesMeshResolution (Handle, enumMeshResolution));
  1851. }
  1852. public eSlicesMeshResolution GetSlicesMeshResolution ()
  1853. {
  1854. Int32 resultMeshResolution = 0;
  1855. CheckError(Internal.Lib3MFWrapper.Object_GetSlicesMeshResolution (Handle, out resultMeshResolution));
  1856. return (eSlicesMeshResolution) (resultMeshResolution);
  1857. }
  1858. public bool HasSlices (bool ARecursive)
  1859. {
  1860. Byte resultHasSlices = 0;
  1861. CheckError(Internal.Lib3MFWrapper.Object_HasSlices (Handle, (Byte)( ARecursive ? 1 : 0 ), out resultHasSlices));
  1862. return (resultHasSlices != 0);
  1863. }
  1864. public void ClearSliceStack ()
  1865. {
  1866. CheckError(Internal.Lib3MFWrapper.Object_ClearSliceStack (Handle));
  1867. }
  1868. public CSliceStack GetSliceStack ()
  1869. {
  1870. IntPtr newSliceStackInstance = IntPtr.Zero;
  1871. CheckError(Internal.Lib3MFWrapper.Object_GetSliceStack (Handle, out newSliceStackInstance));
  1872. return new CSliceStack (newSliceStackInstance );
  1873. }
  1874. public void AssignSliceStack (CSliceStack ASliceStackInstance)
  1875. {
  1876. CheckError(Internal.Lib3MFWrapper.Object_AssignSliceStack (Handle, ASliceStackInstance.GetHandle()));
  1877. }
  1878. }
  1879. public class CMeshObject : CObject
  1880. {
  1881. public CMeshObject (IntPtr NewHandle) : base (NewHandle)
  1882. {
  1883. }
  1884. public UInt32 GetVertexCount ()
  1885. {
  1886. UInt32 resultVertexCount = 0;
  1887. CheckError(Internal.Lib3MFWrapper.MeshObject_GetVertexCount (Handle, out resultVertexCount));
  1888. return resultVertexCount;
  1889. }
  1890. public UInt32 GetTriangleCount ()
  1891. {
  1892. UInt32 resultVertexCount = 0;
  1893. CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangleCount (Handle, out resultVertexCount));
  1894. return resultVertexCount;
  1895. }
  1896. public sPosition GetVertex (UInt32 AIndex)
  1897. {
  1898. Internal.InternalPosition intresultCoordinates;
  1899. CheckError(Internal.Lib3MFWrapper.MeshObject_GetVertex (Handle, AIndex, out intresultCoordinates));
  1900. return Internal.Lib3MFWrapper.convertInternalToStruct_Position (intresultCoordinates);
  1901. }
  1902. public void SetVertex (UInt32 AIndex, sPosition ACoordinates)
  1903. {
  1904. Internal.InternalPosition intCoordinates = Internal.Lib3MFWrapper.convertStructToInternal_Position (ACoordinates);
  1905. CheckError(Internal.Lib3MFWrapper.MeshObject_SetVertex (Handle, AIndex, intCoordinates));
  1906. }
  1907. public UInt32 AddVertex (sPosition ACoordinates)
  1908. {
  1909. Internal.InternalPosition intCoordinates = Internal.Lib3MFWrapper.convertStructToInternal_Position (ACoordinates);
  1910. UInt32 resultNewIndex = 0;
  1911. CheckError(Internal.Lib3MFWrapper.MeshObject_AddVertex (Handle, intCoordinates, out resultNewIndex));
  1912. return resultNewIndex;
  1913. }
  1914. public void GetVertices (out sPosition[] AVertices)
  1915. {
  1916. UInt64 sizeVertices = 0;
  1917. UInt64 neededVertices = 0;
  1918. CheckError(Internal.Lib3MFWrapper.MeshObject_GetVertices (Handle, sizeVertices, out neededVertices, IntPtr.Zero));
  1919. sizeVertices = neededVertices;
  1920. var arrayVertices = new Internal.InternalPosition[sizeVertices];
  1921. GCHandle dataVertices = GCHandle.Alloc(arrayVertices, GCHandleType.Pinned);
  1922. CheckError(Internal.Lib3MFWrapper.MeshObject_GetVertices (Handle, sizeVertices, out neededVertices, dataVertices.AddrOfPinnedObject()));
  1923. dataVertices.Free();
  1924. AVertices = new sPosition[sizeVertices];
  1925. for (int index = 0; index < AVertices.Length; index++)
  1926. AVertices[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Position(arrayVertices[index]);
  1927. }
  1928. public sTriangle GetTriangle (UInt32 AIndex)
  1929. {
  1930. Internal.InternalTriangle intresultIndices;
  1931. CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangle (Handle, AIndex, out intresultIndices));
  1932. return Internal.Lib3MFWrapper.convertInternalToStruct_Triangle (intresultIndices);
  1933. }
  1934. public void SetTriangle (UInt32 AIndex, sTriangle AIndices)
  1935. {
  1936. Internal.InternalTriangle intIndices = Internal.Lib3MFWrapper.convertStructToInternal_Triangle (AIndices);
  1937. CheckError(Internal.Lib3MFWrapper.MeshObject_SetTriangle (Handle, AIndex, intIndices));
  1938. }
  1939. public UInt32 AddTriangle (sTriangle AIndices)
  1940. {
  1941. Internal.InternalTriangle intIndices = Internal.Lib3MFWrapper.convertStructToInternal_Triangle (AIndices);
  1942. UInt32 resultNewIndex = 0;
  1943. CheckError(Internal.Lib3MFWrapper.MeshObject_AddTriangle (Handle, intIndices, out resultNewIndex));
  1944. return resultNewIndex;
  1945. }
  1946. public void GetTriangleIndices (out sTriangle[] AIndices)
  1947. {
  1948. UInt64 sizeIndices = 0;
  1949. UInt64 neededIndices = 0;
  1950. CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangleIndices (Handle, sizeIndices, out neededIndices, IntPtr.Zero));
  1951. sizeIndices = neededIndices;
  1952. var arrayIndices = new Internal.InternalTriangle[sizeIndices];
  1953. GCHandle dataIndices = GCHandle.Alloc(arrayIndices, GCHandleType.Pinned);
  1954. CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangleIndices (Handle, sizeIndices, out neededIndices, dataIndices.AddrOfPinnedObject()));
  1955. dataIndices.Free();
  1956. AIndices = new sTriangle[sizeIndices];
  1957. for (int index = 0; index < AIndices.Length; index++)
  1958. AIndices[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Triangle(arrayIndices[index]);
  1959. }
  1960. public void SetObjectLevelProperty (UInt32 AUniqueResourceID, UInt32 APropertyID)
  1961. {
  1962. CheckError(Internal.Lib3MFWrapper.MeshObject_SetObjectLevelProperty (Handle, AUniqueResourceID, APropertyID));
  1963. }
  1964. public bool GetObjectLevelProperty (out UInt32 AUniqueResourceID, out UInt32 APropertyID)
  1965. {
  1966. Byte resultHasObjectLevelProperty = 0;
  1967. CheckError(Internal.Lib3MFWrapper.MeshObject_GetObjectLevelProperty (Handle, out AUniqueResourceID, out APropertyID, out resultHasObjectLevelProperty));
  1968. return (resultHasObjectLevelProperty != 0);
  1969. }
  1970. public void SetTriangleProperties (UInt32 AIndex, sTriangleProperties AProperties)
  1971. {
  1972. Internal.InternalTriangleProperties intProperties = Internal.Lib3MFWrapper.convertStructToInternal_TriangleProperties (AProperties);
  1973. CheckError(Internal.Lib3MFWrapper.MeshObject_SetTriangleProperties (Handle, AIndex, intProperties));
  1974. }
  1975. public void GetTriangleProperties (UInt32 AIndex, out sTriangleProperties AProperty)
  1976. {
  1977. Internal.InternalTriangleProperties intresultProperty;
  1978. CheckError(Internal.Lib3MFWrapper.MeshObject_GetTriangleProperties (Handle, AIndex, out intresultProperty));
  1979. AProperty = Internal.Lib3MFWrapper.convertInternalToStruct_TriangleProperties (intresultProperty);
  1980. }
  1981. public void SetAllTriangleProperties (sTriangleProperties[] APropertiesArray)
  1982. {
  1983. Internal.InternalTriangleProperties[] intdataPropertiesArray = new Internal.InternalTriangleProperties[APropertiesArray.Length];
  1984. for (int index = 0; index < APropertiesArray.Length; index++)
  1985. intdataPropertiesArray[index] = Internal.Lib3MFWrapper.convertStructToInternal_TriangleProperties(APropertiesArray[index]);
  1986. GCHandle dataPropertiesArray = GCHandle.Alloc(intdataPropertiesArray, GCHandleType.Pinned);
  1987. CheckError(Internal.Lib3MFWrapper.MeshObject_SetAllTriangleProperties (Handle, (UInt64) APropertiesArray.Length, dataPropertiesArray.AddrOfPinnedObject()));
  1988. dataPropertiesArray.Free ();
  1989. }
  1990. public void GetAllTriangleProperties (out sTriangleProperties[] APropertiesArray)
  1991. {
  1992. UInt64 sizePropertiesArray = 0;
  1993. UInt64 neededPropertiesArray = 0;
  1994. CheckError(Internal.Lib3MFWrapper.MeshObject_GetAllTriangleProperties (Handle, sizePropertiesArray, out neededPropertiesArray, IntPtr.Zero));
  1995. sizePropertiesArray = neededPropertiesArray;
  1996. var arrayPropertiesArray = new Internal.InternalTriangleProperties[sizePropertiesArray];
  1997. GCHandle dataPropertiesArray = GCHandle.Alloc(arrayPropertiesArray, GCHandleType.Pinned);
  1998. CheckError(Internal.Lib3MFWrapper.MeshObject_GetAllTriangleProperties (Handle, sizePropertiesArray, out neededPropertiesArray, dataPropertiesArray.AddrOfPinnedObject()));
  1999. dataPropertiesArray.Free();
  2000. APropertiesArray = new sTriangleProperties[sizePropertiesArray];
  2001. for (int index = 0; index < APropertiesArray.Length; index++)
  2002. APropertiesArray[index] = Internal.Lib3MFWrapper.convertInternalToStruct_TriangleProperties(arrayPropertiesArray[index]);
  2003. }
  2004. public void ClearAllProperties ()
  2005. {
  2006. CheckError(Internal.Lib3MFWrapper.MeshObject_ClearAllProperties (Handle));
  2007. }
  2008. public void SetGeometry (sPosition[] AVertices, sTriangle[] AIndices)
  2009. {
  2010. Internal.InternalPosition[] intdataVertices = new Internal.InternalPosition[AVertices.Length];
  2011. for (int index = 0; index < AVertices.Length; index++)
  2012. intdataVertices[index] = Internal.Lib3MFWrapper.convertStructToInternal_Position(AVertices[index]);
  2013. GCHandle dataVertices = GCHandle.Alloc(intdataVertices, GCHandleType.Pinned);
  2014. Internal.InternalTriangle[] intdataIndices = new Internal.InternalTriangle[AIndices.Length];
  2015. for (int index = 0; index < AIndices.Length; index++)
  2016. intdataIndices[index] = Internal.Lib3MFWrapper.convertStructToInternal_Triangle(AIndices[index]);
  2017. GCHandle dataIndices = GCHandle.Alloc(intdataIndices, GCHandleType.Pinned);
  2018. CheckError(Internal.Lib3MFWrapper.MeshObject_SetGeometry (Handle, (UInt64) AVertices.Length, dataVertices.AddrOfPinnedObject(), (UInt64) AIndices.Length, dataIndices.AddrOfPinnedObject()));
  2019. dataVertices.Free ();
  2020. dataIndices.Free ();
  2021. }
  2022. public bool IsManifoldAndOriented ()
  2023. {
  2024. Byte resultIsManifoldAndOriented = 0;
  2025. CheckError(Internal.Lib3MFWrapper.MeshObject_IsManifoldAndOriented (Handle, out resultIsManifoldAndOriented));
  2026. return (resultIsManifoldAndOriented != 0);
  2027. }
  2028. public CBeamLattice BeamLattice ()
  2029. {
  2030. IntPtr newTheBeamLattice = IntPtr.Zero;
  2031. CheckError(Internal.Lib3MFWrapper.MeshObject_BeamLattice (Handle, out newTheBeamLattice));
  2032. return new CBeamLattice (newTheBeamLattice );
  2033. }
  2034. }
  2035. public class CBeamLattice : CBase
  2036. {
  2037. public CBeamLattice (IntPtr NewHandle) : base (NewHandle)
  2038. {
  2039. }
  2040. public Double GetMinLength ()
  2041. {
  2042. Double resultMinLength = 0;
  2043. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetMinLength (Handle, out resultMinLength));
  2044. return resultMinLength;
  2045. }
  2046. public void SetMinLength (Double AMinLength)
  2047. {
  2048. CheckError(Internal.Lib3MFWrapper.BeamLattice_SetMinLength (Handle, AMinLength));
  2049. }
  2050. public void GetClipping (out eBeamLatticeClipMode AClipMode, out UInt32 AUniqueResourceID)
  2051. {
  2052. Int32 resultClipMode = 0;
  2053. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetClipping (Handle, out resultClipMode, out AUniqueResourceID));
  2054. AClipMode = (eBeamLatticeClipMode) (resultClipMode);
  2055. }
  2056. public void SetClipping (eBeamLatticeClipMode AClipMode, UInt32 AUniqueResourceID)
  2057. {
  2058. Int32 enumClipMode = (Int32) AClipMode;
  2059. CheckError(Internal.Lib3MFWrapper.BeamLattice_SetClipping (Handle, enumClipMode, AUniqueResourceID));
  2060. }
  2061. public bool GetRepresentation (out UInt32 AUniqueResourceID)
  2062. {
  2063. Byte resultHasRepresentation = 0;
  2064. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetRepresentation (Handle, out resultHasRepresentation, out AUniqueResourceID));
  2065. return (resultHasRepresentation != 0);
  2066. }
  2067. public void SetRepresentation (UInt32 AUniqueResourceID)
  2068. {
  2069. CheckError(Internal.Lib3MFWrapper.BeamLattice_SetRepresentation (Handle, AUniqueResourceID));
  2070. }
  2071. public void GetBallOptions (out eBeamLatticeBallMode ABallMode, out Double ABallRadius)
  2072. {
  2073. Int32 resultBallMode = 0;
  2074. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBallOptions (Handle, out resultBallMode, out ABallRadius));
  2075. ABallMode = (eBeamLatticeBallMode) (resultBallMode);
  2076. }
  2077. public void SetBallOptions (eBeamLatticeBallMode ABallMode, Double ABallRadius)
  2078. {
  2079. Int32 enumBallMode = (Int32) ABallMode;
  2080. CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBallOptions (Handle, enumBallMode, ABallRadius));
  2081. }
  2082. public UInt32 GetBeamCount ()
  2083. {
  2084. UInt32 resultCount = 0;
  2085. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeamCount (Handle, out resultCount));
  2086. return resultCount;
  2087. }
  2088. public sBeam GetBeam (UInt32 AIndex)
  2089. {
  2090. Internal.InternalBeam intresultBeamInfo;
  2091. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeam (Handle, AIndex, out intresultBeamInfo));
  2092. return Internal.Lib3MFWrapper.convertInternalToStruct_Beam (intresultBeamInfo);
  2093. }
  2094. public UInt32 AddBeam (sBeam ABeamInfo)
  2095. {
  2096. Internal.InternalBeam intBeamInfo = Internal.Lib3MFWrapper.convertStructToInternal_Beam (ABeamInfo);
  2097. UInt32 resultIndex = 0;
  2098. CheckError(Internal.Lib3MFWrapper.BeamLattice_AddBeam (Handle, intBeamInfo, out resultIndex));
  2099. return resultIndex;
  2100. }
  2101. public void SetBeam (UInt32 AIndex, sBeam ABeamInfo)
  2102. {
  2103. Internal.InternalBeam intBeamInfo = Internal.Lib3MFWrapper.convertStructToInternal_Beam (ABeamInfo);
  2104. CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBeam (Handle, AIndex, intBeamInfo));
  2105. }
  2106. public void SetBeams (sBeam[] ABeamInfo)
  2107. {
  2108. Internal.InternalBeam[] intdataBeamInfo = new Internal.InternalBeam[ABeamInfo.Length];
  2109. for (int index = 0; index < ABeamInfo.Length; index++)
  2110. intdataBeamInfo[index] = Internal.Lib3MFWrapper.convertStructToInternal_Beam(ABeamInfo[index]);
  2111. GCHandle dataBeamInfo = GCHandle.Alloc(intdataBeamInfo, GCHandleType.Pinned);
  2112. CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBeams (Handle, (UInt64) ABeamInfo.Length, dataBeamInfo.AddrOfPinnedObject()));
  2113. dataBeamInfo.Free ();
  2114. }
  2115. public void GetBeams (out sBeam[] ABeamInfo)
  2116. {
  2117. UInt64 sizeBeamInfo = 0;
  2118. UInt64 neededBeamInfo = 0;
  2119. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeams (Handle, sizeBeamInfo, out neededBeamInfo, IntPtr.Zero));
  2120. sizeBeamInfo = neededBeamInfo;
  2121. var arrayBeamInfo = new Internal.InternalBeam[sizeBeamInfo];
  2122. GCHandle dataBeamInfo = GCHandle.Alloc(arrayBeamInfo, GCHandleType.Pinned);
  2123. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeams (Handle, sizeBeamInfo, out neededBeamInfo, dataBeamInfo.AddrOfPinnedObject()));
  2124. dataBeamInfo.Free();
  2125. ABeamInfo = new sBeam[sizeBeamInfo];
  2126. for (int index = 0; index < ABeamInfo.Length; index++)
  2127. ABeamInfo[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Beam(arrayBeamInfo[index]);
  2128. }
  2129. public UInt32 GetBallCount ()
  2130. {
  2131. UInt32 resultCount = 0;
  2132. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBallCount (Handle, out resultCount));
  2133. return resultCount;
  2134. }
  2135. public sBall GetBall (UInt32 AIndex)
  2136. {
  2137. Internal.InternalBall intresultBallInfo;
  2138. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBall (Handle, AIndex, out intresultBallInfo));
  2139. return Internal.Lib3MFWrapper.convertInternalToStruct_Ball (intresultBallInfo);
  2140. }
  2141. public UInt32 AddBall (sBall ABallInfo)
  2142. {
  2143. Internal.InternalBall intBallInfo = Internal.Lib3MFWrapper.convertStructToInternal_Ball (ABallInfo);
  2144. UInt32 resultIndex = 0;
  2145. CheckError(Internal.Lib3MFWrapper.BeamLattice_AddBall (Handle, intBallInfo, out resultIndex));
  2146. return resultIndex;
  2147. }
  2148. public void SetBall (UInt32 AIndex, sBall ABallInfo)
  2149. {
  2150. Internal.InternalBall intBallInfo = Internal.Lib3MFWrapper.convertStructToInternal_Ball (ABallInfo);
  2151. CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBall (Handle, AIndex, intBallInfo));
  2152. }
  2153. public void SetBalls (sBall[] ABallInfo)
  2154. {
  2155. Internal.InternalBall[] intdataBallInfo = new Internal.InternalBall[ABallInfo.Length];
  2156. for (int index = 0; index < ABallInfo.Length; index++)
  2157. intdataBallInfo[index] = Internal.Lib3MFWrapper.convertStructToInternal_Ball(ABallInfo[index]);
  2158. GCHandle dataBallInfo = GCHandle.Alloc(intdataBallInfo, GCHandleType.Pinned);
  2159. CheckError(Internal.Lib3MFWrapper.BeamLattice_SetBalls (Handle, (UInt64) ABallInfo.Length, dataBallInfo.AddrOfPinnedObject()));
  2160. dataBallInfo.Free ();
  2161. }
  2162. public void GetBalls (out sBall[] ABallInfo)
  2163. {
  2164. UInt64 sizeBallInfo = 0;
  2165. UInt64 neededBallInfo = 0;
  2166. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBalls (Handle, sizeBallInfo, out neededBallInfo, IntPtr.Zero));
  2167. sizeBallInfo = neededBallInfo;
  2168. var arrayBallInfo = new Internal.InternalBall[sizeBallInfo];
  2169. GCHandle dataBallInfo = GCHandle.Alloc(arrayBallInfo, GCHandleType.Pinned);
  2170. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBalls (Handle, sizeBallInfo, out neededBallInfo, dataBallInfo.AddrOfPinnedObject()));
  2171. dataBallInfo.Free();
  2172. ABallInfo = new sBall[sizeBallInfo];
  2173. for (int index = 0; index < ABallInfo.Length; index++)
  2174. ABallInfo[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Ball(arrayBallInfo[index]);
  2175. }
  2176. public UInt32 GetBeamSetCount ()
  2177. {
  2178. UInt32 resultCount = 0;
  2179. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeamSetCount (Handle, out resultCount));
  2180. return resultCount;
  2181. }
  2182. public CBeamSet AddBeamSet ()
  2183. {
  2184. IntPtr newBeamSet = IntPtr.Zero;
  2185. CheckError(Internal.Lib3MFWrapper.BeamLattice_AddBeamSet (Handle, out newBeamSet));
  2186. return new CBeamSet (newBeamSet );
  2187. }
  2188. public CBeamSet GetBeamSet (UInt32 AIndex)
  2189. {
  2190. IntPtr newBeamSet = IntPtr.Zero;
  2191. CheckError(Internal.Lib3MFWrapper.BeamLattice_GetBeamSet (Handle, AIndex, out newBeamSet));
  2192. return new CBeamSet (newBeamSet );
  2193. }
  2194. }
  2195. public class CComponent : CBase
  2196. {
  2197. public CComponent (IntPtr NewHandle) : base (NewHandle)
  2198. {
  2199. }
  2200. public CObject GetObjectResource ()
  2201. {
  2202. IntPtr newObjectResource = IntPtr.Zero;
  2203. CheckError(Internal.Lib3MFWrapper.Component_GetObjectResource (Handle, out newObjectResource));
  2204. return new CObject (newObjectResource );
  2205. }
  2206. public UInt32 GetObjectResourceID ()
  2207. {
  2208. UInt32 resultUniqueResourceID = 0;
  2209. CheckError(Internal.Lib3MFWrapper.Component_GetObjectResourceID (Handle, out resultUniqueResourceID));
  2210. return resultUniqueResourceID;
  2211. }
  2212. public String GetUUID (out bool AHasUUID)
  2213. {
  2214. Byte resultHasUUID = 0;
  2215. UInt32 sizeUUID = 0;
  2216. UInt32 neededUUID = 0;
  2217. CheckError(Internal.Lib3MFWrapper.Component_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, IntPtr.Zero));
  2218. sizeUUID = neededUUID;
  2219. byte[] bytesUUID = new byte[sizeUUID];
  2220. GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned);
  2221. CheckError(Internal.Lib3MFWrapper.Component_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject()));
  2222. AHasUUID = (resultHasUUID != 0);
  2223. dataUUID.Free();
  2224. return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue);
  2225. }
  2226. public void SetUUID (String AUUID)
  2227. {
  2228. byte[] byteUUID = Encoding.UTF8.GetBytes(AUUID + char.MinValue);
  2229. CheckError(Internal.Lib3MFWrapper.Component_SetUUID (Handle, byteUUID));
  2230. }
  2231. public bool HasTransform ()
  2232. {
  2233. Byte resultHasTransform = 0;
  2234. CheckError(Internal.Lib3MFWrapper.Component_HasTransform (Handle, out resultHasTransform));
  2235. return (resultHasTransform != 0);
  2236. }
  2237. public sTransform GetTransform ()
  2238. {
  2239. Internal.InternalTransform intresultTransform;
  2240. CheckError(Internal.Lib3MFWrapper.Component_GetTransform (Handle, out intresultTransform));
  2241. return Internal.Lib3MFWrapper.convertInternalToStruct_Transform (intresultTransform);
  2242. }
  2243. public void SetTransform (sTransform ATransform)
  2244. {
  2245. Internal.InternalTransform intTransform = Internal.Lib3MFWrapper.convertStructToInternal_Transform (ATransform);
  2246. CheckError(Internal.Lib3MFWrapper.Component_SetTransform (Handle, intTransform));
  2247. }
  2248. }
  2249. public class CComponentsObject : CObject
  2250. {
  2251. public CComponentsObject (IntPtr NewHandle) : base (NewHandle)
  2252. {
  2253. }
  2254. public CComponent AddComponent (CObject AObjectResource, sTransform ATransform)
  2255. {
  2256. Internal.InternalTransform intTransform = Internal.Lib3MFWrapper.convertStructToInternal_Transform (ATransform);
  2257. IntPtr newComponentInstance = IntPtr.Zero;
  2258. CheckError(Internal.Lib3MFWrapper.ComponentsObject_AddComponent (Handle, AObjectResource.GetHandle(), intTransform, out newComponentInstance));
  2259. return new CComponent (newComponentInstance );
  2260. }
  2261. public CComponent GetComponent (UInt32 AIndex)
  2262. {
  2263. IntPtr newComponentInstance = IntPtr.Zero;
  2264. CheckError(Internal.Lib3MFWrapper.ComponentsObject_GetComponent (Handle, AIndex, out newComponentInstance));
  2265. return new CComponent (newComponentInstance );
  2266. }
  2267. public UInt32 GetComponentCount ()
  2268. {
  2269. UInt32 resultCount = 0;
  2270. CheckError(Internal.Lib3MFWrapper.ComponentsObject_GetComponentCount (Handle, out resultCount));
  2271. return resultCount;
  2272. }
  2273. }
  2274. public class CBeamSet : CBase
  2275. {
  2276. public CBeamSet (IntPtr NewHandle) : base (NewHandle)
  2277. {
  2278. }
  2279. public void SetName (String AName)
  2280. {
  2281. byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue);
  2282. CheckError(Internal.Lib3MFWrapper.BeamSet_SetName (Handle, byteName));
  2283. }
  2284. public String GetName ()
  2285. {
  2286. UInt32 sizeName = 0;
  2287. UInt32 neededName = 0;
  2288. CheckError(Internal.Lib3MFWrapper.BeamSet_GetName (Handle, sizeName, out neededName, IntPtr.Zero));
  2289. sizeName = neededName;
  2290. byte[] bytesName = new byte[sizeName];
  2291. GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned);
  2292. CheckError(Internal.Lib3MFWrapper.BeamSet_GetName (Handle, sizeName, out neededName, dataName.AddrOfPinnedObject()));
  2293. dataName.Free();
  2294. return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue);
  2295. }
  2296. public void SetIdentifier (String AIdentifier)
  2297. {
  2298. byte[] byteIdentifier = Encoding.UTF8.GetBytes(AIdentifier + char.MinValue);
  2299. CheckError(Internal.Lib3MFWrapper.BeamSet_SetIdentifier (Handle, byteIdentifier));
  2300. }
  2301. public String GetIdentifier ()
  2302. {
  2303. UInt32 sizeIdentifier = 0;
  2304. UInt32 neededIdentifier = 0;
  2305. CheckError(Internal.Lib3MFWrapper.BeamSet_GetIdentifier (Handle, sizeIdentifier, out neededIdentifier, IntPtr.Zero));
  2306. sizeIdentifier = neededIdentifier;
  2307. byte[] bytesIdentifier = new byte[sizeIdentifier];
  2308. GCHandle dataIdentifier = GCHandle.Alloc(bytesIdentifier, GCHandleType.Pinned);
  2309. CheckError(Internal.Lib3MFWrapper.BeamSet_GetIdentifier (Handle, sizeIdentifier, out neededIdentifier, dataIdentifier.AddrOfPinnedObject()));
  2310. dataIdentifier.Free();
  2311. return Encoding.UTF8.GetString(bytesIdentifier).TrimEnd(char.MinValue);
  2312. }
  2313. public UInt32 GetReferenceCount ()
  2314. {
  2315. UInt32 resultCount = 0;
  2316. CheckError(Internal.Lib3MFWrapper.BeamSet_GetReferenceCount (Handle, out resultCount));
  2317. return resultCount;
  2318. }
  2319. public void SetReferences (UInt32[] AReferences)
  2320. {
  2321. GCHandle dataReferences = GCHandle.Alloc(AReferences, GCHandleType.Pinned);
  2322. CheckError(Internal.Lib3MFWrapper.BeamSet_SetReferences (Handle, (UInt64) AReferences.Length, dataReferences.AddrOfPinnedObject()));
  2323. dataReferences.Free ();
  2324. }
  2325. public void GetReferences (out UInt32[] AReferences)
  2326. {
  2327. UInt64 sizeReferences = 0;
  2328. UInt64 neededReferences = 0;
  2329. CheckError(Internal.Lib3MFWrapper.BeamSet_GetReferences (Handle, sizeReferences, out neededReferences, IntPtr.Zero));
  2330. sizeReferences = neededReferences;
  2331. AReferences = new UInt32[sizeReferences];
  2332. GCHandle dataReferences = GCHandle.Alloc(AReferences, GCHandleType.Pinned);
  2333. CheckError(Internal.Lib3MFWrapper.BeamSet_GetReferences (Handle, sizeReferences, out neededReferences, dataReferences.AddrOfPinnedObject()));
  2334. dataReferences.Free();
  2335. }
  2336. public UInt32 GetBallReferenceCount ()
  2337. {
  2338. UInt32 resultCount = 0;
  2339. CheckError(Internal.Lib3MFWrapper.BeamSet_GetBallReferenceCount (Handle, out resultCount));
  2340. return resultCount;
  2341. }
  2342. public void SetBallReferences (UInt32[] ABallReferences)
  2343. {
  2344. GCHandle dataBallReferences = GCHandle.Alloc(ABallReferences, GCHandleType.Pinned);
  2345. CheckError(Internal.Lib3MFWrapper.BeamSet_SetBallReferences (Handle, (UInt64) ABallReferences.Length, dataBallReferences.AddrOfPinnedObject()));
  2346. dataBallReferences.Free ();
  2347. }
  2348. public void GetBallReferences (out UInt32[] ABallReferences)
  2349. {
  2350. UInt64 sizeBallReferences = 0;
  2351. UInt64 neededBallReferences = 0;
  2352. CheckError(Internal.Lib3MFWrapper.BeamSet_GetBallReferences (Handle, sizeBallReferences, out neededBallReferences, IntPtr.Zero));
  2353. sizeBallReferences = neededBallReferences;
  2354. ABallReferences = new UInt32[sizeBallReferences];
  2355. GCHandle dataBallReferences = GCHandle.Alloc(ABallReferences, GCHandleType.Pinned);
  2356. CheckError(Internal.Lib3MFWrapper.BeamSet_GetBallReferences (Handle, sizeBallReferences, out neededBallReferences, dataBallReferences.AddrOfPinnedObject()));
  2357. dataBallReferences.Free();
  2358. }
  2359. }
  2360. public class CBaseMaterialGroup : CResource
  2361. {
  2362. public CBaseMaterialGroup (IntPtr NewHandle) : base (NewHandle)
  2363. {
  2364. }
  2365. public UInt32 GetCount ()
  2366. {
  2367. UInt32 resultCount = 0;
  2368. CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetCount (Handle, out resultCount));
  2369. return resultCount;
  2370. }
  2371. public void GetAllPropertyIDs (out UInt32[] APropertyIDs)
  2372. {
  2373. UInt64 sizePropertyIDs = 0;
  2374. UInt64 neededPropertyIDs = 0;
  2375. CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero));
  2376. sizePropertyIDs = neededPropertyIDs;
  2377. APropertyIDs = new UInt32[sizePropertyIDs];
  2378. GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned);
  2379. CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject()));
  2380. dataPropertyIDs.Free();
  2381. }
  2382. public UInt32 AddMaterial (String AName, sColor ADisplayColor)
  2383. {
  2384. byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue);
  2385. Internal.InternalColor intDisplayColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ADisplayColor);
  2386. UInt32 resultPropertyID = 0;
  2387. CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_AddMaterial (Handle, byteName, intDisplayColor, out resultPropertyID));
  2388. return resultPropertyID;
  2389. }
  2390. public void RemoveMaterial (UInt32 APropertyID)
  2391. {
  2392. CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_RemoveMaterial (Handle, APropertyID));
  2393. }
  2394. public String GetName (UInt32 APropertyID)
  2395. {
  2396. UInt32 sizeName = 0;
  2397. UInt32 neededName = 0;
  2398. CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetName (Handle, APropertyID, sizeName, out neededName, IntPtr.Zero));
  2399. sizeName = neededName;
  2400. byte[] bytesName = new byte[sizeName];
  2401. GCHandle dataName = GCHandle.Alloc(bytesName, GCHandleType.Pinned);
  2402. CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetName (Handle, APropertyID, sizeName, out neededName, dataName.AddrOfPinnedObject()));
  2403. dataName.Free();
  2404. return Encoding.UTF8.GetString(bytesName).TrimEnd(char.MinValue);
  2405. }
  2406. public void SetName (UInt32 APropertyID, String AName)
  2407. {
  2408. byte[] byteName = Encoding.UTF8.GetBytes(AName + char.MinValue);
  2409. CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_SetName (Handle, APropertyID, byteName));
  2410. }
  2411. public void SetDisplayColor (UInt32 APropertyID, sColor ATheColor)
  2412. {
  2413. Internal.InternalColor intTheColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ATheColor);
  2414. CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_SetDisplayColor (Handle, APropertyID, intTheColor));
  2415. }
  2416. public sColor GetDisplayColor (UInt32 APropertyID)
  2417. {
  2418. Internal.InternalColor intresultTheColor;
  2419. CheckError(Internal.Lib3MFWrapper.BaseMaterialGroup_GetDisplayColor (Handle, APropertyID, out intresultTheColor));
  2420. return Internal.Lib3MFWrapper.convertInternalToStruct_Color (intresultTheColor);
  2421. }
  2422. }
  2423. public class CColorGroup : CResource
  2424. {
  2425. public CColorGroup (IntPtr NewHandle) : base (NewHandle)
  2426. {
  2427. }
  2428. public UInt32 GetCount ()
  2429. {
  2430. UInt32 resultCount = 0;
  2431. CheckError(Internal.Lib3MFWrapper.ColorGroup_GetCount (Handle, out resultCount));
  2432. return resultCount;
  2433. }
  2434. public void GetAllPropertyIDs (out UInt32[] APropertyIDs)
  2435. {
  2436. UInt64 sizePropertyIDs = 0;
  2437. UInt64 neededPropertyIDs = 0;
  2438. CheckError(Internal.Lib3MFWrapper.ColorGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero));
  2439. sizePropertyIDs = neededPropertyIDs;
  2440. APropertyIDs = new UInt32[sizePropertyIDs];
  2441. GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned);
  2442. CheckError(Internal.Lib3MFWrapper.ColorGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject()));
  2443. dataPropertyIDs.Free();
  2444. }
  2445. public UInt32 AddColor (sColor ATheColor)
  2446. {
  2447. Internal.InternalColor intTheColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ATheColor);
  2448. UInt32 resultPropertyID = 0;
  2449. CheckError(Internal.Lib3MFWrapper.ColorGroup_AddColor (Handle, intTheColor, out resultPropertyID));
  2450. return resultPropertyID;
  2451. }
  2452. public void RemoveColor (UInt32 APropertyID)
  2453. {
  2454. CheckError(Internal.Lib3MFWrapper.ColorGroup_RemoveColor (Handle, APropertyID));
  2455. }
  2456. public void SetColor (UInt32 APropertyID, sColor ATheColor)
  2457. {
  2458. Internal.InternalColor intTheColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ATheColor);
  2459. CheckError(Internal.Lib3MFWrapper.ColorGroup_SetColor (Handle, APropertyID, intTheColor));
  2460. }
  2461. public sColor GetColor (UInt32 APropertyID)
  2462. {
  2463. Internal.InternalColor intresultTheColor;
  2464. CheckError(Internal.Lib3MFWrapper.ColorGroup_GetColor (Handle, APropertyID, out intresultTheColor));
  2465. return Internal.Lib3MFWrapper.convertInternalToStruct_Color (intresultTheColor);
  2466. }
  2467. }
  2468. public class CTexture2DGroup : CResource
  2469. {
  2470. public CTexture2DGroup (IntPtr NewHandle) : base (NewHandle)
  2471. {
  2472. }
  2473. public UInt32 GetCount ()
  2474. {
  2475. UInt32 resultCount = 0;
  2476. CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetCount (Handle, out resultCount));
  2477. return resultCount;
  2478. }
  2479. public void GetAllPropertyIDs (out UInt32[] APropertyIDs)
  2480. {
  2481. UInt64 sizePropertyIDs = 0;
  2482. UInt64 neededPropertyIDs = 0;
  2483. CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero));
  2484. sizePropertyIDs = neededPropertyIDs;
  2485. APropertyIDs = new UInt32[sizePropertyIDs];
  2486. GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned);
  2487. CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject()));
  2488. dataPropertyIDs.Free();
  2489. }
  2490. public UInt32 AddTex2Coord (sTex2Coord AUVCoordinate)
  2491. {
  2492. Internal.InternalTex2Coord intUVCoordinate = Internal.Lib3MFWrapper.convertStructToInternal_Tex2Coord (AUVCoordinate);
  2493. UInt32 resultPropertyID = 0;
  2494. CheckError(Internal.Lib3MFWrapper.Texture2DGroup_AddTex2Coord (Handle, intUVCoordinate, out resultPropertyID));
  2495. return resultPropertyID;
  2496. }
  2497. public sTex2Coord GetTex2Coord (UInt32 APropertyID)
  2498. {
  2499. Internal.InternalTex2Coord intresultUVCoordinate;
  2500. CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetTex2Coord (Handle, APropertyID, out intresultUVCoordinate));
  2501. return Internal.Lib3MFWrapper.convertInternalToStruct_Tex2Coord (intresultUVCoordinate);
  2502. }
  2503. public void RemoveTex2Coord (UInt32 APropertyID)
  2504. {
  2505. CheckError(Internal.Lib3MFWrapper.Texture2DGroup_RemoveTex2Coord (Handle, APropertyID));
  2506. }
  2507. public CTexture2D GetTexture2D ()
  2508. {
  2509. IntPtr newTexture2DInstance = IntPtr.Zero;
  2510. CheckError(Internal.Lib3MFWrapper.Texture2DGroup_GetTexture2D (Handle, out newTexture2DInstance));
  2511. return new CTexture2D (newTexture2DInstance );
  2512. }
  2513. }
  2514. public class CCompositeMaterials : CResource
  2515. {
  2516. public CCompositeMaterials (IntPtr NewHandle) : base (NewHandle)
  2517. {
  2518. }
  2519. public UInt32 GetCount ()
  2520. {
  2521. UInt32 resultCount = 0;
  2522. CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetCount (Handle, out resultCount));
  2523. return resultCount;
  2524. }
  2525. public void GetAllPropertyIDs (out UInt32[] APropertyIDs)
  2526. {
  2527. UInt64 sizePropertyIDs = 0;
  2528. UInt64 neededPropertyIDs = 0;
  2529. CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero));
  2530. sizePropertyIDs = neededPropertyIDs;
  2531. APropertyIDs = new UInt32[sizePropertyIDs];
  2532. GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned);
  2533. CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject()));
  2534. dataPropertyIDs.Free();
  2535. }
  2536. public CBaseMaterialGroup GetBaseMaterialGroup ()
  2537. {
  2538. IntPtr newBaseMaterialGroupInstance = IntPtr.Zero;
  2539. CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetBaseMaterialGroup (Handle, out newBaseMaterialGroupInstance));
  2540. return new CBaseMaterialGroup (newBaseMaterialGroupInstance );
  2541. }
  2542. public UInt32 AddComposite (sCompositeConstituent[] AComposite)
  2543. {
  2544. Internal.InternalCompositeConstituent[] intdataComposite = new Internal.InternalCompositeConstituent[AComposite.Length];
  2545. for (int index = 0; index < AComposite.Length; index++)
  2546. intdataComposite[index] = Internal.Lib3MFWrapper.convertStructToInternal_CompositeConstituent(AComposite[index]);
  2547. GCHandle dataComposite = GCHandle.Alloc(intdataComposite, GCHandleType.Pinned);
  2548. UInt32 resultPropertyID = 0;
  2549. CheckError(Internal.Lib3MFWrapper.CompositeMaterials_AddComposite (Handle, (UInt64) AComposite.Length, dataComposite.AddrOfPinnedObject(), out resultPropertyID));
  2550. dataComposite.Free ();
  2551. return resultPropertyID;
  2552. }
  2553. public void RemoveComposite (UInt32 APropertyID)
  2554. {
  2555. CheckError(Internal.Lib3MFWrapper.CompositeMaterials_RemoveComposite (Handle, APropertyID));
  2556. }
  2557. public void GetComposite (UInt32 APropertyID, out sCompositeConstituent[] AComposite)
  2558. {
  2559. UInt64 sizeComposite = 0;
  2560. UInt64 neededComposite = 0;
  2561. CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetComposite (Handle, APropertyID, sizeComposite, out neededComposite, IntPtr.Zero));
  2562. sizeComposite = neededComposite;
  2563. var arrayComposite = new Internal.InternalCompositeConstituent[sizeComposite];
  2564. GCHandle dataComposite = GCHandle.Alloc(arrayComposite, GCHandleType.Pinned);
  2565. CheckError(Internal.Lib3MFWrapper.CompositeMaterials_GetComposite (Handle, APropertyID, sizeComposite, out neededComposite, dataComposite.AddrOfPinnedObject()));
  2566. dataComposite.Free();
  2567. AComposite = new sCompositeConstituent[sizeComposite];
  2568. for (int index = 0; index < AComposite.Length; index++)
  2569. AComposite[index] = Internal.Lib3MFWrapper.convertInternalToStruct_CompositeConstituent(arrayComposite[index]);
  2570. }
  2571. }
  2572. public class CMultiPropertyGroup : CResource
  2573. {
  2574. public CMultiPropertyGroup (IntPtr NewHandle) : base (NewHandle)
  2575. {
  2576. }
  2577. public UInt32 GetCount ()
  2578. {
  2579. UInt32 resultCount = 0;
  2580. CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetCount (Handle, out resultCount));
  2581. return resultCount;
  2582. }
  2583. public void GetAllPropertyIDs (out UInt32[] APropertyIDs)
  2584. {
  2585. UInt64 sizePropertyIDs = 0;
  2586. UInt64 neededPropertyIDs = 0;
  2587. CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero));
  2588. sizePropertyIDs = neededPropertyIDs;
  2589. APropertyIDs = new UInt32[sizePropertyIDs];
  2590. GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned);
  2591. CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetAllPropertyIDs (Handle, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject()));
  2592. dataPropertyIDs.Free();
  2593. }
  2594. public UInt32 AddMultiProperty (UInt32[] APropertyIDs)
  2595. {
  2596. GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned);
  2597. UInt32 resultPropertyID = 0;
  2598. CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_AddMultiProperty (Handle, (UInt64) APropertyIDs.Length, dataPropertyIDs.AddrOfPinnedObject(), out resultPropertyID));
  2599. dataPropertyIDs.Free ();
  2600. return resultPropertyID;
  2601. }
  2602. public void SetMultiProperty (UInt32 APropertyID, UInt32[] APropertyIDs)
  2603. {
  2604. GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned);
  2605. CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_SetMultiProperty (Handle, APropertyID, (UInt64) APropertyIDs.Length, dataPropertyIDs.AddrOfPinnedObject()));
  2606. dataPropertyIDs.Free ();
  2607. }
  2608. public void GetMultiProperty (UInt32 APropertyID, out UInt32[] APropertyIDs)
  2609. {
  2610. UInt64 sizePropertyIDs = 0;
  2611. UInt64 neededPropertyIDs = 0;
  2612. CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetMultiProperty (Handle, APropertyID, sizePropertyIDs, out neededPropertyIDs, IntPtr.Zero));
  2613. sizePropertyIDs = neededPropertyIDs;
  2614. APropertyIDs = new UInt32[sizePropertyIDs];
  2615. GCHandle dataPropertyIDs = GCHandle.Alloc(APropertyIDs, GCHandleType.Pinned);
  2616. CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetMultiProperty (Handle, APropertyID, sizePropertyIDs, out neededPropertyIDs, dataPropertyIDs.AddrOfPinnedObject()));
  2617. dataPropertyIDs.Free();
  2618. }
  2619. public void RemoveMultiProperty (UInt32 APropertyID)
  2620. {
  2621. CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_RemoveMultiProperty (Handle, APropertyID));
  2622. }
  2623. public UInt32 GetLayerCount ()
  2624. {
  2625. UInt32 resultCount = 0;
  2626. CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetLayerCount (Handle, out resultCount));
  2627. return resultCount;
  2628. }
  2629. public UInt32 AddLayer (sMultiPropertyLayer ATheLayer)
  2630. {
  2631. Internal.InternalMultiPropertyLayer intTheLayer = Internal.Lib3MFWrapper.convertStructToInternal_MultiPropertyLayer (ATheLayer);
  2632. UInt32 resultLayerIndex = 0;
  2633. CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_AddLayer (Handle, intTheLayer, out resultLayerIndex));
  2634. return resultLayerIndex;
  2635. }
  2636. public sMultiPropertyLayer GetLayer (UInt32 ALayerIndex)
  2637. {
  2638. Internal.InternalMultiPropertyLayer intresultTheLayer;
  2639. CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_GetLayer (Handle, ALayerIndex, out intresultTheLayer));
  2640. return Internal.Lib3MFWrapper.convertInternalToStruct_MultiPropertyLayer (intresultTheLayer);
  2641. }
  2642. public void RemoveLayer (UInt32 ALayerIndex)
  2643. {
  2644. CheckError(Internal.Lib3MFWrapper.MultiPropertyGroup_RemoveLayer (Handle, ALayerIndex));
  2645. }
  2646. }
  2647. public class CAttachment : CBase
  2648. {
  2649. public CAttachment (IntPtr NewHandle) : base (NewHandle)
  2650. {
  2651. }
  2652. public String GetPath ()
  2653. {
  2654. UInt32 sizePath = 0;
  2655. UInt32 neededPath = 0;
  2656. CheckError(Internal.Lib3MFWrapper.Attachment_GetPath (Handle, sizePath, out neededPath, IntPtr.Zero));
  2657. sizePath = neededPath;
  2658. byte[] bytesPath = new byte[sizePath];
  2659. GCHandle dataPath = GCHandle.Alloc(bytesPath, GCHandleType.Pinned);
  2660. CheckError(Internal.Lib3MFWrapper.Attachment_GetPath (Handle, sizePath, out neededPath, dataPath.AddrOfPinnedObject()));
  2661. dataPath.Free();
  2662. return Encoding.UTF8.GetString(bytesPath).TrimEnd(char.MinValue);
  2663. }
  2664. public void SetPath (String APath)
  2665. {
  2666. byte[] bytePath = Encoding.UTF8.GetBytes(APath + char.MinValue);
  2667. CheckError(Internal.Lib3MFWrapper.Attachment_SetPath (Handle, bytePath));
  2668. }
  2669. public CPackagePart PackagePart ()
  2670. {
  2671. IntPtr newPackagePart = IntPtr.Zero;
  2672. CheckError(Internal.Lib3MFWrapper.Attachment_PackagePart (Handle, out newPackagePart));
  2673. return new CPackagePart (newPackagePart );
  2674. }
  2675. public String GetRelationShipType ()
  2676. {
  2677. UInt32 sizePath = 0;
  2678. UInt32 neededPath = 0;
  2679. CheckError(Internal.Lib3MFWrapper.Attachment_GetRelationShipType (Handle, sizePath, out neededPath, IntPtr.Zero));
  2680. sizePath = neededPath;
  2681. byte[] bytesPath = new byte[sizePath];
  2682. GCHandle dataPath = GCHandle.Alloc(bytesPath, GCHandleType.Pinned);
  2683. CheckError(Internal.Lib3MFWrapper.Attachment_GetRelationShipType (Handle, sizePath, out neededPath, dataPath.AddrOfPinnedObject()));
  2684. dataPath.Free();
  2685. return Encoding.UTF8.GetString(bytesPath).TrimEnd(char.MinValue);
  2686. }
  2687. public void SetRelationShipType (String APath)
  2688. {
  2689. byte[] bytePath = Encoding.UTF8.GetBytes(APath + char.MinValue);
  2690. CheckError(Internal.Lib3MFWrapper.Attachment_SetRelationShipType (Handle, bytePath));
  2691. }
  2692. public void WriteToFile (String AFileName)
  2693. {
  2694. byte[] byteFileName = Encoding.UTF8.GetBytes(AFileName + char.MinValue);
  2695. CheckError(Internal.Lib3MFWrapper.Attachment_WriteToFile (Handle, byteFileName));
  2696. }
  2697. public void ReadFromFile (String AFileName)
  2698. {
  2699. byte[] byteFileName = Encoding.UTF8.GetBytes(AFileName + char.MinValue);
  2700. CheckError(Internal.Lib3MFWrapper.Attachment_ReadFromFile (Handle, byteFileName));
  2701. }
  2702. public UInt64 GetStreamSize ()
  2703. {
  2704. UInt64 resultStreamSize = 0;
  2705. CheckError(Internal.Lib3MFWrapper.Attachment_GetStreamSize (Handle, out resultStreamSize));
  2706. return resultStreamSize;
  2707. }
  2708. public void WriteToBuffer (out Byte[] ABuffer)
  2709. {
  2710. UInt64 sizeBuffer = 0;
  2711. UInt64 neededBuffer = 0;
  2712. CheckError(Internal.Lib3MFWrapper.Attachment_WriteToBuffer (Handle, sizeBuffer, out neededBuffer, IntPtr.Zero));
  2713. sizeBuffer = neededBuffer;
  2714. ABuffer = new Byte[sizeBuffer];
  2715. GCHandle dataBuffer = GCHandle.Alloc(ABuffer, GCHandleType.Pinned);
  2716. CheckError(Internal.Lib3MFWrapper.Attachment_WriteToBuffer (Handle, sizeBuffer, out neededBuffer, dataBuffer.AddrOfPinnedObject()));
  2717. dataBuffer.Free();
  2718. }
  2719. public void ReadFromBuffer (Byte[] ABuffer)
  2720. {
  2721. GCHandle dataBuffer = GCHandle.Alloc(ABuffer, GCHandleType.Pinned);
  2722. CheckError(Internal.Lib3MFWrapper.Attachment_ReadFromBuffer (Handle, (UInt64) ABuffer.Length, dataBuffer.AddrOfPinnedObject()));
  2723. dataBuffer.Free ();
  2724. }
  2725. }
  2726. public class CTexture2D : CResource
  2727. {
  2728. public CTexture2D (IntPtr NewHandle) : base (NewHandle)
  2729. {
  2730. }
  2731. public CAttachment GetAttachment ()
  2732. {
  2733. IntPtr newAttachment = IntPtr.Zero;
  2734. CheckError(Internal.Lib3MFWrapper.Texture2D_GetAttachment (Handle, out newAttachment));
  2735. return new CAttachment (newAttachment );
  2736. }
  2737. public void SetAttachment (CAttachment AAttachment)
  2738. {
  2739. CheckError(Internal.Lib3MFWrapper.Texture2D_SetAttachment (Handle, AAttachment.GetHandle()));
  2740. }
  2741. public eTextureType GetContentType ()
  2742. {
  2743. Int32 resultContentType = 0;
  2744. CheckError(Internal.Lib3MFWrapper.Texture2D_GetContentType (Handle, out resultContentType));
  2745. return (eTextureType) (resultContentType);
  2746. }
  2747. public void SetContentType (eTextureType AContentType)
  2748. {
  2749. Int32 enumContentType = (Int32) AContentType;
  2750. CheckError(Internal.Lib3MFWrapper.Texture2D_SetContentType (Handle, enumContentType));
  2751. }
  2752. public void GetTileStyleUV (out eTextureTileStyle ATileStyleU, out eTextureTileStyle ATileStyleV)
  2753. {
  2754. Int32 resultTileStyleU = 0;
  2755. Int32 resultTileStyleV = 0;
  2756. CheckError(Internal.Lib3MFWrapper.Texture2D_GetTileStyleUV (Handle, out resultTileStyleU, out resultTileStyleV));
  2757. ATileStyleU = (eTextureTileStyle) (resultTileStyleU);
  2758. ATileStyleV = (eTextureTileStyle) (resultTileStyleV);
  2759. }
  2760. public void SetTileStyleUV (eTextureTileStyle ATileStyleU, eTextureTileStyle ATileStyleV)
  2761. {
  2762. Int32 enumTileStyleU = (Int32) ATileStyleU;
  2763. Int32 enumTileStyleV = (Int32) ATileStyleV;
  2764. CheckError(Internal.Lib3MFWrapper.Texture2D_SetTileStyleUV (Handle, enumTileStyleU, enumTileStyleV));
  2765. }
  2766. public eTextureFilter GetFilter ()
  2767. {
  2768. Int32 resultFilter = 0;
  2769. CheckError(Internal.Lib3MFWrapper.Texture2D_GetFilter (Handle, out resultFilter));
  2770. return (eTextureFilter) (resultFilter);
  2771. }
  2772. public void SetFilter (eTextureFilter AFilter)
  2773. {
  2774. Int32 enumFilter = (Int32) AFilter;
  2775. CheckError(Internal.Lib3MFWrapper.Texture2D_SetFilter (Handle, enumFilter));
  2776. }
  2777. }
  2778. public class CBuildItem : CBase
  2779. {
  2780. public CBuildItem (IntPtr NewHandle) : base (NewHandle)
  2781. {
  2782. }
  2783. public CObject GetObjectResource ()
  2784. {
  2785. IntPtr newObjectResource = IntPtr.Zero;
  2786. CheckError(Internal.Lib3MFWrapper.BuildItem_GetObjectResource (Handle, out newObjectResource));
  2787. return new CObject (newObjectResource );
  2788. }
  2789. public String GetUUID (out bool AHasUUID)
  2790. {
  2791. Byte resultHasUUID = 0;
  2792. UInt32 sizeUUID = 0;
  2793. UInt32 neededUUID = 0;
  2794. CheckError(Internal.Lib3MFWrapper.BuildItem_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, IntPtr.Zero));
  2795. sizeUUID = neededUUID;
  2796. byte[] bytesUUID = new byte[sizeUUID];
  2797. GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned);
  2798. CheckError(Internal.Lib3MFWrapper.BuildItem_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject()));
  2799. AHasUUID = (resultHasUUID != 0);
  2800. dataUUID.Free();
  2801. return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue);
  2802. }
  2803. public void SetUUID (String AUUID)
  2804. {
  2805. byte[] byteUUID = Encoding.UTF8.GetBytes(AUUID + char.MinValue);
  2806. CheckError(Internal.Lib3MFWrapper.BuildItem_SetUUID (Handle, byteUUID));
  2807. }
  2808. public UInt32 GetObjectResourceID ()
  2809. {
  2810. UInt32 resultUniqueResourceID = 0;
  2811. CheckError(Internal.Lib3MFWrapper.BuildItem_GetObjectResourceID (Handle, out resultUniqueResourceID));
  2812. return resultUniqueResourceID;
  2813. }
  2814. public bool HasObjectTransform ()
  2815. {
  2816. Byte resultHasTransform = 0;
  2817. CheckError(Internal.Lib3MFWrapper.BuildItem_HasObjectTransform (Handle, out resultHasTransform));
  2818. return (resultHasTransform != 0);
  2819. }
  2820. public sTransform GetObjectTransform ()
  2821. {
  2822. Internal.InternalTransform intresultTransform;
  2823. CheckError(Internal.Lib3MFWrapper.BuildItem_GetObjectTransform (Handle, out intresultTransform));
  2824. return Internal.Lib3MFWrapper.convertInternalToStruct_Transform (intresultTransform);
  2825. }
  2826. public void SetObjectTransform (sTransform ATransform)
  2827. {
  2828. Internal.InternalTransform intTransform = Internal.Lib3MFWrapper.convertStructToInternal_Transform (ATransform);
  2829. CheckError(Internal.Lib3MFWrapper.BuildItem_SetObjectTransform (Handle, intTransform));
  2830. }
  2831. public String GetPartNumber ()
  2832. {
  2833. UInt32 sizePartNumber = 0;
  2834. UInt32 neededPartNumber = 0;
  2835. CheckError(Internal.Lib3MFWrapper.BuildItem_GetPartNumber (Handle, sizePartNumber, out neededPartNumber, IntPtr.Zero));
  2836. sizePartNumber = neededPartNumber;
  2837. byte[] bytesPartNumber = new byte[sizePartNumber];
  2838. GCHandle dataPartNumber = GCHandle.Alloc(bytesPartNumber, GCHandleType.Pinned);
  2839. CheckError(Internal.Lib3MFWrapper.BuildItem_GetPartNumber (Handle, sizePartNumber, out neededPartNumber, dataPartNumber.AddrOfPinnedObject()));
  2840. dataPartNumber.Free();
  2841. return Encoding.UTF8.GetString(bytesPartNumber).TrimEnd(char.MinValue);
  2842. }
  2843. public void SetPartNumber (String ASetPartnumber)
  2844. {
  2845. byte[] byteSetPartnumber = Encoding.UTF8.GetBytes(ASetPartnumber + char.MinValue);
  2846. CheckError(Internal.Lib3MFWrapper.BuildItem_SetPartNumber (Handle, byteSetPartnumber));
  2847. }
  2848. public CMetaDataGroup GetMetaDataGroup ()
  2849. {
  2850. IntPtr newMetaDataGroup = IntPtr.Zero;
  2851. CheckError(Internal.Lib3MFWrapper.BuildItem_GetMetaDataGroup (Handle, out newMetaDataGroup));
  2852. return new CMetaDataGroup (newMetaDataGroup );
  2853. }
  2854. public sBox GetOutbox ()
  2855. {
  2856. Internal.InternalBox intresultOutbox;
  2857. CheckError(Internal.Lib3MFWrapper.BuildItem_GetOutbox (Handle, out intresultOutbox));
  2858. return Internal.Lib3MFWrapper.convertInternalToStruct_Box (intresultOutbox);
  2859. }
  2860. }
  2861. public class CBuildItemIterator : CBase
  2862. {
  2863. public CBuildItemIterator (IntPtr NewHandle) : base (NewHandle)
  2864. {
  2865. }
  2866. public bool MoveNext ()
  2867. {
  2868. Byte resultHasNext = 0;
  2869. CheckError(Internal.Lib3MFWrapper.BuildItemIterator_MoveNext (Handle, out resultHasNext));
  2870. return (resultHasNext != 0);
  2871. }
  2872. public bool MovePrevious ()
  2873. {
  2874. Byte resultHasPrevious = 0;
  2875. CheckError(Internal.Lib3MFWrapper.BuildItemIterator_MovePrevious (Handle, out resultHasPrevious));
  2876. return (resultHasPrevious != 0);
  2877. }
  2878. public CBuildItem GetCurrent ()
  2879. {
  2880. IntPtr newBuildItem = IntPtr.Zero;
  2881. CheckError(Internal.Lib3MFWrapper.BuildItemIterator_GetCurrent (Handle, out newBuildItem));
  2882. return new CBuildItem (newBuildItem );
  2883. }
  2884. public CBuildItemIterator Clone ()
  2885. {
  2886. IntPtr newOutBuildItemIterator = IntPtr.Zero;
  2887. CheckError(Internal.Lib3MFWrapper.BuildItemIterator_Clone (Handle, out newOutBuildItemIterator));
  2888. return new CBuildItemIterator (newOutBuildItemIterator );
  2889. }
  2890. public UInt64 Count ()
  2891. {
  2892. UInt64 resultCount = 0;
  2893. CheckError(Internal.Lib3MFWrapper.BuildItemIterator_Count (Handle, out resultCount));
  2894. return resultCount;
  2895. }
  2896. }
  2897. public class CSlice : CBase
  2898. {
  2899. public CSlice (IntPtr NewHandle) : base (NewHandle)
  2900. {
  2901. }
  2902. public void SetVertices (sPosition2D[] AVertices)
  2903. {
  2904. Internal.InternalPosition2D[] intdataVertices = new Internal.InternalPosition2D[AVertices.Length];
  2905. for (int index = 0; index < AVertices.Length; index++)
  2906. intdataVertices[index] = Internal.Lib3MFWrapper.convertStructToInternal_Position2D(AVertices[index]);
  2907. GCHandle dataVertices = GCHandle.Alloc(intdataVertices, GCHandleType.Pinned);
  2908. CheckError(Internal.Lib3MFWrapper.Slice_SetVertices (Handle, (UInt64) AVertices.Length, dataVertices.AddrOfPinnedObject()));
  2909. dataVertices.Free ();
  2910. }
  2911. public void GetVertices (out sPosition2D[] AVertices)
  2912. {
  2913. UInt64 sizeVertices = 0;
  2914. UInt64 neededVertices = 0;
  2915. CheckError(Internal.Lib3MFWrapper.Slice_GetVertices (Handle, sizeVertices, out neededVertices, IntPtr.Zero));
  2916. sizeVertices = neededVertices;
  2917. var arrayVertices = new Internal.InternalPosition2D[sizeVertices];
  2918. GCHandle dataVertices = GCHandle.Alloc(arrayVertices, GCHandleType.Pinned);
  2919. CheckError(Internal.Lib3MFWrapper.Slice_GetVertices (Handle, sizeVertices, out neededVertices, dataVertices.AddrOfPinnedObject()));
  2920. dataVertices.Free();
  2921. AVertices = new sPosition2D[sizeVertices];
  2922. for (int index = 0; index < AVertices.Length; index++)
  2923. AVertices[index] = Internal.Lib3MFWrapper.convertInternalToStruct_Position2D(arrayVertices[index]);
  2924. }
  2925. public UInt64 GetVertexCount ()
  2926. {
  2927. UInt64 resultCount = 0;
  2928. CheckError(Internal.Lib3MFWrapper.Slice_GetVertexCount (Handle, out resultCount));
  2929. return resultCount;
  2930. }
  2931. public UInt64 AddPolygon (UInt32[] AIndices)
  2932. {
  2933. GCHandle dataIndices = GCHandle.Alloc(AIndices, GCHandleType.Pinned);
  2934. UInt64 resultIndex = 0;
  2935. CheckError(Internal.Lib3MFWrapper.Slice_AddPolygon (Handle, (UInt64) AIndices.Length, dataIndices.AddrOfPinnedObject(), out resultIndex));
  2936. dataIndices.Free ();
  2937. return resultIndex;
  2938. }
  2939. public UInt64 GetPolygonCount ()
  2940. {
  2941. UInt64 resultCount = 0;
  2942. CheckError(Internal.Lib3MFWrapper.Slice_GetPolygonCount (Handle, out resultCount));
  2943. return resultCount;
  2944. }
  2945. public void SetPolygonIndices (UInt64 AIndex, UInt32[] AIndices)
  2946. {
  2947. GCHandle dataIndices = GCHandle.Alloc(AIndices, GCHandleType.Pinned);
  2948. CheckError(Internal.Lib3MFWrapper.Slice_SetPolygonIndices (Handle, AIndex, (UInt64) AIndices.Length, dataIndices.AddrOfPinnedObject()));
  2949. dataIndices.Free ();
  2950. }
  2951. public void GetPolygonIndices (UInt64 AIndex, out UInt32[] AIndices)
  2952. {
  2953. UInt64 sizeIndices = 0;
  2954. UInt64 neededIndices = 0;
  2955. CheckError(Internal.Lib3MFWrapper.Slice_GetPolygonIndices (Handle, AIndex, sizeIndices, out neededIndices, IntPtr.Zero));
  2956. sizeIndices = neededIndices;
  2957. AIndices = new UInt32[sizeIndices];
  2958. GCHandle dataIndices = GCHandle.Alloc(AIndices, GCHandleType.Pinned);
  2959. CheckError(Internal.Lib3MFWrapper.Slice_GetPolygonIndices (Handle, AIndex, sizeIndices, out neededIndices, dataIndices.AddrOfPinnedObject()));
  2960. dataIndices.Free();
  2961. }
  2962. public UInt64 GetPolygonIndexCount (UInt64 AIndex)
  2963. {
  2964. UInt64 resultCount = 0;
  2965. CheckError(Internal.Lib3MFWrapper.Slice_GetPolygonIndexCount (Handle, AIndex, out resultCount));
  2966. return resultCount;
  2967. }
  2968. public Double GetZTop ()
  2969. {
  2970. Double resultZTop = 0;
  2971. CheckError(Internal.Lib3MFWrapper.Slice_GetZTop (Handle, out resultZTop));
  2972. return resultZTop;
  2973. }
  2974. }
  2975. public class CSliceStack : CResource
  2976. {
  2977. public CSliceStack (IntPtr NewHandle) : base (NewHandle)
  2978. {
  2979. }
  2980. public Double GetBottomZ ()
  2981. {
  2982. Double resultZBottom = 0;
  2983. CheckError(Internal.Lib3MFWrapper.SliceStack_GetBottomZ (Handle, out resultZBottom));
  2984. return resultZBottom;
  2985. }
  2986. public UInt64 GetSliceCount ()
  2987. {
  2988. UInt64 resultCount = 0;
  2989. CheckError(Internal.Lib3MFWrapper.SliceStack_GetSliceCount (Handle, out resultCount));
  2990. return resultCount;
  2991. }
  2992. public CSlice GetSlice (UInt64 ASliceIndex)
  2993. {
  2994. IntPtr newTheSlice = IntPtr.Zero;
  2995. CheckError(Internal.Lib3MFWrapper.SliceStack_GetSlice (Handle, ASliceIndex, out newTheSlice));
  2996. return new CSlice (newTheSlice );
  2997. }
  2998. public CSlice AddSlice (Double AZTop)
  2999. {
  3000. IntPtr newTheSlice = IntPtr.Zero;
  3001. CheckError(Internal.Lib3MFWrapper.SliceStack_AddSlice (Handle, AZTop, out newTheSlice));
  3002. return new CSlice (newTheSlice );
  3003. }
  3004. public UInt64 GetSliceRefCount ()
  3005. {
  3006. UInt64 resultCount = 0;
  3007. CheckError(Internal.Lib3MFWrapper.SliceStack_GetSliceRefCount (Handle, out resultCount));
  3008. return resultCount;
  3009. }
  3010. public void AddSliceStackReference (CSliceStack ATheSliceStack)
  3011. {
  3012. CheckError(Internal.Lib3MFWrapper.SliceStack_AddSliceStackReference (Handle, ATheSliceStack.GetHandle()));
  3013. }
  3014. public CSliceStack GetSliceStackReference (UInt64 ASliceRefIndex)
  3015. {
  3016. IntPtr newTheSliceStack = IntPtr.Zero;
  3017. CheckError(Internal.Lib3MFWrapper.SliceStack_GetSliceStackReference (Handle, ASliceRefIndex, out newTheSliceStack));
  3018. return new CSliceStack (newTheSliceStack );
  3019. }
  3020. public void CollapseSliceReferences ()
  3021. {
  3022. CheckError(Internal.Lib3MFWrapper.SliceStack_CollapseSliceReferences (Handle));
  3023. }
  3024. public void SetOwnPath (String APath)
  3025. {
  3026. byte[] bytePath = Encoding.UTF8.GetBytes(APath + char.MinValue);
  3027. CheckError(Internal.Lib3MFWrapper.SliceStack_SetOwnPath (Handle, bytePath));
  3028. }
  3029. public String GetOwnPath ()
  3030. {
  3031. UInt32 sizePath = 0;
  3032. UInt32 neededPath = 0;
  3033. CheckError(Internal.Lib3MFWrapper.SliceStack_GetOwnPath (Handle, sizePath, out neededPath, IntPtr.Zero));
  3034. sizePath = neededPath;
  3035. byte[] bytesPath = new byte[sizePath];
  3036. GCHandle dataPath = GCHandle.Alloc(bytesPath, GCHandleType.Pinned);
  3037. CheckError(Internal.Lib3MFWrapper.SliceStack_GetOwnPath (Handle, sizePath, out neededPath, dataPath.AddrOfPinnedObject()));
  3038. dataPath.Free();
  3039. return Encoding.UTF8.GetString(bytesPath).TrimEnd(char.MinValue);
  3040. }
  3041. }
  3042. public class CConsumer : CBase
  3043. {
  3044. public CConsumer (IntPtr NewHandle) : base (NewHandle)
  3045. {
  3046. }
  3047. public String GetConsumerID ()
  3048. {
  3049. UInt32 sizeConsumerID = 0;
  3050. UInt32 neededConsumerID = 0;
  3051. CheckError(Internal.Lib3MFWrapper.Consumer_GetConsumerID (Handle, sizeConsumerID, out neededConsumerID, IntPtr.Zero));
  3052. sizeConsumerID = neededConsumerID;
  3053. byte[] bytesConsumerID = new byte[sizeConsumerID];
  3054. GCHandle dataConsumerID = GCHandle.Alloc(bytesConsumerID, GCHandleType.Pinned);
  3055. CheckError(Internal.Lib3MFWrapper.Consumer_GetConsumerID (Handle, sizeConsumerID, out neededConsumerID, dataConsumerID.AddrOfPinnedObject()));
  3056. dataConsumerID.Free();
  3057. return Encoding.UTF8.GetString(bytesConsumerID).TrimEnd(char.MinValue);
  3058. }
  3059. public String GetKeyID ()
  3060. {
  3061. UInt32 sizeKeyID = 0;
  3062. UInt32 neededKeyID = 0;
  3063. CheckError(Internal.Lib3MFWrapper.Consumer_GetKeyID (Handle, sizeKeyID, out neededKeyID, IntPtr.Zero));
  3064. sizeKeyID = neededKeyID;
  3065. byte[] bytesKeyID = new byte[sizeKeyID];
  3066. GCHandle dataKeyID = GCHandle.Alloc(bytesKeyID, GCHandleType.Pinned);
  3067. CheckError(Internal.Lib3MFWrapper.Consumer_GetKeyID (Handle, sizeKeyID, out neededKeyID, dataKeyID.AddrOfPinnedObject()));
  3068. dataKeyID.Free();
  3069. return Encoding.UTF8.GetString(bytesKeyID).TrimEnd(char.MinValue);
  3070. }
  3071. public String GetKeyValue ()
  3072. {
  3073. UInt32 sizeKeyValue = 0;
  3074. UInt32 neededKeyValue = 0;
  3075. CheckError(Internal.Lib3MFWrapper.Consumer_GetKeyValue (Handle, sizeKeyValue, out neededKeyValue, IntPtr.Zero));
  3076. sizeKeyValue = neededKeyValue;
  3077. byte[] bytesKeyValue = new byte[sizeKeyValue];
  3078. GCHandle dataKeyValue = GCHandle.Alloc(bytesKeyValue, GCHandleType.Pinned);
  3079. CheckError(Internal.Lib3MFWrapper.Consumer_GetKeyValue (Handle, sizeKeyValue, out neededKeyValue, dataKeyValue.AddrOfPinnedObject()));
  3080. dataKeyValue.Free();
  3081. return Encoding.UTF8.GetString(bytesKeyValue).TrimEnd(char.MinValue);
  3082. }
  3083. }
  3084. public class CAccessRight : CBase
  3085. {
  3086. public CAccessRight (IntPtr NewHandle) : base (NewHandle)
  3087. {
  3088. }
  3089. public CConsumer GetConsumer ()
  3090. {
  3091. IntPtr newConsumer = IntPtr.Zero;
  3092. CheckError(Internal.Lib3MFWrapper.AccessRight_GetConsumer (Handle, out newConsumer));
  3093. return new CConsumer (newConsumer );
  3094. }
  3095. public eWrappingAlgorithm GetWrappingAlgorithm ()
  3096. {
  3097. Int32 resultAlgorithm = 0;
  3098. CheckError(Internal.Lib3MFWrapper.AccessRight_GetWrappingAlgorithm (Handle, out resultAlgorithm));
  3099. return (eWrappingAlgorithm) (resultAlgorithm);
  3100. }
  3101. public eMgfAlgorithm GetMgfAlgorithm ()
  3102. {
  3103. Int32 resultAlgorithm = 0;
  3104. CheckError(Internal.Lib3MFWrapper.AccessRight_GetMgfAlgorithm (Handle, out resultAlgorithm));
  3105. return (eMgfAlgorithm) (resultAlgorithm);
  3106. }
  3107. public eDigestMethod GetDigestMethod ()
  3108. {
  3109. Int32 resultAlgorithm = 0;
  3110. CheckError(Internal.Lib3MFWrapper.AccessRight_GetDigestMethod (Handle, out resultAlgorithm));
  3111. return (eDigestMethod) (resultAlgorithm);
  3112. }
  3113. }
  3114. public class CContentEncryptionParams : CBase
  3115. {
  3116. public CContentEncryptionParams (IntPtr NewHandle) : base (NewHandle)
  3117. {
  3118. }
  3119. public eEncryptionAlgorithm GetEncryptionAlgorithm ()
  3120. {
  3121. Int32 resultAlgorithm = 0;
  3122. CheckError(Internal.Lib3MFWrapper.ContentEncryptionParams_GetEncryptionAlgorithm (Handle, out resultAlgorithm));
  3123. return (eEncryptionAlgorithm) (resultAlgorithm);
  3124. }
  3125. public void GetKey (out Byte[] AByteData)
  3126. {
  3127. UInt64 sizeByteData = 0;
  3128. UInt64 neededByteData = 0;
  3129. CheckError(Internal.Lib3MFWrapper.ContentEncryptionParams_GetKey (Handle, sizeByteData, out neededByteData, IntPtr.Zero));
  3130. sizeByteData = neededByteData;
  3131. AByteData = new Byte[sizeByteData];
  3132. GCHandle dataByteData = GCHandle.Alloc(AByteData, GCHandleType.Pinned);
  3133. CheckError(Internal.Lib3MFWrapper.ContentEncryptionParams_GetKey (Handle, sizeByteData, out neededByteData, dataByteData.AddrOfPinnedObject()));
  3134. dataByteData.Free();
  3135. }
  3136. public void GetInitializationVector (out Byte[] AByteData)
  3137. {
  3138. UInt64 sizeByteData = 0;
  3139. UInt64 neededByteData = 0;
  3140. CheckError(Internal.Lib3MFWrapper.ContentEncryptionParams_GetInitializationVector (Handle, sizeByteData, out neededByteData, IntPtr.Zero));
  3141. sizeByteData = neededByteData;
  3142. AByteData = new Byte[sizeByteData];
  3143. GCHandle dataByteData = GCHandle.Alloc(AByteData, GCHandleType.Pinned);
  3144. CheckError(Internal.Lib3MFWrapper.ContentEncryptionParams_GetInitializationVector (Handle, sizeByteData, out neededByteData, dataByteData.AddrOfPinnedObject()));
  3145. dataByteData.Free();
  3146. }
  3147. public void GetAuthenticationTag (out Byte[] AByteData)
  3148. {
  3149. UInt64 sizeByteData = 0;
  3150. UInt64 neededByteData = 0;
  3151. CheckError(Internal.Lib3MFWrapper.ContentEncryptionParams_GetAuthenticationTag (Handle, sizeByteData, out neededByteData, IntPtr.Zero));
  3152. sizeByteData = neededByteData;
  3153. AByteData = new Byte[sizeByteData];
  3154. GCHandle dataByteData = GCHandle.Alloc(AByteData, GCHandleType.Pinned);
  3155. CheckError(Internal.Lib3MFWrapper.ContentEncryptionParams_GetAuthenticationTag (Handle, sizeByteData, out neededByteData, dataByteData.AddrOfPinnedObject()));
  3156. dataByteData.Free();
  3157. }
  3158. public void SetAuthenticationTag (Byte[] AByteData)
  3159. {
  3160. GCHandle dataByteData = GCHandle.Alloc(AByteData, GCHandleType.Pinned);
  3161. CheckError(Internal.Lib3MFWrapper.ContentEncryptionParams_SetAuthenticationTag (Handle, (UInt64) AByteData.Length, dataByteData.AddrOfPinnedObject()));
  3162. dataByteData.Free ();
  3163. }
  3164. public void GetAdditionalAuthenticationData (out Byte[] AByteData)
  3165. {
  3166. UInt64 sizeByteData = 0;
  3167. UInt64 neededByteData = 0;
  3168. CheckError(Internal.Lib3MFWrapper.ContentEncryptionParams_GetAdditionalAuthenticationData (Handle, sizeByteData, out neededByteData, IntPtr.Zero));
  3169. sizeByteData = neededByteData;
  3170. AByteData = new Byte[sizeByteData];
  3171. GCHandle dataByteData = GCHandle.Alloc(AByteData, GCHandleType.Pinned);
  3172. CheckError(Internal.Lib3MFWrapper.ContentEncryptionParams_GetAdditionalAuthenticationData (Handle, sizeByteData, out neededByteData, dataByteData.AddrOfPinnedObject()));
  3173. dataByteData.Free();
  3174. }
  3175. public UInt64 GetDescriptor ()
  3176. {
  3177. UInt64 resultDescriptor = 0;
  3178. CheckError(Internal.Lib3MFWrapper.ContentEncryptionParams_GetDescriptor (Handle, out resultDescriptor));
  3179. return resultDescriptor;
  3180. }
  3181. public String GetKeyUUID ()
  3182. {
  3183. UInt32 sizeUUID = 0;
  3184. UInt32 neededUUID = 0;
  3185. CheckError(Internal.Lib3MFWrapper.ContentEncryptionParams_GetKeyUUID (Handle, sizeUUID, out neededUUID, IntPtr.Zero));
  3186. sizeUUID = neededUUID;
  3187. byte[] bytesUUID = new byte[sizeUUID];
  3188. GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned);
  3189. CheckError(Internal.Lib3MFWrapper.ContentEncryptionParams_GetKeyUUID (Handle, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject()));
  3190. dataUUID.Free();
  3191. return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue);
  3192. }
  3193. }
  3194. public class CResourceData : CBase
  3195. {
  3196. public CResourceData (IntPtr NewHandle) : base (NewHandle)
  3197. {
  3198. }
  3199. public CPackagePart GetPath ()
  3200. {
  3201. IntPtr newPath = IntPtr.Zero;
  3202. CheckError(Internal.Lib3MFWrapper.ResourceData_GetPath (Handle, out newPath));
  3203. return new CPackagePart (newPath );
  3204. }
  3205. public eEncryptionAlgorithm GetEncryptionAlgorithm ()
  3206. {
  3207. Int32 resultEncryptionAlgorithm = 0;
  3208. CheckError(Internal.Lib3MFWrapper.ResourceData_GetEncryptionAlgorithm (Handle, out resultEncryptionAlgorithm));
  3209. return (eEncryptionAlgorithm) (resultEncryptionAlgorithm);
  3210. }
  3211. public eCompression GetCompression ()
  3212. {
  3213. Int32 resultCompression = 0;
  3214. CheckError(Internal.Lib3MFWrapper.ResourceData_GetCompression (Handle, out resultCompression));
  3215. return (eCompression) (resultCompression);
  3216. }
  3217. public void GetAdditionalAuthenticationData (out Byte[] AByteData)
  3218. {
  3219. UInt64 sizeByteData = 0;
  3220. UInt64 neededByteData = 0;
  3221. CheckError(Internal.Lib3MFWrapper.ResourceData_GetAdditionalAuthenticationData (Handle, sizeByteData, out neededByteData, IntPtr.Zero));
  3222. sizeByteData = neededByteData;
  3223. AByteData = new Byte[sizeByteData];
  3224. GCHandle dataByteData = GCHandle.Alloc(AByteData, GCHandleType.Pinned);
  3225. CheckError(Internal.Lib3MFWrapper.ResourceData_GetAdditionalAuthenticationData (Handle, sizeByteData, out neededByteData, dataByteData.AddrOfPinnedObject()));
  3226. dataByteData.Free();
  3227. }
  3228. }
  3229. public class CResourceDataGroup : CBase
  3230. {
  3231. public CResourceDataGroup (IntPtr NewHandle) : base (NewHandle)
  3232. {
  3233. }
  3234. public String GetKeyUUID ()
  3235. {
  3236. UInt32 sizeUUID = 0;
  3237. UInt32 neededUUID = 0;
  3238. CheckError(Internal.Lib3MFWrapper.ResourceDataGroup_GetKeyUUID (Handle, sizeUUID, out neededUUID, IntPtr.Zero));
  3239. sizeUUID = neededUUID;
  3240. byte[] bytesUUID = new byte[sizeUUID];
  3241. GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned);
  3242. CheckError(Internal.Lib3MFWrapper.ResourceDataGroup_GetKeyUUID (Handle, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject()));
  3243. dataUUID.Free();
  3244. return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue);
  3245. }
  3246. public CAccessRight AddAccessRight (CConsumer AConsumer, eWrappingAlgorithm AWrappingAlgorithm, eMgfAlgorithm AMgfAlgorithm, eDigestMethod ADigestMethod)
  3247. {
  3248. Int32 enumWrappingAlgorithm = (Int32) AWrappingAlgorithm;
  3249. Int32 enumMgfAlgorithm = (Int32) AMgfAlgorithm;
  3250. Int32 enumDigestMethod = (Int32) ADigestMethod;
  3251. IntPtr newTheAccessRight = IntPtr.Zero;
  3252. CheckError(Internal.Lib3MFWrapper.ResourceDataGroup_AddAccessRight (Handle, AConsumer.GetHandle(), enumWrappingAlgorithm, enumMgfAlgorithm, enumDigestMethod, out newTheAccessRight));
  3253. return new CAccessRight (newTheAccessRight );
  3254. }
  3255. public CAccessRight FindAccessRightByConsumer (CConsumer AConsumer)
  3256. {
  3257. IntPtr newTheAccessRight = IntPtr.Zero;
  3258. CheckError(Internal.Lib3MFWrapper.ResourceDataGroup_FindAccessRightByConsumer (Handle, AConsumer.GetHandle(), out newTheAccessRight));
  3259. return new CAccessRight (newTheAccessRight );
  3260. }
  3261. public void RemoveAccessRight (CConsumer AConsumer)
  3262. {
  3263. CheckError(Internal.Lib3MFWrapper.ResourceDataGroup_RemoveAccessRight (Handle, AConsumer.GetHandle()));
  3264. }
  3265. }
  3266. public class CKeyStore : CBase
  3267. {
  3268. public CKeyStore (IntPtr NewHandle) : base (NewHandle)
  3269. {
  3270. }
  3271. public CConsumer AddConsumer (String AConsumerID, String AKeyID, String AKeyValue)
  3272. {
  3273. byte[] byteConsumerID = Encoding.UTF8.GetBytes(AConsumerID + char.MinValue);
  3274. byte[] byteKeyID = Encoding.UTF8.GetBytes(AKeyID + char.MinValue);
  3275. byte[] byteKeyValue = Encoding.UTF8.GetBytes(AKeyValue + char.MinValue);
  3276. IntPtr newConsumer = IntPtr.Zero;
  3277. CheckError(Internal.Lib3MFWrapper.KeyStore_AddConsumer (Handle, byteConsumerID, byteKeyID, byteKeyValue, out newConsumer));
  3278. return new CConsumer (newConsumer );
  3279. }
  3280. public UInt64 GetConsumerCount ()
  3281. {
  3282. UInt64 resultCount = 0;
  3283. CheckError(Internal.Lib3MFWrapper.KeyStore_GetConsumerCount (Handle, out resultCount));
  3284. return resultCount;
  3285. }
  3286. public CConsumer GetConsumer (UInt64 AConsumerIndex)
  3287. {
  3288. IntPtr newConsumer = IntPtr.Zero;
  3289. CheckError(Internal.Lib3MFWrapper.KeyStore_GetConsumer (Handle, AConsumerIndex, out newConsumer));
  3290. return new CConsumer (newConsumer );
  3291. }
  3292. public void RemoveConsumer (CConsumer AConsumer)
  3293. {
  3294. CheckError(Internal.Lib3MFWrapper.KeyStore_RemoveConsumer (Handle, AConsumer.GetHandle()));
  3295. }
  3296. public CConsumer FindConsumer (String AConsumerID)
  3297. {
  3298. byte[] byteConsumerID = Encoding.UTF8.GetBytes(AConsumerID + char.MinValue);
  3299. IntPtr newConsumer = IntPtr.Zero;
  3300. CheckError(Internal.Lib3MFWrapper.KeyStore_FindConsumer (Handle, byteConsumerID, out newConsumer));
  3301. return new CConsumer (newConsumer );
  3302. }
  3303. public UInt64 GetResourceDataGroupCount ()
  3304. {
  3305. UInt64 resultCount = 0;
  3306. CheckError(Internal.Lib3MFWrapper.KeyStore_GetResourceDataGroupCount (Handle, out resultCount));
  3307. return resultCount;
  3308. }
  3309. public CResourceDataGroup AddResourceDataGroup ()
  3310. {
  3311. IntPtr newResourceDataGroup = IntPtr.Zero;
  3312. CheckError(Internal.Lib3MFWrapper.KeyStore_AddResourceDataGroup (Handle, out newResourceDataGroup));
  3313. return new CResourceDataGroup (newResourceDataGroup );
  3314. }
  3315. public CResourceDataGroup GetResourceDataGroup (UInt64 AResourceDataIndex)
  3316. {
  3317. IntPtr newResourceDataGroup = IntPtr.Zero;
  3318. CheckError(Internal.Lib3MFWrapper.KeyStore_GetResourceDataGroup (Handle, AResourceDataIndex, out newResourceDataGroup));
  3319. return new CResourceDataGroup (newResourceDataGroup );
  3320. }
  3321. public void RemoveResourceDataGroup (CResourceDataGroup AResourceDataGroup)
  3322. {
  3323. CheckError(Internal.Lib3MFWrapper.KeyStore_RemoveResourceDataGroup (Handle, AResourceDataGroup.GetHandle()));
  3324. }
  3325. public CResourceDataGroup FindResourceDataGroup (CPackagePart APartPath)
  3326. {
  3327. IntPtr newResourceDataGroup = IntPtr.Zero;
  3328. CheckError(Internal.Lib3MFWrapper.KeyStore_FindResourceDataGroup (Handle, APartPath.GetHandle(), out newResourceDataGroup));
  3329. return new CResourceDataGroup (newResourceDataGroup );
  3330. }
  3331. public CResourceData AddResourceData (CResourceDataGroup AResourceDataGroup, CPackagePart APartPath, eEncryptionAlgorithm AAlgorithm, eCompression ACompression, Byte[] AAdditionalAuthenticationData)
  3332. {
  3333. Int32 enumAlgorithm = (Int32) AAlgorithm;
  3334. Int32 enumCompression = (Int32) ACompression;
  3335. GCHandle dataAdditionalAuthenticationData = GCHandle.Alloc(AAdditionalAuthenticationData, GCHandleType.Pinned);
  3336. IntPtr newResourceData = IntPtr.Zero;
  3337. CheckError(Internal.Lib3MFWrapper.KeyStore_AddResourceData (Handle, AResourceDataGroup.GetHandle(), APartPath.GetHandle(), enumAlgorithm, enumCompression, (UInt64) AAdditionalAuthenticationData.Length, dataAdditionalAuthenticationData.AddrOfPinnedObject(), out newResourceData));
  3338. dataAdditionalAuthenticationData.Free ();
  3339. return new CResourceData (newResourceData );
  3340. }
  3341. public void RemoveResourceData (CResourceData AResourceData)
  3342. {
  3343. CheckError(Internal.Lib3MFWrapper.KeyStore_RemoveResourceData (Handle, AResourceData.GetHandle()));
  3344. }
  3345. public CResourceData FindResourceData (CPackagePart AResourcePath)
  3346. {
  3347. IntPtr newResourceData = IntPtr.Zero;
  3348. CheckError(Internal.Lib3MFWrapper.KeyStore_FindResourceData (Handle, AResourcePath.GetHandle(), out newResourceData));
  3349. return new CResourceData (newResourceData );
  3350. }
  3351. public UInt64 GetResourceDataCount ()
  3352. {
  3353. UInt64 resultCount = 0;
  3354. CheckError(Internal.Lib3MFWrapper.KeyStore_GetResourceDataCount (Handle, out resultCount));
  3355. return resultCount;
  3356. }
  3357. public CResourceData GetResourceData (UInt64 AResourceDataIndex)
  3358. {
  3359. IntPtr newResourceData = IntPtr.Zero;
  3360. CheckError(Internal.Lib3MFWrapper.KeyStore_GetResourceData (Handle, AResourceDataIndex, out newResourceData));
  3361. return new CResourceData (newResourceData );
  3362. }
  3363. public String GetUUID (out bool AHasUUID)
  3364. {
  3365. Byte resultHasUUID = 0;
  3366. UInt32 sizeUUID = 0;
  3367. UInt32 neededUUID = 0;
  3368. CheckError(Internal.Lib3MFWrapper.KeyStore_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, IntPtr.Zero));
  3369. sizeUUID = neededUUID;
  3370. byte[] bytesUUID = new byte[sizeUUID];
  3371. GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned);
  3372. CheckError(Internal.Lib3MFWrapper.KeyStore_GetUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject()));
  3373. AHasUUID = (resultHasUUID != 0);
  3374. dataUUID.Free();
  3375. return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue);
  3376. }
  3377. public void SetUUID (String AUUID)
  3378. {
  3379. byte[] byteUUID = Encoding.UTF8.GetBytes(AUUID + char.MinValue);
  3380. CheckError(Internal.Lib3MFWrapper.KeyStore_SetUUID (Handle, byteUUID));
  3381. }
  3382. }
  3383. public class CModel : CBase
  3384. {
  3385. public CModel (IntPtr NewHandle) : base (NewHandle)
  3386. {
  3387. }
  3388. public CPackagePart RootModelPart ()
  3389. {
  3390. IntPtr newRootModelPart = IntPtr.Zero;
  3391. CheckError(Internal.Lib3MFWrapper.Model_RootModelPart (Handle, out newRootModelPart));
  3392. return new CPackagePart (newRootModelPart );
  3393. }
  3394. public CPackagePart FindOrCreatePackagePart (String AAbsolutePath)
  3395. {
  3396. byte[] byteAbsolutePath = Encoding.UTF8.GetBytes(AAbsolutePath + char.MinValue);
  3397. IntPtr newModelPart = IntPtr.Zero;
  3398. CheckError(Internal.Lib3MFWrapper.Model_FindOrCreatePackagePart (Handle, byteAbsolutePath, out newModelPart));
  3399. return new CPackagePart (newModelPart );
  3400. }
  3401. public void SetUnit (eModelUnit AUnit)
  3402. {
  3403. Int32 enumUnit = (Int32) AUnit;
  3404. CheckError(Internal.Lib3MFWrapper.Model_SetUnit (Handle, enumUnit));
  3405. }
  3406. public eModelUnit GetUnit ()
  3407. {
  3408. Int32 resultUnit = 0;
  3409. CheckError(Internal.Lib3MFWrapper.Model_GetUnit (Handle, out resultUnit));
  3410. return (eModelUnit) (resultUnit);
  3411. }
  3412. public String GetLanguage ()
  3413. {
  3414. UInt32 sizeLanguage = 0;
  3415. UInt32 neededLanguage = 0;
  3416. CheckError(Internal.Lib3MFWrapper.Model_GetLanguage (Handle, sizeLanguage, out neededLanguage, IntPtr.Zero));
  3417. sizeLanguage = neededLanguage;
  3418. byte[] bytesLanguage = new byte[sizeLanguage];
  3419. GCHandle dataLanguage = GCHandle.Alloc(bytesLanguage, GCHandleType.Pinned);
  3420. CheckError(Internal.Lib3MFWrapper.Model_GetLanguage (Handle, sizeLanguage, out neededLanguage, dataLanguage.AddrOfPinnedObject()));
  3421. dataLanguage.Free();
  3422. return Encoding.UTF8.GetString(bytesLanguage).TrimEnd(char.MinValue);
  3423. }
  3424. public void SetLanguage (String ALanguage)
  3425. {
  3426. byte[] byteLanguage = Encoding.UTF8.GetBytes(ALanguage + char.MinValue);
  3427. CheckError(Internal.Lib3MFWrapper.Model_SetLanguage (Handle, byteLanguage));
  3428. }
  3429. public CWriter QueryWriter (String AWriterClass)
  3430. {
  3431. byte[] byteWriterClass = Encoding.UTF8.GetBytes(AWriterClass + char.MinValue);
  3432. IntPtr newWriterInstance = IntPtr.Zero;
  3433. CheckError(Internal.Lib3MFWrapper.Model_QueryWriter (Handle, byteWriterClass, out newWriterInstance));
  3434. return new CWriter (newWriterInstance );
  3435. }
  3436. public CReader QueryReader (String AReaderClass)
  3437. {
  3438. byte[] byteReaderClass = Encoding.UTF8.GetBytes(AReaderClass + char.MinValue);
  3439. IntPtr newReaderInstance = IntPtr.Zero;
  3440. CheckError(Internal.Lib3MFWrapper.Model_QueryReader (Handle, byteReaderClass, out newReaderInstance));
  3441. return new CReader (newReaderInstance );
  3442. }
  3443. public CTexture2D GetTexture2DByID (UInt32 AUniqueResourceID)
  3444. {
  3445. IntPtr newTextureInstance = IntPtr.Zero;
  3446. CheckError(Internal.Lib3MFWrapper.Model_GetTexture2DByID (Handle, AUniqueResourceID, out newTextureInstance));
  3447. return new CTexture2D (newTextureInstance );
  3448. }
  3449. public ePropertyType GetPropertyTypeByID (UInt32 AUniqueResourceID)
  3450. {
  3451. Int32 resultThePropertyType = 0;
  3452. CheckError(Internal.Lib3MFWrapper.Model_GetPropertyTypeByID (Handle, AUniqueResourceID, out resultThePropertyType));
  3453. return (ePropertyType) (resultThePropertyType);
  3454. }
  3455. public CBaseMaterialGroup GetBaseMaterialGroupByID (UInt32 AUniqueResourceID)
  3456. {
  3457. IntPtr newBaseMaterialGroupInstance = IntPtr.Zero;
  3458. CheckError(Internal.Lib3MFWrapper.Model_GetBaseMaterialGroupByID (Handle, AUniqueResourceID, out newBaseMaterialGroupInstance));
  3459. return new CBaseMaterialGroup (newBaseMaterialGroupInstance );
  3460. }
  3461. public CTexture2DGroup GetTexture2DGroupByID (UInt32 AUniqueResourceID)
  3462. {
  3463. IntPtr newTexture2DGroupInstance = IntPtr.Zero;
  3464. CheckError(Internal.Lib3MFWrapper.Model_GetTexture2DGroupByID (Handle, AUniqueResourceID, out newTexture2DGroupInstance));
  3465. return new CTexture2DGroup (newTexture2DGroupInstance );
  3466. }
  3467. public CCompositeMaterials GetCompositeMaterialsByID (UInt32 AUniqueResourceID)
  3468. {
  3469. IntPtr newCompositeMaterialsInstance = IntPtr.Zero;
  3470. CheckError(Internal.Lib3MFWrapper.Model_GetCompositeMaterialsByID (Handle, AUniqueResourceID, out newCompositeMaterialsInstance));
  3471. return new CCompositeMaterials (newCompositeMaterialsInstance );
  3472. }
  3473. public CMultiPropertyGroup GetMultiPropertyGroupByID (UInt32 AUniqueResourceID)
  3474. {
  3475. IntPtr newMultiPropertyGroupInstance = IntPtr.Zero;
  3476. CheckError(Internal.Lib3MFWrapper.Model_GetMultiPropertyGroupByID (Handle, AUniqueResourceID, out newMultiPropertyGroupInstance));
  3477. return new CMultiPropertyGroup (newMultiPropertyGroupInstance );
  3478. }
  3479. public CMeshObject GetMeshObjectByID (UInt32 AUniqueResourceID)
  3480. {
  3481. IntPtr newMeshObjectInstance = IntPtr.Zero;
  3482. CheckError(Internal.Lib3MFWrapper.Model_GetMeshObjectByID (Handle, AUniqueResourceID, out newMeshObjectInstance));
  3483. return new CMeshObject (newMeshObjectInstance );
  3484. }
  3485. public CComponentsObject GetComponentsObjectByID (UInt32 AUniqueResourceID)
  3486. {
  3487. IntPtr newComponentsObjectInstance = IntPtr.Zero;
  3488. CheckError(Internal.Lib3MFWrapper.Model_GetComponentsObjectByID (Handle, AUniqueResourceID, out newComponentsObjectInstance));
  3489. return new CComponentsObject (newComponentsObjectInstance );
  3490. }
  3491. public CColorGroup GetColorGroupByID (UInt32 AUniqueResourceID)
  3492. {
  3493. IntPtr newColorGroupInstance = IntPtr.Zero;
  3494. CheckError(Internal.Lib3MFWrapper.Model_GetColorGroupByID (Handle, AUniqueResourceID, out newColorGroupInstance));
  3495. return new CColorGroup (newColorGroupInstance );
  3496. }
  3497. public CSliceStack GetSliceStackByID (UInt32 AUniqueResourceID)
  3498. {
  3499. IntPtr newSliceStacInstance = IntPtr.Zero;
  3500. CheckError(Internal.Lib3MFWrapper.Model_GetSliceStackByID (Handle, AUniqueResourceID, out newSliceStacInstance));
  3501. return new CSliceStack (newSliceStacInstance );
  3502. }
  3503. public String GetBuildUUID (out bool AHasUUID)
  3504. {
  3505. Byte resultHasUUID = 0;
  3506. UInt32 sizeUUID = 0;
  3507. UInt32 neededUUID = 0;
  3508. CheckError(Internal.Lib3MFWrapper.Model_GetBuildUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, IntPtr.Zero));
  3509. sizeUUID = neededUUID;
  3510. byte[] bytesUUID = new byte[sizeUUID];
  3511. GCHandle dataUUID = GCHandle.Alloc(bytesUUID, GCHandleType.Pinned);
  3512. CheckError(Internal.Lib3MFWrapper.Model_GetBuildUUID (Handle, out resultHasUUID, sizeUUID, out neededUUID, dataUUID.AddrOfPinnedObject()));
  3513. AHasUUID = (resultHasUUID != 0);
  3514. dataUUID.Free();
  3515. return Encoding.UTF8.GetString(bytesUUID).TrimEnd(char.MinValue);
  3516. }
  3517. public void SetBuildUUID (String AUUID)
  3518. {
  3519. byte[] byteUUID = Encoding.UTF8.GetBytes(AUUID + char.MinValue);
  3520. CheckError(Internal.Lib3MFWrapper.Model_SetBuildUUID (Handle, byteUUID));
  3521. }
  3522. public CBuildItemIterator GetBuildItems ()
  3523. {
  3524. IntPtr newBuildItemIterator = IntPtr.Zero;
  3525. CheckError(Internal.Lib3MFWrapper.Model_GetBuildItems (Handle, out newBuildItemIterator));
  3526. return new CBuildItemIterator (newBuildItemIterator );
  3527. }
  3528. public sBox GetOutbox ()
  3529. {
  3530. Internal.InternalBox intresultOutbox;
  3531. CheckError(Internal.Lib3MFWrapper.Model_GetOutbox (Handle, out intresultOutbox));
  3532. return Internal.Lib3MFWrapper.convertInternalToStruct_Box (intresultOutbox);
  3533. }
  3534. public CResourceIterator GetResources ()
  3535. {
  3536. IntPtr newResourceIterator = IntPtr.Zero;
  3537. CheckError(Internal.Lib3MFWrapper.Model_GetResources (Handle, out newResourceIterator));
  3538. return new CResourceIterator (newResourceIterator );
  3539. }
  3540. public CObjectIterator GetObjects ()
  3541. {
  3542. IntPtr newResourceIterator = IntPtr.Zero;
  3543. CheckError(Internal.Lib3MFWrapper.Model_GetObjects (Handle, out newResourceIterator));
  3544. return new CObjectIterator (newResourceIterator );
  3545. }
  3546. public CMeshObjectIterator GetMeshObjects ()
  3547. {
  3548. IntPtr newResourceIterator = IntPtr.Zero;
  3549. CheckError(Internal.Lib3MFWrapper.Model_GetMeshObjects (Handle, out newResourceIterator));
  3550. return new CMeshObjectIterator (newResourceIterator );
  3551. }
  3552. public CComponentsObjectIterator GetComponentsObjects ()
  3553. {
  3554. IntPtr newResourceIterator = IntPtr.Zero;
  3555. CheckError(Internal.Lib3MFWrapper.Model_GetComponentsObjects (Handle, out newResourceIterator));
  3556. return new CComponentsObjectIterator (newResourceIterator );
  3557. }
  3558. public CTexture2DIterator GetTexture2Ds ()
  3559. {
  3560. IntPtr newResourceIterator = IntPtr.Zero;
  3561. CheckError(Internal.Lib3MFWrapper.Model_GetTexture2Ds (Handle, out newResourceIterator));
  3562. return new CTexture2DIterator (newResourceIterator );
  3563. }
  3564. public CBaseMaterialGroupIterator GetBaseMaterialGroups ()
  3565. {
  3566. IntPtr newResourceIterator = IntPtr.Zero;
  3567. CheckError(Internal.Lib3MFWrapper.Model_GetBaseMaterialGroups (Handle, out newResourceIterator));
  3568. return new CBaseMaterialGroupIterator (newResourceIterator );
  3569. }
  3570. public CColorGroupIterator GetColorGroups ()
  3571. {
  3572. IntPtr newResourceIterator = IntPtr.Zero;
  3573. CheckError(Internal.Lib3MFWrapper.Model_GetColorGroups (Handle, out newResourceIterator));
  3574. return new CColorGroupIterator (newResourceIterator );
  3575. }
  3576. public CTexture2DGroupIterator GetTexture2DGroups ()
  3577. {
  3578. IntPtr newResourceIterator = IntPtr.Zero;
  3579. CheckError(Internal.Lib3MFWrapper.Model_GetTexture2DGroups (Handle, out newResourceIterator));
  3580. return new CTexture2DGroupIterator (newResourceIterator );
  3581. }
  3582. public CCompositeMaterialsIterator GetCompositeMaterials ()
  3583. {
  3584. IntPtr newResourceIterator = IntPtr.Zero;
  3585. CheckError(Internal.Lib3MFWrapper.Model_GetCompositeMaterials (Handle, out newResourceIterator));
  3586. return new CCompositeMaterialsIterator (newResourceIterator );
  3587. }
  3588. public CMultiPropertyGroupIterator GetMultiPropertyGroups ()
  3589. {
  3590. IntPtr newResourceIterator = IntPtr.Zero;
  3591. CheckError(Internal.Lib3MFWrapper.Model_GetMultiPropertyGroups (Handle, out newResourceIterator));
  3592. return new CMultiPropertyGroupIterator (newResourceIterator );
  3593. }
  3594. public CSliceStackIterator GetSliceStacks ()
  3595. {
  3596. IntPtr newResourceIterator = IntPtr.Zero;
  3597. CheckError(Internal.Lib3MFWrapper.Model_GetSliceStacks (Handle, out newResourceIterator));
  3598. return new CSliceStackIterator (newResourceIterator );
  3599. }
  3600. public CModel MergeToModel ()
  3601. {
  3602. IntPtr newMergedModelInstance = IntPtr.Zero;
  3603. CheckError(Internal.Lib3MFWrapper.Model_MergeToModel (Handle, out newMergedModelInstance));
  3604. return new CModel (newMergedModelInstance );
  3605. }
  3606. public CMeshObject AddMeshObject ()
  3607. {
  3608. IntPtr newMeshObjectInstance = IntPtr.Zero;
  3609. CheckError(Internal.Lib3MFWrapper.Model_AddMeshObject (Handle, out newMeshObjectInstance));
  3610. return new CMeshObject (newMeshObjectInstance );
  3611. }
  3612. public CComponentsObject AddComponentsObject ()
  3613. {
  3614. IntPtr newComponentsObjectInstance = IntPtr.Zero;
  3615. CheckError(Internal.Lib3MFWrapper.Model_AddComponentsObject (Handle, out newComponentsObjectInstance));
  3616. return new CComponentsObject (newComponentsObjectInstance );
  3617. }
  3618. public CSliceStack AddSliceStack (Double AZBottom)
  3619. {
  3620. IntPtr newSliceStackInstance = IntPtr.Zero;
  3621. CheckError(Internal.Lib3MFWrapper.Model_AddSliceStack (Handle, AZBottom, out newSliceStackInstance));
  3622. return new CSliceStack (newSliceStackInstance );
  3623. }
  3624. public CTexture2D AddTexture2DFromAttachment (CAttachment ATextureAttachment)
  3625. {
  3626. IntPtr newTexture2DInstance = IntPtr.Zero;
  3627. CheckError(Internal.Lib3MFWrapper.Model_AddTexture2DFromAttachment (Handle, ATextureAttachment.GetHandle(), out newTexture2DInstance));
  3628. return new CTexture2D (newTexture2DInstance );
  3629. }
  3630. public CBaseMaterialGroup AddBaseMaterialGroup ()
  3631. {
  3632. IntPtr newBaseMaterialGroupInstance = IntPtr.Zero;
  3633. CheckError(Internal.Lib3MFWrapper.Model_AddBaseMaterialGroup (Handle, out newBaseMaterialGroupInstance));
  3634. return new CBaseMaterialGroup (newBaseMaterialGroupInstance );
  3635. }
  3636. public CColorGroup AddColorGroup ()
  3637. {
  3638. IntPtr newColorGroupInstance = IntPtr.Zero;
  3639. CheckError(Internal.Lib3MFWrapper.Model_AddColorGroup (Handle, out newColorGroupInstance));
  3640. return new CColorGroup (newColorGroupInstance );
  3641. }
  3642. public CTexture2DGroup AddTexture2DGroup (CTexture2D ATexture2DInstance)
  3643. {
  3644. IntPtr newTexture2DGroupInstance = IntPtr.Zero;
  3645. CheckError(Internal.Lib3MFWrapper.Model_AddTexture2DGroup (Handle, ATexture2DInstance.GetHandle(), out newTexture2DGroupInstance));
  3646. return new CTexture2DGroup (newTexture2DGroupInstance );
  3647. }
  3648. public CCompositeMaterials AddCompositeMaterials (CBaseMaterialGroup ABaseMaterialGroupInstance)
  3649. {
  3650. IntPtr newCompositeMaterialsInstance = IntPtr.Zero;
  3651. CheckError(Internal.Lib3MFWrapper.Model_AddCompositeMaterials (Handle, ABaseMaterialGroupInstance.GetHandle(), out newCompositeMaterialsInstance));
  3652. return new CCompositeMaterials (newCompositeMaterialsInstance );
  3653. }
  3654. public CMultiPropertyGroup AddMultiPropertyGroup ()
  3655. {
  3656. IntPtr newMultiPropertyGroupInstance = IntPtr.Zero;
  3657. CheckError(Internal.Lib3MFWrapper.Model_AddMultiPropertyGroup (Handle, out newMultiPropertyGroupInstance));
  3658. return new CMultiPropertyGroup (newMultiPropertyGroupInstance );
  3659. }
  3660. public CBuildItem AddBuildItem (CObject AObject, sTransform ATransform)
  3661. {
  3662. Internal.InternalTransform intTransform = Internal.Lib3MFWrapper.convertStructToInternal_Transform (ATransform);
  3663. IntPtr newBuildItemInstance = IntPtr.Zero;
  3664. CheckError(Internal.Lib3MFWrapper.Model_AddBuildItem (Handle, AObject.GetHandle(), intTransform, out newBuildItemInstance));
  3665. return new CBuildItem (newBuildItemInstance );
  3666. }
  3667. public void RemoveBuildItem (CBuildItem ABuildItemInstance)
  3668. {
  3669. CheckError(Internal.Lib3MFWrapper.Model_RemoveBuildItem (Handle, ABuildItemInstance.GetHandle()));
  3670. }
  3671. public CMetaDataGroup GetMetaDataGroup ()
  3672. {
  3673. IntPtr newTheMetaDataGroup = IntPtr.Zero;
  3674. CheckError(Internal.Lib3MFWrapper.Model_GetMetaDataGroup (Handle, out newTheMetaDataGroup));
  3675. return new CMetaDataGroup (newTheMetaDataGroup );
  3676. }
  3677. public CAttachment AddAttachment (String AURI, String ARelationShipType)
  3678. {
  3679. byte[] byteURI = Encoding.UTF8.GetBytes(AURI + char.MinValue);
  3680. byte[] byteRelationShipType = Encoding.UTF8.GetBytes(ARelationShipType + char.MinValue);
  3681. IntPtr newAttachmentInstance = IntPtr.Zero;
  3682. CheckError(Internal.Lib3MFWrapper.Model_AddAttachment (Handle, byteURI, byteRelationShipType, out newAttachmentInstance));
  3683. return new CAttachment (newAttachmentInstance );
  3684. }
  3685. public void RemoveAttachment (CAttachment AAttachmentInstance)
  3686. {
  3687. CheckError(Internal.Lib3MFWrapper.Model_RemoveAttachment (Handle, AAttachmentInstance.GetHandle()));
  3688. }
  3689. public CAttachment GetAttachment (UInt32 AIndex)
  3690. {
  3691. IntPtr newAttachmentInstance = IntPtr.Zero;
  3692. CheckError(Internal.Lib3MFWrapper.Model_GetAttachment (Handle, AIndex, out newAttachmentInstance));
  3693. return new CAttachment (newAttachmentInstance );
  3694. }
  3695. public CAttachment FindAttachment (String AURI)
  3696. {
  3697. byte[] byteURI = Encoding.UTF8.GetBytes(AURI + char.MinValue);
  3698. IntPtr newAttachmentInstance = IntPtr.Zero;
  3699. CheckError(Internal.Lib3MFWrapper.Model_FindAttachment (Handle, byteURI, out newAttachmentInstance));
  3700. return new CAttachment (newAttachmentInstance );
  3701. }
  3702. public UInt32 GetAttachmentCount ()
  3703. {
  3704. UInt32 resultAttachmentCount = 0;
  3705. CheckError(Internal.Lib3MFWrapper.Model_GetAttachmentCount (Handle, out resultAttachmentCount));
  3706. return resultAttachmentCount;
  3707. }
  3708. public bool HasPackageThumbnailAttachment ()
  3709. {
  3710. Byte resultHasThumbnail = 0;
  3711. CheckError(Internal.Lib3MFWrapper.Model_HasPackageThumbnailAttachment (Handle, out resultHasThumbnail));
  3712. return (resultHasThumbnail != 0);
  3713. }
  3714. public CAttachment CreatePackageThumbnailAttachment ()
  3715. {
  3716. IntPtr newAttachment = IntPtr.Zero;
  3717. CheckError(Internal.Lib3MFWrapper.Model_CreatePackageThumbnailAttachment (Handle, out newAttachment));
  3718. return new CAttachment (newAttachment );
  3719. }
  3720. public CAttachment GetPackageThumbnailAttachment ()
  3721. {
  3722. IntPtr newAttachment = IntPtr.Zero;
  3723. CheckError(Internal.Lib3MFWrapper.Model_GetPackageThumbnailAttachment (Handle, out newAttachment));
  3724. return new CAttachment (newAttachment );
  3725. }
  3726. public void RemovePackageThumbnailAttachment ()
  3727. {
  3728. CheckError(Internal.Lib3MFWrapper.Model_RemovePackageThumbnailAttachment (Handle));
  3729. }
  3730. public void AddCustomContentType (String AExtension, String AContentType)
  3731. {
  3732. byte[] byteExtension = Encoding.UTF8.GetBytes(AExtension + char.MinValue);
  3733. byte[] byteContentType = Encoding.UTF8.GetBytes(AContentType + char.MinValue);
  3734. CheckError(Internal.Lib3MFWrapper.Model_AddCustomContentType (Handle, byteExtension, byteContentType));
  3735. }
  3736. public void RemoveCustomContentType (String AExtension)
  3737. {
  3738. byte[] byteExtension = Encoding.UTF8.GetBytes(AExtension + char.MinValue);
  3739. CheckError(Internal.Lib3MFWrapper.Model_RemoveCustomContentType (Handle, byteExtension));
  3740. }
  3741. public void SetRandomNumberCallback (IntPtr ATheCallback, UInt64 AUserData)
  3742. {
  3743. CheckError(Internal.Lib3MFWrapper.Model_SetRandomNumberCallback (Handle, IntPtr.Zero, AUserData));
  3744. }
  3745. public CKeyStore GetKeyStore ()
  3746. {
  3747. IntPtr newKeyStore = IntPtr.Zero;
  3748. CheckError(Internal.Lib3MFWrapper.Model_GetKeyStore (Handle, out newKeyStore));
  3749. return new CKeyStore (newKeyStore );
  3750. }
  3751. }
  3752. public class Wrapper
  3753. {
  3754. private static void CheckError (Int32 errorCode)
  3755. {
  3756. if (errorCode != 0) {
  3757. Internal.Lib3MFWrapper.ThrowError (IntPtr.Zero, errorCode);
  3758. }
  3759. }
  3760. public static void GetLibraryVersion (out UInt32 AMajor, out UInt32 AMinor, out UInt32 AMicro)
  3761. {
  3762. CheckError(Internal.Lib3MFWrapper.GetLibraryVersion (out AMajor, out AMinor, out AMicro));
  3763. }
  3764. public static bool GetPrereleaseInformation (out String APrereleaseInfo)
  3765. {
  3766. Byte resultHasPrereleaseInfo = 0;
  3767. UInt32 sizePrereleaseInfo = 0;
  3768. UInt32 neededPrereleaseInfo = 0;
  3769. CheckError(Internal.Lib3MFWrapper.GetPrereleaseInformation (out resultHasPrereleaseInfo, sizePrereleaseInfo, out neededPrereleaseInfo, IntPtr.Zero));
  3770. sizePrereleaseInfo = neededPrereleaseInfo;
  3771. byte[] bytesPrereleaseInfo = new byte[sizePrereleaseInfo];
  3772. GCHandle dataPrereleaseInfo = GCHandle.Alloc(bytesPrereleaseInfo, GCHandleType.Pinned);
  3773. CheckError(Internal.Lib3MFWrapper.GetPrereleaseInformation (out resultHasPrereleaseInfo, sizePrereleaseInfo, out neededPrereleaseInfo, dataPrereleaseInfo.AddrOfPinnedObject()));
  3774. dataPrereleaseInfo.Free();
  3775. APrereleaseInfo = Encoding.UTF8.GetString(bytesPrereleaseInfo).TrimEnd(char.MinValue);
  3776. return (resultHasPrereleaseInfo != 0);
  3777. }
  3778. public static bool GetBuildInformation (out String ABuildInformation)
  3779. {
  3780. Byte resultHasBuildInfo = 0;
  3781. UInt32 sizeBuildInformation = 0;
  3782. UInt32 neededBuildInformation = 0;
  3783. CheckError(Internal.Lib3MFWrapper.GetBuildInformation (out resultHasBuildInfo, sizeBuildInformation, out neededBuildInformation, IntPtr.Zero));
  3784. sizeBuildInformation = neededBuildInformation;
  3785. byte[] bytesBuildInformation = new byte[sizeBuildInformation];
  3786. GCHandle dataBuildInformation = GCHandle.Alloc(bytesBuildInformation, GCHandleType.Pinned);
  3787. CheckError(Internal.Lib3MFWrapper.GetBuildInformation (out resultHasBuildInfo, sizeBuildInformation, out neededBuildInformation, dataBuildInformation.AddrOfPinnedObject()));
  3788. dataBuildInformation.Free();
  3789. ABuildInformation = Encoding.UTF8.GetString(bytesBuildInformation).TrimEnd(char.MinValue);
  3790. return (resultHasBuildInfo != 0);
  3791. }
  3792. public static void GetSpecificationVersion (String ASpecificationURL, out bool AIsSupported, out UInt32 AMajor, out UInt32 AMinor, out UInt32 AMicro)
  3793. {
  3794. byte[] byteSpecificationURL = Encoding.UTF8.GetBytes(ASpecificationURL + char.MinValue);
  3795. Byte resultIsSupported = 0;
  3796. CheckError(Internal.Lib3MFWrapper.GetSpecificationVersion (byteSpecificationURL, out resultIsSupported, out AMajor, out AMinor, out AMicro));
  3797. AIsSupported = (resultIsSupported != 0);
  3798. }
  3799. public static CModel CreateModel ()
  3800. {
  3801. IntPtr newModel = IntPtr.Zero;
  3802. CheckError(Internal.Lib3MFWrapper.CreateModel (out newModel));
  3803. return new CModel (newModel );
  3804. }
  3805. public static void Release (CBase AInstance)
  3806. {
  3807. CheckError(Internal.Lib3MFWrapper.Release (AInstance.GetHandle()));
  3808. }
  3809. public static void Acquire (CBase AInstance)
  3810. {
  3811. CheckError(Internal.Lib3MFWrapper.Acquire (AInstance.GetHandle()));
  3812. }
  3813. public static void SetJournal (String AJournalPath)
  3814. {
  3815. byte[] byteJournalPath = Encoding.UTF8.GetBytes(AJournalPath + char.MinValue);
  3816. CheckError(Internal.Lib3MFWrapper.SetJournal (byteJournalPath));
  3817. }
  3818. public static bool GetLastError (CBase AInstance, out String ALastErrorString)
  3819. {
  3820. Byte resultHasLastError = 0;
  3821. UInt32 sizeLastErrorString = 0;
  3822. UInt32 neededLastErrorString = 0;
  3823. CheckError(Internal.Lib3MFWrapper.GetLastError (AInstance.GetHandle(), sizeLastErrorString, out neededLastErrorString, IntPtr.Zero, out resultHasLastError));
  3824. sizeLastErrorString = neededLastErrorString;
  3825. byte[] bytesLastErrorString = new byte[sizeLastErrorString];
  3826. GCHandle dataLastErrorString = GCHandle.Alloc(bytesLastErrorString, GCHandleType.Pinned);
  3827. CheckError(Internal.Lib3MFWrapper.GetLastError (AInstance.GetHandle(), sizeLastErrorString, out neededLastErrorString, dataLastErrorString.AddrOfPinnedObject(), out resultHasLastError));
  3828. dataLastErrorString.Free();
  3829. ALastErrorString = Encoding.UTF8.GetString(bytesLastErrorString).TrimEnd(char.MinValue);
  3830. return (resultHasLastError != 0);
  3831. }
  3832. public static void RetrieveProgressMessage (eProgressIdentifier ATheProgressIdentifier, out String AProgressMessage)
  3833. {
  3834. Int32 enumTheProgressIdentifier = (Int32) ATheProgressIdentifier;
  3835. UInt32 sizeProgressMessage = 0;
  3836. UInt32 neededProgressMessage = 0;
  3837. CheckError(Internal.Lib3MFWrapper.RetrieveProgressMessage (enumTheProgressIdentifier, sizeProgressMessage, out neededProgressMessage, IntPtr.Zero));
  3838. sizeProgressMessage = neededProgressMessage;
  3839. byte[] bytesProgressMessage = new byte[sizeProgressMessage];
  3840. GCHandle dataProgressMessage = GCHandle.Alloc(bytesProgressMessage, GCHandleType.Pinned);
  3841. CheckError(Internal.Lib3MFWrapper.RetrieveProgressMessage (enumTheProgressIdentifier, sizeProgressMessage, out neededProgressMessage, dataProgressMessage.AddrOfPinnedObject()));
  3842. dataProgressMessage.Free();
  3843. AProgressMessage = Encoding.UTF8.GetString(bytesProgressMessage).TrimEnd(char.MinValue);
  3844. }
  3845. public static sColor RGBAToColor (Byte ARed, Byte AGreen, Byte ABlue, Byte AAlpha)
  3846. {
  3847. Internal.InternalColor intresultTheColor;
  3848. CheckError(Internal.Lib3MFWrapper.RGBAToColor (ARed, AGreen, ABlue, AAlpha, out intresultTheColor));
  3849. return Internal.Lib3MFWrapper.convertInternalToStruct_Color (intresultTheColor);
  3850. }
  3851. public static sColor FloatRGBAToColor (Single ARed, Single AGreen, Single ABlue, Single AAlpha)
  3852. {
  3853. Internal.InternalColor intresultTheColor;
  3854. CheckError(Internal.Lib3MFWrapper.FloatRGBAToColor (ARed, AGreen, ABlue, AAlpha, out intresultTheColor));
  3855. return Internal.Lib3MFWrapper.convertInternalToStruct_Color (intresultTheColor);
  3856. }
  3857. public static void ColorToRGBA (sColor ATheColor, out Byte ARed, out Byte AGreen, out Byte ABlue, out Byte AAlpha)
  3858. {
  3859. Internal.InternalColor intTheColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ATheColor);
  3860. CheckError(Internal.Lib3MFWrapper.ColorToRGBA (intTheColor, out ARed, out AGreen, out ABlue, out AAlpha));
  3861. }
  3862. public static void ColorToFloatRGBA (sColor ATheColor, out Single ARed, out Single AGreen, out Single ABlue, out Single AAlpha)
  3863. {
  3864. Internal.InternalColor intTheColor = Internal.Lib3MFWrapper.convertStructToInternal_Color (ATheColor);
  3865. CheckError(Internal.Lib3MFWrapper.ColorToFloatRGBA (intTheColor, out ARed, out AGreen, out ABlue, out AAlpha));
  3866. }
  3867. public static sTransform GetIdentityTransform ()
  3868. {
  3869. Internal.InternalTransform intresultTransform;
  3870. CheckError(Internal.Lib3MFWrapper.GetIdentityTransform (out intresultTransform));
  3871. return Internal.Lib3MFWrapper.convertInternalToStruct_Transform (intresultTransform);
  3872. }
  3873. public static sTransform GetUniformScaleTransform (Single AFactor)
  3874. {
  3875. Internal.InternalTransform intresultTransform;
  3876. CheckError(Internal.Lib3MFWrapper.GetUniformScaleTransform (AFactor, out intresultTransform));
  3877. return Internal.Lib3MFWrapper.convertInternalToStruct_Transform (intresultTransform);
  3878. }
  3879. public static sTransform GetScaleTransform (Single AFactorX, Single AFactorY, Single AFactorZ)
  3880. {
  3881. Internal.InternalTransform intresultTransform;
  3882. CheckError(Internal.Lib3MFWrapper.GetScaleTransform (AFactorX, AFactorY, AFactorZ, out intresultTransform));
  3883. return Internal.Lib3MFWrapper.convertInternalToStruct_Transform (intresultTransform);
  3884. }
  3885. public static sTransform GetTranslationTransform (Single AVectorX, Single AVectorY, Single AVectorZ)
  3886. {
  3887. Internal.InternalTransform intresultTransform;
  3888. CheckError(Internal.Lib3MFWrapper.GetTranslationTransform (AVectorX, AVectorY, AVectorZ, out intresultTransform));
  3889. return Internal.Lib3MFWrapper.convertInternalToStruct_Transform (intresultTransform);
  3890. }
  3891. }
  3892. }