From 51b4e61d6c6df5e88e9a5dfcdfd7944e2a3f64e7 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 30 Jan 2012 13:25:15 -0800 Subject: Syncing stage view when rotating stage. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/draw-utils.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'js/helper-classes') diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index 3fd6e8fc..c26a5cd1 100644 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js @@ -107,6 +107,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { this.eventManager.addEventListener("elementAdded", this, false); this.eventManager.addEventListener("elementDeleted", this, false); + this.eventManager.addEventListener("elementChange", this, false); } }, @@ -124,6 +125,27 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { }, + handleElementChange: { + value: function(event) { + var els = event.detail.data.els; + if(els) + { + var len = els.length, + i = 0, + item, + el; + + for(i=0; i < len; i++) { + item = els[i]; + el = item._element || item; + el.elementModel.props3D.elementPlane.init(); + } + + this.drawWorkingPlane(); + } + } + }, + /////////////////////////////////////////////////////////////////////// // Methods /////////////////////////////////////////////////////////////////////// @@ -150,6 +172,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { plane.setElement( elt ); plane.init(); this._planesArray.push( plane ); + elt.elementModel.props3D.elementPlane = plane; } }, @@ -166,6 +189,8 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { // Then remove the element this._eltArray.splice(i, 1); + + // TODO - May need to delete props3D and elementPlane as well return; } } -- cgit v1.2.3 From cbdc001ea4afd054e7a9e1b4e54629254a68376b Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 30 Jan 2012 16:14:43 -0800 Subject: Removing unused Properties3D file since those values are now saved with the models. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/Properties3D.js | 82 --------------------------------------- 1 file changed, 82 deletions(-) delete mode 100644 js/helper-classes/Properties3D.js (limited to 'js/helper-classes') diff --git a/js/helper-classes/Properties3D.js b/js/helper-classes/Properties3D.js deleted file mode 100644 index 42499877..00000000 --- a/js/helper-classes/Properties3D.js +++ /dev/null @@ -1,82 +0,0 @@ -/* -This file contains proprietary software owned by Motorola Mobility, Inc.
-No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
-(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ - -/* Class that holds all 3d properties per element. -*/ - -exports.Properties3D = Object.create(Object.prototype, { - m_element : {value : null, writable:true, enumerable:true, configurable:true}, - -// m_upVector : {value : Vector.create( [0,1,0] ), writable: true, enumerable: true, configurable: true}, - m_azimuth : {value : 0.0, writable: true, enumerable: true, configurable: true}, - m_altitude : {value : 0.0, writable: true, enumerable: true, configurable: true}, - - m_transformCtr : {value : null, writable: true, enumerable: true, configurable: true}, -// m_targetPos : {value : Vector.create( [0,0,0] ), writable: true, enumerable: true, configurable: true}, - - m_endAzimuth : {value : 0, writable: true, enumerable: true, configurable: true}, - m_endAltitude : {value : 0, writable: true, enumerable: true, configurable: true}, - -// m_objStartPos : {value : Vector.create( [0,0,0] ), writable: true, enumerable: true, configurable: true}, - - //TODO - not sure if this should be part of the tool or stage or a utility - perspectiveDist : { value : 1400, writable: true, enumerable: true, configurable: true}, - - // keep a referenceto the GLWorld (if any) - _world : {value : null, writable:true, enumerable:true, configurable:true}, - - // keep a flag indicating the element is in the 2D snap cache - _eltIsIn2DSnapCache : { value: false, writable: true, enumerable: true, configurable: true}, - - Init : { - value : function(elt) - { - this.m_element = elt; - - this.m_azimuth = 0.0; - this.m_altitude = 0.0; - - this.m_endAzimuth = 0.0; - this.m_endAltitude = 0.0; - -// this.m_upVector = Vector.create( [0,1,0] ); -// this.m_viewDir = Vector.create( [0,0,1] ); -// this.m_endUpVector = Vector.create( [0,1,0] ); - - this.m_transformCtr = null; -// this.m_targetPos = Vector.create( [0,0,0] ); - -// this.m_objStartPos = Vector.create( [0,0,0] ); - - this.perspectiveDist = 1400; - } - }, - - ResetRotationValues : { - value : function(elt) - { -// this.m_upVector = Vector.create( [0,1,0] ); -// this.m_viewDir = Vector.create( [0,0,1] ); - - this.m_azimuth = 0.0; - this.m_altitude = 0.0; - - this.m_endAzimuth = 0.0; - this.m_endAltitude = 0.0; - - this.m_transformCtr = null; -// this.m_targetPos = Vector.create( [0,0,0] ); - } - }, - - ResetTranslationValues : { - value : function(elt) - { -// this.m_objStartPos = Vector.create( [0,0,0] ); - this.perspectiveDist = 1400; - } - } -}); \ No newline at end of file -- cgit v1.2.3