1 | /****************************************************************************** |
---|
2 | * SAGE - Scalable Adaptive Graphics Environment |
---|
3 | * |
---|
4 | * Module: streamInfo.h |
---|
5 | * Author : Byungil Jeong |
---|
6 | * |
---|
7 | * Copyright (C) 2004 Electronic Visualization Laboratory, |
---|
8 | * University of Illinois at Chicago |
---|
9 | * |
---|
10 | * All rights reserved. |
---|
11 | * |
---|
12 | * Redistribution and use in source and binary forms, with or without |
---|
13 | * modification, are permitted provided that the following conditions are met: |
---|
14 | * |
---|
15 | * * Redistributions of source code must retain the above copyright |
---|
16 | * notice, this list of conditions and the following disclaimer. |
---|
17 | * * Redistributions in binary form must reproduce the above |
---|
18 | * copyright notice, this list of conditions and the following disclaimer |
---|
19 | * in the documentation and/or other materials provided with the distribution. |
---|
20 | * * Neither the name of the University of Illinois at Chicago nor |
---|
21 | * the names of its contributors may be used to endorse or promote |
---|
22 | * products derived from this software without specific prior written permission. |
---|
23 | * |
---|
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
---|
25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
---|
26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
---|
27 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
---|
28 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
---|
29 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
---|
30 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
---|
31 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
---|
32 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
---|
33 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
---|
34 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
35 | * |
---|
36 | * Direct questions, comments etc about SAGE to sage_users@listserv.uic.edu or |
---|
37 | * http://www.evl.uic.edu/cavern/forum/ |
---|
38 | * |
---|
39 | *****************************************************************************/ |
---|
40 | |
---|
41 | #ifndef _STREAM_INFO_H |
---|
42 | #define _STREAM_INFO_H |
---|
43 | |
---|
44 | #include "sageBase.h" |
---|
45 | |
---|
46 | class sageBlock; |
---|
47 | |
---|
48 | class streamInfo : public sageRect { |
---|
49 | public: |
---|
50 | sageRect imgCoord; |
---|
51 | int receiverID; // Display Node ID |
---|
52 | int rcvNum; |
---|
53 | int connectionIdx; |
---|
54 | |
---|
55 | streamInfo() : receiverID(0), rcvNum(0) {} |
---|
56 | ~streamInfo() {} |
---|
57 | |
---|
58 | void printImageInfo(); |
---|
59 | int generateInitBlock(sageBlock *block, int margin); |
---|
60 | }; |
---|
61 | |
---|
62 | class streamGroup : public sageRect { |
---|
63 | private: |
---|
64 | std::vector<streamInfo> streamList; |
---|
65 | int rcvNum; |
---|
66 | |
---|
67 | public: |
---|
68 | streamGroup(); |
---|
69 | ~streamGroup() {} |
---|
70 | void init(); |
---|
71 | void operator=(sageRect& rect) { sageRect::operator=(rect); } |
---|
72 | |
---|
73 | streamInfo* getStream(int i) { return &streamList[i]; } |
---|
74 | std::vector<streamInfo> getStreamList() { return streamList; } |
---|
75 | int streamNum() { return streamList.size(); } |
---|
76 | int getRcvNum() { return rcvNum; } |
---|
77 | void setRcvNum(int num) { rcvNum = num; } |
---|
78 | |
---|
79 | int addStream(streamInfo &s); |
---|
80 | int addImageInfo(sageRect &imgRect); |
---|
81 | void createMessage(sageMessage &msg, int code); |
---|
82 | void createRcvMsg(int winID, char *msgStr); |
---|
83 | void parseMessage(char *str); |
---|
84 | }; |
---|
85 | |
---|
86 | class bridgeStreamInfo { |
---|
87 | public: |
---|
88 | int firstID, lastID; |
---|
89 | int receiverID; |
---|
90 | |
---|
91 | bridgeStreamInfo() : firstID(0), lastID(0), receiverID(0) {} |
---|
92 | }; |
---|
93 | |
---|
94 | class bridgeStreamGroup { |
---|
95 | public: |
---|
96 | bridgeStreamInfo *streamList; |
---|
97 | int streamNum; |
---|
98 | |
---|
99 | bridgeStreamGroup() : streamNum(0), streamList(NULL) {} |
---|
100 | void parseMessage(char *str); |
---|
101 | }; |
---|
102 | |
---|
103 | #endif |
---|