--- /dev/null
+#ifndef VIEWER_H
+#define VIEWER_H
+
+/**
+ * Crée une instance automatiquement de 'TOutput' en appelant 'TProvider::createGL()'.
+ */
+template <class TOutput, class TProvider>
+class AutoViewer
+ {
+ private:
+ TOutput* ptrOutput;
+ GLUTImageViewers viewer;
+
+ public:
+ AutoViewer(bool isAnimation, bool isSelection, int pxFrame, int pyFrame):
+ ptrOutput(TProvider::createGL()),
+ viewer(ptrOutput, isAnimation, isSelection, pxFrame, pyFrame)
+ {
+ }
+
+ ~AutoViewer()
+ {
+ delete this->ptrOutput;
+ }
+ };
+
+
+template <class TOutput>
+class Viewer
+ {
+ private:
+ TOutput* ptrOutput;
+ GLUTImageViewers viewer;
+
+ public:
+ Viewer(TOutput* output, bool isAnimation, bool isSelection, int pxFrame, int pyFrame):
+ ptrOutput(output),
+ viewer(ptrOutput, isAnimation, isSelection, pxFrame, pyFrame)
+ {
+ }
+
+ ~Viewer()
+ {
+ delete this->ptrOutput;
+ }
+ };
+
+#endif
+