diff --git a/index.html b/index.html index 906f0c293c84bcf01ad8c71c245c8d926a6010dc..e27bfcdca07ffeba0de76f1c2299f3e8437e9273 100644 --- a/index.html +++ b/index.html @@ -53,9 +53,18 @@ <!--models--> <script src="js/models/ThreeModel.js"></script> - <script src="js/models/LatticeOcta.js"></script> - <script src="js/models/LatticeOther.js"></script> + <script src="js/lattice/Lattice.js"></script> + <script src="js/lattice/CubeLattice.js"></script> + <script src="js/lattice/GIKLattice.js"></script> + <script src="js/lattice/KelvinLattice.js"></script> + <script src="js/lattice/OctaEdgeLattice.js"></script> + <script src="js/lattice/OctaFaceLattice.js"></script> + <script src="js/lattice/OctaFreeFormFaceLattice.js"></script> + <script src="js/lattice/OctaRotEdgeLattice.js"></script> + <script src="js/lattice/OctaVertexLattice.js"></script> + <script src="js/lattice/TruncatedCubeLattice.js"></script> + <script src="js/models/FillGeometry.js"></script> <script src="js/models/BasePlane.js"></script> <script src="js/models/extrudeVisualizer.js"></script> diff --git a/js/lattice/CubeLattice.js b/js/lattice/CubeLattice.js index e9db2e0a0a3eaf6d5e4bee041ab0499633ccbe3f..e2ce706e01b031752288bb562fd1c9df629a3e11 100644 --- a/js/lattice/CubeLattice.js +++ b/js/lattice/CubeLattice.js @@ -2,10 +2,9 @@ * Created by aghassaei on 5/26/15. */ +latticeSubclasses = latticeSubclasses || {}; -_.extend(Lattice, { - - CubeLattice: { +latticeSubclasses["CubeLattice"] = { _initLatticeType: function(){ globals.basePlane = new SquareBasePlane(); @@ -43,4 +42,3 @@ _.extend(Lattice, { }); } } -}); \ No newline at end of file diff --git a/js/lattice/GIKLattice.js b/js/lattice/GIKLattice.js index d2182bbd86519fa4e10fcf2da88ebde70dc88242..98d5af067083c0a8fcba1fa27ac5d2552d7c2ecb 100644 --- a/js/lattice/GIKLattice.js +++ b/js/lattice/GIKLattice.js @@ -2,10 +2,9 @@ * Created by aghassaei on 5/26/15. */ +latticeSubclasses = latticeSubclasses || {}; -_.extend(Lattice, { - - GIKLattice: { +latticeSubclasses["GIKLattice"] = { _initLatticeType: function(){ globals.basePlane = new SquareBasePlane(); @@ -99,4 +98,3 @@ _.extend(Lattice, { }); } } -}); \ No newline at end of file diff --git a/js/lattice/KelvinLattice.js b/js/lattice/KelvinLattice.js index b98be46de1c981518749d3f8fd7da5ebd3a2ab29..96c9a6cb54d46518a4941fab9d6ea399bf1ec887 100644 --- a/js/lattice/KelvinLattice.js +++ b/js/lattice/KelvinLattice.js @@ -3,9 +3,9 @@ */ -_.extend(Lattice, { +latticeSubclasses = latticeSubclasses || {}; - KelvinLattice: { +latticeSubclasses["KelvinLattice"] = { _initLatticeType: function(){ globals.basePlane = new SquareBasePlane(); @@ -43,4 +43,3 @@ _.extend(Lattice, { }); } } -}); \ No newline at end of file diff --git a/js/lattice/Lattice.js b/js/lattice/Lattice.js index ce6437319b420fd571f0ba08ac0221f6f9f7623e..ac7c6075ff68af0370d0e824ffe938872ecdf3c0 100644 --- a/js/lattice/Lattice.js +++ b/js/lattice/Lattice.js @@ -2,6 +2,7 @@ * Created by aghassaei on 1/16/15. */ +latticeSubclasses = {}; Lattice = Backbone.Model.extend({ @@ -31,7 +32,7 @@ Lattice = Backbone.Model.extend({ initialize: function(){ - _.extend(this, OctaLatticeSubclasses, OtherLatticeSubclasses); + _.extend(this, latticeSubclasses); //bind events this.listenTo(this, "change:gikLength", this._gikLengthDidChange); diff --git a/js/lattice/OctaEdgeLattice.js b/js/lattice/OctaEdgeLattice.js index 0d1b73e26701e8e83ee70883597a93c34c69ea10..ab4db72a1a0e3486ccaffdebc4f11007829b00e9 100644 --- a/js/lattice/OctaEdgeLattice.js +++ b/js/lattice/OctaEdgeLattice.js @@ -2,10 +2,9 @@ * Created by aghassaei on 5/26/15. */ +latticeSubclasses = latticeSubclasses || {}; -_.extend(Lattice, { - - OctaEdgeLattice: { +latticeSubclasses["OctaEdgeLattice"] = { _initLatticeType: function(){ globals.basePlane = new OctaBasePlane(); @@ -61,4 +60,3 @@ _.extend(Lattice, { }); } } -}); \ No newline at end of file diff --git a/js/lattice/OctaFaceLattice.js b/js/lattice/OctaFaceLattice.js index a10acb0975f632732de8108ac281d517b4426b08..195cf6a0642e92decd8239cc166358556ab0b3c7 100644 --- a/js/lattice/OctaFaceLattice.js +++ b/js/lattice/OctaFaceLattice.js @@ -2,9 +2,9 @@ * Created by aghassaei on 5/26/15. */ -_.extend(Lattice, { +latticeSubclasses = latticeSubclasses || {}; - OctaFaceLattice: { +latticeSubclasses["OctaFaceLattice"] = { _initLatticeType: function(){ globals.basePlane = new OctaBasePlane(); @@ -51,4 +51,3 @@ _.extend(Lattice, { }); } } -}); \ No newline at end of file diff --git a/js/lattice/OctaFreeFormFaceLattice.js b/js/lattice/OctaFreeFormFaceLattice.js index acc7ab9e52197b64fdb2b10d2d54f163d1ec93fe..5984a10fada735c1409dfd6389c7db25ba879a52 100644 --- a/js/lattice/OctaFreeFormFaceLattice.js +++ b/js/lattice/OctaFreeFormFaceLattice.js @@ -2,10 +2,9 @@ * Created by aghassaei on 5/26/15. */ +latticeSubclasses = latticeSubclasses || {}; -_.extend(Lattice, { - - OctaFreeFormFaceLattice: { +latticeSubclasses["OctaFreeFormFaceLattice"] = { _initLatticeType: function(){ globals.basePlane = new OctaBasePlane(); @@ -70,5 +69,4 @@ _.extend(Lattice, { self[key] = null; }); } - } -}); \ No newline at end of file + } \ No newline at end of file diff --git a/js/lattice/OctaRotEdgeLattice.js b/js/lattice/OctaRotEdgeLattice.js index ad0d4759120731b5627fb89e519699ee7c45c0ab..0582bb92447b9658603edb979982236215f333ad 100644 --- a/js/lattice/OctaRotEdgeLattice.js +++ b/js/lattice/OctaRotEdgeLattice.js @@ -2,10 +2,9 @@ * Created by aghassaei on 5/26/15. */ +latticeSubclasses = latticeSubclasses || {}; -_.extend(Lattice, { - - OctaRotEdgeLattice: { +latticeSubclasses["OctaRotEdgeLattice"] = { _initLatticeType: function(){ globals.basePlane = new RotEdgeOctaBasePlane(); @@ -55,4 +54,3 @@ _.extend(Lattice, { }); } } -}); \ No newline at end of file diff --git a/js/lattice/OctaVertexLattice.js b/js/lattice/OctaVertexLattice.js index a0a2ac396bf44b86109a2aab7e3ee2b5abec80df..27c8a5cc3062b601b71b425f25f648e3b56e803e 100644 --- a/js/lattice/OctaVertexLattice.js +++ b/js/lattice/OctaVertexLattice.js @@ -2,10 +2,9 @@ * Created by aghassaei on 5/26/15. */ +latticeSubclasses = latticeSubclasses || {}; -_.extend(Lattice, { - - OctaVertexLattice: { +latticeSubclasses["OctaVertexLattice"] = { _initLatticeType: function(){ globals.basePlane = new SquareBasePlane(); @@ -51,4 +50,3 @@ _.extend(Lattice, { }); } } -}); \ No newline at end of file diff --git a/js/lattice/TruncatedCubeLattice.js b/js/lattice/TruncatedCubeLattice.js index e81739bca00ffcadc97b33b30d850a94180bc2bb..edde79a7bf3540e4294a8988ab219119f0700be7 100644 --- a/js/lattice/TruncatedCubeLattice.js +++ b/js/lattice/TruncatedCubeLattice.js @@ -2,10 +2,9 @@ * Created by aghassaei on 5/26/15. */ +latticeSubclasses = latticeSubclasses || {}; -_.extend(Lattice, { - - TruncatedCubeLattice: { +latticeSubclasses["TruncatedCubeLattice"] = { _initLatticeType: function(){ globals.basePlane = new SquareBasePlane(); @@ -43,4 +42,3 @@ _.extend(Lattice, { }); } } -}); \ No newline at end of file