Structural deformable models
deform.h
Go to the documentation of this file.
1 #ifndef _DEFORM_H_
2 #define _DEFORM_H_
3 #include "fxconfig.h"
4 #include <fx.h>
5 #include <FXApp.h>
6 #include <string>
7 #include "glImage.h"
8 #include "sensordlg.h"
9 #include "Brain.h"
10 
11 /*******************************************************************************/
12 // Event Handler Object
13 class ImageWindow : public FXMainWindow {
14 
15  // Macro for class hierarchy declarations
16  FXDECLARE(ImageWindow)
17 
18 private:
19 
20  FXGLCanvas *glcanvas; // glcanvas
21 
22  FXTimer *timer; // Timer for spinning box
23 
24  FXString filename; // File being viewed
25  FXString savefilename; // File for results
26  FXString directory; // Last visited directory
27 
28  Brain m_Brain;
29  GLImage m_GLScreenImg;
30  Image<byte> m_ScreenImg;
31  bool m_RefreshScreenImg;
32 
33  FXGLVisual *glvisual; // Visual for OpenGL
34 
35  float m_XYScale;
36  bool m_BrainStarted;
37  FXStatusLine *m_Statusline;
38  SensorDialog* m_SensorDlg;
39 
40 protected:
42 
43 public:
44 
45  // Message handler
46  long onCanvasRepaint(FXObject*,FXSelector,void*);
47  long onLeftMouseClick(FXObject*,FXSelector,void*);
48  long onRightMouseClick(FXObject*,FXSelector,void*);
49  long onMouseMove(FXObject*,FXSelector,void*);
50  long onKeyPress(FXObject*,FXSelector,void* ptr);
51  long onKeyRelease(FXObject*,FXSelector,void* ptr);
52  long onCmdRestore(FXObject*,FXSelector,void*);
53  long onLoadImage(FXObject*,FXSelector,void*);
54  long onExpose(FXObject*,FXSelector,void*);
55  long onConfigure(FXObject*,FXSelector,void*);
56  long onCmdOpenGL(FXObject*,FXSelector,void*);
57  long onToggleSensorDlg(FXObject*,FXSelector,void*);
58  long onTimeout(FXObject*,FXSelector,void*);
59  int selectSensor(int sido);
60 
61  // Draw scene
62  void drawScene();
63  void setStatusText(const char* msg, bool append=false);
64 
65 public:
66 
67  // Messages for our class
68  enum{
69  ID_CANVAS=FXMainWindow::ID_LAST,
70  ID_TEST,
71  ID_LOAD,
73  ID_OPENGL,
74  ID_LAST,
76  };
77 
78 public:
79 
80  // ImageWindow constructor
81  ImageWindow(FXApp* a);
82 
83  // Initialize
84  virtual void create();
85 
86  // Read command line
87  FXbool cmdline(int argc, char ** argv);
88 
89  // ImageWindow destructor
90  virtual ~ImageWindow();
91 
92 };
93 
94 extern bool setTitle(const std::string& title);
95 extern bool setStatusText(const std::string& stext);
96 
97 #endif
bool setTitle(const std::string &title)
Definition: deform.cpp:68
int selectSensor(int sido)
Definition: deform.cpp:325
long onTimeout(FXObject *, FXSelector, void *)
Definition: deform.cpp:456
FXbool cmdline(int argc, char **argv)
Definition: browser.cpp:671
Definition: glImage.h:9
long onMouseMove(FXObject *, FXSelector, void *)
Definition: deform.cpp:432
long onKeyPress(FXObject *, FXSelector, void *ptr)
Definition: browser.cpp:415
long onLoadImage(FXObject *, FXSelector, void *)
Definition: browser.cpp:370
long onLeftMouseClick(FXObject *, FXSelector, void *)
Definition: browser.cpp:613
long onConfigure(FXObject *, FXSelector, void *)
Definition: browser.cpp:292
void setStatusText(const char *msg, bool append=false)
Definition: browser.cpp:663
Definition: Brain.h:27
virtual ~ImageWindow()
Definition: browser.cpp:219
long onRightMouseClick(FXObject *, FXSelector, void *)
Definition: browser.cpp:635
long onToggleSensorDlg(FXObject *, FXSelector, void *)
Definition: deform.cpp:265
long onKeyRelease(FXObject *, FXSelector, void *ptr)
Definition: browser.cpp:598
long onCanvasRepaint(FXObject *, FXSelector, void *)
Definition: browser.cpp:276
long onCmdOpenGL(FXObject *, FXSelector, void *)
Definition: browser.cpp:361
unsigned char byte
Definition: simpletypes.h:4
Definition: Image.h:16
long onCmdRestore(FXObject *, FXSelector, void *)
virtual void create()
Definition: browser.cpp:233
long onExpose(FXObject *, FXSelector, void *)
Definition: browser.cpp:303
void drawScene()
Definition: browser.cpp:309