OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
glwin_base.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2020 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_GFX_GLWIN_BASE_HH
20 #define OST_GFX_GLWIN_BASE_HH
21 
22 /*
23  abstract base class for use in the GUI
24 
25  Author: Ansgar Philippsen
26 */
27 
28 #include <ost/gfx/module_config.hh>
29 #include <ost/message.hh>
30 
31 namespace ost { namespace gfx {
32 
34 public:
35  virtual ~GLWinBase() {}
36 
37  virtual void MakeActive() {}
38 
39  virtual void DoRefresh() = 0;
40 
41  virtual void StatusMessage(const String& m) = 0;
42 
43  virtual bool HasStereo() const = 0;
44 
45  virtual bool HasMultisample() const = 0;
46 
47  // The GLWin is supposed to setup the OpenGL resources. To avoid implementing
48  // our own offscreen buffers, image export from OpenGL also happens here
49  virtual void Export(const String& fname, unsigned int width,
50  unsigned int height, bool transparent) {
51  throw ost::Error("Image export not implemented for this GLWin");
52  }
53 
54  virtual void Export(const String& fname, unsigned int width,
55  unsigned int height, int max_samples,
56  bool transparent) {
57  throw ost::Error("Image export with multi-sampling not implemented for "
58  "this GLWin");
59  }
60 
61  virtual void Export(const String& fname, bool transparent) {
62  throw ost::Error("Image export not implemented for this GLWin");
63  }
64 
65 };
66 
67 }}
68 
69 #endif
std::string String
Definition: base.hh:54
virtual void Export(const String &fname, bool transparent)
Definition: glwin_base.hh:61
virtual void Export(const String &fname, unsigned int width, unsigned int height, bool transparent)
Definition: glwin_base.hh:49
virtual ~GLWinBase()
Definition: glwin_base.hh:35
#define DLLEXPORT_OST_GFX
virtual void Export(const String &fname, unsigned int width, unsigned int height, int max_samples, bool transparent)
Definition: glwin_base.hh:54
virtual void MakeActive()
Definition: glwin_base.hh:37