diff options
Diffstat (limited to 'js/helper-classes/3D')
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/GLMatrix/gl-matrix.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/GLMatrix/notice.txt | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/LinePlaneIntersectRec.js | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/ParseUtils.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/Rectangle.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/StageLine.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/draw-utils.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/element-planes.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/glUtils.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/hit-record.js | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/math-utils.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/snap-2d-record.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/snap-manager.js | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/vec-utils.js | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | js/helper-classes/3D/view-utils.js | 42 |
15 files changed, 18 insertions, 34 deletions
diff --git a/js/helper-classes/3D/GLMatrix/gl-matrix.js b/js/helper-classes/3D/GLMatrix/gl-matrix.js index 811ed5cd..811ed5cd 100644..100755 --- a/js/helper-classes/3D/GLMatrix/gl-matrix.js +++ b/js/helper-classes/3D/GLMatrix/gl-matrix.js | |||
diff --git a/js/helper-classes/3D/GLMatrix/notice.txt b/js/helper-classes/3D/GLMatrix/notice.txt index 8903aa97..8903aa97 100644..100755 --- a/js/helper-classes/3D/GLMatrix/notice.txt +++ b/js/helper-classes/3D/GLMatrix/notice.txt | |||
diff --git a/js/helper-classes/3D/LinePlaneIntersectRec.js b/js/helper-classes/3D/LinePlaneIntersectRec.js index e075dd3d..cb172bf7 100644..100755 --- a/js/helper-classes/3D/LinePlaneIntersectRec.js +++ b/js/helper-classes/3D/LinePlaneIntersectRec.js | |||
@@ -42,9 +42,6 @@ var LinePlaneIntersectRec = exports.LinePlaneIntersectRec = Object.create(Object | |||
42 | setDeltaVis: { value: function(d) { this._deltaVis = d; } }, | 42 | setDeltaVis: { value: function(d) { this._deltaVis = d; } }, |
43 | getDeltaVis: { value: function() { return this._deltaVis; } }, | 43 | getDeltaVis: { value: function() { return this._deltaVis; } }, |
44 | 44 | ||
45 | getElementPlanes: { value: function() { return this._deltaVis; } }, | ||
46 | setElementPlanes: { value: function(p) { this._elementPlanes = p; } }, | ||
47 | |||
48 | setNext: { value: function(n) { this._next = n; } }, | 45 | setNext: { value: function(n) { this._next = n; } }, |
49 | getNext: { value: function() { return this._next; } }, | 46 | getNext: { value: function() { return this._next; } }, |
50 | 47 | ||
diff --git a/js/helper-classes/3D/ParseUtils.js b/js/helper-classes/3D/ParseUtils.js index 556253e9..556253e9 100644..100755 --- a/js/helper-classes/3D/ParseUtils.js +++ b/js/helper-classes/3D/ParseUtils.js | |||
diff --git a/js/helper-classes/3D/Rectangle.js b/js/helper-classes/3D/Rectangle.js index e797eedf..e797eedf 100644..100755 --- a/js/helper-classes/3D/Rectangle.js +++ b/js/helper-classes/3D/Rectangle.js | |||
diff --git a/js/helper-classes/3D/StageLine.js b/js/helper-classes/3D/StageLine.js index e0e7a8e3..e0e7a8e3 100644..100755 --- a/js/helper-classes/3D/StageLine.js +++ b/js/helper-classes/3D/StageLine.js | |||
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index c07391db..c07391db 100644..100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js | |||
diff --git a/js/helper-classes/3D/element-planes.js b/js/helper-classes/3D/element-planes.js index 7ccf311e..7ccf311e 100644..100755 --- a/js/helper-classes/3D/element-planes.js +++ b/js/helper-classes/3D/element-planes.js | |||
diff --git a/js/helper-classes/3D/glUtils.js b/js/helper-classes/3D/glUtils.js index f6d075f8..f6d075f8 100644..100755 --- a/js/helper-classes/3D/glUtils.js +++ b/js/helper-classes/3D/glUtils.js | |||
diff --git a/js/helper-classes/3D/hit-record.js b/js/helper-classes/3D/hit-record.js index 5546cc5a..2c60adc6 100644..100755 --- a/js/helper-classes/3D/hit-record.js +++ b/js/helper-classes/3D/hit-record.js | |||
@@ -139,12 +139,10 @@ var HitRecord = exports.HitRecord = Object.create(Object.prototype, | |||
139 | 139 | ||
140 | isSomeGridTypeSnap : { | 140 | isSomeGridTypeSnap : { |
141 | value: function() { | 141 | value: function() { |
142 | return | 142 | return ((this._type == this.SNAP_TYPE_GRID_VERTEX) || |
143 | ( | ||
144 | (this._type == this.SNAP_TYPE_GRID_VERTEX) || | ||
145 | (this._type == this.SNAP_TYPE_GRID_HORIZONTAL) || | 143 | (this._type == this.SNAP_TYPE_GRID_HORIZONTAL) || |
146 | (this._type == this.SNAP_TYPE_GRID_VERTICAL) | 144 | (this._type == this.SNAP_TYPE_GRID_VERTICAL) |
147 | ) | 145 | ); |
148 | } | 146 | } |
149 | }, | 147 | }, |
150 | 148 | ||
diff --git a/js/helper-classes/3D/math-utils.js b/js/helper-classes/3D/math-utils.js index 37044763..37044763 100644..100755 --- a/js/helper-classes/3D/math-utils.js +++ b/js/helper-classes/3D/math-utils.js | |||
diff --git a/js/helper-classes/3D/snap-2d-record.js b/js/helper-classes/3D/snap-2d-record.js index c77b28b3..c77b28b3 100644..100755 --- a/js/helper-classes/3D/snap-2d-record.js +++ b/js/helper-classes/3D/snap-2d-record.js | |||
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 0a950658..ada6960b 100644..100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js | |||
@@ -1087,6 +1087,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
1087 | 1087 | ||
1088 | // we need to check the orientation of the bounds | 1088 | // we need to check the orientation of the bounds |
1089 | var nrm = MathUtils.getNormalFromBounds3D( bounds3D ); | 1089 | var nrm = MathUtils.getNormalFromBounds3D( bounds3D ); |
1090 | if (MathUtils.fpSign(nrm[2]) == 0) return null; | ||
1090 | var zNrm = nrm[2]; | 1091 | var zNrm = nrm[2]; |
1091 | var dist; | 1092 | var dist; |
1092 | 1093 | ||
diff --git a/js/helper-classes/3D/vec-utils.js b/js/helper-classes/3D/vec-utils.js index ceff4f64..ceff4f64 100644..100755 --- a/js/helper-classes/3D/vec-utils.js +++ b/js/helper-classes/3D/vec-utils.js | |||
diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index c8e20def..a2fac34f 100644..100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js | |||
@@ -4,16 +4,16 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. |
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | var vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils, | 7 | var Montage = require("montage/core/core").Montage, |
8 | snapManagerModule = require("js/helper-classes/3D/snap-manager"), | 8 | Component = require("montage/ui/component").Component, |
9 | vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils, | ||
9 | Rectangle = require("js/helper-classes/3D/rectangle").Rectangle, | 10 | Rectangle = require("js/helper-classes/3D/rectangle").Rectangle, |
10 | ElementsMediator = require("js/mediators/element-mediator").ElementMediator; | 11 | ElementsMediator = require("js/mediators/element-mediator").ElementMediator; |
11 | /////////////////////////////////////////////////////////////////////// | 12 | /////////////////////////////////////////////////////////////////////// |
12 | // Class ViewUtils | 13 | // Class ViewUtils |
13 | // Viewing Utility functions | 14 | // Viewing Utility functions |
14 | /////////////////////////////////////////////////////////////////////// | 15 | /////////////////////////////////////////////////////////////////////// |
15 | var ViewUtils = exports.ViewUtils = Object.create(Object.prototype, | 16 | exports.ViewUtils = Montage.create(Component, { |
16 | { | ||
17 | /////////////////////////////////////////////////////////////////////// | 17 | /////////////////////////////////////////////////////////////////////// |
18 | // Instance variables | 18 | // Instance variables |
19 | /////////////////////////////////////////////////////////////////////// | 19 | /////////////////////////////////////////////////////////////////////// |
@@ -133,7 +133,7 @@ var ViewUtils = exports.ViewUtils = Object.create(Object.prototype, | |||
133 | var xVec = [mat[0], mat[1], mat[2], mat[3]]; | 133 | var xVec = [mat[0], mat[1], mat[2], mat[3]]; |
134 | var yVec = [mat[4], mat[5], mat[6], mat[7]]; | 134 | var yVec = [mat[4], mat[5], mat[6], mat[7]]; |
135 | 135 | ||
136 | var stage = snapManagerModule.SnapManager.getStage(); | 136 | var stage = this.application.ninja.currentDocument.documentRoot; |
137 | var stageMat = this.getMatrixFromElement(stage); | 137 | var stageMat = this.getMatrixFromElement(stage); |
138 | var stagePlane = [stageMat[8], stageMat[9], stageMat[10], stageMat[11]]; | 138 | var stagePlane = [stageMat[8], stageMat[9], stageMat[10], stageMat[11]]; |
139 | 139 | ||
@@ -412,7 +412,7 @@ var ViewUtils = exports.ViewUtils = Object.create(Object.prototype, | |||
412 | // get the four corners of the element in global space | 412 | // get the four corners of the element in global space |
413 | var bounds = this.getElementViewBounds3D( elt ); | 413 | var bounds = this.getElementViewBounds3D( elt ); |
414 | var bounds3D = new Array(); | 414 | var bounds3D = new Array(); |
415 | var stage = snapManagerModule.SnapManager.getStage(); | 415 | var stage = this.application.ninja.currentDocument.documentRoot; |
416 | for (var i=0; i<3; i++) | 416 | for (var i=0; i<3; i++) |
417 | { | 417 | { |
418 | var gPt = this.localToGlobal( bounds[i], elt ); | 418 | var gPt = this.localToGlobal( bounds[i], elt ); |
@@ -789,7 +789,7 @@ var ViewUtils = exports.ViewUtils = Object.create(Object.prototype, | |||
789 | 789 | ||
790 | getStageWorldToGlobalMatrix: { | 790 | getStageWorldToGlobalMatrix: { |
791 | value: function() { | 791 | value: function() { |
792 | var stage = snapManagerModule.SnapManager.getStage(); | 792 | var stage = this.application.ninja.currentDocument.documentRoot; |
793 | this.pushViewportObj( stage ); | 793 | this.pushViewportObj( stage ); |
794 | 794 | ||
795 | // get the matrix to the parent | 795 | // get the matrix to the parent |
@@ -1190,12 +1190,7 @@ var ViewUtils = exports.ViewUtils = Object.create(Object.prototype, | |||
1190 | // drawLayoutModule.drawLayout.redrawDocument() OR | 1190 | // drawLayoutModule.drawLayout.redrawDocument() OR |
1191 | // window.stageManager.drawSelectionRec(true) this.getStage().draw(); | 1191 | // window.stageManager.drawSelectionRec(true) this.getStage().draw(); |
1192 | // drawLayoutModule.drawLayout.redrawDocument(); | 1192 | // drawLayoutModule.drawLayout.redrawDocument(); |
1193 | // | 1193 | |
1194 | // SNAP MANAGER | ||
1195 | // snapManager: snapManagerModule.SnapManager | ||
1196 | // snapManagerModule: snapManagerModule = r_equire("js/helper-classes/3D/snap-manager") | ||
1197 | // stage stage = snapManagerModule.SnapManager.getStage(); | ||
1198 | // | ||
1199 | // SELECTION MANAGER | 1194 | // SELECTION MANAGER |
1200 | // selected elements: this.application.ninja.selectedElements | 1195 | // selected elements: this.application.ninja.selectedElements |
1201 | // selectionManager this.application.ninja.selectionController | 1196 | // selectionManager this.application.ninja.selectionController |
@@ -1213,10 +1208,10 @@ var ViewUtils = exports.ViewUtils = Object.create(Object.prototype, | |||
1213 | 1208 | ||
1214 | clearStageTranslation: { | 1209 | clearStageTranslation: { |
1215 | value: function() { | 1210 | value: function() { |
1216 | if (snapManagerModule.SnapManager.application.ninja.currentDocument) | 1211 | if (this.application.ninja.currentDocument) |
1217 | { | 1212 | { |
1218 | // get the user content object | 1213 | // get the user content object |
1219 | var userContent = snapManagerModule.SnapManager.application.ninja.currentDocument.documentRoot; | 1214 | var userContent = this.application.ninja.currentDocument.documentRoot; |
1220 | if (!userContent) return; | 1215 | if (!userContent) return; |
1221 | this.setViewportObj( userContent ); | 1216 | this.setViewportObj( userContent ); |
1222 | 1217 | ||
@@ -1235,9 +1230,10 @@ var ViewUtils = exports.ViewUtils = Object.create(Object.prototype, | |||
1235 | value:function( globalPt, zoomFactor ) { | 1230 | value:function( globalPt, zoomFactor ) { |
1236 | var localPt; | 1231 | var localPt; |
1237 | var tmp1, tmp2, tmp3; | 1232 | var tmp1, tmp2, tmp3; |
1238 | if (snapManagerModule.SnapManager.application.ninja.currentDocument) | 1233 | |
1234 | if (this.application.ninja.currentDocument) | ||
1239 | { | 1235 | { |
1240 | var userContent = snapManagerModule.SnapManager.application.ninja.currentDocument.documentRoot; | 1236 | var userContent = this.application.ninja.currentDocument.documentRoot; |
1241 | if (!userContent) return; | 1237 | if (!userContent) return; |
1242 | this.setViewportObj( userContent ); | 1238 | this.setViewportObj( userContent ); |
1243 | var userContentMat = this.getMatrixFromElement(userContent); | 1239 | var userContentMat = this.getMatrixFromElement(userContent); |
@@ -1285,7 +1281,7 @@ var ViewUtils = exports.ViewUtils = Object.create(Object.prototype, | |||
1285 | tmp2 = this.localToGlobal( localPt, userContent ); // DEBUG - remove this line | 1281 | tmp2 = this.localToGlobal( localPt, userContent ); // DEBUG - remove this line |
1286 | 1282 | ||