aboutsummaryrefslogtreecommitdiff
path: root/js/lib/geom/rectangle.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/geom/rectangle.js')
-rwxr-xr-xjs/lib/geom/rectangle.js110
1 files changed, 0 insertions, 110 deletions
diff --git a/js/lib/geom/rectangle.js b/js/lib/geom/rectangle.js
index 46876ba7..00c40eb9 100755
--- a/js/lib/geom/rectangle.js
+++ b/js/lib/geom/rectangle.js
@@ -187,65 +187,6 @@ var Rectangle = function GLRectangle() {
187 /////////////////////////////////////////////////////////////////////// 187 ///////////////////////////////////////////////////////////////////////
188 // Methods 188 // Methods
189 /////////////////////////////////////////////////////////////////////// 189 ///////////////////////////////////////////////////////////////////////
190 /*
191 this.export = function() {
192 var rtnStr = "type: " + this.geomType() + "\n";
193
194 /////////////////////////////////////////////////////////////////////////
195 //
196 // world, xOffset, yOffset, width, height, strokeSize, strokeColor, fillColor,
197 // tlRadius, trRadius, blRadius, brRadius, strokeMaterial, fillMaterial, strokeStyle
198 //
199 /////////////////////////////////////////////////////////////////////////////
200
201 rtnStr += "xoff: " + this._xOffset + "\n";
202 rtnStr += "yoff: " + this._yOffset + "\n";
203 rtnStr += "width: " + this._width + "\n";
204 rtnStr += "height: " + this._height + "\n";
205 rtnStr += "strokeWidth: " + this._strokeWidth + "\n";
206
207 if(this._strokeColor.gradientMode) {
208 rtnStr += "strokeGradientMode: " + this._strokeColor.gradientMode + "\n";
209 rtnStr += "strokeColor: " + this.gradientToString(this._strokeColor.color) + "\n";
210 } else {
211 rtnStr += "strokeColor: " + String(this._strokeColor) + "\n";
212 }
213
214 if(this._fillColor.gradientMode) {
215 rtnStr += "fillGradientMode: " + this._fillColor.gradientMode + "\n";
216 rtnStr += "fillColor: " + this.gradientToString(this._fillColor.color) + "\n";
217 } else {
218 rtnStr += "fillColor: " + String(this._fillColor) + "\n";
219 }
220 rtnStr += "tlRadius: " + this._tlRadius + "\n";
221 rtnStr += "trRadius: " + this._trRadius + "\n";
222 rtnStr += "blRadius: " + this._blRadius + "\n";
223 rtnStr += "brRadius: " + this._brRadius + "\n";
224 rtnStr += "innerRadius: " + this._innerRadius + "\n";
225 rtnStr += "strokeStyle: " + this._strokeStyle + "\n";
226
227 rtnStr += "strokeMat: ";
228 if (this._strokeMaterial) {
229 rtnStr += this._strokeMaterial.getName();
230 } else {
231 rtnStr += MaterialsModel.getDefaultMaterialName();
232 }
233 rtnStr += "\n";
234
235 rtnStr += "fillMat: ";
236 if (this._fillMaterial) {
237 rtnStr += this._fillMaterial.getName();
238 } else {
239 rtnStr += MaterialsModel.getDefaultMaterialName();
240 }
241 rtnStr += "\n";
242
243 rtnStr += this.exportMaterials();
244
245 return rtnStr;
246 };
247 */
248
249 // JSON export 190 // JSON export
250 this.exportJSON = function() 191 this.exportJSON = function()
251 { 192 {
@@ -293,57 +234,6 @@ var Rectangle = function GLRectangle() {
293 this.importMaterialsJSON( jObj.materials ); 234 this.importMaterialsJSON( jObj.materials );
294 }; 235 };
295 236
296 this.import = function( importStr ) {
297 this._xOffset = Number( this.getPropertyFromString( "xoff: ", importStr ) );
298 this._yOffset = Number( this.getPropertyFromString( "yoff: ", importStr ) );
299 this._width = Number( this.getPropertyFromString( "width: ", importStr ) );
300 this._height = Number( this.getPropertyFromString( "height: ", importStr ) );
301 this._strokeWidth = Number( this.getPropertyFromString( "strokeWidth: ", importStr ) );
302 this._innerRadius = Number( this.getPropertyFromString( "innerRadius: ", importStr ) );
303 this._strokeStyle = Number( this.getPropertyFromString( "strokeStyle: ", importStr ) );
304 var strokeMaterialName = this.getPropertyFromString( "strokeMat: ", importStr );
305 var fillMaterialName = this.getPropertyFromString( "fillMat: ", importStr );
306 this._strokeStyle = this.getPropertyFromString( "strokeStyle: ", importStr );
307
308 if(importStr.indexOf("fillGradientMode: ") < 0) {
309 this._fillColor = eval( "[" + this.getPropertyFromString( "fillColor: ", importStr ) + "]" );
310 } else {
311 this._fillColor = {};
312 this._fillColor.gradientMode = this.getPropertyFromString( "fillGradientMode: ", importStr );
313 this._fillColor.color = this.stringToGradient(this.getPropertyFromString( "fillColor: ", importStr ));
314 }
315
316 if(importStr.indexOf("strokeGradientMode: ") < 0)
317 {
318 this._strokeColor = eval( "[" + this.getPropertyFromString( "strokeColor: ", importStr ) + "]" );
319 } else {
320 this._strokeColor = {};
321 this._strokeColor.gradientMode = this.getPropertyFromString( "strokeGradientMode: ", importStr );
322 this._strokeColor.color = this.stringToGradient(this.getPropertyFromString( "strokeColor: ", importStr ));
323 }
324
325 this._tlRadius = Number( this.getPropertyFromString( "tlRadius: ", importStr ) );
326 this._trRadius = Number( this.getPropertyFromString( "trRadius: ", importStr ) );
327 this._blRadius = Number( this.getPropertyFromString( "blRadius: ", importStr ) );
328 this._brRadius = Number( this.getPropertyFromString( "brRadius: ", importStr ) );
329
330 var strokeMat = MaterialsModel.getMaterial( strokeMaterialName );
331 if (!strokeMat) {
332 console.log( "object material not found in library: " + strokeMaterialName );
333 strokeMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() );
334 }
335 this._strokeMaterial = strokeMat;
336
337 var fillMat = MaterialsModel.getMaterial( fillMaterialName );
338 if (!fillMat) {
339 console.log( "object material not found in library: " + fillMaterialName );
340 fillMat = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() );
341 }
342 this._fillMaterial = fillMat;
343
344 this.importMaterials( importStr );
345 };
346
347 this.buildBuffers = function() { 237 this.buildBuffers = function() {
348 // get the world 238 // get the world
349 var world = this.getWorld(); 239 var world = this.getWorld();