-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathudp_server.h
97 lines (77 loc) · 1.97 KB
/
udp_server.h
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
#ifndef UDP_SERVER
#define UDP_SERVER
#include <iostream>
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <sstream>
#include "util/linear_math.h"
#include <cstring>
#include "global.h"
#include <vector>
#include "Selection.h"
#define BUFLEN 512
#define NUMBEROFITEMSINMESSAGE 35
class udp_server{
public:
int port ;
struct sockaddr_in si_me, si_other ;
int sock ;
socklen_t slen ;
int recv_len ;
char buf[BUFLEN] ;
bool hasDataChanged = false ;
bool hasDataSetChanged = false ;
bool hasSelectionSet = false;
bool hasSelectionClear = true;
bool hasPostTreatmentSet = false;
bool hasSubDataChanged = false;
bool hasSetToSelection = false;
std::string previousMessage ;
udp_server();
udp_server(int p);
~udp_server();
//static void* launch_listen(void* args);
void listen(void);
Matrix4 getDataMatrix();
Matrix4 getSliceMatrix();
Vector3 getSeedPoint();
int getDataSet();
float getZoomFactor();
bool getShowVolume();
bool getShowSurface();
bool getShowStylus();
bool getShowSlice();
bool getShowOutline();
short getConsiderX();
short getConsiderY();
short getConsiderZ();
Synchronized<Vector3> selectionStartPoint;
Synchronized<std::vector<Matrix4>> selectionMatrix;
Synchronized<std::vector<Vector3>> selectionPoint;
Synchronized<Matrix4> postTreatmentMat;
Synchronized<Vector3> postTreatmentTrans;
Synchronized<Quaternion> postTreatmentRot;
Synchronized<Vector3> dataTrans;
Synchronized<Quaternion> dataRot;
Synchronized<std::vector<Selection>> dataSelected;
private:
void initSocket();
Synchronized<Matrix4> dataMatrix ;
Synchronized<Matrix4> sliceMatrix ;
Synchronized<Vector3> seedPoint ;
int dataset = 1 ;
float zoomingFactor = 1 ;
bool showVolume = true ;
bool showSurface = true ;
bool showStylus = true ;
bool showSlice = true ;
bool showOutline = true ;
short considerX = 1 ;
short considerY = 1 ;
short considerZ = 1 ;
};
#endif