;+ ; NAME: ; RemoteView_CubeFrame ; PURPOSE: ; Draws outline of 3D data cube ; CATEGORY: ; Graphics ; CALLING SEQUENCE: FUNCTION RemoteView_CubeFrame, nS, color=Color, corners=Corners ; INPUTS: ; nS integer; type: float ; cube size in data units ; (if nL is fo type float it is rounded up to the ; next integer) ; OPTIONAL INPUT PARAMETERS: ; color=Color scalar color index used for drawing ; (if omitted then !p.color is used) ; OUTPUTS: ; Cube ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; IsType, gridgen ; PROCEDURE: ; Make sure the proper 3D transformation is set up. ; The cube drawn extends from 0 to nDim-1 in all three dimensions. ; MODIFICATION HISTORY: ; Feb-1997, Paul Hick (UCSD) ;- IF IsType(nS, /generic_integer) THEN nL = nS ELSE nL = ceil(nS) IF keyword_set(Corners) THEN BEGIN Cube = intarr(3,16) Cube[0,*] = [0,0,0,0,0,1,1,0,1,0,0,1,1,1,1,1] Cube[1,*] = [0,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1] Cube[2,*] = [0,0,1,1,0,0,0,0,1,1,1,1,1,0,0,1] Cube = nL*Cube IF n_elements(Color) NE 0 THEN BEGIN plots, Cube[*,0: 7], /t3d, color=Color plots, Cube[*,8:15], /t3d, color=Color ENDIF ENDIF ELSE BEGIN s = gridgen( nL, range=[1.0/nL,1] ) ; 1./nL to 1 along cube side t1 = replicate(1.,nL) t0 = replicate(0.,nL) Cube = fltarr(3,1+7*nL,2) j = 0 k = 0 Cube[0,j,k] = 0. Cube[1,j,k] = 0. Cube[2,j,k] = 0. i = j+1 & j = j+nL Cube[0,i:j,k] = t0 Cube[1,i:j,k] = s Cube[2,i:j,k] = t0 i = j+1 & j = j+nL Cube[0,i:j,k] = t0 Cube[1,i:j,k] = t1 Cube[2,i:j,k] = s i = j+1 & j = j+nL Cube[0,i:j,k] = t0 Cube[1,i:j,k] = 1-s Cube[2,i:j,k] = t1 i = j+1 & j = j+nL Cube[0,i:j,k] = t0 Cube[1,i:j,k] = t0 Cube[2,i:j,k] = 1-s i = j+1 & j = j+nL Cube[0,i:j,k] = s Cube[1,i:j,k] = t0 Cube[2,i:j,k] = t0 i = j+1 & j = j+nL Cube[0,i:j,k] = t1 Cube[1,i:j,k] = s Cube[2,i:j,k] = t0 i = j+1 & j = j+nL Cube[0,i:j,k] = 1-s Cube[1,i:j,k] = t1 Cube[2,i:j,k] = t0 j = 0 k = 1 Cube[0,j,k] = 1. Cube[1,j,k] = 0. Cube[2,j,k] = 1. i = j+1 & j = j+nL Cube[0,i:j,k] = 1-s Cube[1,i:j,k] = t0 Cube[2,i:j,k] = t1 i = j+1 & j = j+nL Cube[0,i:j,k] = t0 Cube[1,i:j,k] = s Cube[2,i:j,k] = t1 i = j+1 & j = j+nL Cube[0,i:j,k] = s Cube[1,i:j,k] = t1 Cube[2,i:j,k] = t1 i = j+1 & j = j+nL Cube[0,i:j,k] = t1 Cube[1,i:j,k] = 1-s Cube[2,i:j,k] = t1 i = j+1 & j = j+nL Cube[0,i:j,k] = t1 Cube[1,i:j,k] = t0 Cube[2,i:j,k] = 1-s i = j+1 & j = j+nL Cube[0,i:j,k] = t1 Cube[1,i:j,k] = s Cube[2,i:j,k] = t0 i = j+1 & j = j+nL Cube[0,i:j,k] = t1 Cube[1,i:j,k] = t1 Cube[2,i:j,k] = s Cube = nL*Cube ENDELSE RETURN, Cube & END