kepler_ra/lib.rs
1// MIT License
2
3// Copyright (c) 2023 Techtron-Lab
4
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11
12// The above copyright notice and this permission notice shall be included in all
13// copies or substantial portions of the Software.
14
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21// SOFTWARE.
22
23
24#![allow(unused)]
25mod colormap;
26mod modal;
27mod utils;
28// mod textureid;
29mod debug;
30mod techtron;
31mod view;
32mod shader_sources;
33mod glcanvas;
34
35// Refactoring
36// mod techtron;
37
38use std::cell::RefCell;
39use std::cmp::Ordering;
40use std::convert::TryInto;
41use std::ops::DerefMut;
42use std::rc::Rc;
43// use js_sys::Math::{abs};
44// use std::rc::Rc;
45
46use do_notation::m;
47use js_sys::{ArrayBuffer, Float32Array, Int16Array, Uint16Array, Uint8Array};
48use wasm_bindgen::prelude::*;
49use wasm_bindgen::JsCast;
50// use web_sys::{File, FileReader};
51use web_sys::{
52 Performance,
53 WebGl2RenderingContext,
54 WebGlProgram,
55 WebGlShader,
56 WebGlTexture, //WebGlUniformLocation,
57};
58
59// use crate::colormap::cmocean::LUT;
60// use crate::colormap::jet::LUT;
61// use crate::modal::{VolumeDataType, VolumeInfo};
62// use techtron::prelude::*;
63use crate::shader_sources::*;
64
65use log::{info, warn, Level};
66// pub use glcanvas::*;
67pub use crate::techtron::prelude;
68
69// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
70// allocator.
71#[cfg(feature = "wee_alloc")]
72#[global_allocator]
73static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;