Ajout des cas de tests pour les TP non-graphiques. Cleanage en tous genres.
[GPU.git] / WCudaMSE / Student_Cuda_Image / src / cpp / core / Viewer.h
1 #ifndef VIEWER_H
2 #define VIEWER_H
3
4 /**
5 * Crée une instance automatiquement de 'TOutput' en appelant 'TProvider::createGL()'.
6 */
7 template <class TOutput, class TProvider>
8 class AutoViewer
9 {
10 private:
11 TOutput* ptrOutput;
12 GLUTImageViewers viewer;
13
14 public:
15 AutoViewer(bool isAnimation, bool isSelection, int pxFrame, int pyFrame, bool run = true):
16 ptrOutput(TProvider::createGL()),
17 viewer(ptrOutput, isAnimation, isSelection, pxFrame, pyFrame)
18 {
19 if (run)
20 GLUTImageViewers::runALL();
21 }
22
23 ~AutoViewer()
24 {
25 delete this->ptrOutput;
26 }
27 };
28
29
30 template <class TOutput>
31 class Viewer
32 {
33 private:
34 TOutput* ptrOutput;
35 GLUTImageViewers viewer;
36
37 public:
38 Viewer(TOutput* output, bool isAnimation, bool isSelection, int pxFrame, int pyFrame, bool run = true):
39 ptrOutput(output),
40 viewer(ptrOutput, isAnimation, isSelection, pxFrame, pyFrame)
41 {
42 if (run)
43 GLUTImageViewers::runALL();
44 }
45
46 ~Viewer()
47 {
48 delete this->ptrOutput;
49 }
50 };
51
52 #endif
53