[2892] | 1 | ================================================================================ |
---|
[3502] | 2 | |
---|
| 3 | Copyright (C) 2004-2013 HUBzero Foundation, LLC |
---|
| 4 | |
---|
[2892] | 5 | ================================================================================ |
---|
| 6 | Protocol for nanovis render server. |
---|
| 7 | |
---|
| 8 | Commands take the general form of command and arguments using Tcl syntax and are |
---|
| 9 | terminated by a newline. Some command arguments expect a Tcl list which can be |
---|
| 10 | sent by enclosing the list in curly braces to prevent the interpreter from |
---|
| 11 | splitting the list into multiple arguments. Likewise, strings with spaces |
---|
| 12 | should be quoted or enclosed in curly braces. In the documentation below, |
---|
| 13 | arguments are indicated by angle brackets and optional arguments are surrounded |
---|
| 14 | by question marks -- the brackets and question marks are not part of the |
---|
| 15 | protocol and should not be included in argument strings. The arguments shown |
---|
| 16 | in angle brackets should be replaced with a string (where there are fixed |
---|
| 17 | choices this document indicates valid values by separating them with pipe |
---|
| 18 | symbols), a list in Tcl syntax, or a numeric value. Boolean arguments can take |
---|
| 19 | the form of 0|1, true|false, or yes|no. Since the protocol commands are |
---|
| 20 | executed in a Tcl interpreter, Tcl code such as math expressions in expr |
---|
| 21 | commands enclosed in square brackets are also allowed. Since the interpreter |
---|
| 22 | is a "safe" interpreter, some Tcl commands that could cause security issues may |
---|
| 23 | not be available for use. |
---|
| 24 | |
---|
| 25 | Some commands such as the 'flowvis add' commands create Tcl objects within the |
---|
| 26 | server's interpreter. The name sent as an argument when adding the object can |
---|
| 27 | then be used as a protocol command. For example, the string sent as the <name> |
---|
| 28 | argument to 'flowvis add' can then be used in place of <flowObj> in the commands |
---|
| 29 | documented below. The flow object name also creates a volume name that can |
---|
| 30 | be used in volume and cutplane commands, but in that case the name is used as |
---|
| 31 | an argument to the volume or cutplane commands rather than as the command |
---|
| 32 | itself. |
---|
| 33 | |
---|
| 34 | When binary data is to be sent, it should follow the newline after a command |
---|
| 35 | that indicates incoming data including a byte count argument. |
---|
| 36 | ================================================================================ |
---|
| 37 | ================================================================================ |
---|
| 38 | Requests: |
---|
| 39 | ================================================================================ |
---|
| 40 | axis visible <false|true> |
---|
| 41 | |
---|
| 42 | grid axiscolor <red> <green> <blue> <?alpha?> |
---|
| 43 | grid axisname <x|y|z> <name> |
---|
| 44 | grid linecolor <red> <green> <blue> <?alpha?> |
---|
| 45 | grid visible <false|true> |
---|
| 46 | |
---|
[3362] | 47 | camera angle <xAngle> <yAngle> <zAngle> |
---|
[3478] | 48 | ** Deprecated, use camera orient ** |
---|
[2892] | 49 | camera orient <quatW> <quatX> <quatY> <quatZ> |
---|
| 50 | camera pan <x> <y> |
---|
[3362] | 51 | camera pos <x> <y> <z> |
---|
[3478] | 52 | camera reset <?all?> |
---|
[2892] | 53 | camera zoom <factor> |
---|
| 54 | |
---|
[3478] | 55 | screen bgcolor <r> <g> <b> |
---|
| 56 | Set screen background color |
---|
| 57 | screen size <width> <height> |
---|
| 58 | Set size of rendered images |
---|
| 59 | |
---|
[2892] | 60 | snapshot |
---|
[3478] | 61 | Render a 2k x 2k image (offscreen buffer) |
---|
[2892] | 62 | |
---|
| 63 | transfunc define <name> {colors} {alpha} |
---|
| 64 | colors => 1 line each of "value r g b" |
---|
| 65 | alpha => 1 line each of "value alpha" |
---|
| 66 | value => [0,1] |
---|
| 67 | |
---|
| 68 | legend <transferfunc name> <width> <height> |
---|
| 69 | Request render of transfer function |
---|
| 70 | |
---|
| 71 | heightmap data visible <true|false> <volume IDs> |
---|
| 72 | heightmap data follows <nbytes> <data> |
---|
| 73 | heightmap linecontour visible <true|false> <volume IDs> |
---|
| 74 | heightmap linecontour color <red> <green> <blue> <volume IDs> |
---|
| 75 | heightmap tranfunc <transfer function name> <volume IDs> |
---|
| 76 | heightmap cull <no/back/front> |
---|
| 77 | heightmap polygon <wireframe/fill> |
---|
| 78 | |
---|
| 79 | flow add <name> <?option value...?> |
---|
| 80 | <name> is an object name to use in <flowObj> commands |
---|
| 81 | In addition, a volume is added with the same name |
---|
| 82 | which can be used in volume and cutplane commands |
---|
| 83 | see '<flowObj> configure' for switch options |
---|
| 84 | flow delete <names> |
---|
| 85 | flow exists <name> |
---|
| 86 | flow goto <nSteps> |
---|
| 87 | flow names <?pattern?> |
---|
| 88 | flow next |
---|
| 89 | flow reset |
---|
| 90 | flow video <token> <?switches...?> |
---|
| 91 | -bitrate <val> |
---|
| 92 | -format <mpeg|theora|mov> |
---|
| 93 | -framerate <val> |
---|
| 94 | -height <val> |
---|
| 95 | -numframes <val> |
---|
| 96 | -width <val> |
---|
| 97 | |
---|
| 98 | <flowObj> box add <name> <?switches...?> |
---|
| 99 | See '<flowObj> box configure' for switches |
---|
| 100 | <flowObj> box configure <name> <?switches...?> |
---|
| 101 | -color <{r g b a}> |
---|
| 102 | -corner1 <{x y z}> |
---|
| 103 | -corner2 <{x y z}> |
---|
| 104 | -hide <bool> |
---|
| 105 | -linewidth <val> |
---|
| 106 | <flowObj> box delete <?names?> |
---|
| 107 | <flowObj> box names <?pattern?> |
---|
| 108 | |
---|
| 109 | <flowObj> configure <?option value...?> |
---|
[3362] | 110 | -ambient <val> |
---|
[2892] | 111 | -arrows <bool> |
---|
| 112 | -axis <x|y|z> |
---|
| 113 | -diffuse <val> |
---|
| 114 | -hide <bool> |
---|
| 115 | -opacity <val> |
---|
| 116 | -outline <bool> |
---|
| 117 | -position <val|%val> |
---|
| 118 | val = [0,100], or %val = [0,1] |
---|
| 119 | -slice <bool> |
---|
[3362] | 120 | -specularExp <val> |
---|
| 121 | -specularLevel <val> |
---|
[2892] | 122 | -transferfunction <name> |
---|
| 123 | -volume <bool> |
---|
| 124 | <flowObj> data file <fileName> <numComponents> |
---|
| 125 | Load a data file. fileName is path to file on server |
---|
| 126 | <flowObj> data follows <nbytes> <numComponents> |
---|
| 127 | Send flow data. Data bytes follow the newline after the command |
---|
| 128 | <flowObj> legend <w> <h> |
---|
| 129 | <flowObj> particles add <name> <?switches?> |
---|
| 130 | see '<flowObj> particles configure' for switches |
---|
| 131 | <flowObj> particles configure <name> <?switches?> |
---|
| 132 | -axis <x|y|z> |
---|
| 133 | -color <{r g b a}> |
---|
| 134 | -hide <bool> |
---|
| 135 | -position <val|%val> |
---|
| 136 | val = [0,100], or %val = [0,1] |
---|
| 137 | -size <val> |
---|
| 138 | |
---|
| 139 | volume data state <on|off> <?names?> |
---|
| 140 | volume data follows <size> <tag> |
---|
| 141 | volume delete <?names?> |
---|
| 142 | volume exists <name> |
---|
| 143 | volume names <?pattern?> |
---|
| 144 | volume outline color <r> <g> <b> <?names?> |
---|
| 145 | volume outline state|visible <bool> <?names?> |
---|
[3362] | 146 | volume shading ambient <value> <?names?> |
---|
[2892] | 147 | volume shading diffuse <value> <?names?> |
---|
| 148 | volume shading isosurface <bool> <?names?> |
---|
| 149 | volume shading opacity <value> <?names?> |
---|
[3362] | 150 | volume shading specularExp <value> <?names?> |
---|
| 151 | volume shading specularLevel <value> <?names?> |
---|
[2892] | 152 | volume shading transfunc <tfName> <?names?> |
---|
| 153 | volume state <bool> <?names?> |
---|
| 154 | |
---|
| 155 | volume animation volumes <volume IDs> |
---|
| 156 | volume animation start |
---|
| 157 | volume animation stop |
---|
| 158 | volume animation clear |
---|
| 159 | volume animation capture numframes <filename> |
---|
| 160 | |
---|
| 161 | cutplane position <relval> <x|y|z> <?names?> |
---|
| 162 | Set the position of a volume cutplane. Names is |
---|
| 163 | an optional list of volume names. |
---|
| 164 | relval = [0,1] |
---|
| 165 | cutplane state <bool> <x|y|z> <?names?> |
---|
| 166 | Set the axis (normal) of a volume cutplane. Names is |
---|
| 167 | an optional list of volume names. |
---|
| 168 | |
---|
| 169 | up <x|y|z|-x|-y|-z> |
---|
| 170 | Set orientation of volumes |
---|
| 171 | |
---|
| 172 | |
---|
[3362] | 173 | --- Colormaped Plane (if PLANE_CMD is defined in config.h) --- |
---|
[2892] | 174 | plane active <planeIdx> |
---|
| 175 | Set the active plane [0,9], or -1 to disable |
---|
| 176 | Plane must first be added and linked |
---|
| 177 | plane add <planeIdx> <width> <height> |
---|
| 178 | followed by image data: w * h floats on stdin |
---|
| 179 | planeIdx: [0,9] |
---|
| 180 | plane link <planeIdx> <transfunc name> |
---|
| 181 | Enable a plane for rendering using the given transfer |
---|
| 182 | function. Plane must first be added. |
---|
[3362] | 183 | --- End Colormaped Plane (if PLANE_CMD is defined in config.h) --- |
---|
[2892] | 184 | |
---|
| 185 | ================================================================================ |
---|
| 186 | Replies: |
---|
| 187 | ================================================================================ |
---|
| 188 | nv>legend <volume> <min> <max> <nbytes> |
---|
| 189 | (followed by bytes and newline) |
---|
| 190 | |
---|
| 191 | nv>image -type image -bytes <nbytes> |
---|
| 192 | (followed by bytes -- command _preceded_ by newline) |
---|
| 193 | |
---|
| 194 | nv>image -type print -bytes <nbytes> |
---|
| 195 | (followed by bytes -- command _preceded_ by newline) |
---|
| 196 | |
---|
| 197 | nv>image -type movie -token <token> -bytes <nbytes> |
---|
| 198 | (followed by bytes) |
---|
| 199 | |
---|
[2953] | 200 | nv>data tag <dataobj-tag> min <val> max <val> vmin <val> vmax <val> |
---|
| 201 | The min,max data values for the data object and the cumulative volume data |
---|
| 202 | min,max over all volumes |
---|
| 203 | |
---|
[2892] | 204 | ================================================================================ |
---|
| 205 | Error Replies: |
---|
| 206 | ================================================================================ |
---|
[3478] | 207 | nv>viserror -bytes <nbytes> |
---|
| 208 | <multi-line error string of nbytes> |
---|
[2892] | 209 | ================================================================================ |
---|