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

Amanda Ghassaei's avatar
Amanda Ghassaei committed
require.config({
Amanda Ghassaei's avatar
Amanda Ghassaei committed

Amanda Ghassaei's avatar
Amanda Ghassaei committed
    baseUrl: 'js',
Amanda Ghassaei's avatar
Amanda Ghassaei committed

Amanda Ghassaei's avatar
Amanda Ghassaei committed
    paths: {
        jquery: 'dependencies/jquery-2.1.3',
        underscore: 'dependencies/underscore',
        backbone: 'dependencies/backbone',
        flatUI: 'dependencies/flatUI/js/flat-ui',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        fileSaverLib: 'dependencies/loaders/FileSaver.min',

        //three
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        three: 'dependencies/three',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        orbitControls: 'dependencies/OrbitControls',
        stlLoader: 'dependencies/loaders/STLLoader',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        threeModel: 'three/ThreeModel',
        threeView: 'three/ThreeView',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        //models
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        globals: 'models/globals',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        plist: 'models/PList',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        appState: 'models/AppState',
        fileSaver: 'models/FileSaver',
Amanda Ghassaei's avatar
Amanda Ghassaei committed

Amanda Ghassaei's avatar
Amanda Ghassaei committed
        //lattice
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        latticeBase: 'lattice/LatticeBase',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        lattice: 'lattice/Lattice',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        cubeLattice: 'lattice/CubeLattice',
        gikLattice: 'lattice/GIKLattice',
        kelvinLattice: 'lattice/KelvinLattice',
        octaEdgeLattice: 'lattice/OctaEdgeLattice',
        octaFaceLattice: 'lattice/OctaFaceLattice',
        octaRotEdgeLattice: 'lattice/OctaRotEdgeLattice',
        octaVertexLattice: 'lattice/OctaVertexLattice',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        truncatedCubeLattice: 'lattice/TruncatedCubeLattice',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        tetraStackedLattice: 'lattice/TetraStackedLattice',
        tetraVertexLattice: 'lattice/TetraVertexLattice',
        compositeEditorLattice: 'lattice/CompositeEditorLattice',
Amanda Ghassaei's avatar
Amanda Ghassaei committed

        //baseplane
        baseplane: 'baseplane/BasePlane',
        squareBaseplane: 'baseplane/SquareBasePlane',
        octaBaseplane: 'baseplane/OctaBasePlane',
        rotEdgeOctaBaseplane: 'baseplane/RotEdgeOctaBasePlane',

Amanda Ghassaei's avatar
Amanda Ghassaei committed
        //highlighter
        highlighter: 'highlighter/Highlighter',
        defaultHighlighter: 'highlighter/DefaultHighlighter',
        cubeHighlighter: 'highlighter/CubeHighlighter',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        superCellHighlighter: 'highlighter/SuperCellHighlighter',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        octaFaceHighlighter: 'highlighter/OctaFaceHighlighter',
        truncatedCubeHighlighter: 'highlighter/TruncatedCubeHighlighter',

Amanda Ghassaei's avatar
Amanda Ghassaei committed
        //cells
        cell: 'cells/DMACell',
        octaFaceCell: 'cells/OctaFaceCell',
        octaEdgeCell: 'cells/OctaEdgeCell',
        octaVertexCell: 'cells/OctaVertexCell',
        octaRotEdgeCell: 'cells/OctaRotEdgeCell',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        tetraStackedCell: 'cells/TetraStackedCell',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        tetraVertexCell: 'cells/TetraVertexCell',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        truncatedCubeCell: 'cells/TruncatedCubeCell',
        kelvinCell: 'cells/KelvinCell',
        cubeCell: 'cells/CubeCell',
        gikCell: 'cells/GIKCell',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        superCell: 'cells/supercells/DMASupercell',
        gikSuperCell: 'cells/supercells/GIKSuperCell',

        //parts
        part: 'parts/DMAPart',
        octaFaceTriPart: 'parts/OctaFaceTriPart',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        octaEdgeVoxPart: 'parts/OctaEdgeVoxPart',
        octaEdgeVoxPartLowPoly: 'parts/OctaEdgeVoxPartLowPoly',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        gikPart: 'parts/GIKPart',
        gikPartLowPoly: 'parts/GIKPartLowPoly',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        //materials
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        materials: 'materials/DMAMaterials',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        electronicMaterials: 'materials/ElectronicMaterials',
        mechanicalMaterials: 'materials/MechanicalMaterials',
Amanda Ghassaei's avatar
Amanda Ghassaei committed

Amanda Ghassaei's avatar
Amanda Ghassaei committed
        //UI
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        navbar: 'menus/Navbar',
        navViewMenu: 'menus/NavViewMenu',//view dropdown
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        ribbon: 'menus/Ribbon',
        menuWrapper: 'menus/MenuWrapperView',
        menuParent: 'menus/MenuParentView',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        latticeMenu: 'menus/LatticeMenuView',
        importMenu: 'menus/LatticeMenuView',
        partMenu: 'menus/PartMenuView',
        scriptMenu: 'menus/ScriptMenuView',
        physicsMenu: 'menus/PhysicsMenuView',
        materialMenu: 'menus/MaterialMenuView',
        optimizeMenu: 'menus/OptimizationMenuView',
        assemblerMenu: 'menus/AssemblerMenuView',
        camMenu: 'menus/CamMenuView',
        animateMenu: 'menus/AnimationMenuView',
        sendMenu: 'menus/SendMenuView',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        compositeMenu: 'menus/CompositeMenu',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        octaFaceTrianglePartSTL: '../assets/stls/parts/OctaFaceTrianglePart.stl',
        octaEdgeVoxPartSTL: '../assets/stls/parts/OctaEdgeVoxPart.stl',
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        octaEdgeVoxPartLowPolySTL: '../assets/stls/parts/OctaEdgeVoxPartLowPoly.stl',
        gikPartSTL: '../assets/stls/parts/GIKPart.stl',
        gikEndPartSTL: '../assets/stls/parts/GIKEndPart.stl',
        gikPartLowPolySTL: '../assets/stls/parts/GIKPartLowPoly.stl',
        gikEndPartLowPolySTL: '../assets/stls/parts/GIKEndPartLowPoly.stl'
Amanda Ghassaei's avatar
Amanda Ghassaei committed

Amanda Ghassaei's avatar
Amanda Ghassaei committed

Amanda Ghassaei's avatar
Amanda Ghassaei committed
    shim: {
        three: {
            exports: 'THREE'
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        },
        orbitControls: {
            deps: ['three'],
            exports: 'THREE'
        },
        stlLoader: {
            deps: ['three'],
            exports: 'THREE'
        },
Amanda Ghassaei's avatar
Amanda Ghassaei committed
        fileSaverLib: {
            exports: 'saveAs'
        },
        flatUI: {
            deps: ['jquery']
Amanda Ghassaei's avatar
Amanda Ghassaei committed

Amanda Ghassaei's avatar
Amanda Ghassaei committed

Amanda Ghassaei's avatar
Amanda Ghassaei committed
//require.onError = function (err) {
//    console.log(err.requireType);
//    console.log(err.requireModules);
//    throw err;
//};
Amanda Ghassaei's avatar
Amanda Ghassaei committed
//init stuff
Amanda Ghassaei's avatar
Amanda Ghassaei committed
require(['appState', 'lattice', 'menuWrapper', 'navbar', 'ribbon', 'threeModel', 'threeView', 'flatUI'],
Amanda Ghassaei's avatar
Amanda Ghassaei committed
    function(appState, lattice, MenuWrapper, Navbar, Ribbon, three, ThreeView){
Amanda Ghassaei's avatar
Amanda Ghassaei committed

    new MenuWrapper({model:appState});
    new Navbar({model:appState});
Amanda Ghassaei's avatar
Amanda Ghassaei committed
    new Ribbon({model:appState});
Amanda Ghassaei's avatar
Amanda Ghassaei committed

    new ThreeView({model:three});

//    if (lattice.get("connectionType") != "gik") lattice.addCellAtIndex({x:0,y:0,z:0});//add a cell