HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TIL_DeepSocketHandler.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: TIL_DeepSocketHandler.h ( TIL Library, C++)
7  *
8  * COMMENTS: This class handles reading the interface for reading an image
9  * from a socket. The class will read messages from the socket
10  * and send the data to the reader.
11  * The class assumes that the initial connection has been made and
12  * that the deep reader is configured to accept data.
13  */
14 
15 #ifndef __TIL_DeepSocketHandler__
16 #define __TIL_DeepSocketHandler__
17 
18 #include "TIL_API.h"
19 #include <UT/UT_SysClone.h>
20 
21 class UT_NetSocket;
22 class UT_NetPacket;
23 class TIL_DeepReader;
24 
26 public:
27  TIL_DeepSocketHandler(pid_t client,
28  UT_NetSocket *socket,
29  TIL_DeepReader *reader);
31 
32  int64 getMemoryUsage(bool inclusive) const;
33 
34  int getFileDescriptor() const;
35  UT_NetSocket *getSocket() { return mySocket; }
36 
37  int processInput(int max_packets = 1e8);
38  bool terminate(bool kill_proc = true);
39  void setMousePosition(float mx, float my, float radius);
40  void requestMaterialStyleSheet(int style_sheet_index);
41  void autoUpdate();
42  void halt();
43 
44 private:
45  void clean();
46  bool int32Message(int32 *ival, int nints);
47  bool fpreal32Message(fpreal32 *fval, int nfloats);
48 
49  UT_NetSocket *mySocket;
50  UT_NetPacket *myPacket;
51  TIL_DeepReader *myReader;
52  pid_t myPid;
53  float myMouseX;
54  float myMouseY;
55  float myMouseRadius;
56  bool mySwapBytes;
57 };
58 
59 #endif
long long int64
Definition: SYS_Types.h:107
int int32
Definition: SYS_Types.h:35
#define TIL_API
Definition: TIL_API.h:10
float fpreal32
Definition: SYS_Types.h:191