File: HelloWorldGUI.fl

package info (click to toggle)
igstk 4.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 36,940 kB
  • ctags: 6,895
  • sloc: cpp: 70,958; makefile: 99; xml: 70
file content (115 lines) | stat: -rw-r--r-- 3,452 bytes parent folder | download
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# data file for the Fltk User Interface Designer (fluid)
version 1.0107 
header_name {.h} 
code_name {.cxx}
class HelloWorldGUI {open
} {
  decl {typedef igstk::Tracker TrackerType;} {public
  }
  decl {typedef TrackerType::Pointer TrackerPointer;} {public
  }
  decl {bool quit;} {}
  decl {TrackerPointer m_Tracker;} {}
  decl {public: std::string fileName;} {}
  decl {igstk::View3D::Pointer  View;} {public
  }
  Function {HelloWorldGUI()} {open
  } {
    Fl_Window MainWindow {
      label {IGSTK: HelloWorld Example} open selected
      xywh {619 249 515 375} type Double resizable
      code0 {\#include <FL/fl_ask.H>}
      code1 {\#include "igstkView3D.h"}
      code2 {\#include "igstkFLTKWidget.h"}
      code3 {\#include "igstkConfigure.h"} visible
    } {
      Fl_Box Display {
        label Display
        xywh {5 5 505 330} box FLAT_BOX color 0 labelcolor 7
        code0 {\#ifdef IGSTK_USE_SceneGraphVisualization}
        code1 {\#include "igstkSceneGraphUI.h"}
        code2 {\#endif}
        class {igstk::FLTKWidget}
      }
      Fl_Light_Button TrackingBt {
        label Tracking
        callback {this->SetTracking(o->value());}
        xywh {5 345 85 25} labelsize 11
        code0 {\#include "igstkTracker.h"}
      }
      Fl_Light_Button SceneGraphBt {
        label SceneGraph
        callback {this->ShowSceneGraph(o->value());}
        xywh {95 345 85 25} labelsize 11
      }
      Fl_Button ExportBt {
        label ExportSceneGraph
        callback {this->ExportSceneGraph(fileName);}
        xywh {185 345 105 25} labelsize 11
      }
      Fl_Button {} {
        label Quit
        callback {this->Quit()}
        xywh {421 345 90 25}
      }
    }
    code {this->quit = false;
this->View = igstk::View3D::New();
this->Display->RequestSetView( this->View );} {}
  }
  Function {Show()} {return_type {virtual void}
  } {
    code {this->quit = false;
this->MainWindow->show();
this->View->RequestStart();} {}
  }
  Function {Quit()} {return_type {virtual void}
  } {
    code {this->View->RequestStop();
this->quit = true;
this->MainWindow->hide();} {}
  }
  Function {SetTracking( bool tracking )} {return_type {virtual void}
  } {
    code {if( tracking )
  {
  this->m_Tracker->RequestStartTracking();
  }
else
  {
  this->m_Tracker->RequestStopTracking();
  }} {}
  }
  Function {ShowSceneGraph( bool showingSG )} {open return_type {virtual void}
  } {
    code {\#ifdef IGSTK_USE_SceneGraphVisualization
igstk::SceneGraph* m_SceneGraph = igstk::SceneGraph::getInstance();  
m_SceneGraph->ShowSceneGraph(showingSG);
igstk::SceneGraphUI * m_SceneGraphUI = igstk::SceneGraphUI::getInstance();
m_SceneGraphUI->DrawSceneGraph(m_SceneGraph);
\#else
fl_alert("SceneGraphVisualization is turned off in CMake configuration");
\#endif} {}
  }
  Function {ExportSceneGraph( std::string fileName)} {open return_type {virtual void}
  } {
    code {\#ifdef IGSTK_USE_SceneGraphVisualization
igstk::SceneGraph *m_SceneGraph = igstk::SceneGraph::getInstance();  
m_SceneGraph->ExportSceneGraphToDot(fileName);
\#else
fl_alert("SceneGraphVisualization is turned off in CMake configuration");
\#endif} {}
  }
  Function {~HelloWorldGUI()} {return_type virtual
  } {
    code {delete Display;} {}
  }
  Function {SetTracker( TrackerType * tracker)} {return_type {virtual void}
  } {
    code {this->m_Tracker = tracker;} {}
  }
  Function {HasQuitted()} {return_type {virtual bool}
  } {
    code {return this->quit;} {}
  }
}