diff options
author | Nivesh Rajbhandari | 2012-04-04 10:39:32 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-04-04 10:39:32 -0700 |
commit | b9032fb0f656a6c029ef0c71c490bb5d5cd10d94 (patch) | |
tree | 0faee331bf5d28877bdafd46ea26a269abaa91b2 /js/lib | |
parent | df0389e6a191ebbff4e4b5d6625007873c0737bd (diff) | |
parent | dc9650af5760b1f93d6e93a383eabceacfdc0ad8 (diff) | |
download | ninja-b9032fb0f656a6c029ef0c71c490bb5d5cd10d94.tar.gz |
Merge branch 'refs/heads/EricSnapping' into WebGLFileIO
Diffstat (limited to 'js/lib')
-rwxr-xr-x | js/lib/geom/line.js | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/js/lib/geom/line.js b/js/lib/geom/line.js index f3806fac..1e98855e 100755 --- a/js/lib/geom/line.js +++ b/js/lib/geom/line.js | |||
@@ -148,76 +148,6 @@ var Line = function GLLine( world, xOffset, yOffset, width, height, slope, strok | |||
148 | this.importMaterialsJSON( jObj.materials ); | 148 | this.importMaterialsJSON( jObj.materials ); |
149 | }; | 149 | }; |
150 | 150 | ||
151 | this.export = function() { | ||
152 | var rtnStr = "type: " + this.geomType() + "\n"; | ||
153 | |||
154 | rtnStr += "xoff: " + this._xOffset + "\n"; | ||
155 | rtnStr += "yoff: " + this._yOffset + "\n"; | ||
156 | rtnStr += "width: " + this._width + "\n"; | ||
157 | rtnStr += "height: " + this._height + "\n"; | ||
158 | rtnStr += "xAdj: " + this._xAdj + "\n"; | ||
159 | rtnStr += "yAdj: " + this._yAdj + "\n"; | ||
160 | rtnStr += "strokeWidth: " + this._strokeWidth + "\n"; | ||
161 | |||
162 | if(this._strokeColor.gradientMode) { | ||
163 | rtnStr += "strokeGradientMode: " + this._strokeColor.gradientMode + "\n"; | ||
164 | rtnStr += "strokeColor: " + this.gradientToString(this._strokeColor.color) + "\n"; | ||
165 | } else { | ||
166 | rtnStr += "strokeColor: " + String(this._strokeColor) + "\n"; | ||
167 | } | ||
168 | |||
169 | rtnStr += "strokeStyle: " + this._strokeStyle + "\n"; | ||
170 | rtnStr += "slope: " + String(this._slope) + "\n"; | ||
171 | |||
172 | rtnStr += "strokeMat: "; | ||
173 | if (this._strokeMaterial) { | ||
174 | rtnStr += this._strokeMaterial.getName(); | ||
175 | } else { | ||
176 | rtnStr += MaterialsModel.getDefaultMaterialName(); | ||
177 | } | ||
178 | |||
179 | rtnStr += "\n"; | ||
180 | return rtnStr; | ||
181 | }; | ||
182 | |||
183 | this.import = function( importStr ) { | ||
184 | this._xOffset = Number( this.getPropertyFromString( "xoff: ", importStr ) ); | ||
185 | this._yOffset = Number( this.getPropertyFromString( "yoff: ", importStr ) ); | ||
186 | this._width = Number( this.getPropertyFromString( "width: ", importStr ) ); | ||
187 | this._height = Number( this.getPropertyFromString( "height: ", importStr ) ); | ||
188 | this._xAdj = Number( this.getPropertyFromString( "xAdj: ", importStr ) ); | ||
189 | this._yAdj = Number( this.getPropertyFromString( "yAdj: ", importStr ) ); | ||
190 | this._strokeWidth = Number( this.getPropertyFromString( "strokeWidth: ", importStr ) ); | ||
191 | var slope = this.getPropertyFromString( "slope: ", importStr ); | ||
192 | |||
193 | if(isNaN(Number(slope))) { | ||
194 | this._slope = slope; | ||
195 | } else { | ||
196 | this._slope = Number(slope); | ||
197 | } | ||
198 | |||
199 | var strokeMaterialName = this.getPropertyFromString( "strokeMat: ", importStr ); | ||
200 | this._strokeStyle = this.getPropertyFromString( "strokeStyle: ", importStr ); | ||
201 | |||
202 | if(importStr.indexOf("strokeGradientMode: ") < 0) | ||
203 | { | ||
204 | this._strokeColor = eval( "[" + this.getPropertyFromString( "strokeColor: ", importStr ) + "]" ); | ||
205 | } else { | ||
206 | this._strokeColor = {}; | ||
207 | this._strokeColor.gradientMode = this.getPropertyFromString( "strokeGradientMode: ", importStr ); | ||
208 | this._strokeColor.color = this.stringToGradient(this.getPropertyFromString( "strokeColor: ", importStr )); | ||
209 | } | ||
210 | |||
211 | var strokeMat = MaterialsModel.getMaterial( strokeMaterialName ); | ||
212 | if (!strokeMat) { | ||
213 | console.log( "object material not found in library: " + strokeMaterialName ); | ||
214 | strokeMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ); | ||
215 | } | ||
216 | |||
217 | this._strokeMaterial = strokeMat; | ||
218 | |||
219 | }; | ||
220 | |||
221 | /////////////////////////////////////////////////////////////////////// | 151 | /////////////////////////////////////////////////////////////////////// |
222 | // Methods | 152 | // Methods |
223 | /////////////////////////////////////////////////////////////////////// | 153 | /////////////////////////////////////////////////////////////////////// |