Skip to content
Snippets Groups Projects
main.js 900 B
Newer Older
Amanda Ghassaei's avatar
Amanda Ghassaei committed
/**
 * Created by aghassaei on 1/7/15.
 */

Amanda Ghassaei's avatar
Amanda Ghassaei committed
//setup persistent global variables
if (typeof globals === "undefined") globals = {};
Amanda Ghassaei's avatar
Amanda Ghassaei committed

Amanda Ghassaei's avatar
Amanda Ghassaei committed
$(function(){
Amanda Ghassaei's avatar
Amanda Ghassaei committed
    //init web workers
Amanda Ghassaei's avatar
Amanda Ghassaei committed
//    window.workers = persistentWorkers(8);
Amanda Ghassaei's avatar
Amanda Ghassaei committed

amandaghassaei's avatar
amandaghassaei committed
    //init global singletons
Amanda Ghassaei's avatar
Amanda Ghassaei committed
    globals.three = ThreeModel();
    globals.plist = AppPList();
    globals.appState = new AppState();
    globals.lattice = new Lattice();
    globals.lattice.delayedInit();//todo need this?
    globals.assembler = new Assembler({appState: globals.appState, lattice:globals.lattice});
Amanda Ghassaei's avatar
Amanda Ghassaei committed
    globals.fileSaver = GlobalFilesaver();
Amanda Ghassaei's avatar
Amanda Ghassaei committed

    //ui
    new MenuWrapper({model: globals.appState});
    new NavBar({model:globals.appState});
    new Ribbon({model:globals.appState});
Amanda Ghassaei's avatar
Amanda Ghassaei committed

    //threeJS View
    new ThreeView({model:globals.three});
    if (globals.lattice.get("connectionType") != "gik") globals.lattice.addCellAtIndex({x:0,y:0,z:0});//add a cell
Amanda Ghassaei's avatar
Amanda Ghassaei committed
});