Evita  0.16
evGUIClient.h
Go to the documentation of this file.
1 /*
2  *
3  * EVITA: Efficient Visualization of Terascale Datasets
4  * Copyright (C) 2000-2016 Team Evita
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
19  * MA 02139, USA.
20  *
21  */
22 
23 
24 #ifndef __evGUIClient_h
25 #define __evGUIClient_h
26 
27 
28 #include <FL/Fl.H>
29 #include <FL/Fl_Input.H>
30 #include <FL/Fl_Output.H>
31 #include <FL/Fl_Button.H>
32 #include <FL/Fl_Check_Button.H>
33 #include <FL/Fl_Box.H>
34 #include <FL/Fl_Pixmap.H>
35 #include <FL/fl_message.H>
36 
37 #include "evCommon.h"
38 #include "evGUIWindow.h"
40 #include "evSignal.h"
41 #include "evGUIVisualizerWindow.h"
42 #include "evVisualizer2DScalar.h"
43 #include "evVisualizer2DVector.h"
44 #include "evGUIComponentBrowser.h"
45 
46 
47 #define EVGUICLIENT_CONNECTED 0
48 #define EVGUICLIENT_CONNECTION_ERROR 1
49 #define EVGUICLIENT_COMMUNICATION_ERROR 2
50 #define EVGUICLIENT_COMPONENTS 3
51 
52 
53 class evGUIClient : public evGUIWindow
54 {
55 public:
56  evGUIClient(const char *title);
57  virtual ~evGUIClient(void);
58 
59  virtual const evString GetClassName(void) const
60  {
61  return(evString("evGUIClient"));
62  }
63 
64  void SetConnection(const int connected);
65  void SetController(evMultiProcessController *controller);
66 
67 protected:
68 
69 private:
70 
71  Fl_Input *Hostname;
72  Fl_Input *Bitstream;
73  Fl_Button *ConnectButton;
74  Fl_Button *DisconnectButton;
75  Fl_Output *StatusOutput;
76  Fl_Group *ComponentGroup;
78  Fl_Button *VisualizeButton;
79  Fl_Check_Button *ImageButton;
82 
85  int Connected;
86 
87  static void QuitCallback(Fl_Widget *widget, void *data);
88  static void ConnectCallback(Fl_Widget *widget, void *data);
89  static void DisconnectCallback(Fl_Widget *widget, void *data);
90  static void ComponentBrowserCallback(Fl_Widget *widget, void *data);
91  static void VisualizeCallback(Fl_Widget *widget, void *data);
92  static void VisualizerWindowCloseCallback(Fl_Widget *widget, void *data);
93  static void ImageButtonCallback(Fl_Widget *widget, void *data);
94  static void MonitorDecoder(void *data);
95  static void VisualizerRender(void *data);
96  void UpdateConnectionButtons(void);
97  void UpdateComponentBrowser(void);
98  void VisualizerWindowClose(void);
99 
100  void GetComponents(const unsigned int num_components);
101 };
102 
103 
105 {
106  delete this->Visualizer;
107 }
108 
109 
110 inline void evGUIClient::SetConnection(const int connected)
111 {
112  this->Connected = connected;
113  this->UpdateConnectionButtons();
114  this->UpdateComponentBrowser();
115 }
116 
117 
119 {
120  this->Controller = controller;
121 }
122 
123 
124 #endif
125 
evGUIClient(const char *title)
static void VisualizeCallback(Fl_Widget *widget, void *data)
static void DisconnectCallback(Fl_Widget *widget, void *data)
void GetComponents(const unsigned int num_components)
Fl_Button * DisconnectButton
Definition: evGUIClient.h:74
static void ComponentBrowserCallback(Fl_Widget *widget, void *data)
Fl_Input * OutputImageFilename
Definition: evGUIClient.h:80
Definition: evGUIClient.h:53
Fl_Button * ConnectButton
Definition: evGUIClient.h:73
evGUIVisualizerWindow * VisualizerWindow
Definition: evGUIClient.h:81
evMultiProcessController * Controller
Definition: evGUIClient.h:83
static void QuitCallback(Fl_Widget *widget, void *data)
Fl_Check_Button * ImageButton
Definition: evGUIClient.h:79
evVisualizer * Visualizer
Definition: evGUIClient.h:84
Fl_Output * StatusOutput
Definition: evGUIClient.h:75
Fl_Input * Hostname
Definition: evGUIClient.h:71
void UpdateConnectionButtons(void)
evGUIComponentBrowser * ComponentBrowser
Definition: evGUIClient.h:77
void SetController(evMultiProcessController *controller)
Definition: evGUIClient.h:118
Definition: evGUIWindow.h:33
static void MonitorDecoder(void *data)
virtual ~evGUIClient(void)
Definition: evGUIClient.h:104
int Connected
Definition: evGUIClient.h:85
static void VisualizerRender(void *data)
Definition: evMultiProcessController.h:122
Fl_Group * ComponentGroup
Definition: evGUIClient.h:76
Definition: evVisualizer.h:45
Definition: evGUIVisualizerWindow.h:39
void VisualizerWindowClose(void)
static void VisualizerWindowCloseCallback(Fl_Widget *widget, void *data)
static void ConnectCallback(Fl_Widget *widget, void *data)
Definition: evGUIComponentBrowser.h:33
virtual const evString GetClassName(void) const
Definition: evGUIClient.h:59
Fl_Input * Bitstream
Definition: evGUIClient.h:72
void UpdateComponentBrowser(void)
Definition: evString.h:30
static void ImageButtonCallback(Fl_Widget *widget, void *data)
void SetConnection(const int connected)
Definition: evGUIClient.h:110
Fl_Button * VisualizeButton
Definition: evGUIClient.h:78