From f8c79c9637c391c9174eb15c47f877dfcc91f0b2 Mon Sep 17 00:00:00 2001 From: Amanda Ghassaei <amandaghassaei@gmail.com> Date: Fri, 25 Sep 2015 14:02:26 -0400 Subject: [PATCH] getters --- js/API/LatticeAPI.js | 13 ++++++------- js/lattice/LatticeBase.js | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/js/API/LatticeAPI.js b/js/API/LatticeAPI.js index c274a65d..ff9b219e 100644 --- a/js/API/LatticeAPI.js +++ b/js/API/LatticeAPI.js @@ -10,8 +10,7 @@ define(['lattice', 'plist'], function(lattice, plist){ //getters getSize: function(){ - var bBox = lattice.calculateBoundingBox(); - return bBox.max.sub(bBox.min); + return lattice.getSize(); }, getBoundingBox: function(){ @@ -19,23 +18,23 @@ define(['lattice', 'plist'], function(lattice, plist){ }, getAspectRatio: function(){ - return lattice.get("aspectRatio").clone(); + return lattice.getAspectRatio(); }, getCellType: function(){ - return lattice.get("cellType"); + return lattice.getCellType(); }, getConnectionType: function(){ - return lattice.get("connectionType"); + return lattice.getConnectionType(); }, getApplicationType: function(){ - return lattice.get("applicationType"); + return lattice.getApplicationType(); }, getPartType: function(){ - return lattice.get("partType"); + return lattice.getPartType(); }, diff --git a/js/lattice/LatticeBase.js b/js/lattice/LatticeBase.js index 757fc4e4..bf91f278 100644 --- a/js/lattice/LatticeBase.js +++ b/js/lattice/LatticeBase.js @@ -34,6 +34,38 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre + //getters + + getSize: function(){ + var bBox = this.calculateBoundingBox(); + return bBox.max.sub(bBox.min).add(new THREE.Vector3(1,1,1)); + }, + + getBoundingBox: function(){ + return this.calculateBoundingBox(); + }, + + getAspectRatio: function(){ + return this.get("aspectRatio").clone(); + }, + + getCellType: function(){ + return this.get("cellType"); + }, + + getConnectionType: function(){ + return this.get("connectionType"); + }, + + getApplicationType: function(){ + return this.get("applicationType"); + }, + + getPartType: function(){ + return this.get("partType"); + }, + + //setters -- GitLab