@@ -372,7 +372,7 @@ BrainBrowser.SurfaceViewer.modules.rendering = function(viewer) {
372372
373373 var line = new THREE . Line ( geometry , material , THREE . LinePieces ) ;
374374
375- if ( options . draw === false ) { return line }
375+ if ( options . draw === false ) { return line ; }
376376
377377 if ( viewer . model ) {
378378 viewer . model . add ( line ) ;
@@ -383,14 +383,15 @@ BrainBrowser.SurfaceViewer.modules.rendering = function(viewer) {
383383 viewer . updated = true ;
384384
385385 return line ;
386- }
386+ } ;
387387
388388 /**
389389 * @doc function
390390 * @name viewer.rendering:drawAxes
391391 * @param {number } size Define the size of the line representing the axes.
392392 * @param {object } options Options, which include the following:
393393 *
394+ * * **name** The name of the axes
394395 * * **center** A Vector3, that represent the orgin of the axes
395396 * * **x_color** The color of the line as a hexadecimal integer (default 0xff0000).
396397 * * **y_color** The color of the line as a hexadecimal integer (default 0x00ff00).
@@ -409,25 +410,27 @@ BrainBrowser.SurfaceViewer.modules.rendering = function(viewer) {
409410 viewer . drawAxes = function ( size , options ) {
410411 size = size || 300 ;
411412 options = options || { } ;
413+ var name = options . name || "axes" ;
412414 var center = options . center || new THREE . Vector3 ( 0 , 0 , 0 ) ;
413415 var x_color = options . x_color >= 0 ? options . x_color : 0xff0000 ;
414416 var y_color = options . y_color >= 0 ? options . y_color : 0x00ff00 ;
415417 var z_color = options . z_color >= 0 ? options . z_color : 0x0000ff ;
416418 var complete = options . complete === true ;
417419
418- var axes = new THREE . Object3D ( ) ;
420+ var axes = new THREE . Object3D ( ) ;
421+ axes . name = name ;
419422
420423 // X axes
421424 axes . add ( viewer . drawLine ( center , new THREE . Vector3 ( size , 0 , 0 ) , { color : x_color , dashed : false , draw : false } ) ) ;
422- axes . add ( viewer . drawLine ( center , new THREE . Vector3 ( - size , 0 , 0 ) , { color : x_color , dashed : true , draw : false } ) ) ;
425+ if ( complete ) { axes . add ( viewer . drawLine ( center , new THREE . Vector3 ( - size , 0 , 0 ) , { color : x_color , dashed : true , draw : false } ) ) ; }
423426
424427 // Y axes
425428 axes . add ( viewer . drawLine ( center , new THREE . Vector3 ( 0 , size , 0 ) , { color : y_color , dashed : false , draw : false } ) ) ;
426- axes . add ( viewer . drawLine ( center , new THREE . Vector3 ( 0 , - size , 0 ) , { color : y_color , dashed : true , draw : false } ) ) ;
429+ if ( complete ) { axes . add ( viewer . drawLine ( center , new THREE . Vector3 ( 0 , - size , 0 ) , { color : y_color , dashed : true , draw : false } ) ) ; }
427430
428431 // Z axes
429432 axes . add ( viewer . drawLine ( center , new THREE . Vector3 ( 0 , 0 , size ) , { color : z_color , dashed : false , draw : false } ) ) ;
430- axes . add ( viewer . drawLine ( center , new THREE . Vector3 ( 0 , 0 , - size ) , { color : z_color , dashed : true , draw : false } ) ) ;
433+ if ( complete ) { axes . add ( viewer . drawLine ( center , new THREE . Vector3 ( 0 , 0 , - size ) , { color : z_color , dashed : true , draw : false } ) ) ; }
431434
432435 if ( viewer . model ) {
433436 viewer . model . add ( axes ) ;
@@ -438,7 +441,7 @@ BrainBrowser.SurfaceViewer.modules.rendering = function(viewer) {
438441 viewer . updated = true ;
439442
440443 return axes ;
441- }
444+ } ;
442445
443446 /**
444447 * @doc function
0 commit comments