// Interface exposed to emscripten's WebIDL Binder. // http://kripken.github.io/emscripten-site/docs/porting/connecting_cpp_and_javascript/WebIDL-Binder.html [Prefix="draco::"] interface DecoderBuffer { void DecoderBuffer(); void Init([Const] byte[] data, unsigned long data_size); }; enum draco_GeometryAttribute_Type { "draco_GeometryAttribute::INVALID", "draco_GeometryAttribute::POSITION", "draco_GeometryAttribute::NORMAL", "draco_GeometryAttribute::COLOR", "draco_GeometryAttribute::TEX_COORD", "draco_GeometryAttribute::GENERIC" }; [Prefix="draco::"] interface GeometryAttribute { void GeometryAttribute(); }; enum draco_EncodedGeometryType { "draco::INVALID_GEOMETRY_TYPE", "draco::POINT_CLOUD", "draco::TRIANGULAR_MESH" }; [Prefix="draco::"] interface PointAttribute { void PointAttribute(); long size(); // From GeometryAttribute long attribute_type(); long data_type(); byte components_count(); boolean normalized(); long byte_stride(); long byte_offset(); long custom_id(); }; [Prefix="draco::"] interface PointCloud { void PointCloud(); long num_attributes(); long num_points(); }; [Prefix="draco::"] interface Mesh : PointCloud { void Mesh(); long num_faces(); // From PointCloud long num_attributes(); long num_points(); }; // Draco version of typed arrays. The memory of these arrays is allocated on the // emscripten heap. [Prefix="draco::"] interface DracoFloat32Array { void DracoFloat32Array(); float GetValue(long index); }; [Prefix="draco::"] interface DracoInt32Array { void DracoInt32Array(); long GetValue(long index); }; [Prefix="draco::"] interface WebIDLWrapper { void WebIDLWrapper(); draco_EncodedGeometryType GetEncodedGeometryType(DecoderBuffer in_buffer); PointCloud DecodePointCloudFromBuffer(DecoderBuffer in_buffer); Mesh DecodeMeshFromBuffer(DecoderBuffer in_buffer); [Const] long GetAttributeId([Ref, Const] PointCloud pc, draco_GeometryAttribute_Type type); [Const] PointAttribute GetAttribute([Ref, Const] PointCloud pc, long att_id); boolean GetFaceFromMesh([Ref, Const] Mesh m, long face_id, DracoInt32Array out_values); boolean GetAttributeFloat([Ref, Const] PointAttribute pa, long att_index, DracoFloat32Array out_values); boolean GetAttributeFloatForAllPoints([Ref, Const] PointCloud pc, [Ref, Const] PointAttribute pa, DracoFloat32Array out_values); };