source: trunk/packages/vizservers/nanovis/protocol-nanovis.txt @ 2892

Last change on this file since 2892 was 2892, checked in by ldelgass, 8 years ago

Add protocol documentation for NanoVis? server. Add header to vtkvis protocol
document with description of syntax and notes about using the documentation.

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