-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuckets_with_graphics.proto
190 lines (158 loc) · 5.16 KB
/
buckets_with_graphics.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
syntax = "proto3";
package transfers_graphics_protocol;
option java_package = "cz.it4i.ulman.transfers.graphics.protocol";
service ClientToServer {
/**
* Client should start communication with this message.
*
* In this message the client may (not "must") additionally register
* a call back URL at which the server will be sending feedback
* notifications about changes to the displayed graphics, e.g.,
* color changed, position update, (un)selected, focused etc.
*
* If this message is omited, unmatched incoming requests will
* be placed into "unknown_source" collection.
*/
rpc introduceClient(ClientHello) returns (Empty) {}
/**
* Several batches of graphics are requested to be displayed.
*
* One such batch defines graphics instances (spheres, lines, vectors in xyzt)
* that shall be displayed as one entity, e.g., as one Blender object/node.
*
* Since the display need not be able to distinguish among instances
* within the batch, only one ID for the full batch is transfered and,
* consequently, no IDs for the individual instances are recognized
* and thus sent over.
*
* Additionally, each batch must be placed in a particular collection
* using which clients can be grouping their content, client can create
* many collections.
*
* If a name of already existing collection is (re)used, the new content
* will be added to it. Similarily, if the same batch name is used, the
* instances will be added to its corresponding entity; even the instances
* may repeat in which case they will be there just multiple times.
*/
rpc addGraphics (stream BatchOfGraphics) returns (Empty) {}
/**
* The same as addGraphics() except that when sending content to an
* already existing batch, the previous content is first cleared before
* the new (now submitted) one is added.
*/
rpc replaceGraphics (stream BatchOfGraphics) returns (Empty) {}
/**
* Asks the receiver to show (not mandated how exactly) the message,
* e.g., on the console or into a log window.
*/
rpc showMessage (SignedTextMessage) returns (Empty) {}
rpc focusEvent (SignedClickedIDs) returns (Empty) {}
rpc unfocusEvent (ClientIdentification) returns (Empty) {}
rpc selectEvent (SignedClickedIDs) returns (Empty) {}
rpc unselectEvent (SignedClickedIDs) returns (Empty) {}
//TODO: unselectAllEvent
//TODO: selectAllEvent
//TODO: upload (also replaces) color palette (palette_name, [name,r,g,b]+)
//TODO: delete color palette
}
service ServerToClient {
rpc showMessage (TextMessage) returns (Empty) {}
rpc focusEvent (ClickedIDs) returns (Empty) {}
rpc unfocusEvent (Empty) returns (Empty) {}
rpc selectEvent (ClickedIDs) returns (Empty) {}
rpc unselectEvent (ClickedIDs) returns (Empty) {}
}
message Empty {
}
message ClientIdentification {
string clientName = 1;
}
message ClientHello {
// name of source
ClientIdentification clientID = 1;
// URL for server-to-source communication, can be empty string too
string returnURL = 2;
}
/**
* Everything in the batch is treated as one non-dividable entity.
* The graphics elements, which is the content of this message, is
* indistinguishable among themselves, and it makes no sense to assign them
* anything specific to them, anything individual. As a consequence, the
* source clientID, dataName, dataID etc. is given for the full batch and is
* understood to be valid for its full content, for all graphics element inside.
*
* In Blender, for example, it appears as one Blender object (listed as
* one element in the Outliner panel) that displays its content (which
* is the content of this message) using the instancing mechanism.
*/
message BatchOfGraphics {
ClientIdentification clientID = 1;
string collectionName = 2; // Label/name of this collection
string dataName = 5; // Label/name of this data group
uint64 dataID = 6; // ID in the realm of the source
//TODO: select color palette
repeated SphereParameters spheres = 10;
repeated LineParameters lines = 11;
repeated VectorParameters vectors = 12;
}
message Vector3D {
float x = 1;
float y = 2;
float z = 3;
}
message TimeSpan {
float timeFrom = 1;
float timeTill = 2;
}
message SphereParameters {
Vector3D centre = 1;
oneof timeSpec {
uint32 time = 3;
TimeSpan span = 7;
}
float radius = 4;
oneof color {
uint32 colorXRGB = 5;
uint32 colorIdx = 6;
}
}
message LineParameters {
Vector3D startPos = 1;
Vector3D endPos = 2;
oneof timeSpec {
uint32 time = 3;
TimeSpan span = 7;
}
float radius = 4;
oneof color {
uint32 colorXRGB = 5;
uint32 colorIdx = 6;
}
}
message VectorParameters {
Vector3D startPos = 1;
Vector3D endPos = 2;
oneof timeSpec {
uint32 time = 3;
TimeSpan span = 7;
}
float radius = 4;
oneof color {
uint32 colorXRGB = 5;
uint32 colorIdx = 6;
}
}
message TextMessage {
string msg = 1; // any message which the server is asked to possibly display
}
message SignedTextMessage {
ClientIdentification clientID = 1;
TextMessage clientMessage = 2;
}
message ClickedIDs {
repeated uint64 objIDs = 1;
}
message SignedClickedIDs {
ClientIdentification clientID = 1;
ClickedIDs clientClickedIDs = 2;
}