diff options
author | John Mayhew | 2012-07-09 17:28:24 -0700 |
---|---|---|
committer | John Mayhew | 2012-07-09 17:28:24 -0700 |
commit | 770bcb52422742ff741a88a75ecefbeb90bc9247 (patch) | |
tree | 64cb3e09a8daeb340261dd7f3869c73f7b90b643 /js/helper-classes/3D/snap-2d-record.js | |
parent | 8c5ecaf90062f9e030386f338bdc19fd62b826c8 (diff) | |
parent | 2b2b5fbb4b6a786daa4e9d4ee9eba9ac78924842 (diff) | |
download | ninja-770bcb52422742ff741a88a75ecefbeb90bc9247.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
Conflicts:
manifest.json
Diffstat (limited to 'js/helper-classes/3D/snap-2d-record.js')
-rwxr-xr-x | js/helper-classes/3D/snap-2d-record.js | 107 |
1 files changed, 54 insertions, 53 deletions
diff --git a/js/helper-classes/3D/snap-2d-record.js b/js/helper-classes/3D/snap-2d-record.js index 26afaed2..e22b1b66 100755 --- a/js/helper-classes/3D/snap-2d-record.js +++ b/js/helper-classes/3D/snap-2d-record.js | |||
@@ -1,24 +1,25 @@ | |||
1 | /* <copyright> | 1 | /* <copyright> |
2 | Copyright (c) 2012, Motorola Mobility, Inc | 2 | Copyright (c) 2012, Motorola Mobility LLC. |
3 | All Rights Reserved. | 3 | All Rights Reserved. |
4 | BSD License. | ||
5 | 4 | ||
6 | Redistribution and use in source and binary forms, with or without | 5 | Redistribution and use in source and binary forms, with or without |
7 | modification, are permitted provided that the following conditions are met: | 6 | modification, are permitted provided that the following conditions are met: |
8 | 7 | ||
9 | - Redistributions of source code must retain the above copyright notice, | 8 | * Redistributions of source code must retain the above copyright notice, |
10 | this list of conditions and the following disclaimer. | 9 | this list of conditions and the following disclaimer. |
11 | - Redistributions in binary form must reproduce the above copyright | 10 | |
12 | notice, this list of conditions and the following disclaimer in the | 11 | * Redistributions in binary form must reproduce the above copyright notice, |
13 | documentation and/or other materials provided with the distribution. | 12 | this list of conditions and the following disclaimer in the documentation |
14 | - Neither the name of Motorola Mobility nor the names of its contributors | 13 | and/or other materials provided with the distribution. |
15 | may be used to endorse or promote products derived from this software | 14 | |
16 | without specific prior written permission. | 15 | * Neither the name of Motorola Mobility LLC nor the names of its |
16 | contributors may be used to endorse or promote products derived from this | ||
17 | software without specific prior written permission. | ||
17 | 18 | ||
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
@@ -36,45 +37,45 @@ var viewUtils = require("js/helper-classes/3D/view-utils").ViewUtils; | |||
36 | var snapManager = require("js/helper-classes/3D/snap-manager"); | 37 | var snapManager = require("js/helper-classes/3D/snap-manager"); |
37 | var Snap2DRecord = exports.Snap2DRecord = Object.create(Object.prototype, | 38 | var Snap2DRecord = exports.Snap2DRecord = Object.create(Object.prototype, |
38 | { | 39 | { |
39 | /////////////////////////////////////////////////////////////////////// | 40 | /////////////////////////////////////////////////////////////////////// |
40 | // Constant definitions | 41 | // Constant definitions |
41 | /////////////////////////////////////////////////////////////////////// | 42 | /////////////////////////////////////////////////////////////////////// |
42 | 43 | ||
43 | /////////////////////////////////////////////////////////////////////// | 44 | /////////////////////////////////////////////////////////////////////// |
44 | // Instance variables | 45 | // Instance variables |
45 | /////////////////////////////////////////////////////////////////////// | 46 | /////////////////////////////////////////////////////////////////////// |
46 | _elt : { value: null , writable: true}, // the four boundary points for the element in global screen space | 47 | _elt : { value: null , writable: true}, // the four boundary points for the element in global screen space |
47 | _screenPtArray : { value: null , writable: true}, // snap point in global screen space | 48 | _screenPtArray : { value: null , writable: true}, // snap point in global screen space |
48 | _alignPtArray : { value: null , writable: true}, // points for snap-align. Kept in working plane space | 49 | _alignPtArray : { value: null , writable: true}, // points for snap-align. Kept in working plane space |
49 | 50 | ||
50 | _localToGlobalMat : { value: null, writable: true }, | 51 | _localToGlobalMat : { value: null, writable: true }, |
51 | _globalToLocalMat : { value: null, writable: true }, | 52 | _globalToLocalMat : { value: null, writable: true }, |
52 | 53 | ||
53 | // indices to the extremal align points | 54 | // indices to the extremal align points |
54 | _xMinArray : { value: [], writable: true }, | 55 | _xMinArray : { value: [], writable: true }, |
55 | _xMaxArray : { value: [] , writable: true}, | 56 | _xMaxArray : { value: [] , writable: true}, |
56 | _yMinArray : { value: [] , writable: true}, | 57 | _yMinArray : { value: [] , writable: true}, |
57 | _yMaxArray : { value: [] , writable: true}, | 58 | _yMaxArray : { value: [] , writable: true}, |
58 | 59 | ||
59 | /////////////////////////////////////////////////////////////////////// | 60 | /////////////////////////////////////////////////////////////////////// |
60 | // Property accessors | 61 | // Property accessors |
61 | /////////////////////////////////////////////////////////////////////// | 62 | /////////////////////////////////////////////////////////////////////// |
62 | getElement: { value: function() { return this._elt; }}, | 63 | getElement: { value: function() { return this._elt; }}, |
63 | setElement: { value: function() { this._elt = e; }}, | 64 | setElement: { value: function() { this._elt = e; }}, |
64 | 65 | ||
65 | getScreenPointArray: { value: function() { return this._screenPtArray; }}, | 66 | getScreenPointArray: { value: function() { return this._screenPtArray; }}, |
66 | getAlignPointArray: { value: function() { return this._alignPtArray; }}, | 67 | getAlignPointArray: { value: function() { return this._alignPtArray; }}, |
67 | 68 | ||
68 | getLocalToGlobalMatrix: { value: function() { return this._localToGlobalMat; }}, | 69 | getLocalToGlobalMatrix: { value: function() { return this._localToGlobalMat; }}, |
69 | setLocalToGlobalMatrix: { value: function() { this._localToGlobalMat = l2g.slice(0); }}, | 70 | setLocalToGlobalMatrix: { value: function() { this._localToGlobalMat = l2g.slice(0); }}, |
70 | 71 | ||
71 | getGlobalToLocalMatrix: { value: function() { return this._globalToLocalMat; }}, | 72 | getGlobalToLocalMatrix: { value: function() { return this._globalToLocalMat; }}, |
72 | setGlobalToLocalMatrix: { value: function() { this._globalToLocalMat = g2l.slice(0); }}, | 73 | setGlobalToLocalMatrix: { value: function() { this._globalToLocalMat = g2l.slice(0); }}, |
73 | 74 | ||
74 | /////////////////////////////////////////////////////////////////////// | 75 | /////////////////////////////////////////////////////////////////////// |
75 | // Methods | 76 | // Methods |
76 | /////////////////////////////////////////////////////////////////////// | 77 | /////////////////////////////////////////////////////////////////////// |
77 | init: { | 78 | init: { |
78 | value: function( elt ) { | 79 | value: function( elt ) { |
79 | this._elt = elt; | 80 | this._elt = elt; |
80 | var bounds = viewUtils.getElementViewBounds3D( elt ); | 81 | var bounds = viewUtils.getElementViewBounds3D( elt ); |
@@ -112,7 +113,7 @@ var Snap2DRecord = exports.Snap2DRecord = Object.create(Object.prototype, | |||
112 | } | 113 | } |
113 | }, | 114 | }, |
114 | 115 | ||
115 | initAlignExtremalPoints: { | 116 | initAlignExtremalPoints: { |
116 | value: function() { | 117 | value: function() { |
117 | var xMinArray = [0], xMaxArray = [0], | 118 | var xMinArray = [0], xMaxArray = [0], |
118 | yMinArray = [0], yMaxArray = [0]; | 119 | yMinArray = [0], yMaxArray = [0]; |
@@ -135,7 +136,7 @@ var Snap2DRecord = exports.Snap2DRecord = Object.create(Object.prototype, | |||
135 | } | 136 | } |
136 | }, | 137 | }, |
137 | 138 | ||
138 | getScreenPoint: { | 139 | getScreenPoint: { |
139 | value: function( index ) { | 140 | value: function( index ) { |
140 | var rtnPt; | 141 | var rtnPt; |
141 | if ((index >= 0) && (index < 4) && (this._screenPtArray != null)) | 142 | if ((index >= 0) && (index < 4) && (this._screenPtArray != null)) |
@@ -145,7 +146,7 @@ var Snap2DRecord = exports.Snap2DRecord = Object.create(Object.prototype, | |||
145 | } | 146 | } |
146 | }, | 147 | }, |
147 | 148 | ||
148 | addAlignPoint: { | 149 | addAlignPoint: { |
149 | value: function( pt ) { | 150 | value: function( pt ) { |
150 | this._alignPtArray.push( pt ); | 151 | this._alignPtArray.push( pt ); |
151 | } | 152 | } |